Interface MTDocument

All Superinterfaces:
Comparable<MTNamedObject>, MTDocumentHeader, MTHistoryEnabled, MTNamedObject

public interface MTDocument extends MTDocumentHeader, MTHistoryEnabled
Full interface for documents. Each repository maintains a list of documents that can be connected to models and symbols. The same document can be used this way on multiple models and symbols. There are three different types of models: "FILE" - The document is located in a file on the local drive or a network drive. "URL" - The document is accessible by an URL. "MANAGED" - The documents content is stored directly in the database and edited in Modeling Tool.
Since:
3.0
  • Method Details

    • canUserRead

      boolean canUserRead()
    • canUserWrite

      boolean canUserWrite()
    • getPermissions

      MTPermissions getPermissions()
      Returns "access control" permissions for this object.
      Returns:
      permissions for object
    • getDocumentTypes

      Collection<MTDocumentTypeHeader> getDocumentTypes()
      Returns the document types for this document.
      Returns:
      The document types.
      Since:
      3.1
    • getPluginData

      Object getPluginData(MTDataProvider provider)
      Returns the plugin data created for the document by a given provider.
      Parameters:
      provider - The provider.
      Returns:
      The plugin data created by the provider.
    • setPluginData

      void setPluginData(MTDataProvider provider, Object data)
      Sets plugin data for a provider.
      Parameters:
      provider - The provider.
      data - The new data to store for the provider.
    • getPropertyProviders

      Set<String> getPropertyProviders()
      Returns all providers that have stored properties.
      Returns:
      A set of provider ID:s
      Since:
      3.0
    • getPropertyKeys

      Set<String> getPropertyKeys(String provider)
      Returns the property names of all properties stored by a provider.
      Parameters:
      provider - The provider ID.
      Returns:
      A set of property names.
    • getProperty

      String getProperty(String provider, String name)
      Returns a property value.
      Parameters:
      provider - The provider ID.
      name - The property name.
      Returns:
      The property value or null.
      Since:
      3.0
    • setProperty

      void setProperty(String provider, String name, String value)
      Sets a property value.
      Parameters:
      provider - The ID of the provider setting this property.
      name - The property name.
      value - The new property value. Values longer than 255 characters will be truncated.
      Since:
      3.0
    • removeProperty

      void removeProperty(String provider, String name)
      Removes a property.
      Parameters:
      provider - The ID of the provider setting this property.
      name - The property name.
    • setTitle

      void setTitle(String title)
      Sets the documents title in the current language.
      Parameters:
      title - The new title.
      Since:
      3.0
    • setTranslated

      void setTranslated(MTLanguage lang, boolean translated)
      Marks this document as translated in the given language.
      Since:
      3.1
    • setTitle

      void setTitle(MTLanguageHeader language, String title)
      Sets the documents title in a given language.
      Parameters:
      language - The language.
      title - The new title.
      Since:
      3.0
    • setContent

      void setContent(String content)
      Sets the documents content in the current language.
      Parameters:
      content - The new content. This should be a path or URL if the content type is "FILE" or "URL", and HTML if the content type is "MANAGED".
      Since:
      3.0
    • setLastModified

      void setLastModified(Date lastModified)
      Overrides the last modified date of the list.
      Parameters:
      lastModified - The new last modified date.
    • setContent

      void setContent(MTLanguageHeader language, String content)
      Sets the documents content in a given language.
      Parameters:
      language - The language.
      content - The new content. This should be a path or URL if the content type is "FILE" or "URL", and HTML if the content type is "MANAGED".
      Since:
      3.0
    • setContentSource

      void setContentSource(String source)
      Sets the document source type.
      Parameters:
      source - The new source type. Valid values are "FILE", "URL" and "MANAGED".
      Since:
      3.0
    • setCopyOnPublish

      void setCopyOnPublish(boolean copyOnPublish)
      Sets the copy on publish flag. If set to true the document will be copied to the publish directory when publishing to HTML.
      Parameters:
      copyOnPublish - The new value.
      Since:
      3.0
    • addDocumentType

      void addDocumentType(MTDocumentTypeHeader type)
      Adds a document type to the types this document is connected to.
      Parameters:
      type - The new document type.
      Throws:
      MTAccessException
      Since:
      3.0
    • removeDocumentType

      void removeDocumentType(MTDocumentTypeHeader type)
      Removes a document type from the types this document is connected to.
      Parameters:
      type - The type to remove.
      Throws:
      MTAccessException
      Since:
      3.0
    • getOwner

      MTUserHeader getOwner()
      Returns the owner of this document.
      Returns:
      the owner of this document.
      Since:
      3.0
    • setOwner

      void setOwner(MTUserHeader owner)
      Sets the owner of the document.
      Parameters:
      owner - The new owner.
      Since:
      3.0
    • getGroup

      MTPermissionGroup getGroup()
      Returns the group of this document.
      Returns:
      the group of this document.
      Since:
      3.0
    • setGroup

      void setGroup(MTPermissionGroup group)
      Sets the group of the document.
      Parameters:
      group - The new group.
      Since:
      3.0
    • setCreated

      void setCreated(Date created)
      Sets the creation date of the document.
      Parameters:
      created - The new creation date.
      Since:
      3.0
    • getLastModifiedBy

      MTUserHeader getLastModifiedBy()
      Returns the last user that modified this document.
      Returns:
      the user that last modified this document.
      Since:
      3.0
    • setLastModifiedBy

      void setLastModifiedBy(MTUserHeader user)
      Sets the user that last modified the document.
      Parameters:
      user - The new last modified by user.
      Since:
      3.0
    • getCreatedBy

      MTUserHeader getCreatedBy()
      Returns the user that created this document.
      Returns:
      the user that created this document.
      Since:
      3.0
    • setCreatedBy

      void setCreatedBy(MTUserHeader user)
      Sets the creator of the document.
      Parameters:
      user - The new creator.
      Since:
      3.0
    • getResponsible

      MTSymbolHeader getResponsible()
      Returns the symbol designated as "responsible" for this document.
      Returns:
      The responsible for the document.
      Since:
      3.0
    • setResponsible

      void setResponsible(MTSymbolHeader responsible)
      Sets the symbol designated as "responsible" for this document.
      Parameters:
      responsible - The new responsible.
    • save

      void save() throws MTAccessException
      Saves changes made to the document.
      Throws:
      MTAccessException
      Since:
      3.0
    • hasPluginData

      boolean hasPluginData()
      Returns true if there is plug-in data connected to the entity.
    • setIcon

      void setIcon(URL iconURL)
      Sets the document icon URL. Set to null to use default icon.
    • setShowInPanel

      void setShowInPanel(boolean showInPanel)
      Parameters:
      showInPanel -
      See Also:
    • setPrefix

      void setPrefix(String prefix)
      Sets a prefix used to identify this document. If used the prefix can be used for filtering/finding documents easier.
    • setPrefixLocked

      void setPrefixLocked(boolean locked)
      Locks the current prefix so it cannot be modified.
    • cast

      static Optional<MTDocument> cast(Document doc)