Interface MTRepositoryHeader

All Known Subinterfaces:
MTRepository

public interface MTRepositoryHeader
Header interface for repositories. A repository is a self-contained set of symbols, models and documents. They are used to separate information that does not interrelate, since no information is shared between repositories (except for users, which are not part of the data model).
Since:
3.0
  • Method Details

    • getID

      long getID()
      Returns the ID of the repository.
      Returns:
      The ID of the repository.
      Since:
      3.0
    • getTitle

      String getTitle()
      Returns the title of the repository.
      Returns:
      The repository title.
      Since:
      3.0
    • getCreationDate

      Date getCreationDate()
      Returns the creation date of the repository.
      Returns:
      The date when the repository was created.
      Since:
      3.0
    • getLastModifiedDate

      Date getLastModifiedDate()
      Returns the last modification date of the repository.
      Returns:
      The date when the repository was last modified.
      Since:
      3.0
    • getUUID

      String getUUID()
      Returns this repositorys unique identifier.
      Returns:
      This repositorys unique identifier.
      Since:
      3.0
    • getStatus

      String getStatus()
      Returns status of this repository.
      Returns:
      status.
      Since:
      4.0
    • isTemplate

      boolean isTemplate()
      Returns true if this repository is a template.
      Returns:
      true if this repository is a template.
      Since:
      4.0
    • isEnablePermissions

      boolean isEnablePermissions()
      Returns true if permissions are enabled in the repository.
    • getDirectoryId

      Long getDirectoryId()
      Returns the parent directory for the repository, or null if this repository has no parent i.e. parent is the root node.
      Returns:
      The directory for the repository.
      Since:
      3.0
    • expand

      Returns a MTRepository for this status. Beware that this might require querying the storage layer for more data.
      Returns:
      A MTRepository representing this status.
      Throws:
      MTAccessException
      Since:
      3.0
    • createVariable

      MTVariable createVariable(String type, String key)
      Creates a new variable.
      Parameters:
      type - The variable type. 'env' is reserved for enviroment variables and 'propery' is reserved for java properties
      key - The variable key.
      Returns:
      A new MTVariable.
      Since:
      3.0
    • createTimestamp

      MTTimestamp createTimestamp(String uuid, String type)
      Creates a new timestamp.
      Parameters:
      type - The timestamp type.
      Returns:
      A new MTVariable.
    • findVariables

      List<MTVariable> findVariables(String type) throws MTAccessException
      Finds all variables in this repository of a given type.
      Parameters:
      type - The type of the variables to find. 'env' is reserved for enviroment variables and 'propery' is reserved for java properties
      Returns:
      A list of variables.
      Throws:
      MTAccessException
      Since:
      3.2
    • findVariables

      List<MTVariable> findVariables(String[] types) throws MTAccessException
      Finds all variables in this repository that has at least one of the given types.
      Parameters:
      types - The type of the variables to find. 'env' is reserved for enviroment variables and 'propery' is reserved for java properties
      Returns:
      A list of variables.
      Throws:
      MTAccessException
      Since:
      3.2
    • findVariables

      List<MTVariable> findVariables() throws MTAccessException
      Finds all variables in this repository, enviroment variables and java properties.
      Returns:
      A list of variables.
      Throws:
      MTAccessException
      Since:
      3.2
    • createDefaultDescriptionType

      void createDefaultDescriptionType()
      Creates the default description type for a repository and connects it to all currently available symbol types. This will have no effect if any description types have already been created in the repository.
    • createVariableSubstitution

      MTVariableSubstitution createVariableSubstitution() throws MTAccessException
      Creates a helper object for substituting variables in the repository, properties and enviroment variables. Note that the helper caches all values obtained, so in order to ensure that you get the newest values call this method again to create a new helper without cached values.
      Returns:
      A helper object for working with variable substitution.
      Throws:
      MTAccessException
    • createVariableSubstitution

      MTVariableSubstitution createVariableSubstitution(String type) throws MTAccessException
      Creates a helper object for substituting variables in the repository, properties or enviroment variables. Note that the helper caches all values obtained, so in order to ensure that you get the newest values call this method again to create a new helper without cached values.
      Parameters:
      type - The type of variable, 'env' is reserved for enviroment variables and 'propery' is reserved for java properties
      Returns:
      A helper object for working with variable substitution.
      Throws:
      MTAccessException
    • createVariableSubstitution

      MTVariableSubstitution createVariableSubstitution(String[] types) throws MTAccessException
      Creates a helper object for substituting variables in the repository. Note that the helper caches all values obtained, so in order to ensure that you get the newest values call this method again to create a new helper without cached values.
      Parameters:
      types - The type of variable, 'env' is reserved for enviroment variables and 'propery' is reserved for java properties
      Returns:
      A helper object for working with variable substitution.
      Throws:
      MTAccessException
    • findImage

      MTImage findImage(String uuid) throws MTAccessException
      Finds an image that has been stored in this repository.
      Parameters:
      uuid - The image UUID
      Returns:
      The image or null if no image was found.
      Throws:
      MTAccessException
      Since:
      3.0
    • findImageUUIDs

      Set<String> findImageUUIDs()
      Returns the UUID:s of all available images.
      Returns:
      All image UUID:s
    • createImage

      MTImage createImage(String uuid)
      Creates a new image in storage.
      Parameters:
      uuid - The uuid of the new image.
    • findLanguageHeaders

      List<MTLanguageHeader> findLanguageHeaders() throws MTAccessException
      Finds all languages in the repository as headers.
      Returns:
      All languages in the repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findLanguages

      List<MTLanguage> findLanguages() throws MTAccessException
      Finds all languages in the repository.
      Returns:
      All languages in the repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findWorkspaceHeaders

      List<MTWorkspaceHeader> findWorkspaceHeaders() throws MTAccessException
      Finds all workspaces in this repository as headers.
      Returns:
      A list of workspace headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findWorkspaces

      List<MTWorkspace> findWorkspaces() throws MTAccessException
      Finds all workspaces in this repository.
      Returns:
      A list of workspaces.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelCount

      long findModelCount() throws MTAccessException
      Finds number of models in this repository.
      Returns:
      number of models.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSymbolCount

      long findSymbolCount() throws MTAccessException
      Finds number of symbols in this repository.
      Returns:
      number of symbols.
      Throws:
      MTAccessException
      Since:
      4.0
    • findAttributeTypeHeaders

      List<MTAttributeTypeHeader> findAttributeTypeHeaders() throws MTAccessException
      Finds all attribute types in this repository as headers.
      Returns:
      A list of attribute type headers.
      Throws:
      MTAccessException
      Since:
      5.0
    • findAttributeTypes

      List<MTAttributeType> findAttributeTypes() throws MTAccessException
      Finds all attribute types in this repository.
      Returns:
      A list of attribute types.
      Throws:
      MTAccessException
      Since:
      5.0
    • findAttributeTypes

      List<MTAttributeType> findAttributeTypes(SymbolType type)
      Finds all attribute types for the symbol type.
      Parameters:
      type - the symbol type
      Returns:
      the attribute types that symbols of the given type can have
      Since:
      5.0
    • findAttributeTypes

      List<MTAttributeType> findAttributeTypes(ModelType type)
      Finds all attribute types for the model type.
      Parameters:
      type - the model type
      Returns:
      the attribute types that the models of the given type can have
      Since:
      5.0
    • findAttributeType

      MTAttributeType findAttributeType(String uuid) throws MTAccessException
      Finds an attribute type by UUID in this repository.
      Parameters:
      uuid - The UUID of the attribute type.
      Returns:
      The attribute with the given UUID or null if no such attribute type exists in this repository.
      Throws:
      MTAccessException
      Since:
      5.0
    • createAttributeType

      MTAttributeType createAttributeType(String uuid, String inputType, String dataType)
      Creates a new attribute type.
      Parameters:
      uuid - The UUID of the new type.
      inputType - The type of input the created attribute type will be associated with. If null, a default inputType will be used.
      dataType - The type of data the the created attribute type will be associated with. If null, a default dataType will be used.
      Returns:
      a new description type
      Since:
      5.0
    • findAttributeHeaders

      Finds all attributes in this repository associated with the given attribute type as headers.
      Returns:
      An iterator over the attributes associated with the given attribute type in the repository.
      Throws:
      MTAccessException
      Since:
      5.0
    • findAttributeHeaders

      MTIterator<MTAttributeHeader> findAttributeHeaders() throws MTAccessException
      Finds all attributes in this repository as headers.
      Returns:
      An iterator over all attributes in the repository.
      Throws:
      MTAccessException
      Since:
      5.0
    • findAttributes

      MTIterator<MTAttribute> findAttributes() throws MTAccessException
      Finds all attributes in this repository.
      Returns:
      An iterator over all attributes in the repository.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • findDocuments

      List<Long> findDocuments(String searchString, MTLanguage lang) throws IllegalArgumentException
      Searches through existing documents looking for a document that has a title in the given language containing the supplied string. The search "syntax" is rudimentary. Logical OR is space while logical AND is +. To search for phrases, use "".
      Parameters:
      searchString - The string to search for.
      lang - The language to search in.
      Returns:
      A list of ids of all documents matching the search string in the given language.
      Throws:
      IllegalArgumentException - if the language is not a language in this repository.
      See Also:
    • findDocumentsByName

      List<Long> findDocumentsByName(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive)
      Finds documents in this repository by name. Documents which the current user does not have read access to will be filtered out of the result.
      Parameters:
      searchString - the name to search for
      searchedLanguages - the languages to search in
      exactMatch - True to only include exact matches, false to include all titles that contains the given searchString. Note that a false value will likely decrease performance substantially.
      caseSensitive - True to match case sensitive, false to ignore case.
      Returns:
      A collection of document headers that the current user has read access to, and that matches the given searchString in the given language, with the given "exactness".
    • findDocuments

      List<MTDocumentHeader> findDocuments(List<Long> ids)
      Returns a list of document headers with the ids of the supplied list.
      Parameters:
      ids - A list of document ids
      Returns:
      a list of document headers with the ids of the supplied list.
    • findDocument

      MTDocument findDocument(String uuid) throws MTAccessException
      Finds a MT document by UUID in this repository.
      Parameters:
      uuid - The UUID of the document.
      Returns:
      The document with the given UUID or null if no such document exists in this repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocument

      Document findDocument(Document.DocumentID id)
      Finds a document by its global document id.
      Parameters:
      id - The id of the document.
      Returns:
      The document with the given id or null if no such document exists.
    • findDocumentIDs

      List<Long> findDocumentIDs() throws MTAccessException
      Finds the ID:s of all documents in this repository. If the repository is the currently opened repository, the ID:s returned will be ordered by title in the current language (including prefix). Otherwise the ID:s will be returned in no specific order.
      Returns:
      A list of document ID:s.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocumentHeaders

      MTIterator<MTDocumentHeader> findDocumentHeaders() throws MTAccessException
      Finds all documents in this repository as headers.
      Returns:
      An iterator over all documents in this repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocuments

      MTIterator<MTDocument> findDocuments() throws MTAccessException
      Finds all documents in this repository.
      Returns:
      An iterator over all documents in this repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocumentsByUUID

      MTIterator<MTDocument> findDocumentsByUUID(List<String> uuidList) throws MTAccessException
      Finds documents in this repository from a list of document UUID:s. The documents will be returned in the same order as the UUID list. Documents which the current user does not have read access to will be filtered out of the result.
      Parameters:
      uuidList - The UUID:s of documents to find.
      Returns:
      A list of documents with the UUID:s in uuidList.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findDocumentType

      MTDocumentType findDocumentType(String uuid) throws MTAccessException
      Finds a document type by UUID in this repository.
      Parameters:
      uuid - The UUID of the document type.
      Returns:
      The document with the given UUID or null if no such document type exists in this repository.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findDocumentTypeIDs

      List<Long> findDocumentTypeIDs() throws MTAccessException
      Finds the ID:s of all document types in this repository.
      Returns:
      A list of document type ID:s.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocumentTypes

      MTIterator<MTDocumentType> findDocumentTypes() throws MTAccessException
      Finds all document types in this repository.
      Returns:
      An iterator over all document types in the repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findDocumentTypeHeaders

      MTIterator<MTDocumentTypeHeader> findDocumentTypeHeaders() throws MTAccessException
      Finds all document types in this repository as headers.
      Returns:
      An iterator over all document types in the repository.
      Throws:
      MTAccessException
      Since:
      3.0
    • findUsers

      List<MTUser> findUsers()
      Finds all users with direct access to this repository.
    • findAllUsersWithAccess

      List<MTUser> findAllUsersWithAccess()
      Finds all users with access to this repository, directly or through groups.
    • findAccessGroups

      List<MTAccessGroup> findAccessGroups()
      Finds all groups with access to this repository.
    • findPermissionGroups

      List<MTPermissionGroup> findPermissionGroups()
      Finds all permission groups available in this repository.
    • findPublishProfiles

      Collection<MutablePublishProfile> findPublishProfiles() throws MTAccessException
      Deprecated.
      For internal use only, replaced by PublishProfileLocatorService
      Returns a all publish profiles in the repository.
      Returns:
      Profiles in repository
      Throws:
      MTAccessException
      Since:
      3.2
    • findLists

      List<MTList> findLists()
      Returns all lists that are in this repository.
      Returns:
      all lists that are in this repository.
      Since:
      3.0
    • findList

      MTList findList(String uuid)
      Finds a list that has been stored in this repository.
      Returns:
      The list or null if no list was found.
      Since:
      5.0
    • findListsFor

      List<MTList> findListsFor(String objectType)
      Returns all lists that act on the specified objectType. The list must belong to this repository.
      Parameters:
      objectType - The object type that the lists act on. (action object)
      Returns:
      all lists that act on the specified objectType.
      Since:
      3.0
    • findStaticLists

      List<MTList> findStaticLists()
      Returns all static lists for this repository. A static list is a list that is contextless, i.e it does not have an action object (no special object that it acts on).
      Returns:
      all static lists for this repository.
      Since:
      3.0
    • findRelativeLists

      List<MTList> findRelativeLists()
      Returns all non-static lists for this repository. A static list is a list that is contextless, i.e it does not have an action object (no special object that it acts on).
      Returns:
      all static lists for this repository.
      Since:
      3.0
    • createPluginData

      MTPluginData createPluginData(MTDataProvider provider, String key)
      Creates a new plug-in data connected to this repository.
      Parameters:
      key - The key to store the data under.
      Returns:
      A new plug-in data.
    • findPluginData

      Collection<MTPluginData> findPluginData(MTDataProvider provider, String key) throws MTAccessException
      Finds plug-in data connected to this repository.
      Parameters:
      provider - The provider to find data for.
      key - The key for the data to find. If null all data for the provider will be returned.
      Returns:
      The resulting plug-in data
      Throws:
      MTAccessException
      Since:
      3.1
    • createPublishProfile

      MutablePublishProfile createPublishProfile(String type)
      Creates a new publish profile in this repository. The new profile is not saved until save() is called on it.
      Parameters:
      type - The type of the publish profile.
      Returns:
      A new instance of MutablePublishProfile.
    • createList

      MTList createList(boolean staticList, String uuid)
      Creates and returns a new list.
      Parameters:
      staticList - true for a static list, false for a list relative to a selected symbol.
      Returns:
      A new list.
      Since:
      3.0
    • createCachedList

      MTCachedList createCachedList(MTList list, boolean lockedRevisions, boolean includeInitialRevisions)
      Creates and returns a cached list for a relative list.
      Returns:
      A new cached list.
      Since:
      3.0
    • createCachedList

      default MTCachedList createCachedList(MTList list)
    • createLayerType

      MTLayerType createLayerType(String uuid)
      Creates a new layer type in the repository.
      Parameters:
      uuid - The UUID of the created layer type.
      Returns:
      A new category.
    • createDocument

      MTDocument createDocument(String uuid)
      Creates a new document, with default settings.
      Parameters:
      uuid - The uuid of the new document.
      Returns:
      A new MTDocument.
      Since:
      3.0
    • createExtensionDocument

      MTExtensionDocument createExtensionDocument(String uuid, String href, String name, String provider, Date created, boolean isLeaf, byte[] icon)
      Creates a new MTExtensionDocument instance with the supplied values. The instance is not persisted when returning.
      Parameters:
      uuid - The unique uuid of the document
      href - The url in string representation of the document
      name - The name of the document
      provider - The name/id of the provider of the document
      created - The creation time of the document
      isLeaf - true to specify a document, false to specify a non-leaf such as a folder.
      icon - the icon for the document.
      Returns:
      a new, not yet persisted, MTExtensionDocument with the supplied values.
    • findLayerTypeHeaders

      List<MTLayerTypeHeader> findLayerTypeHeaders(ModelType modelType) throws MTAccessException
      Finds all layer types available for a given model type, as headers.
      Parameters:
      modelType - The model type.
      Returns:
      A list of layer type headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findLayerTypes

      List<MTLayerType> findLayerTypes(ModelType modelType) throws MTAccessException
      Finds all layer types available for a given model type.
      Parameters:
      modelType - The model type.
      Returns:
      A list of layer type headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findLayerTypeHeaders

      List<MTLayerTypeHeader> findLayerTypeHeaders() throws MTAccessException
      Finds all layer types available, as headers.
      Returns:
      A list of layer type headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findLayerTypes

      List<MTLayerType> findLayerTypes() throws MTAccessException
      Finds all layer types available.
      Returns:
      A list of layer type headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findColorScheme

      MTColorSchemeHeader findColorScheme() throws MTAccessException
      Finds the color scheme for this repository.
      Returns:
      A color scheme.
      Throws:
      MTAccessException
      Since:
      3.0
    • createLanguage

      MTLanguage createLanguage()
      Creates a new language for the repository. The language needs to be saved before it can be used.
      Returns:
      A new language for the repository.
    • createDocumentType

      MTDocumentType createDocumentType(String uuid)
      Creates a new document type in the repository.
      Returns:
      A new document type.
    • getPluginDataBulkOperations

      MTPluginDataOperations getPluginDataBulkOperations()
    • lock

      Short lock(String reason)
      Tries to get an exclusive lock for editing in this repository. This can only be done by someone that has sufficient privileges to throw out users from a repository. If there are users currently working in the repository a dialog will be shown where the caller will have two options: 1. Cancel the lock operation, causing this call to return false. 2. Notify the users of the lock, giving them a specified time to shutdown before they will be shutdown automatically. NOTE: If the repository was successfully locked, the caller is responsible for making sure unlock() is called to unlock the repository again, otherwise no-one will be able to open the repository later.
      Parameters:
      reason - The reason for needing to lock the repository.
      Returns:
      A lock id if the lock was successful, null otherwise. The id returned is required to unlock the repository later.
    • unlock

      boolean unlock(short lockID)
      Unlocks a locked repository. This will only be successful if called by the same user that locked the repository.
      Parameters:
      lockID - The ID acquired when the repository was locked.
      Returns:
      true if the repository is unlocked after the call.
    • findDocumentByPrefix

      MTDocument findDocumentByPrefix(String prefix)
      Finds a document by prefix.
      Parameters:
      prefix - The prefix.
      Returns:
      The document with the given prefix or null if no such document exists.
    • findImages

      Map<String,String> findImages()
    • isDraft

      boolean isDraft()