Package com.logicaldoc.core.metadata
Interface TemplateDAO
-
- All Superinterfaces:
PersistentObjectDAO<Template>
- All Known Implementing Classes:
HibernateTemplateDAO
public interface TemplateDAO extends PersistentObjectDAO<Template>
This class is a DAO-service for document templates.- Version:
- 1.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Field Summary
-
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
countDocs(long id)
Counts the total number of documents using this templateTemplate
findByName(String name, long tenantId)
This method finds a template by nameList<Template>
findByType(int type, long tenantId)
This method finds a template by typeSet<Permission>
getEnabledPermissions(long templateId, long userId)
Finds all permissions of a user enabled on the specified templatevoid
initialize(Template template)
Initialises lazy loaded data such as collectionsboolean
isReadEnable(long templateId, long userId)
This method is looking up for read rights for a template and an userboolean
isWriteEnable(long templateId, long userId)
Returns if a template is writable for a user-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
findByName
Template findByName(String name, long tenantId)
This method finds a template by name- Parameters:
name
- Name of the templatetenantId
- ID of the owning tenant- Returns:
- Template with given name
-
countDocs
int countDocs(long id)
Counts the total number of documents using this template- Parameters:
id
- The template ID- Returns:
- the documents count
-
findByType
List<Template> findByType(int type, long tenantId)
This method finds a template by type- Parameters:
type
- Type of the templatetenantId
- ID of the owning tenant- Returns:
- Template with given type
-
getEnabledPermissions
Set<Permission> getEnabledPermissions(long templateId, long userId)
Finds all permissions of a user enabled on the specified template- Parameters:
templateId
- ID of the templateuserId
- ID of the user- Returns:
- Collection of enabled permissions
-
isWriteEnable
boolean isWriteEnable(long templateId, long userId)
Returns if a template is writable for a user- Parameters:
templateId
- check this templateuserId
- privileges for this should be checked- Returns:
- if the user can edit the template
-
isReadEnable
boolean isReadEnable(long templateId, long userId)
This method is looking up for read rights for a template and an user- Parameters:
templateId
- ID of the templateuserId
- ID of the user- Returns:
- if the user can access the template
-
initialize
void initialize(Template template)
Description copied from interface:PersistentObjectDAO
Initialises lazy loaded data such as collections- Specified by:
initialize
in interfacePersistentObjectDAO<Template>
- Parameters:
template
- The entity to be initialised
-
-