com.wewebu.ow.server.plug.owrecord
Class OwRecordDocument

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.owrecord.OwRecordDocument
All Implemented Interfaces:
com.wewebu.ow.server.app.OwClientRefreshContext, com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner, com.wewebu.ow.server.ui.OwTreeView.OwTreeViewEventListner, com.wewebu.ow.server.util.OwAttributeBag, com.wewebu.ow.server.util.OwAttributeBagWriteable, EventListener

public class OwRecordDocument
extends com.wewebu.ow.server.app.OwMasterDocument
implements com.wewebu.ow.server.ui.OwTreeView.OwTreeViewEventListner, com.wewebu.ow.server.app.OwClientRefreshContext, com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner

RecordDocument 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


Field Summary
static String CONFIG_NODE_DOCUMENTFUNCTIONPLUGINS
          configuration node name <DocumentFunctionPlugins>
static String CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS
          configuration node name <EnabledDocumentFunctions>
static String CONFIG_NODE_RECORDFUNCTIONPLUGINS
          configuration node name <RecordFunctionPlugins>
protected static String CONFIG_NODE_SHOWFOLDERS
          configuration node name "DisplayFoldersInResultList"
static String CONFIG_NODE_USE_DYNAMIC_SPLIT
          The configuration element for dynamic split flag
protected  int m_iMaxSize
          max number of result items in a search
protected  com.wewebu.ow.server.ui.OwTreeView m_ResultTreeView
          reference to the tree view
protected  com.wewebu.ow.server.ecm.OwObject m_RootFolderObject
          the current root folder object
protected  List m_rulesList
          Map of List of OwPriorityRule rules to be applied on records To be accessed via getRulesList().
protected  String m_strSubFolderPath
          current open subfolder
protected  com.wewebu.ow.server.ecm.OwObject m_SubFolderObject
          the current open sub folder object
protected  com.wewebu.ow.server.ecm.OwObject m_subFolderObjectParent
          the parent of the current open sub folder object
static String PLUGIN_DOC_CONFIG_PARAMETER
           
static String PLUGIN_LIST_ENABLED_ATTRIBUTE
          enabled attribute for function plugin lists
static String SETTINGS_PARAM_COLUMN_INFO
          settings parameter name for the column info list for the node list view.
static String SETTINGS_PARAM_SORT
          settings parameter name for the sorting.
 
Fields inherited from class com.wewebu.ow.server.ui.OwDocument
m_ViewList
 
Constructor Summary
OwRecordDocument()
           
 
Method Summary
protected  boolean checkValidSearchCriteria()
          (overridable) we must not send empty searches to the ECM system in order to prevent mass requests
protected  Collection<com.wewebu.ow.server.field.OwFieldDefinition> collectFilterProperties(Collection columnInfoList_p)
          Create a filter properties collection which will be provided to the current OwObjectCollection.
protected  OwRecordFilterOperatorHelper createFilterOperatorHelper()
          (overridable) Factory method to create an instance of a FilterOperatorHelper.
protected  com.wewebu.ow.server.app.OwDynamicLayoutSettings createLayoutSettings()
          Create layout settings.
 void enableSearchTemplateView(boolean enablesearchtemplateview_p)
          called from the search template view to signal that a valid search is available
 com.wewebu.ow.server.ecm.OwObject getCurrentRootFolder()
          get the currently opened folder
 String getCurrentSubFolderDisplayPath()
          get the currently opened sub folder display path
 com.wewebu.ow.server.ecm.OwObject getCurrentSubFolderObject()
          get the currently opened sub folder object
 com.wewebu.ow.server.ecm.OwObject getCurrentSubFolderObjectParent()
           
 String getCurrentSubFolderPath()
          get the currently opened sub folder path
protected  Collection getDefaultColumnInfo()
          get the default column info for the child list if no column info is defined in the opened folder
protected  com.wewebu.ow.server.util.OwXMLUtil getDocumentFunctionPluginsNode()
          get the document function plugin definition node
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 getFolderSortCriteria()
          Returns the folder sort criteria as defined in plugin description node.
Folder sort criteria can be defined via <FolderSortCriteria> tag in owplugins.xml.
protected  boolean getIsPluginsEnabled()
          check if any function plugins are configured
 com.wewebu.ow.server.app.OwDynamicLayoutSettings getLayoutSettings()
          Get the OwDynamicLayoutSettings instance.
 int getMaxChildSize()
          get the maximum size for object children
protected  com.wewebu.ow.server.util.OwXMLUtil getRecordFunctionPluginsNode()
          get the record function plugin definition node
protected  List getRulesList()
          One time priority rules read utility
 com.wewebu.ow.server.field.OwSearchTemplate getSearchTemplate()
          get the optional searchtemplate to use or null if not defined
 String getTreeViewId()
          Get the id of the configured OwTreeView object.
protected  void init()
          init the target after the context is set.
 boolean isDynamicSplitInUse()
          Check if dynamic split is used.
 boolean isPropertyPreviewViewEnabled()
          signal that a the property preview should be displayed
 boolean isSearchTemplateViewEnabled()
          signal that a valid search is available and the view should be displayed
 void onClientRefreshContextUpdate(int iReason_p, Object param_p)
          implementation of the OwFunction.OwFunctionRefreshContext interface Called from a plugin to inform its client and cause refresh of display data
 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 onObjectListViewFilterChange(com.wewebu.ow.server.field.OwSearchNode filterNode_p, com.wewebu.ow.server.ecm.OwObject parent_p)
           
 String onObjectListViewGetRowClassName(int iIndex_p, com.wewebu.ow.server.ecm.OwObject obj_p)
          get the style class name for the row
 boolean onObjectListViewItemClick(com.wewebu.ow.server.ecm.OwObject obj_p)
           
 void onObjectListViewSelect(com.wewebu.ow.server.ecm.OwObject object_p, com.wewebu.ow.server.ecm.OwObject parent_p)
           
 void onObjectListViewSort(com.wewebu.ow.server.field.OwSort newSort_p, String strSortProperty_p)
           
 void onTreeViewNavigateFolder(com.wewebu.ow.server.ui.OwTreeView.OwTreeViewNode node_p)
          implementation of OwTreeView.OwTreeViewEventListner: event called when a user opens a folder to display its document contents overridden from OwObjectTreeView.OwObjectTreeViewEventListner
 void onTreeViewOpenFolder(com.wewebu.ow.server.ui.OwTreeView.OwTreeViewNode node_p)
          implementation of OwTreeView.OwTreeViewEventListner: event called when a user navigates through the tree (using plus minus icon), but does not open a folder overridden from OwObjectTreeView.OwObjectTreeViewEventListner
 void openFolder(com.wewebu.ow.server.ecm.OwObject folder_p, String strSubFolderPath_p)
          open the specified folder in the plugin
 void setMaxChildSize(int iMax_p)
          set the maximum size for object children
 void setResultTreeView(com.wewebu.ow.server.ui.OwTreeView resultTreeView_p)
          set the result tree view to be used by the record plugin
protected  boolean showFolderInResultList()
          Flag which is used to verify, if folders should be shown in result list or not.
 boolean supportLock()
          is lock supported in plugin definition
 void update(com.wewebu.ow.server.ui.OwEventTarget caller_p, int iCode_p, Object param_p)
          causes all attached views to receive an onUpdate event
 
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
 
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

PLUGIN_LIST_ENABLED_ATTRIBUTE

public static final String PLUGIN_LIST_ENABLED_ATTRIBUTE
enabled attribute for function plugin lists

See Also:
Constant Field Values

PLUGIN_DOC_CONFIG_PARAMETER

public static final String PLUGIN_DOC_CONFIG_PARAMETER
See Also:
Constant Field Values

SETTINGS_PARAM_COLUMN_INFO

public static final String SETTINGS_PARAM_COLUMN_INFO
settings parameter name for the column info list for the node list view.

See Also:
Constant Field Values

SETTINGS_PARAM_SORT

public static final String SETTINGS_PARAM_SORT
settings parameter name for the sorting.

See Also:
Constant Field Values

CONFIG_NODE_DOCUMENTFUNCTIONPLUGINS

public static final String CONFIG_NODE_DOCUMENTFUNCTIONPLUGINS
configuration node name <DocumentFunctionPlugins>

See Also:
Constant Field Values

CONFIG_NODE_RECORDFUNCTIONPLUGINS

public static final String CONFIG_NODE_RECORDFUNCTIONPLUGINS
configuration node name <RecordFunctionPlugins>

See Also:
Constant Field Values

CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS

public static final String CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS
configuration node name <EnabledDocumentFunctions>

See Also:
Constant Field Values

CONFIG_NODE_SHOWFOLDERS

protected static final String CONFIG_NODE_SHOWFOLDERS
configuration node name "DisplayFoldersInResultList"

Since:
2.5.2.0
See Also:
Constant Field Values

CONFIG_NODE_USE_DYNAMIC_SPLIT

public static final String CONFIG_NODE_USE_DYNAMIC_SPLIT
The configuration element for dynamic split flag

Since:
3.1.0.0
See Also:
Constant Field Values

m_iMaxSize

protected int m_iMaxSize
max number of result items in a search


m_RootFolderObject

protected com.wewebu.ow.server.ecm.OwObject m_RootFolderObject
the current root folder object


m_SubFolderObject

protected com.wewebu.ow.server.ecm.OwObject m_SubFolderObject
the current open sub folder object


m_subFolderObjectParent

protected com.wewebu.ow.server.ecm.OwObject m_subFolderObjectParent
the parent of the current open sub folder object


m_strSubFolderPath

protected String m_strSubFolderPath
current open subfolder


m_ResultTreeView

protected com.wewebu.ow.server.ui.OwTreeView m_ResultTreeView
reference to the tree view


m_rulesList

protected List m_rulesList
Map of List of OwPriorityRule rules to be applied on records To be accessed via getRulesList().

Constructor Detail

OwRecordDocument

public OwRecordDocument()
Method Detail

enableSearchTemplateView

public void enableSearchTemplateView(boolean enablesearchtemplateview_p)
called from the search template view to signal that a valid search is available


isSearchTemplateViewEnabled

public boolean isSearchTemplateViewEnabled()
signal that a valid search is available and the view should be displayed


isPropertyPreviewViewEnabled

public boolean isPropertyPreviewViewEnabled()
signal that a the property preview should be displayed


getDefaultColumnInfo

protected Collection getDefaultColumnInfo()
                                   throws Exception
get the default column info for the child list if no column info is defined in the opened folder

Throws:
Exception

getSearchTemplate

public com.wewebu.ow.server.field.OwSearchTemplate getSearchTemplate()
                                                              throws Exception
get the optional searchtemplate to use or null if not defined

Throws:
Exception

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

createLayoutSettings

protected com.wewebu.ow.server.app.OwDynamicLayoutSettings createLayoutSettings()
                                                                         throws Exception
Create layout settings.

Returns:
the newly created object
Throws:
Exception
Since:
3.1.0.0

isDynamicSplitInUse

public boolean isDynamicSplitInUse()
                            throws Exception
Check if dynamic split is used.

Returns:
true if the dynamic split is used
Throws:
Exception
Since:
3.1.0.0

getMaxChildSize

public int getMaxChildSize()
get the maximum size for object children

Returns:
int max size to use for list items

setMaxChildSize

public void setMaxChildSize(int iMax_p)
set the maximum size for object children

Parameters:
iMax_p - int max child size

getCurrentRootFolder

public com.wewebu.ow.server.ecm.OwObject getCurrentRootFolder()
get the currently opened folder

Returns:
OwObject Current folder of null if not set

getCurrentSubFolderObject

public com.wewebu.ow.server.ecm.OwObject getCurrentSubFolderObject()
get the currently opened sub folder object

Returns:
OwObject Current sub folder object

getCurrentSubFolderObjectParent

public com.wewebu.ow.server.ecm.OwObject getCurrentSubFolderObjectParent()
Returns:
the Parent object of the current sub folder object
null if no parent is available

getCurrentSubFolderPath

public String getCurrentSubFolderPath()
get the currently opened sub folder path

Returns:
String Current sub folder path

getCurrentSubFolderDisplayPath

public String getCurrentSubFolderDisplayPath()
get the currently opened sub folder display path

Returns:
String Current sub folder path

openFolder

public void openFolder(com.wewebu.ow.server.ecm.OwObject folder_p,
                       String strSubFolderPath_p)
                throws Exception
open the specified folder in the plugin

Parameters:
folder_p - root folder OwObject to display
strSubFolderPath_p - String path that designates a subfolder to open, can be null to open the root
Throws:
Exception

setResultTreeView

public void setResultTreeView(com.wewebu.ow.server.ui.OwTreeView resultTreeView_p)
                       throws Exception
set the result tree view to be used by the record plugin

Parameters:
resultTreeView_p - OwObjectTreeView
Throws:
Exception

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 - Placeholder for optional parameter
param2_p - Placeholder for optional parameter
Returns:
Object depending on derived implementation
Throws:
Exception

onTreeViewNavigateFolder

public void onTreeViewNavigateFolder(com.wewebu.ow.server.ui.OwTreeView.OwTreeViewNode node_p)
                              throws Exception
implementation of OwTreeView.OwTreeViewEventListner: event called when a user opens a folder to display its document contents overridden from OwObjectTreeView.OwObjectTreeViewEventListner

Specified by:
onTreeViewNavigateFolder in interface com.wewebu.ow.server.ui.OwTreeView.OwTreeViewEventListner
Throws:
Exception

onTreeViewOpenFolder

public void onTreeViewOpenFolder(com.wewebu.ow.server.ui.OwTreeView.OwTreeViewNode node_p)
                          throws Exception
implementation of OwTreeView.OwTreeViewEventListner: event called when a user navigates through the tree (using plus minus icon), but does not open a folder overridden from OwObjectTreeView.OwObjectTreeViewEventListner

Specified by:
onTreeViewOpenFolder in interface com.wewebu.ow.server.ui.OwTreeView.OwTreeViewEventListner
Throws:
Exception

supportLock

public boolean supportLock()
is lock supported in plugin definition


update

public void update(com.wewebu.ow.server.ui.OwEventTarget caller_p,
                   int iCode_p,
                   Object param_p)
            throws Exception
causes all attached views to receive an onUpdate event

Overrides:
update in class com.wewebu.ow.server.ui.OwDocument
Parameters:
caller_p - OwEventTarget target that called update
iCode_p - int optional reason code
param_p - Object optional parameter representing the refresh, depends on the value of iCode_p, can be null
Throws:
Exception

collectFilterProperties

protected Collection<com.wewebu.ow.server.field.OwFieldDefinition> collectFilterProperties(Collection columnInfoList_p)
                                                                                    throws Exception
Create a filter properties collection which will be provided to the current OwObjectCollection.

Parameters:
columnInfoList_p - Collection of OwFieldColumnInfo representing the column which should be shown
Returns:
Collection of OwFieldDefinition
Throws:
Exception
Since:
3.2.0.0

checkValidSearchCriteria

protected boolean checkValidSearchCriteria()
(overridable) we must not send empty searches to the ECM system in order to prevent mass requests

Returns:
true = search is valid and can be submitted

onClientRefreshContextUpdate

public void onClientRefreshContextUpdate(int iReason_p,
                                         Object param_p)
                                  throws Exception
implementation of the OwFunction.OwFunctionRefreshContext interface Called from a plugin to inform its client and cause refresh of display data

Specified by:
onClientRefreshContextUpdate in interface com.wewebu.ow.server.app.OwClientRefreshContext
Parameters:
iReason_p - reason as defined with OwFunction.REFRESH_...
param_p - Object optional parameter representing the refresh, depends on the value of iReason_p, can be null
Throws:
Exception

onObjectListViewFilterChange

public void onObjectListViewFilterChange(com.wewebu.ow.server.field.OwSearchNode filterNode_p,
                                         com.wewebu.ow.server.ecm.OwObject parent_p)
                                  throws Exception
Specified by:
onObjectListViewFilterChange in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner
Throws:
Exception

onObjectListViewItemClick

public boolean onObjectListViewItemClick(com.wewebu.ow.server.ecm.OwObject obj_p)
                                  throws Exception
Specified by:
onObjectListViewItemClick in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner
Throws:
Exception

onObjectListViewSelect

public void onObjectListViewSelect(com.wewebu.ow.server.ecm.OwObject object_p,
                                   com.wewebu.ow.server.ecm.OwObject parent_p)
                            throws Exception
Specified by:
onObjectListViewSelect in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner
Throws:
Exception

onObjectListViewSort

public void onObjectListViewSort(com.wewebu.ow.server.field.OwSort newSort_p,
                                 String strSortProperty_p)
                          throws Exception
Specified by:
onObjectListViewSort in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner
Throws:
Exception

getDocumentFunctionPluginsNode

protected com.wewebu.ow.server.util.OwXMLUtil getDocumentFunctionPluginsNode()
                                                                      throws Exception
get the document function plugin definition node

Returns:
the document function plugin OwXMLUtil
Throws:
Exception

getRecordFunctionPluginsNode

protected com.wewebu.ow.server.util.OwXMLUtil getRecordFunctionPluginsNode()
                                                                    throws Exception
get the record function plugin definition node

Returns:
the record function plugin OwXMLUtil node
Throws:
Exception

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: OwRecordDocument.CONFIG_NODE_ENABLEDDOCUMENTFUNCTIONS

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

getIsPluginsEnabled

protected boolean getIsPluginsEnabled()
                               throws Exception
check if any function plugins are configured

Returns:
a boolean
Throws:
Exception

getFolderSortCriteria

protected com.wewebu.ow.server.field.OwSort getFolderSortCriteria()
Returns the folder sort criteria as defined in plugin description node.
Folder sort criteria can be defined via <FolderSortCriteria> tag in owplugins.xml.

If no criteria isn't defined the method will return an OwSort object with no OwSort.OwSortCriteria contained.

Returns:
sort criteria list with the defined sort criteria

getRulesList

protected List getRulesList()
                     throws Exception
One time priority rules read utility

Returns:
a list of OwPriorityRules
Throws:
Exception - if the priority rules cannot be created

onObjectListViewGetRowClassName

public String onObjectListViewGetRowClassName(int iIndex_p,
                                              com.wewebu.ow.server.ecm.OwObject obj_p)
get the style class name for the row

Specified by:
onObjectListViewGetRowClassName in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectListView.OwObjectListViewEventListner
Parameters:
iIndex_p - int row index
obj_p - current OwObject
Returns:
String with style class name, or null to use default

showFolderInResultList

protected boolean showFolderInResultList()
Flag which is used to verify, if folders should be shown in result list or not.

Returns:
boolean (by default false)
Since:
2.5.2.0

getTreeViewId

public String getTreeViewId()
Get the id of the configured OwTreeView object.

Returns:
- the id of the configured OwTreeView object.
Since:
3.1.0.0

getLayoutSettings

public com.wewebu.ow.server.app.OwDynamicLayoutSettings getLayoutSettings()
Get the OwDynamicLayoutSettings instance.

Returns:
the OwDynamicLayoutSettings instance.
Since:
3.1.0.0

createFilterOperatorHelper

protected OwRecordFilterOperatorHelper createFilterOperatorHelper()
(overridable) Factory method to create an instance of a FilterOperatorHelper.

Returns:
OwRecordFilterOperatorHelper
Since:
3.2.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.