WebObjects 5.2.3

com.webobjects.directtoweb
Class D2W

java.lang.Object
  extended bycom.webobjects.directtoweb.D2W

public class D2W
extends Object

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


Constructor Summary
D2W()
           
 
Method Summary
 void activateWebAssistantServer()
          This method is intentionally undocumented.
 void checkMultithreading(NSNotification n)
          This method is intentionally undocumented.
 ConfirmPageInterface confirmPageForEntityNamed(String entityName, WOSession session)
          Returns a confirm page (a WOComponent object implementing the ConfirmPageInterface) for the entity identified by entityName.
 WOComponent defaultPage(WOSession session)
          Returns a default startup page as a WOComponent, which is a query-all page unless you override the rule for the startupTask key.
 EditPageInterface editPageForEntityNamed(String entityName, WOSession session)
          Returns an edit page (a WOComponent object implementing the EditPageInterface) for the entity identified by entityName.
 EditPageInterface editPageForNewObjectWithConfigurationNamed(String configurationName, WOSession session)
          Creates a new object and returns an edit page as a WOComponent implementing the EditPageInterface.
 EditPageInterface editPageForNewObjectWithEntityNamed(String entityName, WOSession session)
          Creates a new object and returns an edit page as a WOComponent implementing the EditPageInterface.
 EditRelationshipPageInterface editRelationshipPageForEntityNamed(String entityName, WOSession session)
          Returns an edit-relationship page as a WOComponent implementing the EditRelationshipPageInterface for the entity identified by entityName.
static String entityNameFromPage(WOComponent page)
          Returns the name of the entity that the D2WPage manipulates.
 ErrorPageInterface errorPage(WOContext context)
          Returns an error page as a WOComponent implementing the ErrorPageInterface.
 ErrorPageInterface errorPage(WOSession session)
          Returns an error page as a WOComponent implementing the ErrorPageInterface.
static D2W factory()
          Gets the Direct to Web factory, an instance of D2W that creates all of the Direct to Web pages in the application.
 String homeHrefInContext(WOContext context)
          Returns the URL of the login page for the session contained in the specified context.
protected  void init()
          This method is intentionally undocumented.
 InspectPageInterface inspectPageForEntityNamed(String entityName, WOSession session)
          Returns an inspect page as a WOComponent implementing the InspectPageInterface for the entity identified by entityName.
 boolean isLiveAssistantEnabled()
          Deprecated.  
 boolean isWebAssistantEnabled()
          Determines whether or not the Web Assistant is enabled.
 ListPageInterface listPageForEntityNamed(String entityName, WOSession session)
          Returns a list page as a WOComponent implementing the ListPageInterface for the entity identified by entityName.
 void newSignificantKey(String newKey)
          Adds key to the list of keys that the rule engine uses to cache the results of rule firing.
protected  com.apple.client.directtoweb.common.AssistantPacket packetForPropertyAndSettingsWithPage(com.apple.client.directtoweb.common.Property p, com.apple.client.directtoweb.common.Settings settings, WOComponent lastPage)
          This method is intentionally undocumented.
protected  com.apple.client.directtoweb.common.AssistantPacket packetForSettingsWithPage(com.apple.client.directtoweb.common.Settings settings, WOComponent lastPage)
          This method is intentionally undocumented.
 WOComponent pageForConfigurationNamed(String dynamicPageName, WOSession session)
          Returns a Direct to Web page as a WOComponent for a named configuration identified by the dynamicPageName argument.
protected  WOComponent pageForTaskAndEntityNamed(String task, String entityName, WOContext context)
          Returns a Direct to Web page as a WOComponent for the task identified by task and the entity identified by entityName.
 WOComponent pageForTaskAndEntityNamed(String task, String entityName, WOSession session)
          Returns a Direct to Web page as a WOComponent for the task identified by task and the entity identified by entityName.
 QueryAllPageInterface queryAllPage(WOSession session)
          Returns a query-all page as a WOComponent implementing the QueryAllPageInterface.
 QueryPageInterface queryPageForEntityNamed(String entityName, WOSession session)
          Returns a query page as a WOComponent object implementing the QueryPageInterface for the entity identified by entityName.
 void requestWasHandled(WOContext c)
          This method is intentionally undocumented.
 SelectPageInterface selectPageForEntityNamed(String entityName, WOSession session)
          Returns a select page as a WOComponent implementing the SelectPageInterface for the entity identified by entityName.
static void setFactory(D2W newValue)
          Sets the Direct to Web factory, an instance of D2W that is used to create all of the Direct to Web pages of an application.
 void setLiveAssistantEnabled(boolean newValue)
          Deprecated.  
 void setWebAssistantEnabled(boolean newValue)
          Sets whether the Web Assistant is enabled or not.
static boolean traceRuleFiringEnabled()
          Deprecated.  
static boolean traceRuleModificationsEnabled()
          Deprecated.  
 NSArray visibleEntityNames()
          Deprecated.  
 NSArray visibleEntityNames(WOSession session)
           
 WOComponent webAssistantInContext(WOContext context)
          Is invoked when the user clicks Customize in the menu bar.
 void willCheckRules(NSNotification n)
          This method is intentionally undocumented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

D2W

public D2W()
Method Detail

activateWebAssistantServer

public void activateWebAssistantServer()
This method is intentionally undocumented. You should never have to invoke or customize it.


checkMultithreading

public void checkMultithreading(NSNotification n)
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.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
- the confirm page.

defaultPage

public WOComponent defaultPage(WOSession session)
Returns a default startup page as a WOComponent, 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.

Parameters:
session - - the WOSession in which the page should be created.
Returns:
the default startup page.

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.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the edit page.

editPageForNewObjectWithConfigurationNamed

public EditPageInterface editPageForNewObjectWithConfigurationNamed(String configurationName,
                                                                    WOSession session)
Creates a new object and returns an edit page as a WOComponent implementing the EditPageInterface. The class of the object 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.

Parameters:
configurationName - - the name of the configuration.
session - - the WOSession in which the page should be created.
Returns:
the edit page.

editPageForNewObjectWithEntityNamed

public EditPageInterface editPageForNewObjectWithEntityNamed(String entityName,
                                                             WOSession session)
Creates a new object and returns an edit page as a WOComponent implementing the EditPageInterface. The class of the object is determined from the EOEntity 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.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the edit page.

editRelationshipPageForEntityNamed

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

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the edit-relationship page.

entityNameFromPage

public static String entityNameFromPage(WOComponent page)
Returns the name of the entity that the D2WPage manipulates.

Parameters:
page - - the WOComponent page with the entity.
Returns:
string - the name of the entity.

errorPage

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

Parameters:
session - - the WOSession in which the page should be created.
Returns:
the error page.

errorPage

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

Parameters:
context - - the WOContext with the session in which to create the page.
Returns:
the error page.

factory

public static D2W factory()
Gets the Direct to Web factory, an instance of D2W that creates all of the Direct to Web pages in the application.

Returns:
the D2W instance.

homeHrefInContext

public String homeHrefInContext(WOContext context)
Returns the URL of the login page for the session contained in the specified context.

Parameters:
context - - the WOContext object.
Returns:
the URL as a string.

init

protected void init()
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 as a WOComponent implementing the InspectPageInterface for the entity identified by entityName. The session argument specifies the session in which the page should be created.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the inspect page.

isLiveAssistantEnabled

public boolean isLiveAssistantEnabled()
Deprecated.  

This is here for backwards compatibility. Use isWebAssistantEnabled instead.

See Also:
isWebAssistantEnabled()

isWebAssistantEnabled

public boolean isWebAssistantEnabled()
Determines whether or not the Web Assistant is enabled. By default it is enabled.

Returns:
true if the Web Assistant is enabled; false otherwise.

listPageForEntityNamed

public ListPageInterface listPageForEntityNamed(String entityName,
                                                WOSession session)
Returns a list page as a WOComponent implementing the ListPageInterface for the entity identified by entityName. The session argument specifies the session in which the page should be created.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the list page.

newSignificantKey

public void newSignificantKey(String newKey)
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.

Parameters:
newKey - - the key to add to the rule firing cache.

packetForPropertyAndSettingsWithPage

protected com.apple.client.directtoweb.common.AssistantPacket packetForPropertyAndSettingsWithPage(com.apple.client.directtoweb.common.Property p,
                                                                                                   com.apple.client.directtoweb.common.Settings settings,
                                                                                                   WOComponent lastPage)
This method is intentionally undocumented. You should never have to invoke or customize it.


packetForSettingsWithPage

protected com.apple.client.directtoweb.common.AssistantPacket packetForSettingsWithPage(com.apple.client.directtoweb.common.Settings settings,
                                                                                        WOComponent lastPage)
This method is intentionally undocumented. You should never have to invoke or customize it.


pageForConfigurationNamed

public WOComponent pageForConfigurationNamed(String dynamicPageName,
                                             WOSession session)
Returns a Direct to Web page as a WOComponent for a named configuration identified by the dynamicPageName argument. 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.

Parameters:
dynamicPageName - - the name of the configuration.
session - - the WOSession in which the page should be created.
Returns:
the Direct to Web page.

pageForTaskAndEntityNamed

public WOComponent pageForTaskAndEntityNamed(String task,
                                             String entityName,
                                             WOSession session)
Returns a Direct to Web page as a WOComponent for the task identified by task and the entity identified by entityName. The session argument specifies the session in which the page should be created.

Parameters:
task - - name of the task.
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the Direct to Web page.

pageForTaskAndEntityNamed

protected WOComponent pageForTaskAndEntityNamed(String task,
                                                String entityName,
                                                WOContext context)
Returns a Direct to Web page as a WOComponent 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.

Parameters:
task - - name of the task.
entityName - - the name of the entity.
context - - the WOContext with the session in which to create the page.
Returns:
the Direct to Web page.

queryAllPage

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

Parameters:
session - - the WOSession in which the page should be created.
Returns:
the query-all page.

queryPageForEntityNamed

public QueryPageInterface queryPageForEntityNamed(String entityName,
                                                  WOSession session)
Returns a query page as 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.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
- the query page.

requestWasHandled

public void requestWasHandled(WOContext c)
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 as a WOComponent implementing the SelectPageInterface for the entity identified by entityName. The session argument specifies the session in which the page should be created.

Parameters:
entityName - - the name of the entity.
session - - the WOSession in which the page should be created.
Returns:
the select page.

setFactory

public static void setFactory(D2W newValue)
Sets the Direct to Web factory, an instance of D2W that is used to create all of the Direct to Web pages of an application. Use this method when you create a custom subclass of D2W.

Parameters:
newValue - - the D2W instance.

setLiveAssistantEnabled

public void setLiveAssistantEnabled(boolean newValue)
Deprecated.  

This is here for backwards compatibility. Use setWebAssistantEnabled instead.

See Also:
setWebAssistantEnabled(boolean)

setWebAssistantEnabled

public void setWebAssistantEnabled(boolean newValue)
Sets whether the Web Assistant is enabled or not. Remember to disable the Web Assistant in a deployed application to prevent users from modifying the configuration of the application.

Parameters:
newValue - - whether or not to enable the Web Assistant.

traceRuleFiringEnabled

public static boolean traceRuleFiringEnabled()
Deprecated.  


traceRuleModificationsEnabled

public static boolean traceRuleModificationsEnabled()
Deprecated.  


visibleEntityNames

public NSArray visibleEntityNames(WOSession session)

visibleEntityNames

public NSArray visibleEntityNames()
Deprecated.  

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


webAssistantInContext

public WOComponent webAssistantInContext(WOContext context)
Is invoked when the user clicks Customize in the menu bar. Activates the Web Assistant in the user's Web browser.

Parameters:
context - - the WebObjects context.
Returns:
- the WOComponent for the Web Assistant.

willCheckRules

public void willCheckRules(NSNotification n)
This method is intentionally undocumented. You should never have to invoke or customize it.


Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.