com.wewebu.ow.server.plug.owsearch
Class OwSearchDocument

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwDocument
          extended by com.wewebu.ow.server.app.OwMasterDocument
              extended by com.wewebu.ow.server.plug.owsearch.OwSearchDocument
All Implemented Interfaces:
com.wewebu.ow.server.util.OwAttributeBag, com.wewebu.ow.server.util.OwAttributeBagWriteable

public class OwSearchDocument
extends com.wewebu.ow.server.app.OwMasterDocument

Search Document Implementation. The Document to the record management tab.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
 class OwSearchDocument.OwRepositorySearchTemplate
          decorator class for search templates.
 
Field Summary
static String CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS
          configuration node name <EnabledDocumentFunctions>
static String PLUGIN_LIST_ENABLED_ATTRIBUTE
          enabled attribute for document function plugin list
 
Fields inherited from class com.wewebu.ow.server.ui.OwDocument
m_ViewList
 
Constructor Summary
OwSearchDocument()
           
 
Method Summary
protected  boolean autoOpenFirstObject(com.wewebu.ow.server.ecm.OwObject obj_p, int iSize_p)
          (overridable) to check for auto open first one if one or more where found
 boolean canGoBackToSearchTemplate()
          check if navigate to the searchtemplate the caused the last search is possible
 void doSearch(int iMaxListSize_p)
          perform a search and display the result
 com.wewebu.ow.server.field.OwSearchTemplate getCurrentSearchTemplate()
          get the active searchtemplate
protected  com.wewebu.ow.server.util.OwXMLUtil getDocumentFunctionsNode()
          get the document functions definition node or null if config element is missing
protected  com.wewebu.ow.server.field.OwSort getFilteredSort(com.wewebu.ow.server.field.OwSort sort_p, Collection properties_p)
          compute a filtered sort out of a given sort according to the given property list used to adjust a sort created by the resultlist to the current search, which might be different to the last search
protected  Map getRepositories()
          overridable, create a map of repositories that can be searched
 com.wewebu.ow.server.ecm.OwObjectCollection getResultList()
          get the result collection
 Collection getSearchTemplates()
          get the list to the available searchtemplates, which are allowed for the user.
 void goBackToSearchTemplate()
          navigate to the searchtemplate the caused the last search
protected  void init()
          init the target after the context is set.
protected  boolean isAutoOpenFirstDocument()
          check if open first document is activated
protected  boolean isAutoOpenSingleRecord()
          check if open single record (folder) is activated
 Object onDispatch(int iCode_p, Object param1_p, Object param2_p)
          This function will be overloaded by the targets (Views and Documents) to perform a generic action on this target.
 void repeatLastSearch()
          Repeats the last search performed through doSearch(int) preserving the current page in the object list view.
 void setNavigationView(com.wewebu.ow.server.ui.OwNavigationView navView_p)
          set the currently used searchtemplate view which generated the result list
 com.wewebu.ow.server.field.OwSearchTemplate setSearchTemplatName(String strSearchTemplateName_p)
          set and activate the searchtemplate
 
Methods inherited from class com.wewebu.ow.server.app.OwMasterDocument
dispatch, getConfigNode, getConfiguration, getMasterView, getPersistentAttributeBagWriteable, getPlugin, getPluginID, getSafeSetting, setPlugin, setSafeSetting
 
Methods inherited from class com.wewebu.ow.server.ui.OwDocument
attachView, attributecount, clear, detachView, getAttribute, getAttribute, getAttributeNames, getSafeAttribute, hasAttribute, remove, save, setAttribute, update
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getFormName, getFormTarget, getID, onExternalRequest, onFormEvent, onRequest, setExternalFormTarget, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS

public static final String CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS
configuration node name <EnabledDocumentFunctions>

See Also:
Constant Field Values

PLUGIN_LIST_ENABLED_ATTRIBUTE

public static final String PLUGIN_LIST_ENABLED_ATTRIBUTE
enabled attribute for document function plugin list

See Also:
Constant Field Values
Constructor Detail

OwSearchDocument

public OwSearchDocument()
Method Detail

getRepositories

protected Map getRepositories()
overridable, create a map of repositories that can be searched


init

protected void init()
             throws Exception
init the target after the context is set.

Overrides:
init in class com.wewebu.ow.server.app.OwMasterDocument
Throws:
Exception

setSearchTemplatName

public com.wewebu.ow.server.field.OwSearchTemplate setSearchTemplatName(String strSearchTemplateName_p)
                                                                 throws Exception
set and activate the searchtemplate

Parameters:
strSearchTemplateName_p - Name of the template as retrieved from OwNetwork.getSiteObjects("SearchTemplates");
Throws:
Exception

getCurrentSearchTemplate

public com.wewebu.ow.server.field.OwSearchTemplate getCurrentSearchTemplate()
                                                                     throws Exception
get the active searchtemplate

Returns:
the active search template name
Throws:
Exception

getSearchTemplates

public Collection getSearchTemplates()
                              throws Exception
get the list to the available searchtemplates, which are allowed for the user.

Returns:
List of OwSearchTemplates as retrieved from OwNetwork.getSiteObjects("SearchTemplates");
Throws:
Exception

getFilteredSort

protected com.wewebu.ow.server.field.OwSort getFilteredSort(com.wewebu.ow.server.field.OwSort sort_p,
                                                            Collection properties_p)
compute a filtered sort out of a given sort according to the given property list used to adjust a sort created by the resultlist to the current search, which might be different to the last search

Parameters:
sort_p - an OwSort object
properties_p - Properties to filter for
Returns:
cloned and filtered OwSort object

setNavigationView

public void setNavigationView(com.wewebu.ow.server.ui.OwNavigationView navView_p)
set the currently used searchtemplate view which generated the result list


canGoBackToSearchTemplate

public boolean canGoBackToSearchTemplate()
check if navigate to the searchtemplate the caused the last search is possible


goBackToSearchTemplate

public void goBackToSearchTemplate()
                            throws Exception
navigate to the searchtemplate the caused the last search

Throws:
Exception

doSearch

public void doSearch(int iMaxListSize_p)
              throws Exception
perform a search and display the result

Parameters:
iMaxListSize_p - int maximum number of items in the search
Throws:
Exception

repeatLastSearch

public void repeatLastSearch()
                      throws Exception
Repeats the last search performed through doSearch(int) preserving the current page in the object list view.

Throws:
Exception
Since:
2.5.3.0

onDispatch

public Object onDispatch(int iCode_p,
                         Object param1_p,
                         Object param2_p)
                  throws Exception
This function will be overloaded by the targets (Views and Documents) to perform a generic action on this target. this is a generic function, used for communication of plugins, which do not know about the interfaces of each other.

Overrides:
onDispatch in class com.wewebu.ow.server.app.OwMasterDocument
Parameters:
iCode_p - enumerator designating the requested action
param1_p - String Name of search template and max size to activate in the form "[templatename],[maxsize]"
param2_p - Map of values mapped to property names as search parameters
Returns:
Object depending on derived implementation
Throws:
Exception

getResultList

public com.wewebu.ow.server.ecm.OwObjectCollection getResultList()
get the result collection

Returns:
an OwObjectCollection

autoOpenFirstObject

protected boolean autoOpenFirstObject(com.wewebu.ow.server.ecm.OwObject obj_p,
                                      int iSize_p)
(overridable) to check for auto open first one if one or more where found

Parameters:
obj_p - first OwObject to check if it should be auto opened
iSize_p - int number of objects in the result list
Returns:
boolean true = open the first object, false = do nothing

isAutoOpenSingleRecord

protected boolean isAutoOpenSingleRecord()
check if open single record (folder) is activated

Returns:
boolean true = autoOpen if is single record
Since:
3.1.0.0

isAutoOpenFirstDocument

protected boolean isAutoOpenFirstDocument()
check if open first document is activated

Returns:
boolean true = autoOpen first document
Since:
3.1.0.0

getDocumentFunctionsNode

protected com.wewebu.ow.server.util.OwXMLUtil getDocumentFunctionsNode()
                                                                throws Exception
get the document functions definition node or null if config element is missing

Read the configuration tag: OwSearchDocument.CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS

Returns:
the document function plugin OwXMLUtil node or null if config element is missing
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.