Apple WebObjects 3.5 Manuel d'utilisateur

Naviguer en ligne ou télécharger Manuel d'utilisateur pour Logiciel Apple WebObjects 3.5. Apple WebObjects 3.5 User Manual Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 218
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - DEVELOPER’S GUIDE

WEBOBJECTSDEVELOPER’S GUIDE

Page 3 - Contents

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

Page 4

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

Page 5 - Table of Contents

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

Page 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

Page 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

Page 8

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

Page 9 - Introduction

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

Page 10

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

Page 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

Page 13

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

Page 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,

Page 16

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

Page 17 - Chapter 1

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

Page 18

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

Page 19 - <DocumentRoot>

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

Page 20 - Components

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

Page 21 - Code or Script File

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

Page 22 - Bindings

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

Page 23 - A Note on WebObjects Classes

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

Page 24 - Application Directory

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

Page 25

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

Page 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

Page 27 - WODefaultApp

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

Page 28

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

Page 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

Page 30

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

Page 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

Page 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

Page 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

Page 34

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

Page 35

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

Page 36 - Declarations File Syntax

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

Page 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

Page 38

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

Page 39

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

Page 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

Page 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,

Page 42

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

Page 43 - Action Methods

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

Page 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

Page 45

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

Page 47 - Application Initialization

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

Page 48 - Session Initialization

Creating Client-Side ComponentsChapter 8

Page 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

Page 51

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

Page 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

Page 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

Page 54

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

Page 56

Deployment and Performance IssuesChapter 9

Page 57 - Debugging Java

WEBOBJECTS ESSENTIALS

Page 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

Page 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

Page 61 - Java Programming Pitfalls

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

Page 62

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

Page 63 - Chapter 5

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

Page 64

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

Page 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

Page 66 - Session Level

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

Page 67

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

Page 69 - Page Level

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

Page 70

WEBSCRIPT

Page 72

The WebScript LanguageChapter 10

Page 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

Page 75

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

Page 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

Page 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

Page 78 - Assigning Input Values

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

Page 79

What Is a WebObjects Application?Chapter 1

Page 80 - Generating the Response

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

Page 81

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

Page 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

Page 83

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

Page 84

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

Page 85 - START:Calendar {

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

Page 86

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

Page 87

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

Page 88

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

Page 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

Page 91 - Creating Reusable Components

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

Page 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

Page 93

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

Page 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

Page 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

Page 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

Page 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

Page 98 - Intercomponent Communication

WebScript Programmer’s Quick Referenceto Foundation ClassesChapter 11

Page 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

Page 101

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

Page 102

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

Page 103

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

Page 104

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

Page 105 - <DocRoot>

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

Page 106 - Designing for Reusability

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

Page 107 - Complete Declaration

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

Page 108 - Partial Declaration

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

Page 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

Page 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

Page 111

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

Page 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

Page 113 - Objects and State

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

Page 114

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

Page 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

Page 116

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

Page 117

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

Page 118

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

Page 119

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

Page 120 - State Storage Strategies

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

Page 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

Page 122

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

Page 123 - State in the Server

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

Page 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.

Page 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

Page 129

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

Page 130

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

Page 131

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

Page 132

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

Page 133 - Controlling Session State

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

Page 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

Page 135 - Controlling Component State

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

Page 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

Page 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

Page 138

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

Page 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

Page 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.

Page 141 - Chapter 8

Dynamic ElementsChapter 2

Page 142

Contents

Page 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

Page 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

Page 146 - Objective-C Java

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

Page 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

Page 148

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

Page 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

Page 150

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

Page 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

Page 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

Page 155

Common MethodsChapter 3

Page 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

Page 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

Page 159 - Installing Applications

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

Page 160

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

Page 161 - WEBSCRIPT

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

Page 162

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

Page 163 - The WebScript Language

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

Page 164

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

Page 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

Page 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

Page 167 - Variables and Scope

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

Page 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

Page 169

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

Page 170

Debugging a WebObjects ApplicationChapter 4

Page 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

Page 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

Page 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

Page 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

Page 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

Page 177

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

Page 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

Page 179 - “Modern” WebScript Syntax

WebObjects Viewed Through Its ClassesChapter 5

Page 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

Page 182 - Categories

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

Page 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

Page 184

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

Page 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

Page 186

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

Page 187 - Chapter 11

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

Page 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

Page 189 - Foundation Objects

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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 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

Page 199

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

Page 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

Page 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

Page 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,

Page 203 - Querying Dictionaries

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

Page 204

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

Page 205 - Storing Dictionaries

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

Page 210

Creating Reusable ComponentsChapter 6

Page 212

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

Page 213

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

Page 214

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

Page 215

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

Page 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

Page 217

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

Page 218

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

Commentaires sur ces manuels

Pas de commentaire