Project Wonder 2.0

er.directtoweb
Class ERD2WDirectAction

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

public abstract class ERD2WDirectAction
extends ERXDirectAction

Cool class to automatically create page configurations from URLs.
Examples: QueryArticle will create an query page for articles. QueryArticle?__fs=findNewArticles will create an query page for fetch spec "findNewArticles". This will only work if your rules return a ERD2WQueryPageWithFetchSpecification. InspectArticle?__key= will create an inpect page for the given article. EditArticle?__key= will create an edit page for the given article. CreateArticle will create an edit page for a newly created article. ListArticle?__key=&__keypath=User.articles will list the articles of the given user. ListArticle?__fs=recentArticles&authorName=*foo* will list the articles by calling the fetch spec "recentArticles". When the fetch spec has an "authorName" binding, it is set to "*foo*".


Nested Class Summary
 
Nested classes inherited from class 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.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  ERXLogger actionLog
           
protected static ERXLogger log
          logging support
 
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
_CLASS, NullValue
 
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.NSValidation
_CLASS
 
Constructor Summary
ERD2WDirectAction(WORequest r)
          Public constructor
 
Method Summary
 WOActionResults dynamicPageForActionNamed(String anActionName)
           
 EOFetchSpecification fetchSpecificationFromRequest(String entityName)
          Retrieves and executes the fetch specification given in the request.
 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(D2WContext context, EditPageInterface epi, String entityName)
           
protected  void prepareInspectPage(D2WContext context, InspectPageInterface ipi, String entityName)
           
protected  void prepareListPage(D2WContext context, ListPageInterface lpi, String entityName)
           
protected  void prepareQueryPage(D2WContext context, QueryPageInterface qpi, String entityName)
           
 WOComponent previousPageFromRequest()
           
 Number primaryKeyFromRequest()
          Deprecated. use primaryKeyFromRequest(EOEditingContext ec, String entityName)
 NSDictionary primaryKeyFromRequest(EOEditingContext ec, String entityName)
           
 EOArrayDataSource relationshipArrayFromRequest(EOEditingContext ec, EOClassDescription cd)
           
 WOActionResults reportException(Exception ex)
           
 
Methods inherited from class er.extensions.ERXDirectAction
browser, forceGCAction, log4jAction, logoutAction, 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
takeValueForKey, valueForKey
 
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.NSValidation
validateTakeValueForKeyPath, validateValueForKey
 

Field Detail

log

protected static final ERXLogger log
logging support


actionLog

protected final ERXLogger actionLog
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.


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(D2WContext context,
                               EditPageInterface epi,
                               String entityName)

prepareInspectPage

protected void prepareInspectPage(D2WContext context,
                                  InspectPageInterface ipi,
                                  String entityName)

prepareQueryPage

protected void prepareQueryPage(D2WContext context,
                                QueryPageInterface qpi,
                                String entityName)

prepareListPage

protected void prepareListPage(D2WContext context,
                               ListPageInterface lpi,
                               String entityName)

dynamicPageForActionNamed

public WOActionResults dynamicPageForActionNamed(String anActionName)

reportException

public WOActionResults reportException(Exception ex)

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: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.