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
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptioncreateFromFile(File file) De-serialize a template from a filedeploy(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.This method loads all the workflowsfindAllByName(long tenantId, String name) This method finds all the workflow templates by namefindAllDeployed(Long tenantId, Long userId) This method loads all the workflows already deployedfindByName(long tenantId, String name) This method finds a workflow template by name (the latest version is returned)findByNameAndVersion(long tenantId, String name, int version) This method finds a workflow template by name (the latest version is returned)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> getAllowedPermissions(long workflowId, long userId) Finds all permissions of a user enabled on the specified workflowbooleanisReadEnabled(long templateId, long userId) This method is looking up for read rights for a workflow and an userbooleanisWriteEnabled(long templateId, long userId) Returns if a workflow is writable for a userstoreNewVersion(WorkflowTemplate workflowTemplate) Saves the passed workflow as a new versionMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Method Details- 
deployWorkflowTemplate 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 at data layer
 
- 
storeNewVersionWorkflowTemplate 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 at data layer
 
- 
findAllDeployedList<WorkflowTemplate> findAllDeployed(Long tenantId, Long userId) throws com.logicaldoc.core.PersistenceException This method loads all the workflows already deployed- Parameters:
- tenantId- optional tenant specification
- userId- optional user specification
- Returns:
- list of persistence workflow template
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findAllList<WorkflowTemplate> findAll(long tenantId, Long userId) throws com.logicaldoc.core.PersistenceException This method loads all the workflows- Parameters:
- tenantId- tenant specification
- userId- optional user specification
- Returns:
- list of persistence workflow template
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findByNameWorkflowTemplate findByName(long tenantId, String name) throws com.logicaldoc.core.PersistenceException This method finds a workflow template by name (the latest version is returned)- Parameters:
- tenantId- identifier of the tenant
- name- name of the workflow template
- Returns:
- WorkflowTemplatewith given name, latest version
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findLastDeployedWorkflowTemplate findLastDeployed(long tenantId, String name) throws com.logicaldoc.core.PersistenceException This method finds a deployed workflow template by name (the latest deployed version is returned)- Parameters:
- tenantId- identifier of the tenant
- name- name of the workflow template
- Returns:
- WorkflowTemplatewith given name, latest version
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findByNameAndVersionWorkflowTemplate findByNameAndVersion(long tenantId, String name, int version) throws com.logicaldoc.core.PersistenceException This method finds a workflow template by name (the latest version is returned)- Parameters:
- tenantId- identifier of the tenant
- name- name of the workflow template
- version- what version to pick
- Returns:
- WorkflowTemplatewith given name, latest version
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findAllByNameList<WorkflowTemplate> findAllByName(long tenantId, String name) throws com.logicaldoc.core.PersistenceException This method finds all the workflow templates by name- Parameters:
- tenantId- identifier of the tenant
- name- name of the workflow template
- Returns:
- list of templates with same name ordered by descending version
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
createFromFileDe-serialize a template from a file- Parameters:
- file- the file storing the template
- Returns:
- object representation of the template
 
- 
getAllowedPermissionsSet<com.logicaldoc.core.security.Permission> getAllowedPermissions(long workflowId, long userId) throws com.logicaldoc.core.PersistenceException Finds all permissions of a user enabled on the specified workflow- Parameters:
- workflowId- ID of the workflow
- userId- ID of the user
- Returns:
- Collection of enabled permissions
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
isWriteEnabledboolean isWriteEnabled(long templateId, long userId) throws com.logicaldoc.core.PersistenceException Returns if a workflow is writable for a user- Parameters:
- templateId- check this workflow
- userId- privileges for this should be checked
- Returns:
- if the user can edit the workflow
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
isReadEnabledboolean isReadEnabled(long templateId, long userId) throws com.logicaldoc.core.PersistenceException This method is looking up for read rights for a workflow and an user- Parameters:
- templateId- ID of the workflow
- userId- ID of the user
- Returns:
- if the user can access the template
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
 
-