Interface MTWorkspaceHeader

All Known Subinterfaces:
MTWorkspace

public interface MTWorkspaceHeader
Header interface for workspaces. Workspaces are used for revision control. Each repository has one workspace by default. At any point in time this workspace can be turned into a "snapshot". When this is done all revisions of models and symbols in this workspace are locked and can no longer be edited. To be able to edit models and symbols again a new workspace is created from the snapshot, giving the users the possibility to create new revisions which can be edited. The snapshot still remains so that at any point in time you can login to a previous snapshot instead of an open workspace to see exactly how everything looked at that point in time.
Since:
3.0
  • Method Details

    • getID

      long getID()
      Returns the ID of the workspace.
      Returns:
      The workspace ID.
      Since:
      3.0
    • getRepositoryID

      long getRepositoryID()
      Returns the ID of the repository that this workspace belongs to.
      Returns:
      The repository ID.
    • getTitle

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

      Date getCreationDate()
      Returns the creation date of the workspace.
      Returns:
      The workspace creation date.
      Since:
      3.0
    • isLocked

      boolean isLocked()
      Checks if the workspace is locked (a snapshot).
      Returns:
      true if the workspace is locked.
      Since:
      3.0
    • isActive

      boolean isActive()
      Returns true if this is an "active" workspace that is shown by default in the list of workspaces.
      Returns:
      true if the workspace is active.
    • expand

      Returns a MTWorkspace for this workspace. Beware that this might require querying the storage layer for more data.
      Returns:
      A MTWorkspace representing this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findIsReferenceIDExisting

      boolean findIsReferenceIDExisting(String referenceID)
      Returns true if the given reference id already exists in this workspace.
      Parameters:
      referenceID - The reference id to check.
      Returns:
      true if the given reference id already exists in this workspace, false otherwise.
    • findChildren

      List<MTWorkspace> findChildren() throws MTAccessException
      Finds the child workspaces. Only snapshots will have child workspaces.
      Returns:
      A list of child workspaces.
      Throws:
      MTAccessException
      Since:
      3.0
    • findChildHeaders

      List<MTWorkspaceHeader> findChildHeaders() throws MTAccessException
      Finds the child workspaces as headers. Only snapshots will have child workspaces.
      Returns:
      A list of child workspaces as headers.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModel

      MTModel findModel(String uuid) throws MTAccessException
      Finds a model by UUID in this workspace.
      Parameters:
      uuid - The UUID of the model.
      Returns:
      The model with the given UUID or null if no such model exists in the workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelIDs

      List<Long> findModelIDs() throws MTAccessException
      Finds the ID:s of all models in this workspace. If the workspace is the currently opened workspace, the ID:s returned will be ordered by title in the current language. Otherwise the ID:s will be returned in no specific order.
      Returns:
      The ID:s of all models in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelCounts

      Map<String,Integer> findModelCounts() throws MTAccessException
      Throws:
      MTAccessException
    • findModelUUIDs

      List<String> findModelUUIDs() throws MTAccessException
      Finds the UUID:s of all models in this workspace. If the workspace is the currently opened workspace, the UUID:s returned will be ordered by title in the current language. Otherwise the UUID:s will be returned in no specific order.
      Returns:
      The UUID:s of all models in this workspace.
      Throws:
      MTAccessException
    • findModelIDs

      List<Long> findModelIDs(ModelType modelType) throws MTAccessException
      Finds the ID:s of all models of a given type in this workspace. If the workspace is the currently opened workspace, the ID:s returned will be ordered by title in the current language. Otherwise the ID:s will be returned in no specific order.
      Parameters:
      modelType - The model type.
      Returns:
      The ID:s of all models with the given type in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModels

      MTIterator<MTModel> findModels() throws MTAccessException
      Finds all models in this workspace.
      Returns:
      An iterator over all models in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModels

      MTIterator<MTModel> findModels(ModelType modelType) throws MTAccessException
      Finds all models with a given type in this workspace.
      Returns:
      An iterator over all models with a given type in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelsByName

      List<Long> findModelsByName(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive)
      Finds models in the current workspace by name. Models 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 Model headers that the current user has read access to, and that matches the given searchString in the given language, with the given "exactness".
    • findModelHeaders

      MTIterator<MTModelHeader> findModelHeaders() throws MTAccessException
      Finds all models in this workspace as headers.
      Returns:
      An iterator over all models in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelHeaders

      MTIterator<MTModelHeader> findModelHeaders(ModelType type) throws MTAccessException
      Finds all models with a given type in this workspace as headers.
      Returns:
      An iterator over all models with a given type in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelsByUUID

      MTIterator<MTModel> findModelsByUUID(List<String> uuidList) throws MTAccessException
      Finds models in this workspace from a list of model UUID:s. The models will be returned in the same order as the UUID list. Models which the current user does not have read access to will be filtered out of the result.
      Parameters:
      uuidList - The UUID:s of models to find.
      Returns:
      A list of models with the UUID:s in uuidList.
      Throws:
      MTAccessException
      Since:
      3.0
    • findRemovedModels

      MTIterator<MTModel> findRemovedModels()
      Finds models that were previously removed from this workspace.
    • findRemovedSymbols

      MTIterator<MTSymbol> findRemovedSymbols()
      Finds symbols that were previously removed from this workspace.
    • findBreakdowns

      List<Long> findBreakdowns(Collection<Long> rootModels)
      Finds all breakdowns from a set of root models in this workspace.
      Parameters:
      rootModels - The root models to search from
      Returns:
      ID:s of all models broken down to from any of the root models.
    • findSubset

      Set<Long> findSubset(Set<Long> rootModels) throws MTAccessException
      Finds a subset of models by following breakdowns from a set of root models.
      Parameters:
      rootModels - The root models ID:s
      Returns:
      The model ID:s of models included in the subset.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSubsetByUUID

      Set<Long> findSubsetByUUID(Set<String> rootModels) throws MTAccessException
      Finds a subset of models by following breakdowns from a set of root models.
      Parameters:
      rootModels - The root models UUID:s
      Returns:
      The model ID:s of models included in the subset.
      Throws:
      MTAccessException
      Since:
      3.0
    • findModelHeadersByUUID

      MTIterator<MTModelHeader> findModelHeadersByUUID(List<String> uuidList) throws MTAccessException
      Finds models in this workspace from a list of model UUID:s, as headers. The models will be returned in the same order as the UUID list. Models which the current user does not have read access to will be filtered out of the result.
      Parameters:
      uuidList - The UUID:s of models to find.
      Returns:
      A list of models with the UUID:s in uuidList.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSymbol

      MTSymbol findSymbol(String uuid) throws MTAccessException
      Finds a symbol by UUID in this workspace.
      Parameters:
      uuid - The UUID.
      Returns:
      The symbol with the given UUID, or null if no such symbol exists in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSymbolIDs

      List<Long> findSymbolIDs() throws MTAccessException
      Finds the ID:s of all symbols in this workspace. If the workspace is the currently opened workspace, the ID:s returned will be ordered by title in the current language. Otherwise the ID:s will be returned in no specific order.
      Returns:
      The ID:s of all symbols in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSymbolUUIDs

      List<String> findSymbolUUIDs() throws MTAccessException
      Finds the UUID:s of all symbols in this workspace. If the workspace is the currently opened workspace, the UUID:s returned will be ordered by title in the current language. Otherwise the UUID:s will be returned in no specific order.
      Returns:
      The UUID:s of all symbols in this workspace.
      Throws:
      MTAccessException
    • findSymbolIDs

      List<Long> findSymbolIDs(SymbolType symbolType, String variant, String orderBy, String filter) throws MTAccessException
      Finds the ID:s of all symbols with a given type in this workspace. If the workspace is the currently opened workspace, the ID:s returned will be ordered by title in the current language. Otherwise the ID:s will be returned in no specific order.
      Parameters:
      symbolType - the type of objects to return (can be null)
      variant - the symbol variant (can be null)
      orderBy - the field to sort by (can be null)
      filter - title must contain this text (can be null)
      Returns:
      The ID:s of all symbols of the given type in this workspace.
      Throws:
      MTAccessException
      Since:
      3.1
    • findSymbolsByName

      List<Long> findSymbolsByName(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive)
      Finds symbols in this workspace by name. Symbols 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 symbol headers that the current user has read access to, and that matches the given searchString in the given language, with the given "exactness".
    • findSymbols

      MTIterator<MTSymbol> findSymbols() throws MTAccessException
      Finds all symbols in this workspace.
      Returns:
      An iterator over all symbols in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findSymbolHeaders

      MTIterator<MTSymbolHeader> findSymbolHeaders() throws MTAccessException
      Finds all symbols in this workspace as headers.
      Returns:
      An iterator over all symbols in this workspace.
      Throws:
      MTAccessException
      Since:
      3.0
    • findUnusedSymbolIDs

      List<Long> findUnusedSymbolIDs() throws MTAccessException
      Finds the ID:s of all unused symbols in this workspace. If the workspace is the currently opened workspace, the ID:s returned will be ordered by title in the current language. Otherwise the ID:s will be returned in no specific order.
      Returns:
      The ID:s of all unused symbols (not in any models) in this workspace.
      Throws:
      MTAccessException
      Since:
      3.1
    • replaceSymbols

      void replaceSymbols(Collection<MTSymbolHeader> symbolsToReplace, MTSymbolHeader replaceWith) throws MTRemoteChangeException
      Goes through all models and finds any symbols in symbolsToReplace and replaces them with replaceWith.
      Throws:
      MTAccessException
      MTRemoteChangeException
      Since:
      3.1
    • replaceDocumentTypes

      void replaceDocumentTypes(Collection<MTDocumentTypeHeader> documentTypesToReplace, MTDocumentTypeHeader replaceWith) throws MTRemoteChangeException
      Goes through all documents and finds any document type in documentTypesToReplace and replaces them with replaceWith.
      Throws:
      MTAccessException
      MTRemoteChangeException
      Since:
      9.0
    • replaceDocuments

      void replaceDocuments(Collection<MTDocumentHeader> documentsToReplace, MTDocumentHeader replaceWith) throws MTRemoteChangeException
      Goes through all models and symbols and finds any documents in documentsToReplace and replaces them with replaceWith.
      Throws:
      MTAccessException
      MTRemoteChangeException
      Since:
      9.0
    • restoreSymbol

      Long restoreSymbol(String uuid)
      Tries to restore a symbol that was previously removed and add it back to this workspace.
      Parameters:
      uuid - The uuid of the symbol to restore.
      Returns:
      The id of the symbol if it was successfully found and restored, null otherwise.
    • createQuery

      MTQuery createQuery()
      Creates a query for selecting MT-objects.
    • createQuery

      MTQuery createQuery(Element queryElement)
      Re-creates a query that has been serialized to XML.
    • createSymbol

      MTCompleteSymbol createSymbol(SymbolVariant variant, String uuid)
      Creates a new symbol in the workspace.
      Parameters:
      variant - The variant of the symbol.
      uuid - The UUID of the new symbol.
      Returns:
      A new symbol for the workspace.
    • createModel

      MTCompleteModel createModel(ModelType modelType, String uuid)
      Creates a new model, with default settings.
      Parameters:
      modelType - The type of model to create.
      uuid - The UUID of the new model.
      Returns:
      A new MTModel.
      Since:
      3.0
    • getBulkOperations

      MTBulkOperations getBulkOperations()
      Returns a utility for performing bulk operations against the server for this workspace.
      Returns:
      A bulk operations utility.
    • findRemovedEntities

      Map<String,String> findRemovedEntities()
      Finds information about entities that have been removed from this workspace.
      Returns:
      A map where the keys are the UUID:s of the removed entities and the values are their history paths at the time of removal.
    • findModelByPrefix

      MTModel findModelByPrefix(String prefix)
      Finds a model by prefix.
      Parameters:
      prefix - The prefix.
      Returns:
      The model with the given prefix or null if no such model exists.
    • findModelByReferenceID

      MTModel findModelByReferenceID(String referenceID)
      Finds a model by reference id.
      Parameters:
      referenceID - The reference id.
      Returns:
      The model with the given reference id or null if no such model exists.
    • findSymbolByPrefix

      MTSymbol findSymbolByPrefix(String prefix)
      Finds a symbol by prefix.
      Parameters:
      prefix - The prefix.
      Returns:
      The symbol with the given prefix or null if no such symbol exists.
    • findSymbolByReferenceID

      MTSymbol findSymbolByReferenceID(String referenceID)
      Finds a symbol by reference id.
      Parameters:
      referenceID - The reference id.
      Returns:
      The symbol with the given reference id or null if no such symbol exists.
    • findRelationships

      List<Map<String,Object>> findRelationships(Collection<Long> symbolIDs, Collection<Long> searchModelsID, MTLanguage language, Collection<? extends MTLayerTypeHeader> includedLayers)
      Returns edges connected to the given symbols.
      Parameters:
      symbolIDs - symbols the edges are connected to
      searchModelsID - the models to look in
      language - the language of the titles returned
      includedLayers - The layers to take into account when calculating relationships, if null all layers will be considered.
      Returns:
      a list of edges where the map has the following entries { from-symbol-id: long, incoming: boolean, edge-type: String, to-symbol-id: long, to-symbol-type: String, to-symbol-variant: String, to-symbol-title: String }
    • findRelationships

      List<Map<String,Object>> findRelationships(Collection<Long> symbolIDs, MTLanguage language, Collection<? extends MTLayerTypeHeader> includedLayers)
      Returns edges connected to the given symbols in the current workspace.
      Parameters:
      symbolIDs - symbols the edges are connected to
      language - the language of the titles returned
      includedLayers - The layers to take into account when calculating relationships, if null all layers will be considered.
      Returns:
      a list of edges where the map has the following entries { from-symbol-id: long, incoming: boolean, edge-type: String, to-symbol-id: long, to-symbol-type: String, to-symbol-variant: String, to-symbol-title: String }
    • createPluginData

      MTPluginData createPluginData(MTDataProvider provider, String key)
      Creates a new plug-in data connected to this workspace.
      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 workspace.
      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
    • getPluginDataBulkOperations

      MTPluginDataOperations getPluginDataBulkOperations()