Project Wonder 5.0

er.directtoweb
Class ERD2WDirectAction

java.lang.Object
  extended by com.webobjects.appserver.WOAction
      extended by com.webobjects.appserver.WODirectAction
          extended by er.extensions.appserver.ERXDirectAction
              extended by er.directtoweb.ERD2WDirectAction
All Implemented Interfaces:
NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation

public abstract class ERD2WDirectAction
extends ERXDirectAction

Automatically creates page configurations from URLs.
Examples:

To provide some security, you should override allowPageConfiguration(String). Also, this class is abstract, so you need to subclass it.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  Logger actionLog
           
static String contextIDKey
          denotes the context ID for the previous page
static String createPrefix
           
static String fetchLimitKey
          fetchLimit for the fetchSpec.
static String fetchSpecificationKey
          fetchSpecificationKey is used to get the named fetchspec of a given object.
static String keyPathKey
          keyPathKey is used to get relationships of a given object.
protected static Logger log
          logging support
static String primaryKeyKey
          primaryKeyKey is used to identity a given object via it's primary key.
static String usesDistinctKey
          fetchLimit for the fetchSpec.
 
Fields inherited from class com.webobjects.appserver.WODirectAction
actionText
 
Fields inherited from class com.webobjects.appserver.WOAction
_actionClasses, _context
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
ERD2WDirectAction(WORequest r)
          Public constructor
 
Method Summary
protected  boolean allowPageConfiguration(String pageConfiguration)
          Checks if a page configuration is allowed to render.
 WOActionResults dynamicPageForActionNamed(String anActionName)
           
 EOFetchSpecification fetchSpecificationFromRequest(String entityName)
          Retrieves and executes the fetch specification given in the request.
 WOActionResults forbiddenAction()
          Returns a response with a 401 (access denied) message.
 String keyPathFromRequest()
           
protected  EOEditingContext newEditingContext()
          For edit pages, we always use a fresh editing context.
 WOActionResults performActionNamed(String anActionName)
          Overrides the default implementation to try to look up the action as a page configuration if there is no method with the wanted name.
protected  void prepareEditPage(com.webobjects.directtoweb.D2WContext context, com.webobjects.directtoweb.EditPageInterface epi, String entityName)
           
protected  void prepareEditRelationshipPage(com.webobjects.directtoweb.D2WContext context, com.webobjects.directtoweb.EditRelationshipPageInterface erpi, String entityName)
           
protected  WOActionResults prepareErrorPage(com.webobjects.directtoweb.D2WContext d2wContext, com.webobjects.directtoweb.ErrorPageInterface epi)
          Returns an error page and sets the message to the key __message.
protected  void prepareInspectPage(com.webobjects.directtoweb.D2WContext context, com.webobjects.directtoweb.InspectPageInterface ipi, String entityName)
           
protected  void prepareListPage(com.webobjects.directtoweb.D2WContext context, com.webobjects.directtoweb.ListPageInterface lpi, String entityName)
           
protected  void prepareQueryPage(com.webobjects.directtoweb.D2WContext context, com.webobjects.directtoweb.QueryPageInterface qpi, String entityName)
           
 WOComponent previousPageFromRequest()
           
 Number primaryKeyFromRequest()
          Deprecated. use primaryKeyFromRequest(EOEditingContext ec, String entityName)
 NSDictionary primaryKeyFromRequest(EOEditingContext ec, String entityName)
           
protected  Object qualifierValueForAttribute(EOAttribute attribute, String stringValue)
          Overwrite for custom value conversion.
 EOArrayDataSource relationshipArrayFromRequest(EOEditingContext ec, EOClassDescription cd)
           
 WOActionResults reportException(Exception ex)
          Creates an error page with the given exception.
 
Methods inherited from class er.extensions.appserver.ERXDirectAction
browser, canPerformActionWithPasswordKey, closeHTTPSessionAction, databaseConsoleAction, dumpCreatedKeysAction, editLocalizedFilesAction, emptyAction, eoAdaptorDebuggingAction, eventsAction, eventsSetupAction, flushComponentCacheAction, forceGCAction, log4jAction, logoutAction, pageWithName, remoteShellAction, resetStatsAction, showOpenEditingContextLockTracesAction, statsAction, systemPropertyAction, testAction
 
Methods inherited from class com.webobjects.appserver.WODirectAction
_componentAction, defaultAction, getSessionIDForRequest, takeFormValueArraysForKeyArray, takeFormValuesForKeyArray
 
Methods inherited from class com.webobjects.appserver.WOAction
_isActionOnClass, _methodForAction, _preloadAllActionsOnClass, canAccessFieldsDirectly, context, debugString, existingSession, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, initializeRequestSessionIDInContext, languages, logString, pageWithName, request, session, setLanguages, takeValueForKey, takeValueForKeyPath, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
handleQueryWithUnboundKey, handleTakeValueForUnboundKey, unableToSetNullForKey
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
takeValueForKeyPath, valueForKeyPath
 
Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding
takeValueForKey, valueForKey
 
Methods inherited from interface com.webobjects.foundation.NSValidation
validateTakeValueForKeyPath, validateValueForKey
 

Field Detail

log

protected static final Logger log
logging support


actionLog

protected final Logger actionLog

primaryKeyKey

public static final String primaryKeyKey
primaryKeyKey is used to identity a given object via it's primary key.

See Also:
Constant Field Values

keyPathKey

public static final String keyPathKey
keyPathKey is used to get relationships of a given object.

See Also:
Constant Field Values

fetchSpecificationKey

public static final String fetchSpecificationKey
fetchSpecificationKey is used to get the named fetchspec of a given object.

See Also:
Constant Field Values

fetchLimitKey

public static final String fetchLimitKey
fetchLimit for the fetchSpec.

See Also:
Constant Field Values

usesDistinctKey

public static final String usesDistinctKey
fetchLimit for the fetchSpec.

See Also:
Constant Field Values

contextIDKey

public static final String contextIDKey
denotes the context ID for the previous page

See Also:
Constant Field Values

createPrefix

public static final String createPrefix
See Also:
Constant Field Values
Constructor Detail

ERD2WDirectAction

public ERD2WDirectAction(WORequest r)
Public constructor

Parameters:
r - current request
Method Detail

newEditingContext

protected EOEditingContext newEditingContext()
For edit pages, we always use a fresh editing context.


qualifierValueForAttribute

protected Object qualifierValueForAttribute(EOAttribute attribute,
                                            String stringValue)
Overwrite for custom value conversion.

Parameters:
attribute -
stringValue -

fetchSpecificationFromRequest

public EOFetchSpecification fetchSpecificationFromRequest(String entityName)
Retrieves and executes the fetch specification given in the request.


primaryKeyFromRequest

public Number primaryKeyFromRequest()
Deprecated. use primaryKeyFromRequest(EOEditingContext ec, String entityName)


primaryKeyFromRequest

public NSDictionary primaryKeyFromRequest(EOEditingContext ec,
                                          String entityName)

previousPageFromRequest

public WOComponent previousPageFromRequest()

keyPathFromRequest

public String keyPathFromRequest()

relationshipArrayFromRequest

public EOArrayDataSource relationshipArrayFromRequest(EOEditingContext ec,
                                                      EOClassDescription cd)

prepareEditPage

protected void prepareEditPage(com.webobjects.directtoweb.D2WContext context,
                               com.webobjects.directtoweb.EditPageInterface epi,
                               String entityName)

prepareInspectPage

protected void prepareInspectPage(com.webobjects.directtoweb.D2WContext context,
                                  com.webobjects.directtoweb.InspectPageInterface ipi,
                                  String entityName)

prepareQueryPage

protected void prepareQueryPage(com.webobjects.directtoweb.D2WContext context,
                                com.webobjects.directtoweb.QueryPageInterface qpi,
                                String entityName)

prepareEditRelationshipPage

protected void prepareEditRelationshipPage(com.webobjects.directtoweb.D2WContext context,
                                           com.webobjects.directtoweb.EditRelationshipPageInterface erpi,
                                           String entityName)

prepareListPage

protected void prepareListPage(com.webobjects.directtoweb.D2WContext context,
                               com.webobjects.directtoweb.ListPageInterface lpi,
                               String entityName)

dynamicPageForActionNamed

public WOActionResults dynamicPageForActionNamed(String anActionName)

prepareErrorPage

protected WOActionResults prepareErrorPage(com.webobjects.directtoweb.D2WContext d2wContext,
                                           com.webobjects.directtoweb.ErrorPageInterface epi)
Returns an error page and sets the message to the key __message.


reportException

public WOActionResults reportException(Exception ex)
Creates an error page with the given exception.

Parameters:
ex -

allowPageConfiguration

protected boolean allowPageConfiguration(String pageConfiguration)
Checks if a page configuration is allowed to render. Override for a more intelligent access scheme as the default just returns true.

Parameters:
pageConfiguration -

forbiddenAction

public WOActionResults forbiddenAction()
Returns a response with a 401 (access denied) message. Override this for something more user friendly.


performActionNamed

public WOActionResults performActionNamed(String anActionName)
Overrides the default implementation to try to look up the action as a page configuration if there is no method with the wanted name. This implementation catches NoSuchMethodException more or less silently, so be sure to turn on logging.

Overrides:
performActionNamed in class ERXDirectAction

Last updated: Wed, Feb 22, 2012 • 07:00 AM EST

Copyright © 2002 – 2011 Project Wonder.