Package com.logicaldoc.core.metadata
Interface TemplateDAO
- All Superinterfaces:
- PersistentObjectDAO<Template>
- All Known Implementing Classes:
- HibernateTemplateDAO
This class is a DAO-service for document templates.
- Version:
- 1.0
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionCreates a clone of an existing templateintcountDocs(long id) Counts the total number of documents using this templatefindByName(String name, long tenantId) This method finds a template by namefindByType(int type, long tenantId) This method finds a template by typegetAllowedPermissions(long templateId, long userId) Finds all permissions of a user enabled on the specified templatevoidinitialize(Template template) Initialises lazy loaded data such as collectionsbooleanisReadEnable(long templateId, long userId) This method is looking up for read rights for a template and an userbooleanisWriteEnable(long templateId, long userId) Returns if a template is writable for a userMethods 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, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Method Details- 
findByNameThis method finds a template by name- Parameters:
- name- Name of the template
- tenantId- ID of the owning tenant
- Returns:
- Template with given name
- Throws:
- PersistenceException- Error in the data layer
 
- 
cloneCreates a clone of an existing template- Parameters:
- id- Identifier of the original template
- cloneName- Name of the cloned template
- Returns:
- the created clone
- Throws:
- PersistenceException- Error in the data layer
 
- 
countDocsCounts the total number of documents using this template- Parameters:
- id- The template ID
- Returns:
- the documents count
- Throws:
- PersistenceException- Error in the data layer
 
- 
findByTypeThis method finds a template by type- Parameters:
- type- Type of the template
- tenantId- ID of the owning tenant
- Returns:
- Template with given type
- Throws:
- PersistenceException- Error in the data layer
 
- 
getAllowedPermissionsFinds all permissions of a user enabled on the specified template- Parameters:
- templateId- ID of the template
- userId- ID of the user
- Returns:
- Collection of enabled permissions
 
- 
isWriteEnableboolean isWriteEnable(long templateId, long userId) Returns if a template is writable for a user- Parameters:
- templateId- check this template
- userId- privileges for this should be checked
- Returns:
- if the user can edit the template
 
- 
isReadEnableboolean isReadEnable(long templateId, long userId) This method is looking up for read rights for a template and an user- Parameters:
- templateId- ID of the template
- userId- ID of the user
- Returns:
- if the user can access the template
 
- 
initializeDescription copied from interface:PersistentObjectDAOInitialises lazy loaded data such as collections- Specified by:
- initializein interface- PersistentObjectDAO<Template>
- Parameters:
- template- The entity to be initialised
 
 
-