Project Wonder 5.0

er.directtoweb.pages
Class ERD2WPage

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by com.webobjects.directtoweb.D2WComponent
              extended by com.webobjects.directtoweb.D2WPage
                  extended by er.directtoweb.pages.ERD2WPage
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.directtoweb.generation.DTWGeneration, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, ERDBranchInterface, ERDUserInfoInterface, ERXComponentActionRedirector.Restorable, ERXExceptionHolder, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ERD2WEditSortedManyToManyPage, ERD2WGraphVizPage, ERD2WInspectPage, ERD2WListPage, ERD2WMessagePage, ERD2WPickTypePage, ERD2WQueryEntitiesPage, ERD2WQueryPage, ERMODEditRelationshipPage

public abstract class ERD2WPage
extends com.webobjects.directtoweb.D2WPage
implements ERXExceptionHolder, ERDUserInfoInterface, ERXComponentActionRedirector.Restorable, ERDBranchInterface

Common superclass for all ERD2W templates (except ERD2WEditRelationshipPage). Has tons of extra functionality:

  • Debugging support.
    Special handlers add extra info in the request-response loop
  • Workflow extensions.
    If your NextPageDelegate is a ERDBranchDelegate, then all of the code for actions can be handled in your delegate.
  • Display key extensions. We support tab and sectioned pages via the d2wContext array.
    In the case of a non-tab page, we expect d2wContext.sectionsContents to return one of the three following formats: (( section1, key1, key2, key4 ), ( section2, key76, key 5, ..) .. ) OR with the sections enclosed in "()" - this is most useful with the WebAssistant ( "(section1)", key1, key2, key3, "(section2)", key3, key4, key5... ) OR with normal displayPropertyKeys array in fact if sectionContents isn't found then it will look for displayPropertyKeys ( key1, key2, key3, ... ) In the case of a TAB page, we expect d2wContext.tabSectionsContents to return one of the two following formats: ( ( tab1, key1, key2, key4 ), ( tab2, key76, key 5, ..) .. ) OR with sections ( ( tab1, ( section1, key1, key2 ..), (section3, key4, key..) ), ... ) OR with the alternate syntax, which ist most useful with the WebAssistant ( "[tab1]", "(section1)", key1, key2, ... "[tab2]", "(section3)", key4, key..... )

    See Also:
    Serialized Form
    D2W Keys
    objectobject
               
    localContextlocalContext
               
    keyPathsWithValidationExceptionskeyPathsWithValidationExceptions
               
    shouldPropagateExceptionsshouldPropagateExceptions
               
    shouldCollectionValidationExceptionsshouldCollectionValidationExceptions
               
    shouldSetFailedValidationValueshouldSetFailedValidationValue
               
    errorMessageserrorMessages
               
    componentNamecomponentName
               
    customComponentNamecustomComponentName
               
    propertyKeypropertyKey
               
    sectionKeysectionKey
               
    sectionContentssectionContents
               
    tabKeytabKey
               
    displayNameForTabKeydisplayNameForTabKey
               
    isEntityEditableisEntityEditable
               
    pageConfigurationpageConfiguration
               
    displayPropertyKeysdisplayPropertyKeys
               
    tabSectionsContentstabSectionsContents
               
    displayVariantdisplayVariant
               
    displayNameForEntitydisplayNameForEntity
               
    nextPageDelegatenextPageDelegate
               
    pageControllerpageController
               
    pageWrapperNamepageWrapperName
               
    inlineStyleinlineStyle
               

    Nested Class Summary
    static interface ERD2WPage.Keys
              interface for all the keys used in this pages code
     
    Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
    com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event
     
    Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
    com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
     
    Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
    com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
     
    Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
    com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException
     
    Field Summary
    protected static com.webobjects.foundation.NSMutableSet<java.lang.String> _allConfigurations
               
    protected  com.webobjects.foundation.NSDictionary _branch
              holds the chosen branch
    protected  com.webobjects.eocontrol.EOEditingContext _context
              EOEditingContext for the current object
    protected  com.webobjects.appserver.WOComponent _nextPage
               
    protected  com.webobjects.directtoweb.NextPageDelegate _nextPageDelegate
               
    protected  ERDBranchDelegateInterface _pageController
              Holds the page controller for this page.
    protected  com.webobjects.foundation.NSMutableDictionary _userInfo
              Holds the user info.
    protected  com.webobjects.foundation.NSMutableArray<java.lang.String> errorKeyOrder
               
    protected  java.lang.String errorMessage
               
    protected  com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> errorMessages
               
    protected  com.webobjects.foundation.NSMutableArray<java.lang.String> keyPathsWithValidationExceptions
               
    static org.apache.log4j.Logger log
              logging support
    static org.apache.log4j.Logger validationLog
               
     
    Fields inherited from class com.webobjects.directtoweb.D2WComponent
    _eo, _localContext, currentObjectKey
     
    Fields inherited from class com.webobjects.appserver.WOComponent
    _Extension, _IsEventLoggingEnabled, _keyAssociations
     
    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
    ERD2WPage(com.webobjects.appserver.WOContext c)
              Default public constructor.
     
    Method Summary
     long aggregateEventDurationForCurrentPropertyKey()
              Gets the aggregate duration of events sharing the current property key.
    static com.webobjects.foundation.NSArray<java.lang.String> allConfigurationNames()
              Collects the names of all page configurations as you walk through your application.
     void appendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
              Overridden from the parent for better logging.
     void awake()
              Overridden to lock the page's editingContext, if there is any present.
     com.webobjects.foundation.NSDictionary branch()
              Cover method for getting the choosen branch.
     com.webobjects.foundation.NSArray branchChoices()
              Calculates the branch choices for the current page.
     java.lang.String branchName()
              Implementation of the ERDBranchDelegate.
    protected  void clearTabSectionsContents()
              If you switch the context out from under a wizard page it will hold onto the keys in the tab sections and blow up the next time you use it if the entity has changed.
     void clearValidationFailed()
              Clears all of the collected validation exceptions.
     boolean clickToOpenEnabled(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
              Returns whether or not click-to-open should be enabled for this component.
     java.lang.String cssClassForPageContainerElement()
              Gets the CSS class(es) for the container element, based on the current entity and task.
     java.lang.String cssClassForPropertyKey()
              Gets the CSS class(es) that should be applied to the current property key container element.
     java.lang.String cssClassForPropertyName()
              Gets the CSS class(es) that should be applied to the current property name container element.
     ERD2WContainer currentSection()
              The current section of display keys.
     com.webobjects.foundation.NSArray currentSectionKeys()
              The display keys for the current section.
     ERD2WContainer currentTab()
              Returns the ERD2WContainer defining the current tab.
     boolean d2wComponentNameDebuggingEnabled()
              Checks is component names should be shown.
     com.webobjects.directtoweb.D2WContext d2wContext()
              D2WContext for this page.
     java.lang.String d2wCurrentComponentName()
              Helper to return the actual current component name, even when wrapped in a custom component.
     boolean d2wDebuggingEnabled()
              Checks if basic debugging is on
     java.lang.String descriptionForResponse(com.webobjects.appserver.WOResponse aResponse, com.webobjects.appserver.WOContext aContext)
              This will allow d2w pages to be listed on a per configuration basis in stats collecting.
     java.lang.String displayVariant()
              Gets the displayVariant for the current property key.
     com.webobjects.eocontrol.EOEditingContext editingContext()
               
     com.webobjects.foundation.NSArray<java.lang.String> errorKeyOrder()
               
     java.lang.String errorMessage()
               
     com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> errorMessages()
               
     boolean hasActualChanges()
              Returns true if the EC has "real" changes (processRecentChanges was called)
     boolean hasBranchChoices()
              Determines if this message page should display branch choices.
     boolean hasErrors()
               
     boolean hasValidationExceptionForPropertyKey()
              Checks if there is a validation exception in the D2WContext for the current property key.
     java.lang.String inlineStyleDeclarationForPropertyKey()
              Gets any inline style declarations for the current property key container element.
     java.lang.String inlineStyleDeclarationForPropertyName()
              Gets any inline style declarations for the current property name container element.
     com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest r, com.webobjects.appserver.WOContext c)
              Overridden from the parent for better logging.
     boolean isEmbedded()
               
     boolean isEntityEditable()
              If the key isEntityEditable is set, then this value is used, otherwise the value from the super implementation, which checks if the entity is not in the list of readOnlyEntityNames.
     boolean isEntityReadOnly()
              True if the entity is read only.
     boolean isKeyOmitted()
              Determines if display of the current property key should be omitted.
     boolean isObjectDeleteable()
              Checks if the current object can be deleted.
     boolean isObjectEditable()
              Checks if the current object can be edited.
     boolean isObjectInspectable()
              Checks if the current object can be viewed.
     boolean isTopLevelPage()
               
     ERXStats.LogEntry latestEntryForCurrentPropertyKey()
              Gets the latest metrics event for the current property key.
    protected  java.lang.String makeStatsKey(java.lang.String key)
              Makes the stats key, prepending a prefix to identify the stats to the originating page.
     com.webobjects.appserver.WOComponent nextPage()
               
     com.webobjects.directtoweb.NextPageDelegate nextPageDelegate()
              Returns the page's NextPageDelegate, if any, checking for a "nextPageDelegate" binding if no delegate has been explicitly set.
    protected  com.webobjects.appserver.WOComponent nextPageFromDelegate()
              Checks if the delegate is present and can be invoked, then returns the page from it.
     com.webobjects.foundation.NSTimestamp now()
               
     com.webobjects.eocontrol.EOEnterpriseObject object()
              Return the object from the d2wContext.
     ERDBranchDelegateInterface pageController()
              Returns the pageController for this page.
    <T extends com.webobjects.appserver.WOComponent>
    T
    pageWithName(java.lang.Class<T> componentClass)
              This variant of pageWithName provides a Java5 genericized version of the original pageWithName.
     java.lang.String pageWrapperName()
              Gets the name of the page wrapper component.
     com.webobjects.foundation.NSArray sectionsContents()
              The array of sections.
     com.webobjects.foundation.NSArray sectionsForCurrentTab()
              Returns the sections on the current tab.
     com.webobjects.appserver.WOComponent self()
              Can be used to get this instance into KVC
     void setBranch(com.webobjects.foundation.NSDictionary branch)
              Sets the user chosen branch.
     void setCurrentSection(ERD2WContainer value)
              Sets the current section of display keys.
     void setCurrentTab(ERD2WContainer value)
              Sets the current tab.
     void setD2wContext(com.webobjects.directtoweb.D2WContext newValue)
              Key-Value-Coding needs this method.
     void setDataSource(com.webobjects.eocontrol.EODataSource eodatasource)
               
     void setEditingContext(com.webobjects.eocontrol.EOEditingContext newEditingContext)
              Sets the page's editingContext, automatically locking/unlocking it.
     void setErrorMessage(java.lang.String message)
               
     void setErrorMessages(com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> value)
               
     void setLocalContext(com.webobjects.directtoweb.D2WContext newValue)
              Sets the d2wContext for this page
     void setNextPage(com.webobjects.appserver.WOComponent wocomponent)
               
     void setNextPageDelegate(com.webobjects.directtoweb.NextPageDelegate nextpagedelegate)
               
     void setObject(com.webobjects.eocontrol.EOEnterpriseObject eo)
              Implementation of the InspectPageInterface
     void setPageController(ERDBranchDelegateInterface aPageController)
               
     com.webobjects.foundation.NSDictionary settings()
               
     boolean shouldCollectValidationExceptions()
              Should exceptions also be handled here or only handled by the parent.
     boolean shouldDisplayDetailedPageMetrics()
              Determines whether the component should display the detailed "inline" page metrics.
     boolean shouldDisplayPageMetricsSummary()
              Determines whether the component should display the page metrics summary.
     boolean shouldPropagateExceptions()
              Should exceptions be propagated through to the parent page.
     boolean shouldSetFailedValidationValue()
              Should incorrect values still be set into the EO.
     boolean showCancel()
               
     void sleep()
              Overridden to unlock the page's editingContext, if there is any present.
     com.webobjects.foundation.NSDictionary statsForPage()
              Gets the stats for the current page.
     java.lang.String statsKeyForCurrentPropertyKey()
              Creates a stats key to identify stats to the current property key.
     java.lang.String statsKeyPrefix()
              A stats key prefix that guarantees the stats will be identifiable to this instance.
     com.webobjects.foundation.NSArray<ERD2WContainer> tabSectionsContents()
              Returns the array of ERD2WContainer defining the tabs.
    protected static com.webobjects.foundation.NSArray tabSectionsContentsFromRuleResult(com.webobjects.foundation.NSArray tabSectionContentsFromRule)
              Helper method to calulate the tab key array
     void takeValuesFromRequest(com.webobjects.appserver.WORequest r, com.webobjects.appserver.WOContext c)
              Overridden from the parent for better logging.
     java.lang.String urlForCurrentState()
              Implementation of the ERXComponentActionRedirector.Restorable interface.
     com.webobjects.foundation.NSMutableDictionary userInfo()
              Implementation of the ERDUserInfoInterface
    protected  java.lang.Object userPreferencesValueForKey(java.lang.String key)
              Utility method to get a value from the user prefs.
    protected  java.lang.Object userPreferencesValueForPageConfigurationKey(java.lang.String key)
              Utility method to get a value for the current page configuration from the user prefs.
     void validationFailedWithException(java.lang.Throwable e, java.lang.Object value, java.lang.String keyPath)
              Handles validation errors.
     
    Methods inherited from class com.webobjects.directtoweb.D2WPage
    alternateRowColor, dataSource, extraBindings, finalize, replacementAssociationForAssociation, setExtraBindings
     
    Methods inherited from class com.webobjects.directtoweb.D2WComponent
    allEntities, allowCollapsing, applicationPort, assistantPort, attribute, backgroundColorForHeaderRow, backgroundColorForPage, backgroundColorForTable, backgroundColorForTableDark, backgroundColorForTableLight, color, currentSettings, currentUrl, d2wContextVisibleEntityNamesCountPlus1, defaultRowspan, displayNameForKeyWhenRelationship, displayNameForProperty, displayPropertyKeys, dynamicPages, entity, entityName, formatter, generationReplacementFor, generationReplacementForCurrentObject, hasCustomKey, hasEntity, hasNoColor, homeClicked, homeHref, isEditing, isEntityReadOnly, isLiveAssistantEnabled, isNotBoldAsBoolean, isNotItalicAsBoolean, isPropertyAnAttribute, isWebAssistantActive, isWebAssistantConnected, isWebAssistantEnabled, keyForGenerationReplacementForVariableNamed, keyWhenRelationship, lastUrl, length, localContext, logout, objectPropertyValue, objectPropertyValueIsNonNull, pageTitle, property, propertyKey, propertyValueClassName, relationship, resourcePathURL, sessionID, setCurrentSettings, setDynamicPages, setEntities, setEntity, setEntityName, setPropertyKey, setResourcePathURL, setTask, setTasks, showBanner, showWebAssistant, submitActionName, target, task, tasks, visibleEntityNames
     
    Methods inherited from class com.webobjects.appserver.WOComponent
    _associationWithName, _awakeInContext, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, valueForBinding, valueForKey, valueForKeyPath
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    log

    public static final org.apache.log4j.Logger log
    logging support


    validationLog

    public static final org.apache.log4j.Logger validationLog

    _context

    protected com.webobjects.eocontrol.EOEditingContext _context
    EOEditingContext for the current object


    errorMessages

    protected com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> errorMessages

    errorKeyOrder

    protected com.webobjects.foundation.NSMutableArray<java.lang.String> errorKeyOrder

    keyPathsWithValidationExceptions

    protected com.webobjects.foundation.NSMutableArray<java.lang.String> keyPathsWithValidationExceptions

    errorMessage

    protected java.lang.String errorMessage

    _userInfo

    protected com.webobjects.foundation.NSMutableDictionary _userInfo
    Holds the user info.


    _allConfigurations

    protected static final com.webobjects.foundation.NSMutableSet<java.lang.String> _allConfigurations

    _branch

    protected com.webobjects.foundation.NSDictionary _branch
    holds the chosen branch


    _nextPage

    protected com.webobjects.appserver.WOComponent _nextPage

    _nextPageDelegate

    protected com.webobjects.directtoweb.NextPageDelegate _nextPageDelegate

    _pageController

    protected ERDBranchDelegateInterface _pageController
    Holds the page controller for this page.

    Constructor Detail

    ERD2WPage

    public ERD2WPage(com.webobjects.appserver.WOContext c)
    Default public constructor.

    Parameters:
    c - current context.
    Method Detail

    awake

    public void awake()
    Overridden to lock the page's editingContext, if there is any present.

    Overrides:
    awake in class com.webobjects.appserver.WOComponent

    clickToOpenEnabled

    public boolean clickToOpenEnabled(com.webobjects.appserver.WOResponse response,
                                      com.webobjects.appserver.WOContext context)
    Returns whether or not click-to-open should be enabled for this component. By default this returns ERXClickToOpenSupport.isEnabled().

    Parameters:
    response - the response
    context - the context
    Returns:
    whether or not click-to-open is enabled for this component

    userPreferencesValueForKey

    protected java.lang.Object userPreferencesValueForKey(java.lang.String key)
    Utility method to get a value from the user prefs.

    Parameters:
    key -

    userPreferencesValueForPageConfigurationKey

    protected java.lang.Object userPreferencesValueForPageConfigurationKey(java.lang.String key)
    Utility method to get a value for the current page configuration from the user prefs.

    Parameters:
    key -

    sleep

    public void sleep()
    Overridden to unlock the page's editingContext, if there is any present.

    Overrides:
    sleep in class com.webobjects.appserver.WOComponent

    setEditingContext

    public void setEditingContext(com.webobjects.eocontrol.EOEditingContext newEditingContext)
    Sets the page's editingContext, automatically locking/unlocking it.

    Parameters:
    newEditingContext - new EOEditingContext

    editingContext

    public com.webobjects.eocontrol.EOEditingContext editingContext()

    hasActualChanges

    public boolean hasActualChanges()
    Returns true if the EC has "real" changes (processRecentChanges was called)


    urlForCurrentState

    public java.lang.String urlForCurrentState()
    Implementation of the ERXComponentActionRedirector.Restorable interface. This implementation creates an URL with the name of the current pageConfiguration as a direct action, which assumes a ERD2WDirectAction as the default direct action. Subclasses need to implement more sensible behaviour.

    Specified by:
    urlForCurrentState in interface ERXComponentActionRedirector.Restorable
    Returns:
    url for the current page

    setObject

    public void setObject(com.webobjects.eocontrol.EOEnterpriseObject eo)
    Implementation of the InspectPageInterface

    Overrides:
    setObject in class com.webobjects.directtoweb.D2WComponent

    object

    public com.webobjects.eocontrol.EOEnterpriseObject object()
    Return the object from the d2wContext.

    Overrides:
    object in class com.webobjects.directtoweb.D2WComponent

    setDataSource

    public void setDataSource(com.webobjects.eocontrol.EODataSource eodatasource)
    Overrides:
    setDataSource in class com.webobjects.directtoweb.D2WPage

    self

    public final com.webobjects.appserver.WOComponent self()
    Can be used to get this instance into KVC


    d2wContext

    public com.webobjects.directtoweb.D2WContext d2wContext()
    D2WContext for this page. Checks if there is a "d2wContext" binding, too.

    Overrides:
    d2wContext in class com.webobjects.directtoweb.D2WComponent
    Returns:
    d2wContext

    setD2wContext

    public void setD2wContext(com.webobjects.directtoweb.D2WContext newValue)
    Key-Value-Coding needs this method. It should not be called


    setLocalContext

    public void setLocalContext(com.webobjects.directtoweb.D2WContext newValue)
    Sets the d2wContext for this page

    Overrides:
    setLocalContext in class com.webobjects.directtoweb.D2WComponent

    errorMessages

    public com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> errorMessages()

    setErrorMessages

    public void setErrorMessages(com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> value)

    errorMessage

    public java.lang.String errorMessage()

    setErrorMessage

    public void setErrorMessage(java.lang.String message)

    hasErrors

    public boolean hasErrors()

    errorKeyOrder

    public com.webobjects.foundation.NSArray<java.lang.String> errorKeyOrder()

    shouldPropagateExceptions

    public boolean shouldPropagateExceptions()
    Should exceptions be propagated through to the parent page. If false, the validation errors are not shown at all.


    shouldCollectValidationExceptions

    public boolean shouldCollectValidationExceptions()
    Should exceptions also be handled here or only handled by the parent.


    clearValidationFailed

    public void clearValidationFailed()
    Clears all of the collected validation exceptions. Implementation of the ERXExceptionHolder interface.

    Specified by:
    clearValidationFailed in interface ERXExceptionHolder

    shouldSetFailedValidationValue

    public boolean shouldSetFailedValidationValue()
    Should incorrect values still be set into the EO. If not set, then the user must re-enter them.


    validationFailedWithException

    public void validationFailedWithException(java.lang.Throwable e,
                                              java.lang.Object value,
                                              java.lang.String keyPath)
    Handles validation errors.

    Overrides:
    validationFailedWithException in class com.webobjects.appserver.WOComponent

    isObjectEditable

    public boolean isObjectEditable()
    Checks if the current object can be edited.


    isObjectDeleteable

    public boolean isObjectDeleteable()
    Checks if the current object can be deleted.


    isObjectInspectable

    public boolean isObjectInspectable()
    Checks if the current object can be viewed.


    isEntityReadOnly

    public boolean isEntityReadOnly()
    True if the entity is read only. Returns !(isEntityEditable())

    Overrides:
    isEntityReadOnly in class com.webobjects.directtoweb.D2WComponent

    isEntityEditable

    public boolean isEntityEditable()
    If the key isEntityEditable is set, then this value is used, otherwise the value from the super implementation, which checks if the entity is not in the list of readOnlyEntityNames.


    hasValidationExceptionForPropertyKey

    public boolean hasValidationExceptionForPropertyKey()
    Checks if there is a validation exception in the D2WContext for the current property key.


    userInfo

    public com.webobjects.foundation.NSMutableDictionary userInfo()
    Implementation of the ERDUserInfoInterface

    Specified by:
    userInfo in interface ERDUserInfoInterface

    d2wDebuggingEnabled

    public boolean d2wDebuggingEnabled()
    Checks if basic debugging is on


    d2wComponentNameDebuggingEnabled

    public boolean d2wComponentNameDebuggingEnabled()
    Checks is component names should be shown.


    d2wCurrentComponentName

    public java.lang.String d2wCurrentComponentName()
    Helper to return the actual current component name, even when wrapped in a custom component.


    descriptionForResponse

    public java.lang.String descriptionForResponse(com.webobjects.appserver.WOResponse aResponse,
                                                   com.webobjects.appserver.WOContext aContext)
    This will allow d2w pages to be listed on a per configuration basis in stats collecting.

    Overrides:
    descriptionForResponse in class com.webobjects.directtoweb.D2WPage

    takeValuesFromRequest

    public void takeValuesFromRequest(com.webobjects.appserver.WORequest r,
                                      com.webobjects.appserver.WOContext c)
    Overridden from the parent for better logging. Also clears validation errors

    Overrides:
    takeValuesFromRequest in class com.webobjects.appserver.WOComponent

    invokeAction

    public com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest r,
                                                                 com.webobjects.appserver.WOContext c)
    Overridden from the parent for better logging.

    Overrides:
    invokeAction in class com.webobjects.appserver.WOComponent

    allConfigurationNames

    public static com.webobjects.foundation.NSArray<java.lang.String> allConfigurationNames()
    Collects the names of all page configurations as you walk through your application.


    appendToResponse

    public void appendToResponse(com.webobjects.appserver.WOResponse response,
                                 com.webobjects.appserver.WOContext context)
    Overridden from the parent for better logging. Reports exceptions in the console for easier debugging.

    Overrides:
    appendToResponse in class com.webobjects.appserver.WOComponent

    branch

    public com.webobjects.foundation.NSDictionary branch()
    Cover method for getting the choosen branch.

    Returns:
    user choosen branch.

    setBranch

    public void setBranch(com.webobjects.foundation.NSDictionary branch)
    Sets the user chosen branch.

    Parameters:
    branch - chosen by user.

    branchName

    public java.lang.String branchName()
    Implementation of the ERDBranchDelegate. Gets the user selected branch name.

    Specified by:
    branchName in interface ERDBranchInterface
    Returns:
    user selected branch name.

    branchChoices

    public com.webobjects.foundation.NSArray branchChoices()
    Calculates the branch choices for the current page. This method is just a cover for calling the method branchChoicesForContext on the current ERDBranchDelegate.

    Returns:
    array of branch choices

    hasBranchChoices

    public boolean hasBranchChoices()
    Determines if this message page should display branch choices.

    Returns:
    if the current delegate supports branch choices.

    currentSection

    public ERD2WContainer currentSection()
    The current section of display keys.


    setCurrentSection

    public void setCurrentSection(ERD2WContainer value)
    Sets the current section of display keys.


    currentSectionKeys

    public com.webobjects.foundation.NSArray currentSectionKeys()
    The display keys for the current section. You bind to this method.

    Returns:
    array of ERD2WContainer holding the keys for the current section

    sectionsContents

    public com.webobjects.foundation.NSArray sectionsContents()
    The array of sections. You bind to this method.

    Returns:
    array of arrays of ERD2WContainer holding the keys.

    tabSectionsContents

    public com.webobjects.foundation.NSArray<ERD2WContainer> tabSectionsContents()
    Returns the array of ERD2WContainer defining the tabs. A tab is a key and an array of sections


    clearTabSectionsContents

    protected void clearTabSectionsContents()
    If you switch the context out from under a wizard page it will hold onto the keys in the tab sections and blow up the next time you use it if the entity has changed. This allows you to clear the array so it rebuilds.


    sectionsForCurrentTab

    public com.webobjects.foundation.NSArray sectionsForCurrentTab()
    Returns the sections on the current tab.


    currentTab

    public ERD2WContainer currentTab()
    Returns the ERD2WContainer defining the current tab.


    setCurrentTab

    public void setCurrentTab(ERD2WContainer value)
    Sets the current tab.


    tabSectionsContentsFromRuleResult

    protected static com.webobjects.foundation.NSArray tabSectionsContentsFromRuleResult(com.webobjects.foundation.NSArray tabSectionContentsFromRule)
    Helper method to calulate the tab key array


    isEmbedded

    public boolean isEmbedded()

    displayVariant

    public java.lang.String displayVariant()
    Gets the displayVariant for the current property key. The intention is that the display variant allows variation in the display method of property keys without needing different, slightly varying, displayPropertyKeys or tabSectionsContents rules. Template support has been added for the omit and blank variants. One could imagine others, such as collapsed, ajax, etc.

    Returns:
    the display variant, if specified

    isKeyOmitted

    public boolean isKeyOmitted()
    Determines if display of the current property key should be omitted.

    Returns:
    true if key should be omitted

    now

    public com.webobjects.foundation.NSTimestamp now()

    nextPage

    public com.webobjects.appserver.WOComponent nextPage()
    Overrides:
    nextPage in class com.webobjects.directtoweb.D2WPage

    setNextPage

    public void setNextPage(com.webobjects.appserver.WOComponent wocomponent)
    Overrides:
    setNextPage in class com.webobjects.directtoweb.D2WPage

    nextPageFromDelegate

    protected com.webobjects.appserver.WOComponent nextPageFromDelegate()
    Checks if the delegate is present and can be invoked, then returns the page from it.


    nextPageDelegate

    public com.webobjects.directtoweb.NextPageDelegate nextPageDelegate()
    Returns the page's NextPageDelegate, if any, checking for a "nextPageDelegate" binding if no delegate has been explicitly set.

    Overrides:
    nextPageDelegate in class com.webobjects.directtoweb.D2WPage
    Returns:
    The page's next page delegate.

    setNextPageDelegate

    public void setNextPageDelegate(com.webobjects.directtoweb.NextPageDelegate nextpagedelegate)
    Overrides:
    setNextPageDelegate in class com.webobjects.directtoweb.D2WPage

    pageController

    public ERDBranchDelegateInterface pageController()
    Returns the pageController for this page. If there is none given yet, tries to create one by querying the key "pageController" from the d2wContext. The most conventient way to set and use a pageController is via the rule system:
      100: (entity.name='WebSite') and (task = 'list') => pageController = "ListWebSiteController" [er.directtoweb.ERDDelayedObjectCreationAssignment]
      100: (entity.name='WebSite') => actions = {left = (editAction, controllerAction);}
      100: (propertyKey = 'controllerAction') => componentName = "ERDControllerButton"
     
    Then ListWebSiteController would be:
     public class ListWebSiteController extends ERDBranchDelegate {
     
         private WOComponent _sender;
     
         private WOComponent sender() {
             return _sender;
         }
     
         private void setSender(WOComponent aSender) {
             _sender = aSender;
         }
     
         private D2WContext d2wContext() {
             return (D2WContext) sender().valueForKey("d2wContext");
         }
     
         private EOEnterpriseObject object() {
             return (EOEnterpriseObject) d2wContext().valueForKey("object");
         }
     
         // first action, show up as "Copy Web Site"
         public WOComponent copyWebSite(WOComponent sender) {
            setSender(sender);
            WOComponent result = ....
            return result;
         }
     
         // second action, show up as "Delete Web Site"
         public WOComponent deleteWebSite(WOComponent sender) {
            setSender(sender);
            WOComponent result = ....
            return result;
         }
     }
     
    The nice thing about this is that this allows you to keep your logic confined to just a handful of classes, without the need to constantly create new components that just handle one action.


    setPageController

    public void setPageController(ERDBranchDelegateInterface aPageController)

    showCancel

    public boolean showCancel()
    Overrides:
    showCancel in class com.webobjects.directtoweb.D2WPage

    settings

    public com.webobjects.foundation.NSDictionary settings()

    pageWrapperName

    public java.lang.String pageWrapperName()
    Gets the name of the page wrapper component. Overrides the superclass' implementation which caches the name too aggressively. This method allows you to drive the page wrapper component via the rules. Defaults to PageWrapper if a value is not found from the D2W rules.

    Overrides:
    pageWrapperName in class com.webobjects.directtoweb.D2WPage
    Returns:
    the name of the page wrapper

    pageWithName

    public <T extends com.webobjects.appserver.WOComponent> T pageWithName(java.lang.Class<T> componentClass)
    This variant of pageWithName provides a Java5 genericized version of the original pageWithName. You would call it with: MyNextPage nextPage = pageWithName(MyNextPage.class);

    Type Parameters:
    T - the type of component to create
    Parameters:
    componentClass - the Class of the component to load
    Returns:
    an instance of the requested component class

    isTopLevelPage

    public boolean isTopLevelPage()

    shouldDisplayDetailedPageMetrics

    public boolean shouldDisplayDetailedPageMetrics()
    Determines whether the component should display the detailed "inline" page metrics.

    Returns:
    true if should show the detailed metrics

    shouldDisplayPageMetricsSummary

    public boolean shouldDisplayPageMetricsSummary()
    Determines whether the component should display the page metrics summary. On display the summary for the top-level page by default, and for all pages when showing detailed metrics.

    Returns:
    true if should show metrics summary

    statsKeyForCurrentPropertyKey

    public java.lang.String statsKeyForCurrentPropertyKey()
    Creates a stats key to identify stats to the current property key.

    Returns:
    the stats key

    makeStatsKey

    protected java.lang.String makeStatsKey(java.lang.String key)
    Makes the stats key, prepending a prefix to identify the stats to the originating page.

    Parameters:
    key - to format
    Returns:
    the formatted key

    statsKeyPrefix

    public java.lang.String statsKeyPrefix()
    A stats key prefix that guarantees the stats will be identifiable to this instance.

    Returns:
    the key prefix

    latestEntryForCurrentPropertyKey

    public ERXStats.LogEntry latestEntryForCurrentPropertyKey()
    Gets the latest metrics event for the current property key.

    Returns:
    the event

    aggregateEventDurationForCurrentPropertyKey

    public long aggregateEventDurationForCurrentPropertyKey()
    Gets the aggregate duration of events sharing the current property key.

    Returns:
    the duration

    statsForPage

    public com.webobjects.foundation.NSDictionary statsForPage()
    Gets the stats for the current page.

    Returns:
    the stats

    cssClassForPageContainerElement

    public java.lang.String cssClassForPageContainerElement()
    Gets the CSS class(es) for the container element, based on the current entity and task.

    Returns:
    the css classes

    cssClassForPropertyName

    public java.lang.String cssClassForPropertyName()
    Gets the CSS class(es) that should be applied to the current property name container element.

    Returns:
    the css classes

    cssClassForPropertyKey

    public java.lang.String cssClassForPropertyKey()
    Gets the CSS class(es) that should be applied to the current property key container element.

    Returns:
    the css classes

    inlineStyleDeclarationForPropertyName

    public java.lang.String inlineStyleDeclarationForPropertyName()
    Gets any inline style declarations for the current property name container element.

    Returns:
    the inline style declarations

    inlineStyleDeclarationForPropertyKey

    public java.lang.String inlineStyleDeclarationForPropertyKey()
    Gets any inline style declarations for the current property key container element.

    Returns:
    the inline style declarations

    Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

    Copyright © 2002 – 2007 Project Wonder.