atg.epub.servlet
Class AssetSearchFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.epub.servlet.PortletFormHandler
              extended by atg.epub.servlet.BaseSearchFormHandler
                  extended by atg.epub.servlet.SearchFormHandler
                      extended by atg.epub.servlet.AssetSearchFormHandler
All Implemented Interfaces:
atg.droplet.ObjectFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class AssetSearchFormHandler
extends SearchFormHandler

Search form handler for assets. Works for both repository and virtual file assets, by treating VF assets as repository items.


Field Summary
static int ACTION_CHANGE_CURRENT_DIRECTORY
           
static int ACTION_CHANGE_TYPE
           
static int ACTION_CLICK_FOLDER
           
static int ACTION_SEARCH
           
static int ACTION_SORT_ORDER
           
static java.lang.String CLASS_VERSION
           
static int NAME_SEARCH_TYPE_BEGINS_WITH
           
static int NAME_SEARCH_TYPE_CONTAINS
           
static int NAME_SEARCH_TYPE_NONE
           
 
Fields inherited from class atg.epub.servlet.SearchFormHandler
GENERATE_VALUES_BY_TYPE_FAILED, INVALID_KEYWORD_SEARCH_STRING, INVALID_PROP_COMBINATION, INVALID_SEARCH_PROPERTY_NAMES, NO_PROPERTY_NAMES_FOR_ITEM, UNMATCHED_QUOTES
 
Fields inherited from class atg.epub.servlet.BaseSearchFormHandler
EMPTY_SEARCH_VALUES_DISALLOW, INVALID_ITEM_TYPE, MULTIPLE_ITEM_TYPES_DISALLOW, QUERY_FAILURE
 
Fields inherited from class atg.epub.servlet.PortletFormHandler
mFormExceptions, PARAM_USE_FORWARDS, sTransactionManager
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
AssetSearchFormHandler()
           
 
Method Summary
protected  java.util.ArrayList findChildFolders(VirtualFile pFolder)
          Finds the subfolders for a given VirtualFile.
protected  java.util.ArrayList findParentFolders(VirtualFile pFolder)
          Finds the parents of a given folder (inluding current folder) The list is in reverse tree order (i.e.
 int getACTION_CHANGE_CURRENT_DIRECTORY()
           
 int getACTION_CHANGE_TYPE()
           
 int getACTION_CLICK_FOLDER()
           
 int getACTION_SEARCH()
           
 int getACTION_SORT_ORDER()
           
 int getAction()
          Returns property Action
 java.util.ArrayList getChildFolders()
          Returns property ChildFolders
 java.lang.String getClickedFolder()
          Returns property ClickedFolder
 java.lang.String getComponentPath()
          Returns property ComponentPath
 VirtualFile getCurrentFile()
          Returns property CurrentFile
protected  java.lang.String getDisplayNameProperty(Repository pRepository, java.lang.String pTypeName)
          Repository items that implement 'getItemDisplayNameProperty()' ought to do so via an interface.
 java.lang.String getItemType()
          Returns property ItemType
 int getNameSearchType()
          Return the name search type
 java.util.ArrayList getParentFolders()
          Returns property ParentFolders
 VirtualFile getRootFile(VirtualFileSystem pVFS)
           
 java.lang.String getRootFolderName()
          Returns property RootFolderName
 boolean handleChangeCurrentDirectory(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handle method to update form elements when current directory is changed
 void handleChangeCurrentDirectory(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
          Handle method to update form elements when current directory is changed
 boolean handleChangeType(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handle method to update form elements when type is changed
 void handleChangeType(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
          Handle method to update form elements when type is changed
 boolean handleClickFolder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handle method to
 void handleClickFolder(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
          Handle method to update form elements when a folder is clicked
 boolean handlePerformAction(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handle the type of action specified in actionType
 void handlePerformAction(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse)
          Handle the type of action
 boolean isIncludeSubFolders()
          Returns property IncludeSubFolders
protected  boolean prepareSearch(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Prepare for special asset type searches.
 void setAction(int pAction)
          Sets property Action
 void setChildFolders(java.util.ArrayList pChildFolders)
          Sets property ChildFolders
 void setClickedFolder(java.lang.String pClickedFolder)
          Sets property ClickedFolder
 void setComponentPath(java.lang.String pComponentPath)
          Sets property ComponentPath
 void setCurrentFile(VirtualFile pCurrentFile)
          Sets property CurrentFile
 void setIncludeSubFolders(boolean pIncludeSubFolders)
          Sets property IncludeSubFolders
 void setItemType(java.lang.String pItemType)
          Sets property ItemType
 void setNameSearchType(int pType)
          Set name search type to either NAME_SEARCH_TYPE_CONTAINS, NAME_SEARCH_TYPE_BEGINS_WITH, or NAME_SEARCH_TYPE_NONE to disable this type of search.
 void setParentFolders(java.util.ArrayList pParentFolders)
          Sets property ParentFolders
 void setRootFolderName(java.lang.String pRootFolderName)
          Sets property RootFolderName
 
Methods inherited from class atg.epub.servlet.SearchFormHandler
areSearchValuesEmpty, beforeSet, generateAdvancedSearchQuery, generateHierarchicalSearchQuery, generateKeywordSearchQuery, generateResultSet, generateSearchQuery, generateSearchValues, generateSingleKeywordQuery, generateSingleKeywordQuery, generateTextSearchQuery, getAdvancedSearchPropertyNames, getAdvancedSearchPropertyRanges, getAdvancedSearchPropertyValues, getAllowWildcards, getAncestorId, getAncestorPropertyName, getDisplayName, getEncodedPathAndItemType, getFolderPath, getIgnoreCase, getKeywordInput, getKeywords, getKeywordSearchPropertyNames, getMinScore, getPropertyValuesByType, getSearchStringFormat, getSingleKeywordSearchOperator, getTextInput, getTextSearchPropertyNames, getVFSFromComponentPath, getVirtualFileSystems, isAdvancedSearchPropertyRangesEmpty, isAdvancedSearchPropertyValuesEmpty, isDoAdvancedSearch, isDoHierarchicalSearch, isDoKeywordSearch, isDoTextSearch, isToLowerCaseKeywords, isToUpperCaseKeywords, isVirtualFileSystemSearch, prepare, searchFolder, setAdvancedSearchPropertyNames, setAdvancedSearchPropertyRanges, setAdvancedSearchPropertyValues, setAllowWildcards, setAncestorId, setAncestorPropertyName, setDisplayName, setDoAdvancedSearch, setDoHierarchicalSearch, setDoKeywordSearch, setDoTextSearch, setEncodedPathAndItemType, setFolderPath, setIgnoreCase, setKeywordInput, setKeywords, setKeywordSearchPropertyNames, setMinScore, setPropertyValuesByType, setSearchStringFormat, setTextInput, setTextSearchPropertyNames, setToLowerCaseKeywords, setToUpperCaseKeywords, setVirtualFileSystems, setVirtualFileSystemSearch, splitPropertyNames, transformKeywords
 
Methods inherited from class atg.epub.servlet.BaseSearchFormHandler
afterSet, beforeGet, clearPreviousQueries, clearSearchResults, conditionallyClearProject, conditionallySetProjectContext, doGetSortProperty, generateSearchResults, getAllowEmptySearch, getAllowRefine, getClearQueries, getClearQueryURL, getCurrentResultPageNum, getEnableFullResultSetSize, getEndCount, getEndIndex, getErrorURL, getExcludedStringPropertyNames, getFullResultSetSize, getItemTypes, getLastSortDirection, getLastSortProperty, getLocale, getMaxResultsPerPage, getMaxRowCount, getMoreResults, getRepositories, getRepositoryFromComponentPath, getResultPageCount, getResultSetSize, getSearchFilters, getSearchResults, getSearchResultsByItemType, getSortDirection, getSortedSearch, getSortProperty, getStartCount, getStartIndex, getSuccessURL, getUnsetProjectContext, getVersioningLayerTools, handleClearQuery, handleClearQuery, handleSearch, handleSearch, handleSortedSearch, handleSortedSearch, isEnableCountQuery, isPrepared, isPreviouslySubmitted, isSortByDisplayName, isStringPropertyExcluded, isUseRequestLocale, processException, resetMaxRowCount, setAllowEmptySearch, setAllowRefine, setClearQueries, setClearQueryURL, setCurrentResultPageNum, setEnableCountQuery, setEnableFullResultSetSize, setEndIndex, setErrorURL, setExcludedStringPropertyNames, setFullResultSetSize, setItemTypes, setLastSortDirection, setLastSortProperty, setLocale, setMaxResultsPerPage, setMaxRowCount, setMoreResults, setPrepared, setRepositories, setResultSetSize, setSearchFilters, setSortByDisplayName, setSortDirection, setSortedSearch, setSortProperty, setStartIndex, setSuccessURL, setUnsetProjectContext, setUseRequestLocale, unsetProjectContext
 
Methods inherited from class atg.epub.servlet.PortletFormHandler
addFormException, afterGet, afterGet, afterGet, afterSet, afterSet, beforeGet, beforeGet, beforeSet, beforeSet, checkFormRedirect, getCheckForValidSession, getCurrentDynamoRequest, getCurrentDynamoResponse, getFormError, getFormExceptions, getPropertyExceptions, getTransactionDemarcation, handleFormException, handleUncheckedFormException, hasFormExceptions, isEnsureTransaction, isRestorableForm, isRollbackTransaction, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCheckForValidSession, setEnsureTransaction, setRestorableForm, setRollbackTransaction, setTransactionDemarcation, setUseForwards
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

NAME_SEARCH_TYPE_NONE

public static final int NAME_SEARCH_TYPE_NONE
See Also:
Constant Field Values

NAME_SEARCH_TYPE_BEGINS_WITH

public static final int NAME_SEARCH_TYPE_BEGINS_WITH
See Also:
Constant Field Values

NAME_SEARCH_TYPE_CONTAINS

public static final int NAME_SEARCH_TYPE_CONTAINS
See Also:
Constant Field Values

ACTION_CHANGE_TYPE

public static final int ACTION_CHANGE_TYPE
See Also:
Constant Field Values

ACTION_CHANGE_CURRENT_DIRECTORY

public static final int ACTION_CHANGE_CURRENT_DIRECTORY
See Also:
Constant Field Values

ACTION_CLICK_FOLDER

public static final int ACTION_CLICK_FOLDER
See Also:
Constant Field Values

ACTION_SEARCH

public static final int ACTION_SEARCH
See Also:
Constant Field Values

ACTION_SORT_ORDER

public static final int ACTION_SORT_ORDER
See Also:
Constant Field Values
Constructor Detail

AssetSearchFormHandler

public AssetSearchFormHandler()
Method Detail

getACTION_CHANGE_TYPE

public int getACTION_CHANGE_TYPE()

getACTION_CHANGE_CURRENT_DIRECTORY

public int getACTION_CHANGE_CURRENT_DIRECTORY()

getACTION_CLICK_FOLDER

public int getACTION_CLICK_FOLDER()

getACTION_SEARCH

public int getACTION_SEARCH()

getACTION_SORT_ORDER

public int getACTION_SORT_ORDER()

setNameSearchType

public void setNameSearchType(int pType)
Set name search type to either NAME_SEARCH_TYPE_CONTAINS, NAME_SEARCH_TYPE_BEGINS_WITH, or NAME_SEARCH_TYPE_NONE to disable this type of search.

Parameters:
name - search type

getNameSearchType

public int getNameSearchType()
Return the name search type


setIncludeSubFolders

public void setIncludeSubFolders(boolean pIncludeSubFolders)
Sets property IncludeSubFolders

Overrides:
setIncludeSubFolders in class SearchFormHandler

isIncludeSubFolders

public boolean isIncludeSubFolders()
Returns property IncludeSubFolders

Overrides:
isIncludeSubFolders in class SearchFormHandler

setAction

public void setAction(int pAction)
Sets property Action


getAction

public int getAction()
Returns property Action


setClickedFolder

public void setClickedFolder(java.lang.String pClickedFolder)
Sets property ClickedFolder


getClickedFolder

public java.lang.String getClickedFolder()
Returns property ClickedFolder


setChildFolders

public void setChildFolders(java.util.ArrayList pChildFolders)
Sets property ChildFolders


getChildFolders

public java.util.ArrayList getChildFolders()
Returns property ChildFolders


setParentFolders

public void setParentFolders(java.util.ArrayList pParentFolders)
Sets property ParentFolders


getParentFolders

public java.util.ArrayList getParentFolders()
Returns property ParentFolders


setRootFolderName

public void setRootFolderName(java.lang.String pRootFolderName)
Sets property RootFolderName


getRootFolderName

public java.lang.String getRootFolderName()
Returns property RootFolderName


setCurrentFile

public void setCurrentFile(VirtualFile pCurrentFile)
Sets property CurrentFile


getCurrentFile

public VirtualFile getCurrentFile()
Returns property CurrentFile


getRootFile

public VirtualFile getRootFile(VirtualFileSystem pVFS)

setComponentPath

public void setComponentPath(java.lang.String pComponentPath)
Sets property ComponentPath


getComponentPath

public java.lang.String getComponentPath()
Returns property ComponentPath


setItemType

public void setItemType(java.lang.String pItemType)
Sets property ItemType


getItemType

public java.lang.String getItemType()
Returns property ItemType


handleChangeType

public void handleChangeType(javax.portlet.PortletRequest pRequest,
                             javax.portlet.PortletResponse pResponse)
                      throws javax.servlet.ServletException
Handle method to update form elements when type is changed

Throws:
javax.servlet.ServletException

handleChangeType

public boolean handleChangeType(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException
Handle method to update form elements when type is changed

Throws:
javax.servlet.ServletException

handleChangeCurrentDirectory

public void handleChangeCurrentDirectory(javax.portlet.PortletRequest pRequest,
                                         javax.portlet.PortletResponse pResponse)
                                  throws javax.servlet.ServletException
Handle method to update form elements when current directory is changed

Throws:
javax.servlet.ServletException

handleChangeCurrentDirectory

public boolean handleChangeCurrentDirectory(DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
                                     throws javax.servlet.ServletException
Handle method to update form elements when current directory is changed

Throws:
javax.servlet.ServletException

handleClickFolder

public void handleClickFolder(javax.portlet.PortletRequest pRequest,
                              javax.portlet.PortletResponse pResponse)
                       throws javax.servlet.ServletException
Handle method to update form elements when a folder is clicked

Throws:
javax.servlet.ServletException

handleClickFolder

public boolean handleClickFolder(DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
                          throws javax.servlet.ServletException
Handle method to

Throws:
javax.servlet.ServletException

handlePerformAction

public void handlePerformAction(javax.portlet.PortletRequest pRequest,
                                javax.portlet.PortletResponse pResponse)
                         throws javax.servlet.ServletException
Handle the type of action

Throws:
javax.servlet.ServletException

handlePerformAction

public boolean handlePerformAction(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException
Handle the type of action specified in actionType

Throws:
javax.servlet.ServletException

findParentFolders

protected java.util.ArrayList findParentFolders(VirtualFile pFolder)
Finds the parents of a given folder (inluding current folder) The list is in reverse tree order (i.e. this folder, parent, grandparent, great grandparent, etc.) Returns null if pFolder is not a directory.


findChildFolders

protected java.util.ArrayList findChildFolders(VirtualFile pFolder)
Finds the subfolders for a given VirtualFile. The list is alphebetized by name. Returns null if pFolder is not a directory.


prepareSearch

protected boolean prepareSearch(DynamoHttpServletRequest pRequest,
                                DynamoHttpServletResponse pResponse)
Prepare for special asset type searches. This method is called during the handleSearch() method of the parent class to give sub classes a chance to modify search options.

Overrides:
prepareSearch in class atg.epub.servlet.BaseSearchFormHandler
Parameters:
pRequest - the portal request
pResponse - the portal response
Returns:
true if seach should continue

getDisplayNameProperty

protected java.lang.String getDisplayNameProperty(Repository pRepository,
                                                  java.lang.String pTypeName)
Repository items that implement 'getItemDisplayNameProperty()' ought to do so via an interface. Since they don't, this method exists.

Parameters:
pRepository - the repository
pTypeName -
Returns:
the item descriptor name, a "dot", and the property name which is the display name property or null if the values could not be determined