Search path for reusable components – Apple WebObjects 3.5 User Manual

Page 105

Advertising
background image

Search Path for Reusable Components

105

4. Build the framework. If you perform a make install, it installs the

framework in NeXT_ROOT

/NextLibrary/Frameworks

and the WebServer

resources in

<DocRoot>/WebObjects/Frameworks

.

You must build the framework even if it contains only scripted
components.

After the framework is installed, you need to set up the applications so that
they can use components in that framework. Do the following:

5. In Project Builder, add the framework to the application’s project under

Frameworks.

6. Build the application.

The application’s executable file must contain all components that
your application references, as described in the next section. For this
reason, you must build the application even if it contains only scripted
components.

Search Path for Reusable Components

When WebObjects encounters the name of a reusable component at
runtime:

NAVCONTROL: NavigationControl {};

it must find a WOComponent object to represent the component and then
find the component’s resources (the HTML template file, image files, and
so on).

To find an object to represent the component, WebObjects looks in the
runtime system for a subclass of WOComponent (in Java, Component) with
the same name as the component (“NavigationControl” in the example
above). For compiled reusable components this search should succeed, but
for scripted ones it should fail.

Next, WebObjects looks within the application directory for the reusable
component’s resources. For example, if you manually start an application
that resides in

<DocRoot>/WebObjects/MyWOApps/Fortune.woa

, the

Fortune.woa

directory

will be searched.

If WebObjects doesn’t find the component there, it assumes that the
reusable component is included in a framework. It searches all frameworks

Advertising