Apple WebObjects 3.5 Manual do Utilizador

Consulte online ou descarregue Manual do Utilizador para Software Apple WebObjects 3.5. Apple WebObjects 3.5 User Manual Manual do Utilizador

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 218
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes

Resumo do Conteúdo

Página 1 - DEVELOPER’S GUIDE

WEBOBJECTSDEVELOPER’S GUIDE

Página 3 - Contents

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

Página 4

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

Página 5 - Table of Contents

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

Página 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

Página 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

Página 8

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

Página 9 - Introduction

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

Página 10

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

Página 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

Página 13

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

Página 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,

Página 16

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

Página 17 - Chapter 1

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

Página 18

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

Página 19 - <DocumentRoot>

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

Página 20 - Components

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

Página 21 - Code or Script File

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

Página 22 - Bindings

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

Página 23 - A Note on WebObjects Classes

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

Página 24 - Application Directory

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

Página 25

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

Página 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

Página 27 - WODefaultApp

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

Página 28

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

Página 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

Página 30

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

Página 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

Página 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

Página 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

Página 34

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

Página 35

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

Página 36 - Declarations File Syntax

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

Página 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

Página 38

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

Página 39

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

Página 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

Página 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,

Página 42

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

Página 43 - Action Methods

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

Página 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

Página 45

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

Página 47 - Application Initialization

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

Página 48 - Session Initialization

Creating Client-Side ComponentsChapter 8

Página 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

Página 51

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

Página 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

Página 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

Página 54

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

Página 56

Deployment and Performance IssuesChapter 9

Página 57 - Debugging Java

WEBOBJECTS ESSENTIALS

Página 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

Página 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

Página 61 - Java Programming Pitfalls

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

Página 62

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

Página 63 - Chapter 5

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

Página 64

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

Página 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

Página 66 - Session Level

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

Página 67

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

Página 69 - Page Level

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

Página 70

WEBSCRIPT

Página 72

The WebScript LanguageChapter 10

Página 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

Página 75

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

Página 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

Página 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

Página 78 - Assigning Input Values

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

Página 79

What Is a WebObjects Application?Chapter 1

Página 80 - Generating the Response

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

Página 81

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

Página 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

Página 83

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

Página 84

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

Página 85 - START:Calendar {

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

Página 86

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

Página 87

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

Página 88

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

Página 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

Página 91 - Creating Reusable Components

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

Página 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

Página 93

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

Página 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

Página 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

Página 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

Página 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

Página 98 - Intercomponent Communication

WebScript Programmer’s Quick Referenceto Foundation ClassesChapter 11

Página 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

Página 101

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

Página 102

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

Página 103

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

Página 104

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

Página 105 - <DocRoot>

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

Página 106 - Designing for Reusability

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

Página 107 - Complete Declaration

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

Página 108 - Partial Declaration

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

Página 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

Página 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

Página 111

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

Página 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

Página 113 - Objects and State

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

Página 114

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

Página 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

Página 116

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

Página 117

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

Página 118

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

Página 119

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

Página 120 - State Storage Strategies

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

Página 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

Página 122

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

Página 123 - State in the Server

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

Página 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.

Página 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

Página 129

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

Página 130

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

Página 131

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

Página 132

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

Página 133 - Controlling Session State

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

Página 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

Página 135 - Controlling Component State

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

Página 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

Página 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

Página 138

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

Página 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

Página 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.

Página 141 - Chapter 8

Dynamic ElementsChapter 2

Página 142

Contents

Página 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

Página 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

Página 146 - Objective-C Java

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

Página 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

Página 148

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

Página 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

Página 150

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

Página 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

Página 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

Página 155

Common MethodsChapter 3

Página 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

Página 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

Página 159 - Installing Applications

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

Página 160

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

Página 161 - WEBSCRIPT

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

Página 162

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

Página 163 - The WebScript Language

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

Página 164

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

Página 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

Página 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

Página 167 - Variables and Scope

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

Página 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

Página 169

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

Página 170

Debugging a WebObjects ApplicationChapter 4

Página 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

Página 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

Página 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

Página 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

Página 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

Página 177

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

Página 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

Página 179 - “Modern” WebScript Syntax

WebObjects Viewed Through Its ClassesChapter 5

Página 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

Página 182 - Categories

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

Página 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

Página 184

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

Página 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

Página 186

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

Página 187 - Chapter 11

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

Página 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

Página 189 - Foundation Objects

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

Página 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

Página 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

Página 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

Página 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

Página 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

Página 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

Página 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

Página 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

Página 199

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

Página 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

Página 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

Página 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,

Página 203 - Querying Dictionaries

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

Página 204

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

Página 205 - Storing Dictionaries

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

Página 210

Creating Reusable ComponentsChapter 6

Página 212

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

Página 213

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

Página 214

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

Página 215

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

Página 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

Página 217

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

Página 218

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

Comentários a estes Manuais

Sem comentários