public class ERD2WControllerFactory extends ERD2WFactory
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:
public WOActionResults TestEditAction() {
ERD2WControllerFactory.ERCCreate erc = (ERD2WControllerFactory.ERCCreate)ERD2WControllerFactory.controllerFactory().controllerForName("CreateUser", session());
erc.setFinalPage(previousPageFromRequest());
erc.setPrimaryKeyValue(primaryKeyFromRequest());
return (WOActionResults)erc.firstPage();
}
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:(controllerName = "EditDocument") => controllerClassName = "er.directtoweb.ERD2WControllerFactory$ERCEdit"
controllerName <> null => pageConfiguration = controllerName [KeyValueAssignment] [0]
Name | Description |
---|---|
pageConfiguration | pageConfiguration |
Modifier and Type | Class and Description |
---|---|
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 |
defaultListPageDisplayGroupDelegate
Constructor and Description |
---|
ERD2WControllerFactory()
Public constructor
|
Modifier and Type | Method and Description |
---|---|
static ERD2WControllerFactory |
controllerFactory()
Gets the D2W factory cast as an ERD2WControllerFactory object.
|
ERD2WControllerFactory.ERD2WController |
controllerForName(String controllerName,
WOSession session) |
ERD2WControllerFactory.ERD2WController |
controllerForTaskAndEntityNamed(String task,
String entityName,
WOSession session) |
protected ERD2WControllerFactory.ERD2WController |
controllerInstanceWithContext(com.webobjects.directtoweb.D2WContext d2wContext) |
_entityNameFromPage, _pageConfigurationFromPage, _taskFromPage, confirmPageForEntityNamed, csvExportPageForD2WContext, defaultListPageDisplayGroupDelegate, defaultPage, editPageForEntityNamed, editPageForNewObjectWithConfigurationNamed, editPageForNewObjectWithEntityNamed, editRelationshipPageForEntityNamed, entityNameFromPage, erFactory, errorPageForException, errorPageWithMessage, errorPageWithMessageAndDestination, init, inspectPageForEntityNamed, listPageForEntityNamed, myCheckRules, pageConfigurationFromPage, pageForConfigurationNamed, pageForTaskAndEntityNamed, pageForTaskSubTaskAndEntityNamed, pageWithContextTaskEntity, printerFriendlyPageForD2WContext, privateContext, queryAllPage, queryPageForEntityNamed, queryPageWithFetchSpecificationForEntityNamed, selectPageForEntityNamed, setDefaultListPageDisplayGroupDelegate, taskFromPage, visibleEntityNames
_applicationDidFinishLaunching, _applicationWillFinishLaunching, _init, activateWebAssistantServer, checkMultithreading, errorPage, errorPage, factory, homeHrefInContext, isLiveAssistantEnabled, isWebAssistantEnabled, newSignificantKey, packetForPropertyAndSettingsWithPage, packetForSettingsWithPage, pageForTaskAndEntityNamed, requestWasHandled, setFactory, setLiveAssistantEnabled, setWebAssistantEnabled, traceRuleFiringEnabled, traceRuleModificationsEnabled, visibleEntityNames, webAssistantInContext, willCheckRules
public static ERD2WControllerFactory controllerFactory()
protected ERD2WControllerFactory.ERD2WController controllerInstanceWithContext(com.webobjects.directtoweb.D2WContext d2wContext)
public ERD2WControllerFactory.ERD2WController controllerForName(String controllerName, WOSession session)
public ERD2WControllerFactory.ERD2WController controllerForTaskAndEntityNamed(String task, String entityName, WOSession session)
Copyright © 2002 – 2024 Project Wonder.