public class DmsUtils extends Object
DocumentManagementService| Constructor and Description |
|---|
DmsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static ZipOutputStream |
backupToZipFile(Folder rootFolder,
OutputStream outputStream,
DocumentManagementService documentManagementService,
boolean ignoreEmptyFolders,
String partitionId)
Backup a folder to a zip stream
|
static void |
cleanupFolder(Folder parentFolder,
DocumentManagementService documentManagementService) |
static String |
composeDefaultPath(long scopeProcessInstanceOID,
Date scopeProcessInstanceStartTime)
Initialize default path based on the scope process instance OID and its start time.
|
static String |
composeDefaultPath(long activityInstanceOID,
long scopeProcessInstanceOID,
Date scopeProcessInstanceStartTime)
Initialize default path based on the activity instance OID, scope process instance OID and its start time.
|
static DocumentInfo |
createDocumentInfo(String name)
Creates a new
DocumentInfo object that can be filled with additional
information. |
static DocumentInfo |
createDocumentInfo(String name,
String id)
Creates a new
DocumentInfo object that can be filled with additional
information. |
static FolderInfo |
createFolderInfo(String name)
Creates a new
FolderInfo object that can be filled with additional
information. |
static Folder |
ensureFolderHierarchyExists(String folderPath,
DocumentManagementService dms) |
static Long |
getActivityInstanceOid(Resource resource)
Retrieves the activity instance oid from a
Resource path. |
static Document |
getDocument(List documents,
String id) |
static Long |
getProcessInstanceOid(Resource resource)
Retrieves the process instance oid from a
Resource path. |
static void |
loadFromZipFile(String rootFolderPath,
InputStream inputStream,
DocumentManagementService documentManagementService,
boolean ignoreEmptyFolders)
Load a folder from an inputStream
|
static void |
removeDocument(List documents,
String id) |
public static DocumentInfo createDocumentInfo(String name)
DocumentInfo object that can be filled with additional
information.name - the document namepublic static DocumentInfo createDocumentInfo(String name, String id)
DocumentInfo object that can be filled with additional
information. This method allows assigning the document ID for the case where no DMS
backend is used (the caller must ensure the uniqueness of IDs)name - the document nameid - id of the documentpublic static FolderInfo createFolderInfo(String name)
FolderInfo object that can be filled with additional
information.name - the folder namepublic static String composeDefaultPath(long scopeProcessInstanceOID, Date scopeProcessInstanceStartTime)
scopeProcessInstanceStartTime - scopeProcessInstanceOID - public static String composeDefaultPath(long activityInstanceOID, long scopeProcessInstanceOID, Date scopeProcessInstanceStartTime)
activityInstanceOID - scopeProcessInstanceStartTime - scopeProcessInstanceOID - public static Long getActivityInstanceOid(Resource resource)
Resource path.resource - with ai-oid in pathcomposeDefaultPath(long, long, Date)public static Long getProcessInstanceOid(Resource resource)
Resource path.resource - with pi-oid in pathcomposeDefaultPath(long, Date),
composeDefaultPath(long, long, Date)public static ZipOutputStream backupToZipFile(Folder rootFolder, OutputStream outputStream, DocumentManagementService documentManagementService, boolean ignoreEmptyFolders, String partitionId) throws Exception
rootFolder - folder to backupoutputStream - the stream to use for ZipOutputStreamdocumentManagementService - ignoreEmptyFolders - option to not backup empty folderspartitionId - used for zip commentExceptionpublic static void loadFromZipFile(String rootFolderPath, InputStream inputStream, DocumentManagementService documentManagementService, boolean ignoreEmptyFolders) throws Exception
rootFolderPath - loaded data is saved to this repository pathinputStream - the stream is used to create a new ZipInputStreamdocumentManagementService - ignoreEmptyFolders - option to not create empty folders that exist in the zip streamExceptionpublic static void cleanupFolder(Folder parentFolder, DocumentManagementService documentManagementService)
public static Folder ensureFolderHierarchyExists(String folderPath, DocumentManagementService dms)
Copyright © 2016 Eclipse Stardust. All Rights Reserved.