Apple WebObjects 3.5 Manual de usuario Pagina 1

Busca en linea o descarga Manual de usuario para Software Apple WebObjects 3.5. Apple WebObjects 3.5 User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 120
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente

Indice de contenidos

Pagina 1 - WITH WEBOBJECTS

GETTING STARTED WITH WEBOBJECTS

Pagina 2

Preface 10 Where to Go From Here After you have worked through the tutorials in this book, you should have a good working knowledge of WebObjects. Fo

Pagina 3 - Contents

Chapter 3 Creating a WebObjects Database Application100your relationship, and the relationship’s name is dependent on the adaptor the wizard used. Ada

Pagina 4

Refining Your Model1018. Click Connect.EOModeler automatically renames the relationship based on the name of the destination entity. For example, after

Pagina 5 - Table of Contents

Chapter 3 Creating a WebObjects Database Application102At this point your model has all the relationships it needs. The Diagram View gives you an over

Pagina 6 - Refining Your Model 97

Refining Your Model1033. Ensure that the delete rule is set to Cascade.If the wizard created relationships for you, the relationship’s delete rule shou

Pagina 7

Chapter 3 Creating a WebObjects Database Application104Enterprise Objects Framework provides several mechanisms for generating and assigning unique va

Pagina 8

Setting Up a Master-Detail Configuration105In the Movies application, the master-detail configuration is built around Movie’s movieRoles relationship. T

Pagina 9 - About This Book

Chapter 3 Creating a WebObjects Database Application106An Add Display Group panel opens.3. In the Add Display Group panel, change the name to movieRol

Pagina 10 - Where to Go From Here

Setting Up a Master-Detail Configuration107Notice that the “Has detail data source” box is checked. This means that movieRoleDisplayGroup gets its obje

Pagina 11 - Chapter 1

Chapter 3 Creating a WebObjects Database Application1086. Check the “Fetches on load” box.When “Fetches on load” is selected, the display group fetche

Pagina 12

Setting Up a Master-Detail Configuration1091. In the MovieDetails component window, add the bolded text Starring: beneath the Revenue line.2. Below the

Pagina 13

Creating a Simple WebObjects Application Chapter 1

Pagina 14 - Set project type here

Chapter 3 Creating a WebObjects Database Application110When you’re done, the repetition bindings should look like the following:Running MoviesBe sure

Pagina 15 - GuestBook

Updating Objects in the Detail Display Group111Updating Objects in the Detail Display GroupIn this section, you’ll add the ability to insert, update,

Pagina 16

Chapter 3 Creating a WebObjects Database Application112Managing a DisplayGroup’s SelectionRemember how clicking a movie title in the Main page selects

Pagina 17 - Examining Your Project

Updating Objects in the Detail Display Group113Adding a FormNow lay out the user interface used to view and edit the selected MovieRole. When you’re d

Pagina 18 - Launching WebObjects Builder

Chapter 3 Creating a WebObjects Database Application1142. Using the Display Group Options panel, assign talentDisplayGroup’s entity to Talent.Remember

Pagina 19

Updating Objects in the Detail Display Group115Talent browser, the selection should refer to a single object. Consequently, you need to add two method

Pagina 20 - Creating the Page’s Content

Chapter 3 Creating a WebObjects Database Application116Again because the browser uses a vector for its selections attribute, the setTalentSelection me

Pagina 21 - Entering Static Text

Adding Behavior to Your Enterprise Objects1176. Copy the saveChanges method from the Main.java class and paste it into the MovieDetails.java class:pub

Pagina 22 - Using the Inspector

Chapter 3 Creating a WebObjects Database Application1181. In EOModeler, inspect the Talent entity.2. In the Entity Inspector for Talent, type Talent i

Pagina 23

Adding Behavior to Your Enterprise Objects119Adding Custom Behavior to TalentNow add the fullName method to Talent and bind it to the browser.1. Open

Pagina 25 - Resizing the Form Elements

Chapter 3 Creating a WebObjects Database Application120Running MoviesBe sure that all your project’s files are saved (including your model file), and bu

Pagina 26 - Enter rows and columns here

13 This chapter introduces you to the basic concepts and procedures of developing WebObjects applications. You’ll develop, in stages, a simple applic

Pagina 27 - Binding Elements

Chapter 1 Creating a Simple WebObjects Application 14 Project Builder is an integrated software-development application. It contains a project browse

Pagina 28 - String directly in the box

Creating a WebObjects Application Project 15 4. Click Browse.5. In the Save panel, navigate to the DocumentRoot /WebObjects directory. DocumentRoot

Pagina 29 - Binding the Input Elements

Chapter 1 Creating a Simple WebObjects Application 16 9. For Available Assistance, choose None.If you are developing an application that accesses a d

Pagina 30 - Implementing an Action Method

Examining Your Project 17 Examining Your Project Project Builder displays a browser showing the contents of your project. The first column lists sever

Pagina 31

Chapter 1 Creating a Simple WebObjects Application 18 3. Select Classes in the first column of the browser. You’ll see three files listed in the second

Pagina 32 - action method

Launching WebObjects Builder 19 2. Double-click Main.wo in the second column.The application WebObjects Builder launches and displays a window enti

Pagina 33 - <HR> element)

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

Pagina 34 - View Source File

Chapter 1 Creating a Simple WebObjects Application 20 This pop-up list allows you to switch between graphical editing mode and source editing mode. W

Pagina 35 - Click here to build

Creating the Page’s Content 21 • Structures . Use these buttons to create paragraphs, lists, images, and other static HTML elements. This setting is

Pagina 36

Chapter 1 Creating a Simple WebObjects Application 22 Using the Inspector You use the Inspector window to set properties of the elements in your comp

Pagina 37 - Enhancing Your Application

Creating the Page’s Content23Each element has its own Inspector that allows you to set properties appropriate for the element. The Page Attributes Ins

Pagina 38

Chapter 1 Creating a Simple WebObjects Application241. To display the dynamic form elements buttons in the toolbar, choose from the Elements pop-up

Pagina 39 - Duplicating Your Project

Creating the Page’s Content25The window should now look like this:Resizing the Form ElementsThe text fields and text area are a bit small, so you’ll re

Pagina 40 - PB.project.)

Chapter 1 Creating a Simple WebObjects Application261. Inspect the Name text field (that is, select the text field and open the Inspector window). 2. Ch

Pagina 41 - Creating a Custom Guest Class

Binding Elements275. Inspect the multi-line text area. In Text Area Inspector, you can set various attributes corresponding to those of a <TEXTAREA

Pagina 42

Chapter 1 Creating a Simple WebObjects Application28WebObjects Builder allows you to declare variables without having to edit your source file directly

Pagina 43

Binding Elements29Binding the Input ElementsEach dynamic element contains several attributes. These attributes determine what happens when the element

Pagina 44

Contents

Pagina 45

Chapter 1 Creating a Simple WebObjects Application30The Inspector window comes to the front, displaying the bindings for the text area. The value attr

Pagina 46 - Creating the Guest Object

Binding Elements313. From the “Page returned” pop-up menu, select null.The value returned by an action method represents the next page (component) to

Pagina 47 - Main.java

Chapter 1 Creating a Simple WebObjects Application32Creating the Application’s OutputSo far, you have a way for the guest to enter information and a w

Pagina 48 - Creating a Guest List

Creating the Application’s Output332. Choose from the Elements pop-up list to display the Structures buttons.3. Click to create a horizontal line

Pagina 49 - Application, which is

Chapter 1 Creating a Simple WebObjects Application3410. Save your component. It should now look like this:In summary, when the user clicks the Submit

Pagina 50

Building and Running Your Application35Building and Running Your Application1. Make Project Builder active. A quick way to do this from WebObjects Bui

Pagina 51 - Adding a Second Component

Chapter 1 Creating a Simple WebObjects Application366. Click in the Launch panel to launch your application.The Launch Panel displays a series of me

Pagina 52 - WOString

Enhancing Your ApplicationChapter 2

Pagina 54 - Guest as its type

Duplicating Your Project39In the previous tutorial, you learned how to create a web component that has input and output elements and how to bind these

Pagina 56 - Adding the Finishing Touches

Chapter 2 Enhancing Your Application404. Duplicate the GuestBook folder.On Windows NT, you can do this by selecting the folder, choosing Edit m Copy,

Pagina 57 - Adding a Dynamic Hyperlink

Creating a Custom Guest Class41Creating a Custom Guest ClassIn the first chapter, you created individual variables to store a guest’s name, e-mail addr

Pagina 58 - Main”, because you

Chapter 2 Enhancing Your Application42also a class, specifically a subclass of the class next.wo.Component (called WOComponent in WebScript or Objectiv

Pagina 59 - Database Application

Creating a Custom Guest Class436. Double-click the row containing the value binding.This removes the binding for guestName you made previously and bin

Pagina 60

Chapter 2 Enhancing Your Application446. Double-click the upper-left cell.You can now edit the contents of the cell. If you want to resume structure e

Pagina 61

Creating a Custom Guest Class4511. Click in the component window, then press Tab.Pressing Tab when editing a table causes the contents of the next cel

Pagina 62 - The Movies Application

Chapter 2 Enhancing Your Application46The table should now look like this:3. Save the Main component.Creating the Guest ObjectEarlier in this chapter,

Pagina 63

Keeping Track of Multiple Guests474. Save Main.java.5. Build and run your application.The application should work similarly to the first chapter, excep

Pagina 64

Chapter 2 Enhancing Your Application48Before doing this, it is important to understand the scope and life span of variables in WebObjects:• Component

Pagina 65 - Designing the Main Page

Keeping Track of Multiple Guests49Note that there is one method already defined: Application, which is the constructor for the application object. The

Pagina 66 - Specifying a Model File

v Table of Contents Contents iiiPreface 7 About WebObjects 9About This Book 9Where to Go From Here 10 Creating a Simple WebObjects Application 11 Cre

Pagina 67 - Choosing an Adaptor

Chapter 2 Enhancing Your Application503. At the top of the Application class definition, enter this declaration:protected MutableVector allGuests;This

Pagina 68

Adding a Second Component51Adding a Second ComponentIn this section, you’ll create a new component. Instead of Java, you’ll implement its code using W

Pagina 69

Chapter 2 Enhancing Your Application5210. In the object browser, click application. There is an entry in the second column for the allGuests applicati

Pagina 70

Using a Repetition53pageWithName is a standard WebObjects method (defined in the WebApplication class) that allows you to specify a new page to display

Pagina 71 - Specifying Primary Keys

Chapter 2 Enhancing Your Application54You’ll bind the allGuests array to the WORepetition’s list attribute. This tells WebObjects to generate the elem

Pagina 72 - Shift-click to select more

Using a Repetition5511. In the object browser, select application in the first column.12. In the second column, click allGuests and drag the cursor to

Pagina 73

Chapter 2 Enhancing Your Application56By using the name currentGuest for the item attribute, you are taking advantage of the fact that the strings in

Pagina 74 - Choosing an Entity

Adding the Finishing Touches574. Enter the following code before the return statement in clearGuestList:[[self application] clearGuests];This code cal

Pagina 75 - Choosing a Layout

Chapter 2 Enhancing Your Application585. Select the pageName attribute, then double-click in the Binding column and type (including the quotes) "

Pagina 76

Creating a WebObjectsDatabase ApplicationChapter 3

Pagina 77

vi Adding the MovieDetails Page 92 Creating the MovieDetails Component 93Storing the Selected Movie 93Navigating from Main to MovieDetails 94Designin

Pagina 79

61One of the most powerful features of WebObjects is its ability to provide access to databases. To do so, it uses a framework called the Enterprise O

Pagina 80 - Examining the Variables

Chapter 3 Creating a WebObjects Database Application62The Movies ApplicationThe Movies application has two pages, each of which allows you to access i

Pagina 81 - Examining the Bindings

The Movies Application63Enterprise Objects and the Movies DatabaseEnterprise Objects Framework manages the interaction between the database and object

Pagina 82 - Bindings in the Query Part

Chapter 3 Creating a WebObjects Database Application64MOVIE_ROLE table having a MOVIE_ID column. In the MOVIE table, MOVIE_ID is a primary key, while

Pagina 83 - Bindings in the Editing Part

Designing the Main Page65Designing the Main PageEvery WebObjects application has at least one component—usually named Main—that represents the first pa

Pagina 84

Chapter 3 Creating a WebObjects Database Application665. Type Movies in the “File name” field.6. Click Save.7. In the New Project panel, click OK.This

Pagina 85 - Refining Main.wo

Designing the Main Page67Choosing an AdaptorAn adaptor is a mechanism that connects your application to a particular database server. For each type of

Pagina 86 - Specifying a Sort Order

Chapter 3 Creating a WebObjects Database Application683. Complete the login panel.Specify the connection information you provided when you created and

Pagina 87

Designing the Main Page69A relationship is a link between two entities that’s based on attributes of the entities. For example, the Movie entity has a

Pagina 89 - Setting a Number Format

Chapter 3 Creating a WebObjects Database Application703. Uncheck the “Ask about stored procedures” box.Checking this box causes the wizard to read sto

Pagina 90 - Optional Exercise

Designing the Main Page71Choosing the Tables to Include1. In the wizard panel, select MOVIE, MOVIE_ROLE, and TALENT in the Tables browser.The wizard c

Pagina 91

Chapter 3 Creating a WebObjects Database Application721. Select movieId as the primary key for the Movie entity.2. Click Next.3. Select both movieId a

Pagina 92 - Adding the MovieDetails Page

Designing the Main Page73If foreign key definitions aren’t specified in your database server’s schema information (as with Microsoft Access), the wizard

Pagina 93 - Storing the Selected Movie

Chapter 3 Creating a WebObjects Database Application742. Choose Cascade.This option specifies what to do when the source object (the Movie) is deleted.

Pagina 94 - Add the hyperlink below

Designing the Main Page75Choosing a LayoutThe wizard provides several page layout options for formatting objects fetched from the database.1. Choose S

Pagina 95 - Movie Details

Chapter 3 Creating a WebObjects Database Application76There are three parts to this page: the query part (at the top of the page), which contains field

Pagina 96 - MovieSearch

Designing the Main Page77The order in which you add the attributes determines the order in which they appear on the page, so add them in the following

Pagina 97 - Refining Your Model

Chapter 3 Creating a WebObjects Database Application78When the wizard finishes, your new project is displayed in Project Builder. The wizard has produc

Pagina 98

Examining Your Project79Examining Your ProjectWhenever you create a new project, Project Builder populates the project with ready-made files and direct

Pagina 100

Chapter 3 Creating a WebObjects Database Application80Examining the Variables1. Double-click Main.wo in Project Builder’s WebObjects Components catego

Pagina 101 - Switches to Browser View

Examining Your Project81Also note the comment explaining how movieDisplayGroup is initialized. The Main.java class doesn’t have any code to create and

Pagina 102 - This box should be checked

Chapter 3 Creating a WebObjects Database Application82Bindings in the Query PartIn the query part of the component, movieDisplayGroup.queryMatch.title

Pagina 103

Examining Your Project831. Inspect the hyperlink.Its action attribute is bound to the action method selectObject.2. Look in the Main.java class to see

Pagina 104

Chapter 3 Creating a WebObjects Database Application841. Inspect the middle image button.Its action attribute is bound to the action method saveChange

Pagina 105

Refining Main.wo85group’s selected object. These changes happen only in memory—not in the database. To actually insert a new row in the database (or de

Pagina 106 - WebObjects Builder assigns

Chapter 3 Creating a WebObjects Database Application86Specifying a Sort OrderYou can change your application to sort movies alphabetically without wri

Pagina 107

Refining Main.wo87Specifying Default Values for New Enterprise ObjectsWhen new enterprise objects are created in your application, it’s common to assig

Pagina 108 - Adding a Repetition

Chapter 3 Creating a WebObjects Database Application88The Movies application specifies default values for newly created Movie objects using the display

Pagina 109 - Configuring a Repetition

Refining Main.wo89Setting a Number FormatIn addition to a dateformat attribute, text field elements also have a numberformat attribute.1. Inspect the re

Pagina 110 - Running Movies

9 About WebObjects WebObjects is an object-oriented environment for developing and deploying World Wide Web applications. A WebObjects application ru

Pagina 111

Chapter 3 Creating a WebObjects Database Application90Optional ExerciseYou can tidy up the user interface even further by putting the query part of th

Pagina 112 - return null;

Refining Main.wo914. In the Table Inspector, choose Unspecified for the table width.The table resizes to just fit its contents. When you change the cell

Pagina 113 - Adding a Talent Display Group

Chapter 3 Creating a WebObjects Database Application92Adding the MovieDetails PageThe MovieDetails page shows you the detailed information about a mov

Pagina 114 - Configuring the Browser

Adding the MovieDetails Page93Creating the MovieDetails Component1. In Project Builder, choose File m New in Project.2. In the New File panel, click t

Pagina 115

Chapter 3 Creating a WebObjects Database Application94Movie isn’t actually a class; it’s an entity. It’s listed in the combo box as a type along with

Pagina 116 - Add the image buttons inside

Adding the MovieDetails Page958. In Project Builder, modify the showDetails action to look like the following: public Component showDetails(){ Movi

Pagina 117

Chapter 3 Creating a WebObjects Database Application96This adds a new level 3 heading element around the string. The MovieDetails page will show the t

Pagina 118 - Talent in the Class field

Refining Your Model97telling the application to open the MovieSearch page when the hyperlink is clicked.Running MoviesBe sure that all your project’s fi

Pagina 119

Chapter 3 Creating a WebObjects Database Application98Project Builder opens your model file in EOModeler, launching EOModeler first if it isn’t already

Pagina 120

Refining Your Model994. In the MovieRole entity, remove movieId and talentId as class properties.5. In the Talent entity, remove talentId as a class pr

Comentarios a estos manuales

Sin comentarios