com.wewebu.ow.server.history
Class OwStandardHistoryManager

java.lang.Object
  extended by com.wewebu.ow.server.history.OwStandardHistoryManager
All Implemented Interfaces:
OwRepository, OwEventManager, OwFieldDefinitionProvider, OwHistoryManager
Direct Known Subclasses:
OwSimpleHistoryManager

public abstract class OwStandardHistoryManager
extends Object
implements OwHistoryManager

Base implementation for history managers to collect and retrieve history information.
History Events are collected both in the EcmAdapter and in the Workdesk itself.
Most ECM Systems will write their own history and so the history manager needs only to read that information. If the ECM System does not write a history, then the Adapter needs to write events to a database and the history manager needs to read the events there.
For Workdesk events such as a clicked plugin the addEntry function needs to be implemented and the event needs to be written to a database.

To be implemented with the specific ECM system.

You get a instance of the HistoryManager by calling getContext().getHistoryManager().

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
 
Fields inherited from interface com.wewebu.ow.server.event.OwEventManager
HISTORY_EVENT_ID_COPY_OBJECT, HISTORY_EVENT_ID_DOWNLOAD, HISTORY_EVENT_ID_LOGIN, HISTORY_EVENT_ID_LOGOFF, HISTORY_EVENT_ID_NEW_OBJECT, HISTORY_EVENT_ID_OBJECT_ADD, HISTORY_EVENT_ID_OBJECT_CANCELCHECKOUT, HISTORY_EVENT_ID_OBJECT_CHECKIN, HISTORY_EVENT_ID_OBJECT_CHECKOUT, HISTORY_EVENT_ID_OBJECT_DELETE, HISTORY_EVENT_ID_OBJECT_DEMOTE, HISTORY_EVENT_ID_OBJECT_DISPATCH, HISTORY_EVENT_ID_OBJECT_GENERIC, HISTORY_EVENT_ID_OBJECT_LOCK, HISTORY_EVENT_ID_OBJECT_MODIFY_ANNOTATIONS, HISTORY_EVENT_ID_OBJECT_MODIFY_PERMISSIONS, HISTORY_EVENT_ID_OBJECT_MODIFY_PROPERTIES, HISTORY_EVENT_ID_OBJECT_MOVE, HISTORY_EVENT_ID_OBJECT_PROMOTE, HISTORY_EVENT_ID_OBJECT_REMOVE_REF, HISTORY_EVENT_ID_OBJECT_RESUBMIT, HISTORY_EVENT_ID_OBJECT_RETURN_TO_SOURCE, HISTORY_EVENT_ID_SEARCH, HISTORY_EVENT_ID_UPLOAD, HISTORY_EVENT_TYPE_CLEAR_SESSION_HISTORY_FOR_OBJECT, HISTORY_EVENT_TYPE_ECM, HISTORY_EVENT_TYPE_GENERIC, HISTORY_EVENT_TYPE_OBJECT, HISTORY_EVENT_TYPE_PLUGIN_DSPATCH, HISTORY_EVENT_TYPE_PLUGIN_INVOKE_EDIT, HISTORY_EVENT_TYPE_PLUGIN_INVOKE_UI, HISTORY_EVENT_TYPE_PLUGIN_INVOKE_VIEW, HISTORY_EVENT_TYPE_PROPERTY, HISTORY_EVENT_TYPE_VERSION, HISTORY_STATUS_BEGIN, HISTORY_STATUS_CANCEL, HISTORY_STATUS_DISABLED, HISTORY_STATUS_FAILED, HISTORY_STATUS_OK
 
Constructor Summary
OwStandardHistoryManager()
           
 
Method Summary
 void addEvent(int eventType_p, String strEventID_p, OwEvent event_p, int status_p)
          add a new history event to the history database if supported by the historymanager
static void addEventIDDisplayString(String id_p, OwString displaystring_p)
          add a string to the static map
 OwObjectCollection doObjectSearch(OwObjectReference object_p, OwSearchNode filterCriteria_p, OwSort sortCriteria_p, Collection propertyNames_p, int[] includeSubObjectTypes_p, int maxSize_p)
          Search for in memory history entries.
protected  OwXMLUtil getConfigNode()
          get configuration node with XML config information
 OwHistoryManagerContext getContext()
          get the application context
protected  List getDMSIdsFromEvent(OwEvent event_p)
          Create a list of object DMSIDs affected by this event.
static String getEventIDDisplayName(Locale locale_p, String strEventID_p)
          get displayname for given predefined event ID as defined in HISTORY_EVENT_ID_...
static Collection getEventIDs()
          get the predefined event IDs
static OwEnumCollection getEventStatusEnum()
          get a OwEnum enumerator for Combobox selection
static OwEnumCollection getEventTypeEnum()
          get a OwEnum enumerator for Combobox selection
 OwNetwork getNetwork()
          get a reference to the network adapter
 void init(OwHistoryManagerContext mainContext_p, OwXMLUtil configNode_p)
          init the manager, set context
 void setNetwork(OwNetwork network_p)
          set a reference to the network adapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.wewebu.ow.server.event.OwEventManager
addEvent
 
Methods inherited from interface com.wewebu.ow.server.ecm.OwRepository
canBatch, canRefreshStaticClassdescriptions, closeBatch, doSearch, getDMSPrefix, getEventManager, getObjectClass, getObjectClassNames, getObjectFromDMSID, getObjectFromPath, getResource, getResourceIDs, openBatch, refreshStaticClassdescriptions, releaseResources
 
Methods inherited from interface com.wewebu.ow.server.field.OwFieldDefinitionProvider
getFieldDefinition, getWildCardDefinitions
 

Constructor Detail

OwStandardHistoryManager

public OwStandardHistoryManager()
Method Detail

addEventIDDisplayString

public static void addEventIDDisplayString(String id_p,
                                           OwString displaystring_p)
add a string to the static map

Parameters:
id_p -
displaystring_p -
Since:
2.5.2.0

getEventIDDisplayName

public static String getEventIDDisplayName(Locale locale_p,
                                           String strEventID_p)
get displayname for given predefined event ID as defined in HISTORY_EVENT_ID_...


getEventIDs

public static Collection getEventIDs()
get the predefined event IDs


getEventTypeEnum

public static OwEnumCollection getEventTypeEnum()
get a OwEnum enumerator for Combobox selection


getEventStatusEnum

public static OwEnumCollection getEventStatusEnum()
get a OwEnum enumerator for Combobox selection


getConfigNode

protected OwXMLUtil getConfigNode()
get configuration node with XML config information


getContext

public OwHistoryManagerContext getContext()
get the application context

Returns:
OwMainAppContext

init

public void init(OwHistoryManagerContext mainContext_p,
                 OwXMLUtil configNode_p)
          throws Exception
init the manager, set context

Specified by:
init in interface OwHistoryManager
Parameters:
configNode_p - OwXMLUtil node with configuration information
mainContext_p - reference to the main app context of the application
Throws:
Exception

setNetwork

public void setNetwork(OwNetwork network_p)
set a reference to the network adapter

Specified by:
setNetwork in interface OwHistoryManager
Parameters:
network_p - OwNetwork

getNetwork

public OwNetwork getNetwork()
get a reference to the network adapter

Returns:
OwNetwork

doObjectSearch

public OwObjectCollection doObjectSearch(OwObjectReference object_p,
                                         OwSearchNode filterCriteria_p,
                                         OwSort sortCriteria_p,
                                         Collection propertyNames_p,
                                         int[] includeSubObjectTypes_p,
                                         int maxSize_p)
                                  throws Exception
Search for in memory history entries.

Specified by:
doObjectSearch in interface OwHistoryManager
Parameters:
object_p - OwObjectReference to find entries for
filterCriteria_p - OwSearchNode to refine the search or null to retrieve all entries
sortCriteria_p - OwSort to apply, or null
propertyNames_p - Collection of properties to retrieve with the history entries
includeSubObjectTypes_p - array of child OwObject types to be included in history, or null
maxSize_p - max size of entries to retrieve
Returns:
Collection of OwHistoryEntry
Throws:
Exception
See Also:
OwHistoryManager.doObjectSearch(com.wewebu.ow.server.ecm.OwObjectReference, com.wewebu.ow.server.field.OwSearchNode, com.wewebu.ow.server.field.OwSort, java.util.Collection, int[], int)

addEvent

public void addEvent(int eventType_p,
                     String strEventID_p,
                     OwEvent event_p,
                     int status_p)
              throws Exception
Description copied from interface: OwEventManager
add a new history event to the history database if supported by the historymanager

Specified by:
addEvent in interface OwEventManager
Parameters:
eventType_p - int type of event as defined in OwHistoryManager.HISTORY_EVENT_TYPE_...
strEventID_p - Id of event such as a plugin id, can be null
event_p - OwEvent according to iEventType_p, contains additional information, such as the affected Objects or properties
status_p - int as defined in OwHistoryManager.HISTORY_STATUS_...
Throws:
Exception
See Also:
OwEventManager.addEvent(int, java.lang.String, com.wewebu.ow.server.event.OwEvent, int)

getDMSIdsFromEvent

protected List getDMSIdsFromEvent(OwEvent event_p)
                           throws Exception
Create a list of object DMSIDs affected by this event. The delete event is ignored.

Parameters:
event_p - - the event.
Returns:
java.util.List - a list of DMSID affected by the given event.
Throws:
Exception
Since:
2.5.2.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.