com.wewebu.ow.server.app
Class OwEcmUtil

java.lang.Object
  extended by com.wewebu.ow.server.app.OwEcmUtil

public class OwEcmUtil
extends Object

Utility functions for working with the 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


Nested Class Summary
static class OwEcmUtil.OwParentPathInfo
          Returned item from the function getParentPathOfClass(OwObject obj_p, Collection classNames_p)
static class OwEcmUtil.OwSimpleSearchClause
           A simple search clause tuple.
 
Constructor Summary
OwEcmUtil()
           
 
Method Summary
static OwObject createObjectFromString(OwMainAppContext context_p, String strObject_p)
          creates a OwObject from a string.
static OwObject createSafeSubFolder(OwMainAppContext context_p, OwObject baseFolder_p, String strName_p)
          creates a simple subfolder using the default folder class from bootstrap checks if folder exits already
static OwSearchObjectStore createSearchStore(String objectStoreId_p, String objectStoreName_p)
          Creates a OwSearchObjectStore object with the given parameters.
static OwSearchNode createSimpleSearchNode(int objectType_p, OwSearchObjectStore searchObjectStore_p, String strClassName_p, String strResourceName_p, String rootpath_p, OwEcmUtil.OwSimpleSearchClause[] clauses_p, OwFieldDefinitionProvider fielddefinitionprovider_p)
          create a simple search node from a array of property values
static OwSearchNode createSimpleSearchNode(int objectType_p, OwSearchObjectStore searchObjectStore_p, String strClassName_p, String strResourceName_p, String rootpath_p, OwEcmUtil.OwSimpleSearchClause[] clauses_p, OwFieldDefinitionProvider fielddefinitionprovider_p, boolean searchSubFolders_p)
          create a simple search node from a array of property values
static OwSearchNode createSimpleSearchNode(int objectType_p, String strClassName_p, String strResourceName_p, String rootpath_p, OwEcmUtil.OwSimpleSearchClause[] clauses_p, OwFieldDefinitionProvider fielddefinitionprovider_p)
          create a simple search node from a array of property values
static OwSearchNode createSimpleSearchNode(String strClassName_p, String strResourceName_p, String rootpath_p, OwEcmUtil.OwSimpleSearchClause[] clauses_p, OwFieldDefinitionProvider fielddefinitionprovider_p)
          create a simple search node from a array of property values
static OwObjectCollection doSimpleSearch(String strClassName_p, String strResourceName_p, String rootpath_p, OwEcmUtil.OwSimpleSearchClause[] clauses_p, OwRepository repository_p, OwSort sort_p, Collection propertynames_p, int iMaxSize_p, int iVersionSelection_p)
          perform a simple search from a array of property values
static List getParentPathOfClass(OwObject obj_p, Collection classNames_p)
          get a collection of parents with paths for an object, which are of the specified classname used to find the records a object is filed in NOTE: The function will not just search the next parents, but the whole path of parents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwEcmUtil

public OwEcmUtil()
Method Detail

createSimpleSearchNode

public static OwSearchNode createSimpleSearchNode(String strClassName_p,
                                                  String strResourceName_p,
                                                  String rootpath_p,
                                                  OwEcmUtil.OwSimpleSearchClause[] clauses_p,
                                                  OwFieldDefinitionProvider fielddefinitionprovider_p)
                                           throws Exception
create a simple search node from a array of property values

Parameters:
strClassName_p - the objectclass to search for
strResourceName_p - the resource to search in, can be null to search the default resource
rootpath_p - the root path to search in, can be null to search all object's
clauses_p - an array of values operators and criteria names to apply to the search
fielddefinitionprovider_p - the field definition provider to resolve the properties
Returns:
OwSearchNode the created search node that can be submitted to a repository doSearch method
Throws:
Exception

createSimpleSearchNode

public static OwSearchNode createSimpleSearchNode(int objectType_p,
                                                  String strClassName_p,
                                                  String strResourceName_p,
                                                  String rootpath_p,
                                                  OwEcmUtil.OwSimpleSearchClause[] clauses_p,
                                                  OwFieldDefinitionProvider fielddefinitionprovider_p)
                                           throws Exception
create a simple search node from a array of property values

Parameters:
strClassName_p - the object class to search for
strResourceName_p - the resource to search in, can be null to search the default resource
rootpath_p - the root path to search in, can be null to search all object's
clauses_p - an array of values operators and criteria names to apply to the search
fielddefinitionprovider_p - the field definition provider to resolve the properties
objectType_p - - object type, as defined in OwObjectReference class.
Returns:
OwSearchNode the created search node that can be submitted to a repository doSearch method
Throws:
Exception
Since:
3.0.0.0

createSimpleSearchNode

public static OwSearchNode createSimpleSearchNode(int objectType_p,
                                                  OwSearchObjectStore searchObjectStore_p,
                                                  String strClassName_p,
                                                  String strResourceName_p,
                                                  String rootpath_p,
                                                  OwEcmUtil.OwSimpleSearchClause[] clauses_p,
                                                  OwFieldDefinitionProvider fielddefinitionprovider_p)
                                           throws Exception
create a simple search node from a array of property values

Parameters:
searchObjectStore_p - - the search object store.
strClassName_p - the object class to search for
strResourceName_p - the resource to search in, can be null to search the default resource
rootpath_p - the root path to search in, can be null to search all object's
clauses_p - an array of values operators and criteria names to apply to the search
fielddefinitionprovider_p - the field definition provider to resolve the properties
objectType_p - - object type, as defined in OwObjectReference class.
Returns:
OwSearchNode the created search node that can be submitted to a repository doSearch method
Throws:
Exception
Since:
3.0.0.0

createSimpleSearchNode

public static OwSearchNode createSimpleSearchNode(int objectType_p,
                                                  OwSearchObjectStore searchObjectStore_p,
                                                  String strClassName_p,
                                                  String strResourceName_p,
                                                  String rootpath_p,
                                                  OwEcmUtil.OwSimpleSearchClause[] clauses_p,
                                                  OwFieldDefinitionProvider fielddefinitionprovider_p,
                                                  boolean searchSubFolders_p)
                                           throws Exception
create a simple search node from a array of property values

Parameters:
searchObjectStore_p - - the search object store.
strClassName_p - the object class to search for
strResourceName_p - the resource to search in, can be null to search the default resource
rootpath_p - the root path to search in, can be null to search all object's
clauses_p - an array of values operators and criteria names to apply to the search
fielddefinitionprovider_p - the field definition provider to resolve the properties
objectType_p - - object type, as defined in OwObjectReference class.
searchSubFolders_p - - if true the subfolders are included in search path
Returns:
OwSearchNode the created search node that can be submitted to a repository doSearch method
Throws:
Exception
Since:
3.0.0.0

createSearchStore

public static OwSearchObjectStore createSearchStore(String objectStoreId_p,
                                                    String objectStoreName_p)
Creates a OwSearchObjectStore object with the given parameters.

Parameters:
objectStoreName_p - - the name of object store.
objectStoreId_p - - the id of object store.
Returns:
the newly created OwSearchObjectStore object.
Since:
3.0.0.0

doSimpleSearch

public static OwObjectCollection doSimpleSearch(String strClassName_p,
                                                String strResourceName_p,
                                                String rootpath_p,
                                                OwEcmUtil.OwSimpleSearchClause[] clauses_p,
                                                OwRepository repository_p,
                                                OwSort sort_p,
                                                Collection propertynames_p,
                                                int iMaxSize_p,
                                                int iVersionSelection_p)
                                         throws Exception
perform a simple search from a array of property values

Parameters:
strClassName_p - the object class to search for
strResourceName_p - the resource to search in, can be null to search the default resource
rootpath_p - the root path to search in, can be null to search all object's
clauses_p - an array of values operators and criteria names to apply to the search
repository_p - OwRepository the repository to search in
sort_p - the sort to apply, can be null
propertynames_p - the column properties to retrieve, can be null
iMaxSize_p - the max size of returned objects
iVersionSelection_p - int Selects the versions as defined in OwSearchTemplate.VERSION_SELECT_... or (OwSearchTemplate.VERSION_SELECT_DEFAULT or 0) to use default version
Returns:
OwObjectCollection
Throws:
Exception

createObjectFromString

public static OwObject createObjectFromString(OwMainAppContext context_p,
                                              String strObject_p)
                                       throws Exception
creates a OwObject from a string. Uses either a pathname or a dmsid. Useful when working with XML configuration to set a predefined object.

Throws:
Exception

createSafeSubFolder

public static OwObject createSafeSubFolder(OwMainAppContext context_p,
                                           OwObject baseFolder_p,
                                           String strName_p)
                                    throws Exception
creates a simple subfolder using the default folder class from bootstrap checks if folder exits already

Parameters:
context_p - OwMainAppContext instance
baseFolder_p - OwObject where subfolder should be created
strName_p - String name of new subfolder
Returns:
OwObject new folder
Throws:
Exception

getParentPathOfClass

public static List getParentPathOfClass(OwObject obj_p,
                                        Collection classNames_p)
                                 throws Exception
get a collection of parents with paths for an object, which are of the specified classname used to find the records a object is filed in NOTE: The function will not just search the next parents, but the whole path of parents.

Parameters:
obj_p - to find parents for
classNames_p - Collection of classnames which must match the parents
Returns:
List of OwParentPathInfo
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.