Class HibernateTemplateDAO

    • Constructor Detail

      • HibernateTemplateDAO

        public HibernateTemplateDAO()
    • Method Detail

      • setUserDAO

        public void setUserDAO​(UserDAO userDAO)
      • findByName

        public Template findByName​(String name,
                                   long tenantId)
        Description copied from interface: TemplateDAO
        This method finds a template by name
        Specified by:
        findByName in interface TemplateDAO
        Parameters:
        name - Name of the template
        tenantId - ID of the owning tenant
        Returns:
        Template with given name
      • countFolders

        public int countFolders​(long id)
      • countDocs

        public int countDocs​(long id)
        Description copied from interface: TemplateDAO
        Counts the total number of documents using this template
        Specified by:
        countDocs in interface TemplateDAO
        Parameters:
        id - The template ID
        Returns:
        the documents count
      • findByType

        public List<Template> findByType​(int type,
                                         long tenantId)
        Description copied from interface: TemplateDAO
        This method finds a template by type
        Specified by:
        findByType in interface TemplateDAO
        Parameters:
        type - Type of the template
        tenantId - ID of the owning tenant
        Returns:
        Template with given type
      • isWriteEnable

        public boolean isWriteEnable​(long templateId,
                                     long userId)
        Description copied from interface: TemplateDAO
        Returns if a template is writable for a user
        Specified by:
        isWriteEnable in interface TemplateDAO
        Parameters:
        templateId - check this template
        userId - privileges for this should be checked
        Returns:
        if the user can edit the template
      • isReadEnable

        public boolean isReadEnable​(long templateId,
                                    long userId)
        Description copied from interface: TemplateDAO
        This method is looking up for read rights for a template and an user
        Specified by:
        isReadEnable in interface TemplateDAO
        Parameters:
        templateId - ID of the template
        userId - ID of the user
        Returns:
        if the user can access the template
      • getEnabledPermissions

        public Set<Permission> getEnabledPermissions​(long templateId,
                                                     long userId)
        Description copied from interface: TemplateDAO
        Finds all permissions of a user enabled on the specified template
        Specified by:
        getEnabledPermissions in interface TemplateDAO
        Parameters:
        templateId - ID of the template
        userId - ID of the user
        Returns:
        Collection of enabled permissions