Interface EntityDocumentsService

All Known Subinterfaces:
InternalEntityDocumentsService
All Known Implementing Classes:
EntityDocumentsServiceImpl

public interface EntityDocumentsService
  • Method Details

    • getSystemDomain

      DomainNode getSystemDomain() throws EntityDocumentsException
      Get the System Domain
      Returns:
      System Domain
      Throws:
      EntityDocumentsException
    • getEntityModelFolder

      FolderNode getEntityModelFolder(String modelName) throws EntityDocumentsException
      Get the entity documents folder for an entity model
      Parameters:
      modelName - name of the entity model
      Returns:
      entity documents folder
      Throws:
      EntityDocumentsException
    • getEntityModelFolder

      FolderNode getEntityModelFolder(EntityModel entityModel) throws EntityDocumentsException
      Get the entity documents folder for an entity model
      Parameters:
      entityModel - entity model
      Returns:
      entity documents folder
      Throws:
      EntityDocumentsException
    • getEntityDocumentsFolder

      FolderNode getEntityDocumentsFolder(Entity entity) throws EntityDocumentsException
      Get the entity's document folder
      
           - [entity model folder]
            \- [entity folder]     <-- <b>folder returned</b>
              \- [language folder]
       
      Parameters:
      entity - the entity
      Returns:
      entity's document folder
      Throws:
      EntityDocumentsException
    • getRelatedEntity

      Optional<Entity> getRelatedEntity(ContentTreeNode contentTreeNode) throws EntityDocumentsException
      Get the related entity associated with this ContentTreeNode
      Parameters:
      contentTreeNode - ContentTreeNode
      Returns:
      an Optional containing the related entity (if available) or an Optional.empty() )
      Throws:
      EntityDocumentsException
    • isEntityRootFolder

      boolean isEntityRootFolder(Entity entity) throws PersistException
      check if the entity is the root folder for an entity
      Parameters:
      entity - the folder entity
      Returns:
      true / false
      Throws:
      PersistException
    • isEntityModelFolder

      boolean isEntityModelFolder(Entity entity) throws PersistException
      check if the entity is the root folder for an entity model
      Parameters:
      entity - the folder entity
      Returns:
      true / false
      Throws:
      PersistException
    • isEntityDocumentFolder

      boolean isEntityDocumentFolder(Entity entity)
      check if the entity is an entity doc folder (no matter if it's the root folder, the model root folder or a any child folder.
      Parameters:
      entity - the folder entity
      Returns:
      true / false
    • isEntityDocumentFolder

      boolean isEntityDocumentFolder(FolderNode folderNode)
      check if the folder is an entity doc folder (no matter if it's the root folder, the model root folder or a any child folder.
      Parameters:
      folderNode - the folder node
      Returns:
      true / false
    • addTimestampToFilename

      String addTimestampToFilename(String fileName)
    • getRelatedEntityRelationName

      Optional<String> getRelatedEntityRelationName(String relatedEntityName) throws EntityDocumentsException
      Parameters:
      relatedEntityName - name of a related entity model
      Returns:
      name of the relation to the required entity (if such a relation exists, Optional.empty() otherwise)
      Throws:
      EntityDocumentsException
    • isRelationToRelatedEntity

      boolean isRelationToRelatedEntity(String relationName)
      Determine if a freely chosen relation is a relation from an entity document/folder to the related entity. I.e. if there exists an Entity called "Post", which also has entity docs: If this method is called with "relPost_entitydocs", true will be returned.
      Parameters:
      relationName - Any relation name.
      Returns:
      true if it's a relation to the related entity, else false.
    • isEntityDocument

      boolean isEntityDocument(Entity resourceEntity) throws PersistException
      Throws:
      PersistException
    • isEntityDocument

      boolean isEntityDocument(ResourceNode resourceNode) throws PersistException
      Throws:
      PersistException
    • isEntityDetailDocument

      boolean isEntityDetailDocument(Entity resourceEntity) throws PersistException
      Throws:
      PersistException
    • isEntityDetailDocument

      boolean isEntityDetailDocument(ResourceNode resourceNode) throws PersistException
      Throws:
      PersistException
    • getDetailDocumentFileName

      String getDetailDocumentFileName(ResourceNode resourceNode) throws PersistException
      Get the file name for a detail document
      Parameters:
      resourceNode - a detail document ResourceNode (will throw an exception if any other ResourceNodes are provided.
      Returns:
      the file name for the detail document
      Throws:
      PersistException
    • getDetailDocumentForField

      Optional<ResourceNode> getDetailDocumentForField(Entity entity, String fieldName)
    • createEntityDocumentsInvoker

      Invoker createEntityDocumentsInvoker(List<EntityId> entities)