WEBOBJECTSTOOLS AND TECHNIQUES
Chapter 1 Setting Up WebObjects Applications10The New Project panel has a Project Type pop-up list that lets you choose the type of project you want t
Creating WebObjects Application Projects116. Type the name of the project you want to create.7. Click Save.The New Project panel shows the path you sp
Chapter 1 Setting Up WebObjects Applications12Java and Objective-C are compiled languages. WebScript, which is based on Objective-C, is a scripted lan
Chapter 1 Setting Up WebObjects Applications13Project Builder displays a browser showing the contents of your project. The first column lists several c
Chapter 1 Setting Up WebObjects Applications14The New File panel comes up with the suitcase you selected open by default.3. Type the name of the item
The Structure of a WebObjects Application Project15In addition, you can drag a file directly onto the suitcase icon in the browser, and the file is copi
Chapter 1 Setting Up WebObjects Applications16behavior. The name of each one is the component’s name followed by a specific file extension. These are th
The Structure of a WebObjects Application Project17Started With WebObjects for more information on using the Wizard with databases.4. Specify the lang
Chapter 1 Setting Up WebObjects Applications18• The Application.wos and Session.wos files, if your application’s primary language is WebScript• Configur
The Structure of a WebObjects Application Project19To add an existing subproject (such as ClientSideJava or CommonJava) to your project:1. Double-cli
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
Chapter 1 Setting Up WebObjects Applications20Every WebObjects Application project includes several frameworks by default. When you build, your applic
Editing Your Project’s Source Files21Opening an Existing ProjectTo open an existing project from Project Builder:1. Choose Project m Open.2. In the O
Chapter 1 Setting Up WebObjects Applications22• If you use Java or Objective-C, all code files appear in the Classes suitcase. On disk, they live at th
Editing Your Component’s HTML and Declarations Files23Editing Your Component’s HTML and Declarations FilesWhile you must use Project Builder to edit y
Chapter 1 Setting Up WebObjects Applications24changes to your components (the .html, .wod, or .wos files) and test them without rebuilding.Note: When y
Building Your Application25The Application WrapperWhen you build your project, Project Builder creates an application wrapper,which is a folder whose
Chapter 1 Setting Up WebObjects Applications26When you launch your application, your machine’s web browser is launched by default and it accesses your
Converting Old Projects27will reside under the document root, usually DocumentRoot/WebObjects.The file contains a line you can uncomment for this purpo
Chapter 1 Setting Up WebObjects Applications28Performing the ConversionTo convert your project, open it in Project Builder. (It’s a good idea to crea
Converting Old Projects29Moving Your ImagesAfter the project is converted, there are additional changes you may want to make in order to take advantag
Contents
Editing With WebObjects BuilderChapter 2
33IntroductionWebObjects Builder is an application that provides graphical tools for creating dynamic web pages (components). This chapter describes t
Chapter 2 Editing With WebObjects Builder34Note: Depending on the width of the window, the toolbar may appear in two rows or one.The WebObjects Builde
The WebObjects Builder Toolbar35• Graphical mode shows a visual representation of your component, including its dynamic elements. The bottom pane, the
Chapter 2 Editing With WebObjects Builder36The Preferences panel provides several options for how text is displayed in both graphical and source editi
Chapter 2 Editing With WebObjects Builder37: This color well allows you to set the color of the currently selected text. To change the color, click
Chapter 2 Editing With WebObjects Builder381. Place the cursor where you want the element to appear on the page.2. Click the toolbar button representi
The Inspector39Some elements (such as text fields and text areas) can be selected simply by clicking them; they appear with a gray line underneath.Othe
Chapter 2 Editing With WebObjects Builder40The top of the window shows the element path to the selected element. Any element can be contained in a hie
Structure Elements41ListsClick to create a new list. If there is a selection, each line in the selection becomes a list item (<LI>). By default
Chapter 2 Editing With WebObjects Builder42Custom MarkerNot all legal HTML elements can be created directly using WebObjects Builder’s buttons or menu
Working With Tables43You can also enter source editing mode and type the marker and its text directly.Tip: To save a custom element so you can use it
Chapter 2 Editing With WebObjects Builder44To add a column, click the icon at the upper right of the table. The column is added at the right of th
Working With Tables45• Split a selected cell horizontally by clicking or vertically by clicking .• Merge a group of selected contiguous cells into a
Chapter 2 Editing With WebObjects Builder46•To set the width or height of a cell, select the cell and use the Table Data Inspector. Changing a cell’s
Creating Hyperlinks47Creating HyperlinksThere are two types of hyperlinks that you can use in a WebObjects application:•A static hyperlink (which uses
Chapter 2 Editing With WebObjects Builder48Setting Page AttributesThe top level in the element hierarchy is always the page itself. To inspect a page’
Setting Colors49Setting ColorsWebObjects Builder allows you to set the colors for a page’s background, selected text, and hyperlinks. To set the colo
vTable of ContentsContents iiiSetting Up WebObjects Applications 7Introduction 9Creating WebObjects Application Projects 9Choosing Assistance 11Choosi
Chapter 2 Editing With WebObjects Builder50The icons at the top of the palette window show the available palettes. To select a palette, click its icon
Palettes51If the palette’s background is gray, you can’t make any changes to it. To enable editing, choose Palettes m Make Editable. The palette'
Chapter 2 Editing With WebObjects Builder52Note: If the palette is editable, you can drag the item to the window, but it will disappear from the palet
Working With Dynamic ElementsChapter 3
55Introduction to Dynamic ElementsA dynamic element is an element whose exact HTML representation isn’t determined until run time. Dynamic elements ar
Chapter 3 Working With Dynamic Elements56For example, a dynamic hyperlink (WOHyperlink) has an action attribute that specifies an action method in the
Creating Dynamic Elements57In addition, you can also drag a model file (of type .eomodeld) into a component to create a variable of type WODisplayGroup
Chapter 3 Working With Dynamic Elements58The element appears in the HTML template. A template appears in the lower pane (the declarations file) showing
Chapter 3 Working With Dynamic Elements59The first column of the object browser displays two types of objects:• Keys are displayed above the horizontal
viWorking With Dynamic Elements 53Introduction to Dynamic Elements 55Attributes 55Creating Dynamic Elements 56Using the Toolbar 56Dragging Elements in
Chapter 3 Working With Dynamic Elements60There are several ways to add items to the object browser:• Use Project Builder to add keys and actions to yo
Chapter 3 Working With Dynamic Elements61When you choose Add Variable/Method, the following panel opens:In this panel, you specify:• The name of the k
Chapter 3 Working With Dynamic Elements62When you choose Add Action, the following panel appears:When you click Add, the following code is added to yo
Chapter 3 Working With Dynamic Elements63Note: To delete a key or action, you must delete it from the source code in Project Builder. Also, the Add
Chapter 3 Working With Dynamic Elements64• Drag a model (a folder with the extension .eomodeld) from the file system into the object browser in your co
Chapter 3 Working With Dynamic Elements65In the figure, if you choose the entity CarPackage as the variable’s type, the following code gets added to yo
Chapter 3 Working With Dynamic Elements66In the object browser, means that the display group has been configured. A means that it has not been confi
Chapter 3 Working With Dynamic Elements67• Entity: The Entity combo box has a list of entities from the models in your project. You can select one fro
Chapter 3 Working With Dynamic Elements68As with other display groups, you can use the Display Group Options panel to immediately configure the newly c
Chapter 3 Working With Dynamic Elements69In the figure, you have added a dynamic text field (WOTextField) to your component. Note the blue triangle in t
Setting Up WebObjects ApplicationsChapter 1
Chapter 3 Working With Dynamic Elements70window. Some (not all) dynamic elements display the binding for their default attribute inside the element it
Binding Elements71This time, a different attribute is selected, since the default attribute has already been bound.2. Click Connect Variable to bind t
Chapter 3 Working With Dynamic Elements72• Keys must specify their full key path. For example, to bind the key that is selected in the following figure
Dynamic and Static Inspectors73WOForm itself, don’t receive information but contain an action attribute representing an action to be taken when the fo
Chapter 3 Working With Dynamic Elements74To switch back to the WOText Inspector, select Dynamic Inspector from the pop-up list. In addition, you can
Creating Other WebObjects75If you convert a static element to its dynamic counterpart by clicking Make Dynamic, and there is no direct counterpart, th
Chapter 3 Working With Dynamic Elements76To create a dynamic element, you click its toolbar icon. One thing to be aware of is what happens when there
Creating Other WebObjects77time. A WOString is abstract in that it doesn’t represent any specific element, but it can be contained in any other HTML el
Chapter 3 Working With Dynamic Elements78RepetitionsA repetition (WORepetition) is a container element that repeats its contents a certain number of t
Creating Other WebObjects79When you wrap a repetition around a table row, the repetition symbol doesn’t appear. Instead, a blue border appears around
Chapter 3 Working With Dynamic Elements80the WOConditional’s contents are displayed. If condition is false (0), the contents aren’t displayed. conditi
Creating Other WebObjects81Custom WebObjectsYou use custom WebObjects for two main purposes:•To implement WebObjects element classes not directly supp
Chapter 3 Working With Dynamic Elements82the WOExtensions framework, which is included in your project by default.If WebObjects Builder recognizes the
Creating Other WebObjects831. Click in the toolbar. 2. Bring up the Inspector.A generic WebObject element has one required attribute, elementName,wh
Chapter 3 Working With Dynamic Elements84Dynamic ImagesThe elements WOImage and WOActiveImage are dynamic images. At run time, WOImage is rendered as
Reusable Components85appears in your component, with its code attribute set to the name of the file.• Drag an element from the Client-Side Components p
Chapter 3 Working With Dynamic Elements86• Use the toolbar to add a custom WebObject element (see “Custom WebObjects”) to your page, then use the Insp
Reusable Components87The Inspector shows the child component’s attributes. As with any other dynamic element, you can bind the child component’s attri
9IntroductionTo develop WebObjects applications, you use two primary tools: Project Builder and WebObjects Builder. These tools help you perform the
Comments to this Manuals