Apple WebObjects 3.5 Instrukcja Użytkownika

Przeglądaj online lub pobierz Instrukcja Użytkownika dla Oprogramowanie Apple WebObjects 3.5. Apple WebObjects 3.5 User Manual Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 218
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów

Podsumowanie treści

Strona 1 - DEVELOPER’S GUIDE

WEBOBJECTSDEVELOPER’S GUIDE

Strona 3 - Contents

Chapter 6 Creating Reusable Components100The parentAction attribute identifies a callback method, one that the child component invokes in the parent wh

Strona 4

Intercomponent Communication101invoked by the child. In this example parentAction identifies the parent method named "respondToAlert", as spe

Strona 5 - Table of Contents

Chapter 6 Creating Reusable Components102Parent1’s Declarations File (excerpt)ALERT: AlertPanel {...parentAction = "respondToAlert";exitStat

Strona 6 - Managing State 109

Intercomponent Communication103For the sake of illustration, consider a page that displays a value in two different text fields—one provided by the par

Strona 7 - Index 211

Chapter 6 Creating Reusable Components104For instance, it’s sufficient in the example shown in Figure 31 to simply declare a childValue instance variab

Strona 8

Search Path for Reusable Components1054. Build the framework. If you perform a make install, it installs the framework in NeXT_ROOT/NextLibrary/Framew

Strona 9 - Introduction

Chapter 6 Creating Reusable Components106that were linked in to the application executable for a component with that name. For example, applications w

Strona 10

Designing for Reusability107• Provide attributes for all significant features. The more customizable a component is, the more likely it is that people

Strona 11 - About This Book

Chapter 6 Creating Reusable Components108This declaration specifies a value for just one attribute; all others will use the default values provided by

Strona 13

11WebObjects is an object-oriented environment for developing and deploying World Wide Web applications. A WebObjects application runs on a server mac

Strona 15 - WEBOBJECTS ESSENTIALS

111Most applications must be able to preserve some application state between a user’s requests. For example, if you’re writing a catalog application,

Strona 16

Chapter 7 Managing State112• Storing state information on the server. With each transaction, the web application locates the state information associa

Strona 17 - Chapter 1

Objects and State113Characteristically, WebObjects takes an object-oriented approach to fulfilling any of these state-storage requirements.Objects and

Strona 18

Chapter 7 Managing State114// Java DodgeLite Application.javapublic class Application extends WebApplication {public ImmutableHashtable dodgeData;publ

Strona 19 - <DocumentRoot>

Objects and State115The WOComponent class defines a method application, which provides access to the component’s application object. So any component c

Strona 20 - Components

Chapter 7 Managing State116// WebScriptelapsedTime = [[self session] timeSinceSessionBegan];//JavaelapsedTime = this.session().timeSinceSessionBegan()

Strona 21 - Code or Script File

Objects and State117//Java exampleString componentName;Context context;String contextID;String elementID;String uniqueKey;context = this.context();com

Strona 22 - Bindings

Chapter 7 Managing State118Component Objects and Component StateIn WebObjects, state can also be scoped to a component, such as a dynamically generate

Strona 23 - A Note on WebObjects Classes

Objects and State119// Java DodgeLite Main.javaImmutableVector models, prices, types;MutableVector selectedModels, selectedPrices, selectedTypes;Strin

Strona 24 - Application Directory

Introduction12client-side Java components that behave like dynamic elements, and how to design an application for deployment and improved performance.

Strona 25

Chapter 7 Managing State120// Java DodgeLite Main.javapublic Component displayCars() {SelectedCars selectedCarsPage = (SelectedCars)application().page

Strona 26 - WebObjects Adaptors

State Storage Strategies121• In cookies. State is embedded in name-value pairs (“cookies”) in the HTTP header and passed between the client and server

Strona 27 - WODefaultApp

Chapter 7 Managing State122A Closer Look at Storage StrategiesTo compare and further understand state-storage options, look at the SessionStores samp

Strona 28

State Storage Strategies123applications—changing storage strategies midsession can cause errors. For example, imagine an application that stores state

Strona 29 - Dynamic Elements

Chapter 7 Managing State124• Page uniquing by implementing pageWithName: in the session object (see “pageWithName: and Page Caching” (page 138))A sign

Strona 30

State Storage Strategies125<FORM METHOD=Post ACTION=someAction>Can you guess my favorite digit?<BR><SELECT NAME="guesses">

Strona 31 - Server-Side Dynamic Elements

Chapter 7 Managing State126• Backtracking. Because each page carries a record of the state existing at the time of its creation, backtracking can make

Strona 32 - Chapter 2 Dynamic Elements

State Storage Strategies127See http://www.netscape.com/newsref/std/cookie_spec.html for a complete description of cookies.To use cookies, all you nee

Strona 33 - .wod file:

Chapter 7 Managing State128NSData object is then asked for its ASCII representation. WebObjects pairs this data with names it generates and creates th

Strona 34

State Storage Strategies129// WebScript StateStorage FileSessionStore.wos@interface FileSessionStore:NSObject {id archiveDirectory;}- init;- archiveF

Strona 35

Other Useful Documentation13• WebObjects Tools and Techniques describes the development tools WebObjects Builder and Project Builder and shows how to

Strona 36 - Declarations File Syntax

Chapter 7 Managing State130// Unarchive sessionrestoredSession = [NSUnarchiverunarchiveObjectWithData:archivedSession];return restoredSession;}- saveS

Strona 37 - Client-Side Java Components

Storing State for Custom Objects131Storing State for Custom ObjectsWhen state is stored in the server, the objects that hold state are kept intact in

Strona 38

Chapter 7 Managing State132• During unarchiving, an EOEditingContext can recreate individual objects in the graph only as they are needed by the appli

Strona 39

Controlling Session State133You can see implementations of encodeWithCoder: and initWithCoder: in the DodgeDemo application, in the class ShoppingCart

Strona 40

Chapter 7 Managing State134much state is stored. This section takes a closer look at how you manage sessionwide state. Take care that your application

Strona 41 - Common Methods

Controlling Component State135At times, a user’s choice signals the end of a session (such as when the Yes button is clicked in response to the query,

Strona 42

Chapter 7 Managing State136Adjusting the Page Cache SizeAs noted in “WebObjects Viewed Through Its Classes” (page 63), except for the first request, a

Strona 43 - Action Methods

Controlling Component State137responsibility for maintaining any needed component state. For this reason, it’s rarely advisable to turn off page cachi

Strona 44 - Chapter 3 Common Methods

Chapter 7 Managing State138pageWithName: and Page CachingWhen the application object receives a pageWithName: message, it creates a new component. For

Strona 45

Controlling Component State139// example Application.java public Component pageWithName(String aName) {Component aPage;if (aName == null) aName = &quo

Strona 47 - Application Initialization

Chapter 7 Managing State140A WebObjects application handles a page-refresh request differently than it would a standard request. When the application

Strona 48 - Session Initialization

Creating Client-Side ComponentsChapter 8

Strona 50 - Request-Handling Methods

143In earlier chapters, you learned about client-side Java components. Client-side components are Java applets that your application can use instead o

Strona 51

Chapter 8 Creating Client-Side Components144destination applets are. To determine these, it inspects the visible applets on the page and looks for som

Strona 52 - Invoking an Action

When You Have an Applet’s Source Code1451. In Project Builder, add the ClientSideJava subproject to your project. To do so, double-click the word “S

Strona 53 - Generating a Response

Chapter 8 Creating Client-Side Components146The value for a key must be a property-list type of object (either singly or in combination, such as an ar

Strona 54

When You Don’t Have an Applet’s Source Code1471. Declare a subclass of the Association class.class MyAssociation extends Association {...}2. Implement

Strona 56

Deployment and Performance IssuesChapter 9

Strona 57 - Debugging Java

WEBOBJECTS ESSENTIALS

Strona 59 - Using Trace Methods

151After you’ve written your application, tested it, and verified that it works properly, it’s ready to be deployed for use by your customers. Before y

Strona 60 - Programming Pitfalls to Avoid

Chapter 9 Deployment and Performance Issues152Accessing StatisticsIf your application has a WOStats page, you can look at the statistics that WOStatis

Strona 61 - Java Programming Pitfalls

Recording Application Statistics153// WebScriptNSDictionary *myDict = [[[self application] statisticsStore] statistics];// JavaImmutableHashTable myDi

Strona 62

Chapter 9 Deployment and Performance Issues154Error HandlingWhen an error occurs, WebObjects by default returns a page containing debugging informatio

Strona 63 - Chapter 5

Automatically Terminating an Application155Automatically Terminating an ApplicationUnless an application is very carefully constructed, the longer it

Strona 64

Chapter 9 Deployment and Performance Issues156users to be able to end their sessions first, you might write the following code:// WebScript Application

Strona 65 - Server and Application Level

Performance Tips157component’s template (the result of parsing the .html and .wod files) and information about resources the component uses. If you cac

Strona 66 - Session Level

Chapter 9 Deployment and Performance Issues158Limit State StorageAs the amount of memory required by an application becomes large, its performance dec

Strona 67

Installing Applications159Consider implementing a batching display mechanism to display the information in the table. For example, if the array contai

Strona 69 - Page Level

Chapter 9 Deployment and Performance Issues160NeXT_ROOT/NextLibrary/WOApps. Thus, you can install the entire directory under <DocRoot>/WebObject

Strona 70

WEBSCRIPT

Strona 72

The WebScript LanguageChapter 10

Strona 74 - Accessing the Session

165To speed the development cycle, you may want to write your application in a scripting language. The WebObjects scripting language is called WebSc

Strona 75

Chapter 10 The WebScript Language166id number, aName;- awake { if (!number) {number = [[self application] visitorNum];number++;[[self application] set

Strona 76

WebScript Language Elements167In these declarations, id is a data type. The id type is a reference to any object—in reality, a pointer to the object’s

Strona 77

Chapter 10 The WebScript Language168The scope of an instance variable is object-wide. That means that any method in the object can access any instance

Strona 78 - Assigning Input Values

WebScript Language Elements169// assign another variable to a variablemyVar = anotherVar;// assign a string constant to a variablemyString = @"Th

Strona 79

What Is a WebObjects Application?Chapter 1

Strona 80 - Generating the Response

Chapter 10 The WebScript Language170For more information on NSNumber, NSString, NSDictionary, and NSArray, see the chapter “WebScript Programmer’s Qui

Strona 81

WebScript Language Elements171•A return type of void is not allowed:// This won’t work either.- (void) aMethod:(NSString *)anArg { ... }Both example m

Strona 82 - How HTML Pages Are Generated

Chapter 10 The WebScript Language172automatically defines two accessor methods: one to retrieve the instance variable’s value, and one to change the va

Strona 83

WebScript Language Elements173aString = [NSString stringWithString:@"Fred"];Note that a class is represented in a script by its correspondin

Strona 84

Chapter 10 The WebScript Language174// Create a mutable stringstring = [NSMutableString stringWithFormat:@"The string is %@", aString];// Cr

Strona 85 - START:Calendar {

WebScript Language Elements175Explicitly specifying a class in a variable or method declaration is called static typing.Because variables and return v

Strona 86

Chapter 10 The WebScript Language176Control-Flow StatementsWebScript supports the following control-flow statements:ifelseforwhilebreakcontinuereturnAr

Strona 87

WebScript Language Elements177In WebScript, relational operators are only reliable on NSNumbers. If you try to use them on any other class of object,

Strona 88

Chapter 10 The WebScript Language178The postincrement and postdecrement operators are not supported. They behave like the preincrement and predecremen

Strona 89 - SPECIAL TASKS

WebScript Language Elements179[self application]WOComponent also defines a session method, so you can do this to retrieve the current session:[self ses

Strona 91 - Creating Reusable Components

Chapter 10 The WebScript Language180Modern:function submit() {// <body>}• Method Definition With ArgumentsClassic:- takeValuesFromRequest:(WORequ

Strona 92

Advanced WebScript181Note that in this last example the left parenthesis should occur at a break between words when the modern message maps to an exis

Strona 93

Chapter 10 The WebScript Language182@interface Surfshop:NSObject {id name;NSArray *employees;}@end@implementation Surfshop- (Surfshop *)initWithName:a

Strona 94

WebScript for Objective-C Developers183The following example is a simple category of WORequest that gets the sender’s Internet e-mail address from the

Strona 95

Chapter 10 The WebScript Language184Here are some of the more subtle differences between WebScript and Objective-C:•You don’t need to retain instance

Strona 96 - Simplifying Interfaces

WebScript for Objective-C Developers185•You can only use the “at sign” character (@) as a conversion character with methods that take a format string

Strona 97

Chapter 10 The WebScript Language186To access a component’s methods, you must store the component in the session and then access it through the sess

Strona 98 - Intercomponent Communication

WebScript Programmer’s Quick Referenceto Foundation ClassesChapter 11

Strona 100

189As you learned in the previous chapter, when you write an application in WebScript, all values are objects, even simple values such as numbers or s

Strona 101

19WebObjects is a product that makes it easy for you to write dynamic web-based applications (or WebObjects applications). Before you start programmin

Strona 102

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes190Determining EqualityYou can determine if two objects are equal using the isE

Strona 103

Working With Strings191Note: The configuration of your HTTP server determines the user who owns autostarted applications. Reading From FilesThe string,

Strona 104

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes192Commonly Used String MethodsThe following sections list the most commonly us

Strona 105 - <DocRoot>

Commonly Used String Methods193+ stringWithContentsOfFile:Returns a string created by reading characters from a specified file. For example, the followi

Strona 106 - Designing for Reusability

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes194– substringFromIndex:Returns a string containing the characters of the recei

Strona 107 - Complete Declaration

Commonly Used String Methods195Modifying StringsWarning: The following methods are not supported by NSString. They are available only to NSMutableStri

Strona 108 - Partial Declaration

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes196Working With ArraysNSArray and NSMutableArray objects manage immutable and m

Strona 109 - Managing State

Commonly Used Array Methods197Creating ArraysThe methods in this section are class methods, as denoted by the plus sign (+). You use class methods to

Strona 110

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes198– isEqual:Returns YES if the specified object is an array and has contents eq

Strona 111

Commonly Used Array Methods199– insertObject:atIndex:Inserts an object at a specified index. If the specified index is already occupied, the objects at

Strona 112 - Chapter 7 Managing State

Apple, NeXT, and the publishers have tried to make the information contained in this manual as accurate and reliable as possible, but assume no respon

Strona 113 - Objects and State

Chapter 1 What Is a WebObjects Application?20The following sections describe the WebObjects application ingredients in more detail.ComponentsTo write

Strona 114

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes200Storing Arrays– writeToFile:atomically:Writes the array’s string representat

Strona 115

Commonly Used Dictionary Methods201the key’s value. Within a dictionary, the keys are unique. That is, no two keys in a single dictionary are equivale

Strona 116

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes202Creating DictionariesThe methods in this section are class methods, as denot

Strona 117

Commonly Used Dictionary Methods203Querying Dictionaries– allKeysReturns an array containing the dictionary’s keys or an empty array if the dictionary

Strona 118

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes204– isEqual:Returns YES if the specified object is a dictionary and has content

Strona 119

Commonly Used Dictionary Methods205– removeObjectForKey:Removes the entry for a specified key.– removeObjectsForKeys:Removes the entries for each key i

Strona 120 - State Storage Strategies

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes206Working With Dates and TimesNSCalendarDate objects represent dates and times

Strona 121 - Comparison of Storage Options

Commonly Used Date Methods207Commonly Used Date MethodsThe following sections list some of the most commonly used methods of NSCalendarDate, grouped a

Strona 122

Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes208Representing Dates as Strings– descriptionReturns a string representation o

Strona 123 - State in the Server

Commonly Used Date Methods209– minuteOfHourReturns the NSCalendarDate’s minutes value (0–59).– secondOfMinuteReturns the NSCalendarDate’s seconds val

Strona 124 - State in the Page

The Ingredients of a WebObjects Application21files. A component may not need a code file at all; it may need only a template file and a declarations file.

Strona 128 - Custom State-Storage Options

213Index%@ 59.api file 20.html file 20, 21.wo directory, See wo directory.woa directory, See woa directory.wod file, See wod file.wos file, See cod

Strona 129

Index214synchronization 85, 102–104client-side 85–86template 82–83URL, specifying 53variables 118–120in reusable components 97componentsJoinedBy

Strona 130

215IndexinitObject:withCoder: method 132initWithCoder: method 132–133example 133input postprocessing 51insertObject:atIndex: method 199install 1

Strona 131

Index216Rrecording statistics 151–153refuseNewSessions: method 155regenerating request page 45registerForEvents method 73relational operators 176

Strona 132

217IndexstringWithContentsOfFile:method 190–191, 193stringWithFormat: method 192stringWithString: method 192subclass, definition 166substringFromI

Strona 133 - Controlling Session State

Index218terminateAfterTimeInterval:method 155trace methods 59–60WOAssociation 71, 84–85WOComponent 23–24, 69–71, 82–87, 105See also componentsappe

Strona 134 - Setting Session Time-Out

Chapter 1 What Is a WebObjects Application?22as shown in Figure 2. (In Project Builder, Java and Objective-C code files are shown under Classes instead

Strona 135 - Controlling Component State

The Ingredients of a WebObjects Application23Application CodeIn addition to having one or more components, your application can also include applicati

Strona 136 - Adjusting the Page Cache Size

Chapter 1 What Is a WebObjects Application?24where they are used by reading the chapter “WebObjects Viewed Through Its Classes” (page 63).Components a

Strona 137 - Using awake and sleep

Running a WebObjects Application25Now you’ve learned what a WebObjects application looks like and seen the pieces that you’ll have to write. The next

Strona 138

Chapter 1 What Is a WebObjects Application?26Figure 5. Chain of Communication Between the Browser and Your WebObjects ApplicationHere is a brief desc

Strona 139 - Client-Side Page Caching

Running a WebObjects Application27Internet Server API (ISAPI). Thus, WebObjects adaptors can take advantage of server-specific interfaces but still pro

Strona 140

Chapter 1 What Is a WebObjects Application?28associated with the user’s action, and generates a response—usually an HTML page (see Figure 8).Figure 8.

Strona 141 - Chapter 8

Dynamic ElementsChapter 2

Strona 142

Contents

Strona 144

31In the previous chapter, you learned that a WebObjects application is made up of components, which in turn are made up of dynamic elements. Dynamic

Strona 145

Chapter 2 Dynamic Elements32This list is not hard-coded into the page. Instead, it is produced by several dynamic elements. Figure 10 shows how this s

Strona 146 - Objective-C Java

Server-Side Dynamic Elements33Figure 11. Server-Side Dynamic ElementsHow Server-Side Dynamic Elements WorkTo learn how server-side dynamic elements

Strona 147

Chapter 2 Dynamic Elements34In the .wod file, each element is identified by name and then its type is specified. The outermost dynamic element in the HTM

Strona 148

Server-Side Dynamic Elements35Finally, the WOString element defines a value attribute, which specifies the string you want displayed. This value attribu

Strona 149 - Chapter 9

Chapter 2 Dynamic Elements36• It resolves the value for the upSince key by looking for a method named upSincein the application object. If the method

Strona 150

Client-Side Java Components37elementName : elementType { attribute = value;attribute = value };Notice that the last attribute/value pair before a clos

Strona 151 - Maintaining a Log File

Chapter 2 Dynamic Elements38When client-side components are used, an HTTP request can result in either the resynchronization of state or the return of

Strona 152 - Accessing Statistics

Client-Side Java Components39When you look at client-side component’s bindings in the .wod file, it looks like this example:INPUTFIELD : WOApplet {code

Strona 155

Common MethodsChapter 3

Strona 157 - Control Memory Leaks

43The methods that you write for your WebObjects application provide the behavior that makes your application unique. Because you are writing subclass

Strona 158 - Limit Page Sizes

Chapter 3 Common Methods44name and click the button. This initiates the application’s request-response loop, and sayHello is invoked. Action methods t

Strona 159 - Installing Applications

Action Methods45// Java examplepublic Component showPart() {Error errorPage;Inventory inventoryPage;if (isValidPartNumber(partNumber)) {errorPage = (E

Strona 160

Chapter 3 Common Methods46Initialization and Deallocation MethodsLike all objects, WOApplication, WOSession, and WOComponent implement initialization

Strona 161 - WEBSCRIPT

Initialization and Deallocation Methods47- awake {/* initializations go here */}public void awake () {/* initializations go here. */}Application Initi

Strona 162

Chapter 3 Common Methods48// WebScript DodgeDemo Application.wos - awake {++requestCount;[self logWithFormat:@"Now serving request %@", requ

Strona 163 - The WebScript Language

Initialization and Deallocation Methods49Component InitializationA component object’s init method is invoked when the component object is created. Jus

Strona 164

vTable of ContentsIntroduction 9About This Book 11Other Useful Documentation 12Part I WebObjects EssentialsWhat Is a WebObjects Application? 17The In

Strona 165 - Objects in WebScript

Chapter 3 Common Methods50or null in Java). For more information, see the chapter “Managing State” (page 109).Request-Handling MethodsRequest-handling

Strona 166 - WebScript Language Elements

Request-Handling Methods51As you implement request-handling methods, you must invoke the superclass’s implementation of the same methods. But consider

Strona 167 - Variables and Scope

Chapter 3 Common Methods52Invoking an ActionThe second phase of the request-response loop involvesinvokeActionForRequest:inContext:. WebObjects forwar

Strona 168 - Assigning Values to Variables

Request-Handling Methods53following action method, the “CreditCard” component sets the verifiedsession variable to YES when the user has supplied valid

Strona 169

Chapter 3 Common Methods54appendToResponse:inContext: method adds bold and italic markup elements around a string’s value as follows: id value;id esca

Strona 170

Debugging a WebObjects ApplicationChapter 4

Strona 172 - Sending a Message to a Class

57In the previous chapters, you learned the pieces of a WebObjects application and the kinds of methods you need to write. Once you’ve put together an

Strona 173 - Creating Instances of Classes

Chapter 4 Debugging a WebObjects Application58executable in the launch panel. Output from the debugging methods appears in the launch panel. Debugging

Strona 174 - Data Types

Debugging Techniques59In WebScript and Objective-C, logWithFormat: works like the printf() function in C. This method takes a format string and a vari

Strona 175 - Statements and Operators

viHow WebObjects Works—A Class Perspective 72Starting the Request-Response Loop 72Taking Values From the Request 73Accessing the Session 74Creating or

Strona 176 - Relational Operators

Chapter 4 Debugging a WebObjects Application60methods are useful if you want to see all or part of the call stack. The following table describes the t

Strona 177

Programming Pitfalls to Avoid61•WebScript supports only objects that inherit from NSObject. As most objects inherit from NSObject, this limitation is

Strona 178 - Reserved Words

Chapter 4 Debugging a WebObjects Application62• The pageWithName method creates the page by looking up and instantiating the component class that has

Strona 179 - “Modern” WebScript Syntax

WebObjects Viewed Through Its ClassesChapter 5

Strona 181 - Advanced WebScript

The Classes in the Request-Response Loop65As you learned at the end of the first chapter, WebObjects applications respond to HTTP requests from the ser

Strona 182 - Categories

Chapter 5 WebObjects Viewed Through Its Classes66Figure 14. Request-Response Loop: Application and Server LevelThe HTTP server sends a request to the

Strona 183 - Objective-C WebScript

The Classes in the Request-Response Loop67Figure 15. Request-Response Loop: Session LevelThe objects dedicated to session management ensure that stat

Strona 184

Chapter 5 WebObjects Viewed Through Its Classes68When a user makes an initial request to a WebObjects application, the application creates a session o

Strona 185

The Classes in the Request-Response Loop69• WOResponse (in Java, Response)Stores and allows the modification of HTTP response data, such as header info

Strona 186

viiPart III WebScriptThe WebScript Language 163Objects in WebScript 165WebScript Language Elements 166Variables 166Variables and Scope 167Assigning Va

Strona 187 - Chapter 11

Chapter 5 WebObjects Viewed Through Its Classes70Figure 17. Request-Response Loop: Page LevelTwo major branches of these objects descend from WOEleme

Strona 188

The Classes in the Request-Response Loop71• WOAssociation (in Java, Association)Knows how to find and set a value by reference to a key. Instance varia

Strona 189 - Foundation Objects

Chapter 5 WebObjects Viewed Through Its Classes72dynamic elements on your page and the objects in the Enterprise Objects Framework.• EOEditingContext

Strona 190 - Determining Equality

How WebObjects Works—A Class Perspective73HTTP server and the WOApplication object. The application first parses the command line for the specified adap

Strona 191 - Working With Strings

Chapter 5 WebObjects Viewed Through Its Classes74Figure 19. Taking Values From the RequestA cycle of the request-response loop begins when the WOAdap

Strona 192 - Commonly Used String Methods

How WebObjects Works—A Class Perspective75Figure 20. URL to Start a WebObjects ApplicationThis URL does not contain a session ID, so the application

Strona 193

Chapter 5 WebObjects Viewed Through Its Classes76transactions from that of another, session IDs must not be easily predicted or faked. To this end, We

Strona 194 - Converting String Contents

How WebObjects Works—A Class Perspective77class for the page named “Main.” The application object performs the following steps to create a component:1

Strona 195 - Storing Strings

Chapter 5 WebObjects Viewed Through Its Classes78subscription for a friend. You follow the process a second time, selecting a different publication an

Strona 196 - Commonly Used Array Methods

How WebObjects Works—A Class Perspective79For more on how components are associated with templates, and on how HTML elements participate in request-ha

Strona 198 - Adding and Removing Objects

Chapter 5 WebObjects Viewed Through Its Classes80message and invoke the appropriate action method in the request component. This action method returns

Strona 199

How WebObjects Works—A Class Perspective811. The application object stores the response component indicated by the action method’s return value. (This

Strona 200 - Working With Dictionaries

Chapter 5 WebObjects Viewed Through Its Classes824. It saves the session object in the session store. 5. It invokes its own sleep method.When an Objec

Strona 201

How HTML Pages Are Generated83Figure 25. An Object Graph for a Page’s TemplateThe template is created at runtime when the component is first requested

Strona 202 - Creating Dictionaries

Chapter 5 WebObjects Viewed Through Its Classes84Associations and the Current ComponentA dynamic HTML element, such as a text field or a pop-up button,

Strona 203 - Querying Dictionaries

How HTML Pages Are Generated85START:Calendar {selectedDate = startDate;callBack = "mainPage";};In this example, Main is the parent component

Strona 204

Chapter 5 WebObjects Viewed Through Its Classes86associate particular events in the client applet (such as clicking a button) with the invocation of m

Strona 205 - Storing Dictionaries

How HTML Pages Are Generated87Figure 26. An Object Graph for a Page With a Subcomponentpage templatecalendartemplatecalendarinstancecalendarinstancep

Strona 210

Creating Reusable ComponentsChapter 6

Strona 212

93In the simplest applications, each component corresponds to an HTML page, and no two applications share components. However, one of the strengths of

Strona 213

Chapter 6 Creating Reusable Components94Figure 27. A Navigational ControlThe HTML code for one page might look like this:<HTML><HEAD><

Strona 214

Benefits of Reusable Components95<HTML><HEAD><TITLE>World Wide Web Wisdom, Inc.</TITLE></HEAD><BODY>Please come vis

Strona 215

Chapter 6 Creating Reusable Components96the World Wide Web Wisdom company could change the look of the navigational controls in all of its application

Strona 216

Benefits of Reusable Components97Figure 28. An Alert PanelThis panel is similar to the navigation table shown in Figure 27, but as you’ll see, most of

Strona 217

Chapter 6 Creating Reusable Components98the alertTitle and infoString attributes (leaving the other attributes private) using this AlertPanel.api file:

Strona 218

Intercomponent Communication99For reusable components to be truly versatile, there must also be a mechanism for the child component to interact with t

Komentarze do niniejszej Instrukcji

Brak uwag