Documentation Archive Developer
Search
PATH Documentation > WebObjects

Up

D2W

Package: com.webobjects.directtoweb

Inherits from:java.lang.Object


Class Description

The D2W class is responsible for creating Direct to Web pages. In each Direct to Web application, one instance of D2W creates all of the pages. This instance is called the Direct to Web factory and is accessed using the factory static method.

D2W defines several methods to create Direct to Web pages, for example, listPageForEntityNamed, errorPage, pageForConfigurationNamed, and pageForTaskAndEntityNamed. You invoke these methods on the Direct to Web factory. For example, to create a list page for Movies, use

ListPageInterface lpi = D2W.factory().listPageForEntityNamed("Movie",session());

If you want to customize the Direct to Web factory, you need to subclass D2W, create an instance of your subclass, and register it with Direct to Web using the setFactory method. See the "Customizing a Direct to Web Application" chapter in Developing WebObjects Applications With Direct to Web for more information.

The D2W class also provides the setWebAssistantEnabled and isWebAssistantEnabled methods to manage the Web Assistant. You can also change the keys with which Direct to Web caches rule firing results using newSignificantKey. See the "Direct to Web Architecture" chapter of Developing WebObjects Applications With Direct to Web for more information about rule firing caching.

Method Types


Constructors

Creating pages
Managing Rule Firing Caching
Managing the Direct to Web factory
Managing the Web Assistant
Obtaining Page Information
Private Methods


Constructors


D2W

public D2W()

Standard Java no argument constructor. If you subclass D2W, use the constructor to create an instance of your subclass and use D2W.setFactory to register it with Direct to Web.
Methods


activateWebAssistantServer

public void activateWebAssistantServer()

This method is intentionally undocumented. You should never have to invoke or customize it.



checkMultithreading

public void checkMultithreading(NSNotification notification)

This method is intentionally undocumented. You should never have to invoke or customize it.



confirmPageForEntityNamed

public ConfirmPageInterface confirmPageForEntityNamed(String entityName, WOSession session)

Returns a confirm page (a WOComponent object implementing the ConfirmPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



defaultPage

public WOComponent defaultPage(WOSession session)

Returns a default startup page (a WOComponent object), which is a query-all page unless you override the rule for the startupTask key. The session argument specifies the session in which the page should be created.



editPageForEntityNamed

public EditPageInterface editPageForEntityNamed(String entityName, WOSession session)

Returns an edit page (a WOComponent object implementing the EditPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



editPageForNewObjectWithConfigurationNamed

public EditPageInterface editPageForNewObjectWithConfigurationNamed(String configurationName, WOSession session)

Creates a new object and returns an edit page (a WOComponent object implementing the EditPageInterface. The object's class and the configuration of the page are determined from the named configuration identified by configurationName. The session argument specifies the session in which the page should be created.



editPageForNewObjectWithEntityNamed

public EditPageInterface editPageForNewObjectWithEntityNamed(String entityName, WOSession session)

Creates a new object and returns an edit page (a WOComponent object implementing the EditPageInterface. The object's class is determined from the EOEntity object identified by entityName. The session argument specifies the session in which the page should be created.

The EOEntity class is defined in the EOAccess Framework.



editRelationshipPageForEntityNamed

public EditRelationshipPageInterface editRelationshipPageForEntityNamed(String entityName, WOSession session)

Returns an edit-relationship page (a WOComponent object implementing the EditRelationshipPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



entityNameFromPage

public static String entityNameFromPage(WOComponent page)

Returns the name of the entity that the Direct to Web page page manipulates.



errorPage

public ErrorPageInterface errorPage(WOContext context)

Returns an error page (a WOComponent object implementing the ErrorPageInterface). The context argument specifies the WOContext containing the session in which the page should be created.



errorPage

public ErrorPageInterface errorPage(WOSession session)

Returns an error page (a WOComponent object implementing the ErrorPageInterface). The session argument specifies the session in which the page should be created.



factory

static public D2W factory()

Returns the Direct to Web factory, an instance of D2W that creates all of the Direct to Web pages in the application.



homeHrefInContext

public String homeHrefInContext(WOContext context)

Returns the URL for the login page for the session contained in the context WOContext object.



init

protected void init()

This method is intentionally undocumented. You should never have to invoke or customize it.



initializeD2W

public void initializeD2W(NSNotification notification)

This method is intentionally undocumented. You should never have to invoke or customize it.



inspectPageForEntityNamed

public InspectPageInterface inspectPageForEntityNamed(String entityName, WOSession session)

Returns an inspect page (a WOComponent object implementing the InspectPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



isDebugEnabled

public boolean isDebugEnabled()

This method is intentionally undocumented. You should never have to invoke or customize it.



isLiveAssistantEnabled

public boolean isLiveAssistantEnabled()

Use isWebAssistantEnabled instead.

See Also:
isWebAssistantEnabled



isWebAssistantEnabled

public boolean isWebAssistantEnabled()

Returns whether or not the Web Assistant is enabled. By default it is enabled.



listPageForEntityNamed

public ListPageInterface listPageForEntityNamed(String entityName, WOSession session)

Returns a list page (a WOComponent object implementing the ListPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



newSignificantKey

public void newSignificantKey(String key)

Adds key to the list of keys that the rule engine uses to cache the results of rule firing. See the "Direct to Web Architecture" chapter of Developing WebObjects Applications With Direct to Web for more information about rule firing caching.



packetForPropertyAndSettingsWithPage

protected AssistantPacket packetForPropertyAndSettingsWithPage(Property aProperty, Settings settings, WOComponent aComponent)

This method is intentionally undocumented. You should never have to invoke or customize it.



packetForSettingsWithPage

protected AssistantPacket packetForSettingsWithPage(Settings settings, WOComponent aComponent)

This method is intentionally undocumented. You should never have to invoke or customize it.



pageForConfigurationNamed

public WOComponent pageForConfigurationNamed(String configurationName, WOSession session)

Returns a Direct to Web page (a WOComponent object) for a named configuration identified by configurationName. The session argument specifies the session in which the page should be created. See the "Direct to Web" chapter of WebObjects Tools and Techniques for more information about named configurations.



pageForTaskAndEntityNamed

public WOComponent pageForTaskAndEntityNamed(String task, String entityName, WOSession session)

Returns a Direct to Web page (a WOComponent object) for the task identified by task and the entity identified by entityName. The session argument specifies the the session in which the page should be created.



pageForTaskAndEntityNamed

protected WOComponent pageForTaskAndEntityNamed(String task, String entityName, WOContext context)

Returns a Direct to Web page (a WOComponent object) for the task identified by task and the entity identified by entityName. The context argument specifies the context containing the session in which the page should be created.



queryAllPage

public QueryAllPageInterface queryAllPage(WOSession session)

Returns a query-all page (a WOComponent object implementing the QueryAllPageInterface). The session argument specifies the session in which the page should be created.



queryPageForEntityNamed

public QueryPageInterface queryPageForEntityNamed(String entityName, WOSession session)

Returns a query page (a WOComponent object implementing the QueryPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



requestWasHandled

public void requestWasHandled(WOContext context)

This method is intentionally undocumented. You should never have to invoke or customize it.



selectPageForEntityNamed

public SelectPageInterface selectPageForEntityNamed(String entityName, WOSession session)

Returns a select page (a WOComponent object implementing the SelectPageInterface) for the entity identified by entityName. The session argument specifies the session in which the page should be created.



setFactory

static public void setFactory(D2W factory)

Sets the Direct to Web factory, an instance of D2W that is used to create all of the application's Direct to Web pages. Use this method when you create a custom subclass of D2W.



setLiveAssistantEnabled

public void setLiveAssistantEnabled(boolean enabled)

Use setWebAssistantEnabled instead.

See Also:
setWebAssistantEnabled



setWebAssistantEnabled

public void setWebAssistantEnabled(boolean enabled)

Sets whether the Web Assistant is enabled or not. You should disable the Web Assistant when you deploy your application to prevent users from modifying the application's configuration.



visibleEntityNames

public NSArray visibleEntityNames()

This method is deprecated. Use visibleEntityNames(WOSession session) instead.



visibleEntityNames

public NSArray visibleEntityNames(WOSession session)

Returns an NSArray containing the names of the visible entities in session. You can hide entities using the Entities tab in the Web Assistant. See the "Direct to Web" chapter of WebObjects Tools and Techniques for more information about hiding entities.



webAssistantInContext

public WOComponent webAssistantInContext(WOContext context)

This action method is invoked when the user clicks Customize in the menu bar. It activates the Web Assistant in the user's browser.



willCheckRules

public void willCheckRules(NSNotification notification)

This method is intentionally undocumented. You should never have to invoke or customize it.



© 2001 Apple Computer, Inc.