Project Wonder 5.0

er.directtoweb.pages
Class ERD2WQueryPage

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.ERD2WQueryPage
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.directtoweb.generation.DTWGeneration, com.webobjects.directtoweb.QueryPageInterface, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, ERDBranchInterface, ERDQueryPageInterface, ERDUserInfoInterface, ERXComponentActionRedirector.Restorable, ERXExceptionHolder, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ERD2WQueryPageTemplate, ERD2WQueryPageWithFetchSpecification, ERD2WQueryPageWithFetchSpecificationTemplate, ERDIVQueryPage, ERLITQueryPage, ERNEUQueryPage

public class ERD2WQueryPage
extends ERD2WPage
implements ERDQueryPageInterface

Superclass for all query pages.
In addition to the rest of the goodies of ERD2WPage, it lets you save and restore the initial query bindings by supplying a NS(Mutable)Dictionary which contains the keys "queryMin", "queryMax" etc from the respective fields of the WODisplayGroup.

See Also:
Serialized Form
D2W Keys
fetchSpecificationNamefetchSpecificationName
           
enableQueryForNullValuesenableQueryForNullValues
           
isDeepisDeep
           
usesDistinctusesDistinct
           
refrehRefetchedObjectsrefrehRefetchedObjects
           
fetchLimitfetchLimit
           
prefetchingRelationshipKeyPathsprefetchingRelationshipKeyPaths
           
showListInSamePageshowListInSamePage
           
listConfigurationNamelistConfigurationName
           
queryDataSourceDelegatequeryDataSourceDelegate
           
queryValidationDelegatequeryValidationDelegate
           
enableQueryForNullValuesenableQueryForNullValues
           
canQueryPropertyForNullValuescanQueryPropertyForNullValues
           

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
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  com.webobjects.foundation.NSArray _nullablePropertyKeys
           
protected  boolean didLoadQueryBindings
           
protected  com.webobjects.appserver.WODisplayGroup displayGroup
           
protected  com.webobjects.eocontrol.EOFetchSpecification fetchSpecification
           
protected  com.webobjects.foundation.NSMutableDictionary keysToQueryForNull
           
protected  com.webobjects.foundation.NSDictionary queryBindings
           
protected  ERDQueryDataSourceDelegateInterface queryDataSourceDelegate
           
protected  ERDQueryValidationDelegate queryValidationDelegate
           
 com.webobjects.appserver.WOComponent returnPage
           
protected  java.lang.Boolean showResults
           
 
Fields inherited from class er.directtoweb.pages.ERD2WPage
_allConfigurations, _branch, _context, _nextPage, _nextPageDelegate, _pageController, _userInfo, errorKeyOrder, errorMessage, errorMessages, keyPathsWithValidationExceptions, log, 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
ERD2WQueryPage(com.webobjects.appserver.WOContext context)
           
 
Method Summary
 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.appserver.WOComponent cancelAction()
           
 boolean canQueryCurrentPropertyForNullValue()
          Determines if the null query checkbox can be shown for the current D2W property key should be checked.
 com.webobjects.appserver.WOComponent clearAction()
           
protected  void createDisplayGroup()
           
 com.webobjects.eocontrol.EODataSource defaultQueryDataSource()
          Default implementation of which assembles the data source for the search results page, configured for the current query.
 com.webobjects.appserver.WODisplayGroup displayGroup()
          Gets the display group.
 int fetchLimit()
           
 com.webobjects.eocontrol.EOFetchSpecification fetchSpecification()
           
 java.lang.String fetchSpecificationName()
           
 java.lang.String headerTemplate()
           
 boolean isDeep()
           
 boolean isNullQueryCheckedForCurrentProperty()
          Determines if the null query checkbox for the current D2W property key should be checked.
protected  void loadQueryBindings()
           
 com.webobjects.foundation.NSArray nullablePropertyKeys()
          Discovers the property keys that can be queried for a NULL value.
 com.webobjects.foundation.NSArray prefetchingRelationshipKeyPaths()
           
protected  void pullQueryBindingsForName(java.lang.String name)
           
protected  void pushQueryBindingsForName(java.lang.String name)
           
 com.webobjects.eocontrol.EOQualifier qualifier()
           
 com.webobjects.appserver.WOComponent queryAction()
           
 com.webobjects.foundation.NSDictionary queryBindings()
           
 com.webobjects.eocontrol.EODataSource queryDataSource()
          Assembles the data source for the search results page, configured for the current query.
 ERDQueryDataSourceDelegateInterface queryDataSourceDelegate()
          Gets the query data source delegate.
 com.webobjects.eocontrol.EOFetchSpecification queryFetchSpecification()
           
 ERDQueryValidationDelegate queryValidationDelegate()
          Gets the query validation delegate.
 boolean refreshRefetchedObjects()
           
 com.webobjects.appserver.WOComponent returnAction()
           
protected  void saveQueryBindings()
           
 void setCancelDelegate(com.webobjects.directtoweb.NextPageDelegate cancelDelegate)
           
 void setFetchSpecification(com.webobjects.eocontrol.EOFetchSpecification value)
           
 void setFetchSpecificationName(java.lang.String value)
           
 void setIsNullQueryCheckedForCurrentProperty(boolean value)
          Sets the flag denoting a property key is being queried for a null value.
 void setQueryBindings(com.webobjects.foundation.NSDictionary dictionary)
           
 void setQueryDataSource(com.webobjects.eocontrol.EODataSource datasource)
          Sets the query data source.
 void setQueryDataSourceDelegate(ERDQueryDataSourceDelegateInterface delegate)
          Sets the query data source delegate.
 void setQueryMatchForKey(java.lang.Object value, java.lang.String operator, java.lang.String key)
          Set a search value for the display group query match.
 void setQueryValidationDelegate(ERDQueryValidationDelegate delegate)
          Sets the query validation delegate.
 void setShowResults(boolean value)
           
 boolean showCancel()
           
 boolean showResults()
           
protected  void substituteValueForNullableQueryKeys()
          When querying for properties with a null value, and the null value checkbox for a property key is checked, this method substitutes NSKeyValueCoding.NullValue into the display group's query dictionaries for that property key.
 void takeValuesFromRequest(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
          Overridden from the parent for better logging.
 boolean usesDistinct()
           
 
Methods inherited from class er.directtoweb.pages.ERD2WPage
aggregateEventDurationForCurrentPropertyKey, allConfigurationNames, branch, branchChoices, branchName, clearTabSectionsContents, clearValidationFailed, clickToOpenEnabled, cssClassForPageContainerElement, cssClassForPropertyKey, cssClassForPropertyName, currentSection, currentSectionKeys, currentTab, d2wComponentNameDebuggingEnabled, d2wContext, d2wCurrentComponentName, d2wDebuggingEnabled, descriptionForResponse, displayVariant, editingContext, errorKeyOrder, errorMessage, errorMessages, hasActualChanges, hasBranchChoices, hasErrors, hasValidationExceptionForPropertyKey, inlineStyleDeclarationForPropertyKey, inlineStyleDeclarationForPropertyName, invokeAction, isEmbedded, isEntityEditable, isEntityReadOnly, isKeyOmitted, isObjectDeleteable, isObjectEditable, isObjectInspectable, isTopLevelPage, latestEntryForCurrentPropertyKey, makeStatsKey, nextPage, nextPageDelegate, nextPageFromDelegate, now, object, pageController, pageWithName, pageWrapperName, sectionsContents, sectionsForCurrentTab, self, setBranch, setCurrentSection, setCurrentTab, setD2wContext, setDataSource, setEditingContext, setErrorMessage, setErrorMessages, setLocalContext, setNextPage, setNextPageDelegate, setObject, setPageController, settings, shouldCollectValidationExceptions, shouldDisplayDetailedPageMetrics, shouldDisplayPageMetricsSummary, shouldPropagateExceptions, shouldSetFailedValidationValue, sleep, statsForPage, statsKeyForCurrentPropertyKey, statsKeyPrefix, tabSectionsContents, tabSectionsContentsFromRuleResult, urlForCurrentState, userInfo, userPreferencesValueForKey, userPreferencesValueForPageConfigurationKey, validationFailedWithException
 
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
 
Methods inherited from interface com.webobjects.directtoweb.QueryPageInterface
setNextPageDelegate
 

Field Detail

displayGroup

protected com.webobjects.appserver.WODisplayGroup displayGroup

didLoadQueryBindings

protected boolean didLoadQueryBindings

queryBindings

protected com.webobjects.foundation.NSDictionary queryBindings

fetchSpecification

protected com.webobjects.eocontrol.EOFetchSpecification fetchSpecification

queryDataSourceDelegate

protected ERDQueryDataSourceDelegateInterface queryDataSourceDelegate

queryValidationDelegate

protected ERDQueryValidationDelegate queryValidationDelegate

_nullablePropertyKeys

protected com.webobjects.foundation.NSArray _nullablePropertyKeys

keysToQueryForNull

protected com.webobjects.foundation.NSMutableDictionary keysToQueryForNull

showResults

protected java.lang.Boolean showResults

returnPage

public com.webobjects.appserver.WOComponent returnPage
Constructor Detail

ERD2WQueryPage

public ERD2WQueryPage(com.webobjects.appserver.WOContext context)
Method Detail

createDisplayGroup

protected void createDisplayGroup()

pullQueryBindingsForName

protected void pullQueryBindingsForName(java.lang.String name)

clearAction

public com.webobjects.appserver.WOComponent clearAction()

fetchSpecification

public com.webobjects.eocontrol.EOFetchSpecification fetchSpecification()

setFetchSpecification

public void setFetchSpecification(com.webobjects.eocontrol.EOFetchSpecification value)

setFetchSpecificationName

public void setFetchSpecificationName(java.lang.String value)

fetchSpecificationName

public java.lang.String fetchSpecificationName()

queryFetchSpecification

public com.webobjects.eocontrol.EOFetchSpecification queryFetchSpecification()

pushQueryBindingsForName

protected void pushQueryBindingsForName(java.lang.String name)

takeValuesFromRequest

public void takeValuesFromRequest(com.webobjects.appserver.WORequest request,
                                  com.webobjects.appserver.WOContext context)
Description copied from class: ERD2WPage
Overridden from the parent for better logging. Also clears validation errors

Overrides:
takeValuesFromRequest in class ERD2WPage

appendToResponse

public void appendToResponse(com.webobjects.appserver.WOResponse response,
                             com.webobjects.appserver.WOContext context)
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

saveQueryBindings

protected void saveQueryBindings()

loadQueryBindings

protected void loadQueryBindings()

awake

public void awake()
Description copied from class: ERD2WPage
Overridden to lock the page's editingContext, if there is any present.

Overrides:
awake in class ERD2WPage

isDeep

public boolean isDeep()

queryBindings

public com.webobjects.foundation.NSDictionary queryBindings()

setQueryBindings

public void setQueryBindings(com.webobjects.foundation.NSDictionary dictionary)

usesDistinct

public boolean usesDistinct()

refreshRefetchedObjects

public boolean refreshRefetchedObjects()

fetchLimit

public int fetchLimit()

prefetchingRelationshipKeyPaths

public com.webobjects.foundation.NSArray prefetchingRelationshipKeyPaths()

qualifier

public com.webobjects.eocontrol.EOQualifier qualifier()

showResults

public boolean showResults()

setShowResults

public void setShowResults(boolean value)

queryAction

public com.webobjects.appserver.WOComponent queryAction()

cancelAction

public com.webobjects.appserver.WOComponent cancelAction()

returnAction

public com.webobjects.appserver.WOComponent returnAction()

showCancel

public boolean showCancel()
Overrides:
showCancel in class ERD2WPage

queryDataSource

public com.webobjects.eocontrol.EODataSource queryDataSource()
Assembles the data source for the search results page, configured for the current query. If a queryDataSourceDelegate() is defined, the delegate's implementation is invoked. Otherwise, the defaultQueryDataSource() is returned.

Specified by:
queryDataSource in interface com.webobjects.directtoweb.QueryPageInterface
Specified by:
queryDataSource in interface ERDQueryPageInterface
Returns:
the prepared data source

setQueryDataSource

public void setQueryDataSource(com.webobjects.eocontrol.EODataSource datasource)
Sets the query data source.

Parameters:
datasource - to be used as the query data source

defaultQueryDataSource

public com.webobjects.eocontrol.EODataSource defaultQueryDataSource()
Default implementation of which assembles the data source for the search results page, configured for the current query.

Returns:
the prepared data source

queryDataSourceDelegate

public ERDQueryDataSourceDelegateInterface queryDataSourceDelegate()
Gets the query data source delegate.

Returns:
the query data source delegate

setQueryDataSourceDelegate

public void setQueryDataSourceDelegate(ERDQueryDataSourceDelegateInterface delegate)
Sets the query data source delegate.

Parameters:
delegate - to use as the query data source delegate

queryValidationDelegate

public ERDQueryValidationDelegate queryValidationDelegate()
Gets the query validation delegate.

Returns:
the query validation delegate

setQueryValidationDelegate

public void setQueryValidationDelegate(ERDQueryValidationDelegate delegate)
Sets the query validation delegate.

Parameters:
delegate - to use as the query validation delegate

displayGroup

public com.webobjects.appserver.WODisplayGroup displayGroup()
Gets the display group.

Returns:
the display group

headerTemplate

public java.lang.String headerTemplate()

setQueryMatchForKey

public void setQueryMatchForKey(java.lang.Object value,
                                java.lang.String operator,
                                java.lang.String key)
Set a search value for the display group query match. When the value is null is gets removed from the dict, when the operator is null and the value isn't, "=" is chosen. When operator is "<" is uses queryMatch(), if it is ">" is uses queryMin(), so you can use it with the various date range components.

Specified by:
setQueryMatchForKey in interface ERDQueryPageInterface
Parameters:
value - to assign to the queryMatch dictionary for the given key
operator - used for comparing the value
key - to use

setCancelDelegate

public void setCancelDelegate(com.webobjects.directtoweb.NextPageDelegate cancelDelegate)
Specified by:
setCancelDelegate in interface ERDQueryPageInterface

nullablePropertyKeys

public com.webobjects.foundation.NSArray nullablePropertyKeys()
Discovers the property keys that can be queried for a NULL value.

Returns:
the array of nullable and/or non-mandatory property keys

isNullQueryCheckedForCurrentProperty

public boolean isNullQueryCheckedForCurrentProperty()
Determines if the null query checkbox for the current D2W property key should be checked.

Returns:
true if the checkbox should be checked

setIsNullQueryCheckedForCurrentProperty

public void setIsNullQueryCheckedForCurrentProperty(boolean value)
Sets the flag denoting a property key is being queried for a null value.

Parameters:
value - of the checkbox' checked attribute

canQueryCurrentPropertyForNullValue

public boolean canQueryCurrentPropertyForNullValue()
Determines if the null query checkbox can be shown for the current D2W property key should be checked.

Returns:
true if the checkbox should be checked

substituteValueForNullableQueryKeys

protected void substituteValueForNullableQueryKeys()
When querying for properties with a null value, and the null value checkbox for a property key is checked, this method substitutes NSKeyValueCoding.NullValue into the display group's query dictionaries for that property key.


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

Copyright © 2002 – 2007 Project Wonder.