Project Wonder 5.0.0.8794

er.directtoweb.pages
Class ERD2WListPage

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
                      extended by er.directtoweb.pages.ERD2WListPage
All Implemented Interfaces:
WOActionResults, com.webobjects.directtoweb.generation.DTWGeneration, ListPageInterface, SelectPageInterface, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, ERDBranchInterface, ERDListPageInterface, ERDUserInfoInterface, ERXComponentActionRedirector.Restorable, ERXExceptionHolder, Serializable, Cloneable
Direct Known Subclasses:
AjaxLookListPage, ERD2WCalendarPage, ERD2WCompactListPageTemplate, ERD2WCSVListPageTemplate, ERD2WEditableListPage, ERD2WGroupingListPage, ERD2WListComparePage, ERD2WListPageTemplate, ERD2WListXMLPage, ERD2WPickListPage, ERD2WPrinterFriendlyListTemplate, ERExcelListPage, ERNEUListPage

public class ERD2WListPage
extends ERD2WPage
implements ERDListPageInterface, SelectPageInterface, ERXComponentActionRedirector.Restorable

Reimplementation of the D2WListPage. Descendes from ERD2WPage instead of D2WList.

Author:
ak
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class er.directtoweb.pages.ERD2WPage
ERD2WPage.Keys
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  WODisplayGroup _displayGroup
          Holds the display group.
 boolean _hasToUpdate
           
protected  boolean _rowFlip
           
protected  boolean _shouldRefetch
           
protected  Object dataSourceState
           
static Logger log
          logging support
 EOEnterpriseObject referenceEO
           
 
Fields inherited from class er.directtoweb.pages.ERD2WPage
_allConfigurations, _branch, _context, _nextPage, _nextPageDelegate, _pageController, _userInfo, errorKeyOrder, errorMessage, errorMessages, keyPathsWithValidationExceptions, validationLog
 
Fields inherited from class com.webobjects.directtoweb.D2WComponent
_eo, _localContext, currentObjectKey
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
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
ERD2WListPage(WOContext c)
          Public constructor.
 
Method Summary
 String alternatingColorForRow()
          Utility to have alternating row colors.
 boolean alwaysRefetchList()
           
 void appendToResponse(WOResponse r, WOContext c)
          Overridden from the parent for better logging.
 WOComponent backAction()
           
 String backgroundColorForRow()
          The background color for the current row.
 boolean checkSortOrderingKeys()
           
 String colorForRow()
           
protected  void createDisplayGroup()
          Creates the display group and sets the _displayGroup instance variable
 String defaultSortKey()
           
 WOComponent deleteObjectAction()
           
 String descriptionForResponse(WOResponse aResponse, WOContext aContext)
          This will allow d2w pages to be listed on a per configuration basis in stats collecting.
protected  void didUpdate()
           
 WODisplayGroup displayGroup()
          Returns the display group, creating one if there is none present.
 void editingContextDidSaveChanges(NSNotification notif)
          Called when an EOditingContext has changed.
 WOComponent editObjectAction()
           
 void finalize()
          Override to un-register for stop obsevring notifcations.
 String formTargetJavaScriptUrl()
           
 WOComponent inspectObjectAction()
           
 WOActionResults invokeAction(WORequest r, WOContext c)
          Overridden from the parent for better logging.
 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 isEntityInspectable()
           
 boolean isEntityPrintable()
           
 boolean isEntityReadOnly()
          Checks if the entity is read only, meaning that you can't edit it's objects.
 boolean isListEmpty()
          Checks if the current list is empty.
 boolean isSelecting()
          Checks if the current task is select.
 boolean isSelectingNotTopLevel()
          Returns true of we are selecting, but not the top-level page.
 int listSize()
          The number of objects in the list.
protected  EOEnterpriseObject localInstanceOfObject()
           
 int numberOfObjectsPerBatch()
           
 WOComponent printerFriendlyVersion()
           
static WOComponent printerFriendlyVersion(D2WContext d2wContext, WOSession session, EODataSource dataSource, WODisplayGroup displayGroup)
           
 NSArray referenceEOs()
           
 EOEnterpriseObject selectedObject()
          The currently selected object.
 NSArray selectedObjects()
          The currently selected objects.
 WOComponent selectObjectAction()
          Action method to select an object.
 void setBackgroundColorForRow(String value)
          Does nothing and exists only for KeyValueCoding.
 void setDataSource(EODataSource eodatasource)
           
 void setSelectedObject(EOEnterpriseObject eo)
          Sets currently selected object.
 void setSelectedObjects(NSArray eos)
          Sets currently selected objects.
protected  void setSortOrderingsOnDisplayGroup(NSArray sortOrderings, WODisplayGroup dg)
           
protected  void setupPhase()
           
 boolean shouldShowSelectAll()
           
 boolean showCancel()
          Should we show the cancel button? It's only visible when we have a nextPage set up.
 NSArray sortOrderings()
           
 void takeValuesFromRequest(WORequest r, WOContext c)
          Overridden from the parent for better logging.
 String targetString()
           
 String urlForCurrentState()
          end of reimplementation
 boolean useBatchingDisplayGroup()
          Checks the d2wContext for useBatchingDisplayGroup and returns it.
 boolean userPreferencesCanSpecifySorting()
           
 void warmUpForDisplay()
           
protected  void willUpdate()
           
 
Methods inherited from class er.directtoweb.pages.ERD2WPage
allConfigurationNames, awake, branch, branchChoices, branchName, clearValidationFailed, clickToOpenEnabled, currentSection, currentSectionKeys, currentTab, d2wComponentNameDebuggingEnabled, d2wContext, d2wCurrentComponentName, d2wDebuggingEnabled, editingContext, errorKeyOrder, errorMessage, errorMessages, hasActualChanges, hasBranchChoices, hasValidationExceptionForPropertyKey, isEmbedded, isObjectDeleteable, isObjectEditable, isObjectInspectable, nextPage, nextPageDelegate, nextPageFromDelegate, now, object, pageController, pageWithName, pageWrapperName, sectionsContents, sectionsForCurrentTab, self, setBranch, setCurrentSection, setCurrentTab, setD2wContext, setEditingContext, setErrorMessage, setErrorMessages, setLocalContext, setNextPage, setNextPageDelegate, setObject, setPageController, settings, shouldCollectValidationExceptions, shouldPropagateExceptions, shouldSetFailedValidationValue, sleep, tabSectionsContents, tabSectionsContentsFromRuleResult, userInfo, userPreferencesValueForKey, userPreferencesValueForPageConfigurationKey, validationFailedWithException
 
Methods inherited from class com.webobjects.directtoweb.D2WPage
alternateRowColor, dataSource, extraBindings, 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
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _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, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.webobjects.directtoweb.ListPageInterface
setNextPage, setNextPageDelegate
 
Methods inherited from interface com.webobjects.directtoweb.SelectPageInterface
nextPageDelegate, setNextPageDelegate
 

Field Detail

log

public static final Logger log
logging support


_shouldRefetch

protected boolean _shouldRefetch

_displayGroup

protected WODisplayGroup _displayGroup
Holds the display group.


_hasToUpdate

public boolean _hasToUpdate

_rowFlip

protected boolean _rowFlip

dataSourceState

protected Object dataSourceState

referenceEO

public EOEnterpriseObject referenceEO
Constructor Detail

ERD2WListPage

public ERD2WListPage(WOContext c)
Public constructor. Registers for EOEditingContext.EditingContextDidSaveChangesNotification so that component stays informed when objects are deleted and added.

Parameters:
c - current context
Method Detail

finalize

public void finalize()
              throws Throwable
Override to un-register for stop obsevring notifcations.

Overrides:
finalize in class D2WPage
Throws:
Throwable

displayGroup

public WODisplayGroup displayGroup()
Returns the display group, creating one if there is none present.

Specified by:
displayGroup in interface ERDListPageInterface
Returns:
the displayGroup for this list page

createDisplayGroup

protected void createDisplayGroup()
Creates the display group and sets the _displayGroup instance variable


useBatchingDisplayGroup

public boolean useBatchingDisplayGroup()
Checks the d2wContext for useBatchingDisplayGroup and returns it.


editingContextDidSaveChanges

public void editingContextDidSaveChanges(NSNotification notif)
Called when an EOditingContext has changed. Sets _hasToUpdate which in turn lets the group refetch on the next display.


isEntityReadOnly

public boolean isEntityReadOnly()
Checks if the entity is read only, meaning that you can't edit it's objects.

Overrides:
isEntityReadOnly in class ERD2WPage

isEntityEditable

public boolean isEntityEditable()
Description copied from class: ERD2WPage
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.

Overrides:
isEntityEditable in class ERD2WPage

alwaysRefetchList

public boolean alwaysRefetchList()

isSelecting

public boolean isSelecting()
Checks if the current task is select. We need this because this page implements the SelectPageInterface so we can't do an instanceof test.


isListEmpty

public boolean isListEmpty()
Checks if the current list is empty.


listSize

public int listSize()
The number of objects in the list.


alternatingColorForRow

public String alternatingColorForRow()
Utility to have alternating row colors. Override this to have more than one color.


backgroundColorForRow

public String backgroundColorForRow()
The background color for the current row. Override this to have more than one color.


setBackgroundColorForRow

public void setBackgroundColorForRow(String value)
Does nothing and exists only for KeyValueCoding.


selectedObject

public EOEnterpriseObject selectedObject()
The currently selected object.

Specified by:
selectedObject in interface SelectPageInterface

setSelectedObject

public void setSelectedObject(EOEnterpriseObject eo)
Sets currently selected object. Pushes the value to the display group, clearing the selection if needed.

Specified by:
setSelectedObject in interface SelectPageInterface

selectedObjects

public NSArray selectedObjects()
The currently selected objects.


setSelectedObjects

public void setSelectedObjects(NSArray eos)
Sets currently selected objects. Pushes the values to the display group, clearing the selection if needed.


selectObjectAction

public WOComponent selectObjectAction()
Action method to select an object.


backAction

public WOComponent backAction()

urlForCurrentState

public String urlForCurrentState()
end of reimplementation

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

setSortOrderingsOnDisplayGroup

protected void setSortOrderingsOnDisplayGroup(NSArray sortOrderings,
                                              WODisplayGroup dg)

printerFriendlyVersion

public static WOComponent printerFriendlyVersion(D2WContext d2wContext,
                                                 WOSession session,
                                                 EODataSource dataSource,
                                                 WODisplayGroup displayGroup)

printerFriendlyVersion

public WOComponent printerFriendlyVersion()

descriptionForResponse

public String descriptionForResponse(WOResponse aResponse,
                                     WOContext aContext)
Description copied from class: ERD2WPage
This will allow d2w pages to be listed on a per configuration basis in stats collecting.

Overrides:
descriptionForResponse in class ERD2WPage

numberOfObjectsPerBatch

public int numberOfObjectsPerBatch()

userPreferencesCanSpecifySorting

public boolean userPreferencesCanSpecifySorting()

checkSortOrderingKeys

public boolean checkSortOrderingKeys()

sortOrderings

public NSArray sortOrderings()

defaultSortKey

public String defaultSortKey()

takeValuesFromRequest

public void takeValuesFromRequest(WORequest r,
                                  WOContext c)
Description copied from class: ERD2WPage
Overridden from the parent for better logging. Also clears validation errors

Overrides:
takeValuesFromRequest in class ERD2WPage

invokeAction

public WOActionResults invokeAction(WORequest r,
                                    WOContext c)
Description copied from class: ERD2WPage
Overridden from the parent for better logging.

Overrides:
invokeAction in class ERD2WPage

appendToResponse

public void appendToResponse(WOResponse r,
                             WOContext c)
Description copied from class: ERD2WPage
Overridden from the parent for better logging. Reports exceptions in the console for easier debugging.

Overrides:
appendToResponse in class ERD2WPage

setDataSource

public void setDataSource(EODataSource eodatasource)
Specified by:
setDataSource in interface ListPageInterface
Specified by:
setDataSource in interface SelectPageInterface
Overrides:
setDataSource in class ERD2WPage

willUpdate

protected void willUpdate()

didUpdate

protected void didUpdate()

setupPhase

protected void setupPhase()

isEntityInspectable

public boolean isEntityInspectable()

isEntityPrintable

public boolean isEntityPrintable()

deleteObjectAction

public WOComponent deleteObjectAction()

editObjectAction

public WOComponent editObjectAction()

inspectObjectAction

public WOComponent inspectObjectAction()