Apple WebObjects 3.5 Bedienungsanleitung

Stöbern Sie online oder laden Sie Bedienungsanleitung nach Software Apple WebObjects 3.5 herunter. Apple WebObjects 3.5 User Manual Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 120
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen

Inhaltsverzeichnis

Seite 1 - WITH WEBOBJECTS

GETTING STARTED WITH WEBOBJECTS

Seite 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

Seite 3 - Contents

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

Seite 4

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

Seite 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

Seite 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

Seite 7

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

Seite 8

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

Seite 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

Seite 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

Seite 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

Seite 12

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

Seite 13

Creating a Simple WebObjects Application Chapter 1

Seite 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

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

Seite 16

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

Seite 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

Seite 18 - Launching WebObjects Builder

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

Seite 19

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 27 - Binding Elements

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 38

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

Seite 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

Seite 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

Seite 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

Seite 42

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

Seite 43

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

Seite 44

Contents

Seite 45

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 50

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

Seite 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

Seite 52 - WOString

Enhancing Your ApplicationChapter 2

Seite 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

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

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

Seite 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

Seite 64

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

Seite 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

Seite 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

Seite 67 - Choosing an Adaptor

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

Seite 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

Seite 69

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

Seite 70

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

Seite 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

Seite 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

Seite 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

Seite 74 - Choosing an Entity

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

Seite 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) "

Seite 76

Creating a WebObjectsDatabase ApplicationChapter 3

Seite 77

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

Seite 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

Seite 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

Seite 81 - Examining the Bindings

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 98

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

Seite 100

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

Seite 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

Seite 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

Seite 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

Seite 104

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

Seite 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

Seite 106 - WebObjects Builder assigns

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

Seite 107

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

Seite 108 - Adding a Repetition

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

Seite 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

Seite 110 - Running Movies

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

Seite 111

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 119

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

Seite 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

Kommentare zu diesen Handbüchern

Keine Kommentare