Package com.logicaldoc.workflow.template
Interface WorkflowTemplateDAO
-
- All Superinterfaces:
com.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>
- All Known Implementing Classes:
HibernateWorkflowTemplateDAO
public interface WorkflowTemplateDAO extends com.logicaldoc.core.PersistentObjectDAO<WorkflowTemplate>
DAO for Persistent WorkFlow Templates handling.- Since:
- 5.0
- Author:
- Sebastian Wenzky, Matteo Caruso - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkflowTemplate
createFromFile(File file)
De-serialize a template from a fileWorkflowTemplate
deploy(WorkflowTemplate workflowTemplate)
This method deploys the given persistence workflow template that is it copies the draft scheme in the currently used scheme and produces a new version.List<WorkflowTemplate>
findAll(long tenantId, Long userId)
This method loads all the workflowsList<WorkflowTemplate>
findAllByName(long tenantId, String name)
This method finds all the workflow templates by nameList<WorkflowTemplate>
findAllDeployed(Long tenantId, Long userId)
This method loads all the workflows already deployedWorkflowTemplate
findByName(long tenantId, String name)
This method finds a workflow template by name (the latest version is returned)WorkflowTemplate
findByNameAndVersion(long tenantId, String name, int version)
This method finds a workflow template by name (the latest version is returned)WorkflowTemplate
findLastDeployed(long tenantId, String name)
This method finds a deployed workflow template by name (the latest deployed version is returned)Set<com.logicaldoc.core.security.Permission>
getEnabledPermissions(long workflowId, long userId)
Finds all permissions of a user enabled on the specified workflowboolean
isReadEnable(long id, long userId)
This method is looking up for read rights for a workflow and an userboolean
isWriteEnable(long id, long userId)
Returns if a workflow is writeable for a userWorkflowTemplate
storeNewVersion(WorkflowTemplate workflowTemplate)
Saves the passed workflow as a new version-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
deploy
WorkflowTemplate deploy(WorkflowTemplate workflowTemplate) throws com.logicaldoc.core.PersistenceException
This method deploys the given persistence workflow template that is it copies the draft scheme in the currently used scheme and produces a new version.- Parameters:
workflowTemplate
- The persistence workflow template- Returns:
- the next version of the template
- Throws:
com.logicaldoc.core.PersistenceException
- error in the database
-
storeNewVersion
WorkflowTemplate storeNewVersion(WorkflowTemplate workflowTemplate) throws com.logicaldoc.core.PersistenceException
Saves the passed workflow as a new version- Parameters:
workflowTemplate
- The persistence workflow template- Returns:
- the next version of the template
- Throws:
com.logicaldoc.core.PersistenceException
- error in the database
-
findAllDeployed
List<WorkflowTemplate> findAllDeployed(Long tenantId, Long userId)
This method loads all the workflows already deployed- Parameters:
tenantId
- optional tenant specificationuserId
- optional user specification- Returns:
- list of persistence workflow template
-
findAll
List<WorkflowTemplate> findAll(long tenantId, Long userId)
This method loads all the workflows- Parameters:
tenantId
- tenant specificationuserId
- optional user specification- Returns:
- list of persistence workflow template
-
findByName
WorkflowTemplate findByName(long tenantId, String name)
This method finds a workflow template by name (the latest version is returned)- Parameters:
tenantId
- identifier of the tenantname
- name of the workflow template- Returns:
WorkflowTemplate
with given name, latest version
-
findLastDeployed
WorkflowTemplate findLastDeployed(long tenantId, String name)
This method finds a deployed workflow template by name (the latest deployed version is returned)- Parameters:
tenantId
- identifier of the tenantname
- name of the workflow template- Returns:
WorkflowTemplate
with given name, latest version
-
findByNameAndVersion
WorkflowTemplate findByNameAndVersion(long tenantId, String name, int version)
This method finds a workflow template by name (the latest version is returned)- Parameters:
tenantId
- identifier of the tenantname
- name of the workflow templateversion
- what version to pick- Returns:
WorkflowTemplate
with given name, latest version
-
findAllByName
List<WorkflowTemplate> findAllByName(long tenantId, String name)
This method finds all the workflow templates by name- Parameters:
tenantId
- identifier of the tenantname
- name of the workflow template- Returns:
- list of templates with same name ordered by descending version
-
createFromFile
WorkflowTemplate createFromFile(File file)
De-serialize a template from a file- Parameters:
file
- the file storing the template- Returns:
- object representation of the template
-
getEnabledPermissions
Set<com.logicaldoc.core.security.Permission> getEnabledPermissions(long workflowId, long userId)
Finds all permissions of a user enabled on the specified workflow- Parameters:
workflowId
- ID of the workflowuserId
- ID of the user- Returns:
- Collection of enabled permissions
-
isWriteEnable
boolean isWriteEnable(long id, long userId)
Returns if a workflow is writeable for a user- Parameters:
id
- check this workflowuserId
- privileges for this should be checked- Returns:
- if the user can edit the workflow
-
isReadEnable
boolean isReadEnable(long id, long userId)
This method is looking up for read rights for a workflow and an user- Parameters:
id
- ID of the workflowuserId
- ID of the user- Returns:
- if the user can access the menu
-
-