com.wewebu.ow.server.historyimpl.simplehistory
Class OwSimpleHistoryManager

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

public class OwSimpleHistoryManager
extends OwStandardHistoryManager

Simple implementation for the history manager, does not create a history.

To be implemented with the specific ECM system.

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 DMS_PREFIX
          DMS prefix to identify this adapter
 
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
OwSimpleHistoryManager()
           
 
Method Summary
 void addEvent(int iEventType_p, String strEventID_p, int iStatus_p)
          add a new history event to the history database if supported by the historymanager
 void addEvent(int iEventType_p, String strEventID_p, OwEvent event_p, int iStatus_p)
          add a new history event to the history database if supported by the historymanager
 boolean canBatch()
          check if repository supports batch operations
 boolean canRefreshStaticClassdescriptions()
          check if reload of all the static class description data is supported / necessary.
 void closeBatch(OwBatch batch_p)
          close a batch operation, if the batch was not committed, rollback the batch
 OwObjectCollection doObjectSearch(OwObjectReference object_p, OwSearchNode filterCriteria_p, OwSort sortCriteria_p, Collection propertyNames_p, int[] includeSubObjectTypes_p, int iMaxSize_p)
          search for entries in the database for a specific ECM object
 OwObjectCollection doSearch(OwSearchNode filterCriteria_p, OwSort sortCriteria_p, Collection propertyNames_p, int iMaxSize_p, int iVersionSelection_p)
          search for entries in the database
 String getDMSPrefix()
          get a prefix which is used to distinguish the DMSID of objects from the repository
 OwEventManager getEventManager()
          get the instance of the history manager
 OwFieldDefinition getFieldDefinition(String strFieldDefinitionName_p, String strResourceName_p)
          get a field definition for the given name and resource
 OwObjectClass getObjectClass(String strClassName_p, OwResource resource_p)
          get a Property class description of the available object class descriptions
 Map getObjectClassNames(int[] iTypes_p, boolean fExcludeHiddenAndNonInstantiable_p, boolean fRootOnly_p, OwResource resource_p)
          get a list of the available object class descriptions names
 OwObject getObjectFromDMSID(String strDMSID_p, boolean fRefresh_p)
          reconstructs an Object from ECM Id, see OwObject.getDMSID for details.
 OwObject getObjectFromPath(String strPath_p, boolean fRefresh_p)
          get object from given path
 OwResource getResource(String strID_p)
          get the resource with the specified key
 Iterator getResourceIDs()
          get a Iterator of available resource IDs
 Collection getWildCardDefinitions(String strFieldDefinitionName_p, String strResourceName_p, int iOp_p)
          get a collection of wild card definitions that are allowed for the given field, resource and search operator
 OwBatch openBatch()
          open a new batch operation
 void refreshStaticClassdescriptions()
          force the network adapter to reload all the static class description data.
 void releaseResources()
          releases all resources that have been used during this session
 
Methods inherited from class com.wewebu.ow.server.history.OwStandardHistoryManager
addEventIDDisplayString, getConfigNode, getContext, getDMSIdsFromEvent, getEventIDDisplayName, getEventIDs, getEventStatusEnum, getEventTypeEnum, getNetwork, init, setNetwork
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DMS_PREFIX

public static final String DMS_PREFIX
DMS prefix to identify this adapter

See Also:
Constant Field Values
Constructor Detail

OwSimpleHistoryManager

public OwSimpleHistoryManager()
Method Detail

addEvent

public void addEvent(int iEventType_p,
                     String strEventID_p,
                     OwEvent event_p,
                     int iStatus_p)
              throws Exception
add a new history event to the history database if supported by the historymanager

Specified by:
addEvent in interface OwEventManager
Overrides:
addEvent in class OwStandardHistoryManager
Parameters:
iEventType_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 - OwHistoryEvent according to iEventType_p, contains additional information, such as the affected Objects or properties
iStatus_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)

addEvent

public void addEvent(int iEventType_p,
                     String strEventID_p,
                     int iStatus_p)
              throws Exception
add a new history event to the history database if supported by the historymanager

Parameters:
iEventType_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
iStatus_p - int as defined in OwHistoryManager.HISTORY_STATUS_...
Throws:
Exception

doSearch

public OwObjectCollection doSearch(OwSearchNode filterCriteria_p,
                                   OwSort sortCriteria_p,
                                   Collection propertyNames_p,
                                   int iMaxSize_p,
                                   int iVersionSelection_p)
                            throws Exception
search for entries in the database

Parameters:
filterCriteria_p - OwSearchNode to refine the search or null to retrieve all entries
sortCriteria_p - OwSort to apply
propertyNames_p - Collection of properties to retrieve with the history entries
iMaxSize_p - max size of entries to retrieve
iVersionSelection_p - int Selects the versions as defined in OwSearchTemplate.VERSION_SELECT_... or 0 to use default version
Returns:
Collection of OwHistoryEntry
Throws:
Exception

doObjectSearch

public OwObjectCollection doObjectSearch(OwObjectReference object_p,
                                         OwSearchNode filterCriteria_p,
                                         OwSort sortCriteria_p,
                                         Collection propertyNames_p,
                                         int[] includeSubObjectTypes_p,
                                         int iMaxSize_p)
                                  throws Exception
search for entries in the database for a specific ECM object

Specified by:
doObjectSearch in interface OwHistoryManager
Overrides:
doObjectSearch in class OwStandardHistoryManager
Parameters:
object_p - OwObject to find entries for
filterCriteria_p - OwSearchNode to refine the search or null to retrieve all entries
sortCriteria_p - OwSort to apply
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
iMaxSize_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)

getFieldDefinition

public OwFieldDefinition getFieldDefinition(String strFieldDefinitionName_p,
                                            String strResourceName_p)
                                     throws Exception,
                                            OwObjectNotFoundException
get a field definition for the given name and resource

Parameters:
strFieldDefinitionName_p - Name of the field definition class
strResourceName_p - optional name of the resource if there are several different resources for field definitions, can be null
Returns:
OwFieldDefinition or throws OwObjectNotFoundException
Throws:
Exception
OwObjectNotFoundException

getObjectFromDMSID

public OwObject getObjectFromDMSID(String strDMSID_p,
                                   boolean fRefresh_p)
                            throws Exception
reconstructs an Object from ECM Id, see OwObject.getDMSID for details.

Parameters:
strDMSID_p - ECM ID for the requested object
fRefresh_p - true = force refresh of object from ECM System, false = may use cached object
Returns:
an Object Instance
Throws:
Exception

getObjectFromPath

public OwObject getObjectFromPath(String strPath_p,
                                  boolean fRefresh_p)
                           throws Exception
get object from given path

Parameters:
strPath_p - path to the object starting with "/..."
fRefresh_p - true = force refresh of object from ECM System, false = may use cached object
Returns:
OwObject
Throws:
Exception

getObjectClass

public OwObjectClass getObjectClass(String strClassName_p,
                                    OwResource resource_p)
                             throws Exception
get a Property class description of the available object class descriptions

Parameters:
strClassName_p - Name of class
resource_p - OwResource to retrieve the objects from, or null to use the default resource
Returns:
OwObjectClass instance
Throws:
Exception

getObjectClassNames

public Map getObjectClassNames(int[] iTypes_p,
                               boolean fExcludeHiddenAndNonInstantiable_p,
                               boolean fRootOnly_p,
                               OwResource resource_p)
                        throws Exception
get a list of the available object class descriptions names

Parameters:
iTypes_p - int array of Object types as defined in OwObject, of null to retrieve all class names
fExcludeHiddenAndNonInstantiable_p - boolean true = exclude all hidden and non instantiable class descriptions
fRootOnly_p - true = gets only the root classes if we deal with a class tree, false = gets all classes
resource_p - OwResource to retrieve the objects from, or null to use the default resource
Returns:
string array of OwObjectClass Names
Throws:
Exception

getResource

public OwResource getResource(String strID_p)
                       throws Exception
get the resource with the specified key

Parameters:
strID_p - String resource ID, if strID_p is null, returns the default resource
Returns:
OwResource
Throws:
Exception

getResourceIDs

public Iterator getResourceIDs()
                        throws Exception
get a Iterator of available resource IDs

Returns:
Collection of resource IDs used in getResource, or null if no resources are available
Throws:
Exception

getEventManager

public OwEventManager getEventManager()
get the instance of the history manager


refreshStaticClassdescriptions

public void refreshStaticClassdescriptions()
                                    throws Exception
force the network adapter to reload all the static class description data.

Throws:
Exception

canRefreshStaticClassdescriptions

public boolean canRefreshStaticClassdescriptions()
                                          throws Exception
check if reload of all the static class description data is supported / necessary.

Returns:
boolean true = refresh is supported and should be done, false = refresh is not supported and not necessary.
Throws:
Exception

getDMSPrefix

public String getDMSPrefix()
get a prefix which is used to distinguish the DMSID of objects from the repository


releaseResources

public void releaseResources()
                      throws Exception
releases all resources that have been used during this session

Throws:
Exception

getWildCardDefinitions

public Collection getWildCardDefinitions(String strFieldDefinitionName_p,
                                         String strResourceName_p,
                                         int iOp_p)
                                  throws Exception
get a collection of wild card definitions that are allowed for the given field, resource and search operator

Parameters:
strFieldDefinitionName_p - Name of the field definition class
strResourceName_p - optional name of the resource if there are several different resources for field definitions, can be null
iOp_p - search operator as defined in OwSearchOperator CRIT_OP_...
Returns:
Collection of OwWildCardDefinition, or null if no wildcards are defined
Throws:
Exception

canBatch

public boolean canBatch()
Description copied from interface: OwRepository
check if repository supports batch operations

Returns:
true if repository supports batch operations, false otherwise
See Also:
OwRepository.openBatch(), OwRepository.closeBatch(OwBatch)

closeBatch

public void closeBatch(OwBatch batch_p)
                throws OwInvalidOperationException
Description copied from interface: OwRepository
close a batch operation, if the batch was not committed, rollback the batch

Throws:
OwInvalidOperationException
See Also:
OwRepository.canBatch(), OwRepository.openBatch()

openBatch

public OwBatch openBatch()
                  throws OwInvalidOperationException
Description copied from interface: OwRepository
open a new batch operation

Returns:
OwBatch operator
Throws:
OwInvalidOperationException
See Also:
OwRepository.canBatch(), OwRepository.closeBatch(OwBatch)


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.