Class DocumentTemplate

    • Constructor Detail

      • DocumentTemplate

        public DocumentTemplate()
        Initializing a new instance of DocumentTemplate.
    • Method Detail

      • getId

        public String getId()
        Gets the identifier of the document template.

        The identifier is the file base name part of the file registered into repository.

        Returns:
        a string representing an id (UUID).
      • isPersisted

        public boolean isPersisted()
        Indicates if the document template is persisted into Silverpeas's context.
        Returns:
        true is persisted, false otherwise.
      • getPosition

        public int getPosition()
        Gets the position for collection sort processing.
        Returns:
        an integer representing the position into a sorted collection.
      • setPosition

        public void setPosition​(int position)
        Sets the position for collection sort processing.
        Parameters:
        position - an integer representing the position into a sorted collection.
      • existNameTranslationIn

        public boolean existNameTranslationIn​(String language)
        Indicates if a name translation exists into the given language.
        Parameters:
        language - the locale into which the name should be provided.
        Returns:
        true of a translation exists, false otherwise.
      • getName

        public String getName​(String language)
        Gets the name of the document template.
        Parameters:
        language - the locale into which the name should be provided. A default one is provided if none retrieved with given language.
        Returns:
        a string representing a name.
      • setName

        public void setName​(String name,
                            String language)
        Sets the name of the document template.
        Parameters:
        name - a name.
        language - the locale of the given name.
      • existDescriptionTranslationIn

        public boolean existDescriptionTranslationIn​(String language)
        Indicates if a description translation exists for the given language.
        Parameters:
        language - the locale into which the description should be provided.
        Returns:
        true of a translation exists, false otherwise.
      • getDescription

        public String getDescription​(String language)
        Gets the description of the document template.
        Parameters:
        language - the locale into which the description should be provided. A default one is provided if none retrieved with given language.
        Returns:
        a string representing a description.
      • setDescription

        public void setDescription​(String description,
                                   String language)
        Sets the description of the document template.
        Parameters:
        description - a description.
        language - the locale of the given description.
      • getExtension

        public String getExtension()
        Gets the file extension of the document template.
        Returns:
        a string (without the file extension separator).
      • setExtension

        public void setExtension​(String extension)
        Sets the file extension of the document template.
        Parameters:
        extension - a string (without the file extension separator).
      • setRestrictedToSpaceIds

        public void setRestrictedToSpaceIds​(List<String> spacesIds)
        Sets the space identifiers the document template is restricted to.
        Parameters:
        spacesIds - list of space identifier.
      • getRestrictedToSpaceIds

        public List<String> getRestrictedToSpaceIds()
        Gets the space identifiers the document template is restricted to.
        Returns:
        list of space identifier.
      • getContentType

        public String getContentType()
        Gets the content type of the physical file.
        Returns:
        a string representing a mime type.
      • openInputStream

        public InputStream openInputStream()
                                    throws IOException
        Opens an InputStream over the content of the document template in order to copy it.
        Returns:
        an InputStream instance.
        Throws:
        IOException - See FileNotFoundException above, FileNotFoundException is a subclass of IOException.