|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.directtoweb.D2W
er.directtoweb.ERD2WFactory
er.directtoweb.ERD2WControllerFactory
public class ERD2WControllerFactory
ERD2WControllerFactory a an enhancement of the D2W factory class with the notion of "Processes".
A Process - or controller is an abstraction of a sequence of pages. For example, when you want to edit an object, you start at the edit page, make your change, save, get a confirmation page and finally go back to where you started.
The major benefit against simply using pageConfigurations and NextPageDelegates is that it is very confusing to link them together in a flow of pages. The second benefit is that it inherits from branchDelegate, which lets you make up a very flexible UI, you can have page-level actions mixed into the property repetitions for example. Also, you get much more control of the flow of complex tasks where you simply would get lost when you use bare NextPageDelegates and you can more easily create custom pages in between the flow. And finally, they make for great re-use and testing, because you can simply fake the actions the user took.
Controllers are instatiated via something like:
They can be subclassed and you can change the flow of your app without the need to create subclasses of your pages - which spares you the hassle to deal with the duplicated HTML.
A controller gets instantiated via a D2W rule like:
public WOActionResults TestEditAction() {
ERD2WControllerFactory.ERCCreate erc = (ERD2WControllerFactory.ERCCreate)ERD2WControllerFactory.controllerFactory().controllerForName("CreateUser", session());
erc.setFinalPage(previousPageFromRequest());
erc.setPrimaryKeyValue(primaryKeyFromRequest());
return (WOActionResults)erc.firstPage();
}
(controllerName = "EditDocument") => controllerClassName = "er.directtoweb.ERD2WControllerFactory$ERCEdit"
and you might need supporting wildcard rules like the one for the pageConfigurations. Also, rules like:
controllerName <> null => pageConfiguration = controllerName [KeyValueAssignment] [0]
will spare you a lot of work.
The ERD2WControllerFactory is not heavily tested and the API might change. Especially that the controller subclasses are inner classes of this factory is subject to change. Feedback would be very welcome.
D2W Keys | |
pageConfiguration | pageConfiguration |
Nested Class Summary | |
---|---|
static class |
ERD2WControllerFactory.ERCCore
|
static class |
ERD2WControllerFactory.ERCCreate
|
static class |
ERD2WControllerFactory.ERCEdit
|
static class |
ERD2WControllerFactory.ERCInspect
|
static class |
ERD2WControllerFactory.ERCQuery
|
static class |
ERD2WControllerFactory.ERCSingleObject
|
static class |
ERD2WControllerFactory.ERD2WController
|
Nested classes/interfaces inherited from class com.webobjects.directtoweb.D2W |
---|
com.webobjects.directtoweb.D2W._Observer |
Field Summary |
---|
Fields inherited from class er.directtoweb.ERD2WFactory |
---|
defaultListPageDisplayGroupDelegate |
Constructor Summary | |
---|---|
ERD2WControllerFactory()
Public constructor |
Method Summary | |
---|---|
static ERD2WControllerFactory |
controllerFactory()
Gets the D2W factory cast as an ERD2WControllerFactory object. |
ERD2WControllerFactory.ERD2WController |
controllerForName(java.lang.String controllerName,
com.webobjects.appserver.WOSession session)
|
ERD2WControllerFactory.ERD2WController |
controllerForTaskAndEntityNamed(java.lang.String task,
java.lang.String entityName,
com.webobjects.appserver.WOSession session)
|
protected ERD2WControllerFactory.ERD2WController |
controllerInstanceWithContext(com.webobjects.directtoweb.D2WContext d2wContext)
|
Methods inherited from class com.webobjects.directtoweb.D2W |
---|
_applicationDidFinishLaunching, _applicationWillFinishLaunching, _init, activateWebAssistantServer, checkMultithreading, errorPage, errorPage, factory, homeHrefInContext, isLiveAssistantEnabled, isWebAssistantEnabled, newSignificantKey, packetForPropertyAndSettingsWithPage, packetForSettingsWithPage, pageForTaskAndEntityNamed, requestWasHandled, setFactory, setLiveAssistantEnabled, setWebAssistantEnabled, traceRuleFiringEnabled, traceRuleModificationsEnabled, visibleEntityNames, webAssistantInContext, willCheckRules |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ERD2WControllerFactory()
Method Detail |
---|
public static ERD2WControllerFactory controllerFactory()
protected ERD2WControllerFactory.ERD2WController controllerInstanceWithContext(com.webobjects.directtoweb.D2WContext d2wContext)
public ERD2WControllerFactory.ERD2WController controllerForName(java.lang.String controllerName, com.webobjects.appserver.WOSession session)
public ERD2WControllerFactory.ERD2WController controllerForTaskAndEntityNamed(java.lang.String task, java.lang.String entityName, com.webobjects.appserver.WOSession session)
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |