Package se.conciliate.extensions.store
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 Summary
Modifier and TypeMethodDescriptioncreateModel
(ModelType modelType, String uuid) Creates a new model, with default settings.createPluginData
(MTDataProvider provider, String key) Creates a new plug-in data connected to this workspace.Creates a query for selecting MT-objects.createQuery
(Element queryElement) Re-creates a query that has been serialized to XML.createSymbol
(SymbolVariant variant, String uuid) Creates a new symbol in the workspace.expand()
Returns aMTWorkspace
for this workspace.findBreakdowns
(Collection<Long> rootModels) Finds all breakdowns from a set of root models in this workspace.Finds the child workspaces as headers.Finds the child workspaces.boolean
findIsReferenceIDExisting
(String referenceID) Returns true if the given reference id already exists in this workspace.Finds a model by UUID in this workspace.findModelByPrefix
(String prefix) Finds a model by prefix.findModelByReferenceID
(String referenceID) Finds a model by reference id.Finds all models in this workspace as headers.findModelHeaders
(ModelType type) Finds all models with a given type in this workspace as headers.findModelHeadersByUUID
(List<String> uuidList) Finds models in this workspace from a list of model UUID:s, as headers.Finds the ID:s of all models in this workspace.findModelIDs
(ModelType modelType) Finds the ID:s of all models of a given type in this workspace.Finds all models in this workspace.findModels
(ModelType modelType) Finds all models with a given type in this workspace.findModelsByName
(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive) Finds models in the current workspace by name.findModelsByUUID
(List<String> uuidList) Finds models in this workspace from a list of model UUID:s.Finds the UUID:s of all models in this workspace.findPluginData
(MTDataProvider provider, String key) Finds plug-in data connected to this workspace.findRelationships
(Collection<Long> symbolIDs, Collection<Long> searchModelsID, MTLanguage language, Collection<? extends MTLayerTypeHeader> includedLayers) Returns edges connected to the given symbols.findRelationships
(Collection<Long> symbolIDs, MTLanguage language, Collection<? extends MTLayerTypeHeader> includedLayers) Returns edges connected to the given symbols in the current workspace.Finds information about entities that have been removed from this workspace.Finds models that were previously removed from this workspace.Finds symbols that were previously removed from this workspace.findSubset
(Set<Long> rootModels) Finds a subset of models by following breakdowns from a set of root models.findSubsetByUUID
(Set<String> rootModels) Finds a subset of models by following breakdowns from a set of root models.findSymbol
(String uuid) Finds a symbol by UUID in this workspace.findSymbolByPrefix
(String prefix) Finds a symbol by prefix.findSymbolByReferenceID
(String referenceID) Finds a symbol by reference id.Finds all symbols in this workspace as headers.Finds the ID:s of all symbols in this workspace.findSymbolIDs
(SymbolType symbolType, String variant, String orderBy, String filter) Finds the ID:s of all symbols with a given type in this workspace.Finds all symbols in this workspace.findSymbolsByName
(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive) Finds symbols in this workspace by name.Finds the UUID:s of all symbols in this workspace.Finds the ID:s of all unused symbols in this workspace.Returns a utility for performing bulk operations against the server for this workspace.Returns the creation date of the workspace.long
getID()
Returns the ID of the workspace.long
Returns the ID of the repository that this workspace belongs to.getTitle()
Returns the title of the workspace.boolean
isActive()
Returns true if this is an "active" workspace that is shown by default in the list of workspaces.boolean
isLocked()
Checks if the workspace is locked (a snapshot).void
replaceDocuments
(Collection<MTDocumentHeader> documentsToReplace, MTDocumentHeader replaceWith) Goes through all models and symbols and finds any documents indocumentsToReplace
and replaces them withreplaceWith
.void
replaceDocumentTypes
(Collection<MTDocumentTypeHeader> documentTypesToReplace, MTDocumentTypeHeader replaceWith) Goes through all documents and finds any document type indocumentTypesToReplace
and replaces them withreplaceWith
.void
replaceSymbols
(Collection<MTSymbolHeader> symbolsToReplace, MTSymbolHeader replaceWith) Goes through all models and finds any symbols insymbolsToReplace
and replaces them withreplaceWith
.restoreSymbol
(String uuid) Tries to restore a symbol that was previously removed and add it back to this workspace.
-
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 aMTWorkspace
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
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
Finds the child workspaces. Only snapshots will have child workspaces.- Returns:
- A list of child workspaces.
- Throws:
MTAccessException
- Since:
- 3.0
-
findChildHeaders
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
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
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
- Throws:
MTAccessException
-
findModelUUIDs
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
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
Finds all models in this workspace.- Returns:
- An iterator over all models in this workspace.
- Throws:
MTAccessException
- Since:
- 3.0
-
findModels
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 forsearchedLanguages
- the languages to search inexactMatch
- 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
Finds all models in this workspace as headers.- Returns:
- An iterator over all models in this workspace.
- Throws:
MTAccessException
- Since:
- 3.0
-
findModelHeaders
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
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
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
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
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
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
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
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
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 forsearchedLanguages
- the languages to search inexactMatch
- 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
Finds all symbols in this workspace.- Returns:
- An iterator over all symbols in this workspace.
- Throws:
MTAccessException
- Since:
- 3.0
-
findSymbolHeaders
Finds all symbols in this workspace as headers.- Returns:
- An iterator over all symbols in this workspace.
- Throws:
MTAccessException
- Since:
- 3.0
-
findUnusedSymbolIDs
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 insymbolsToReplace
and replaces them withreplaceWith
.- 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 indocumentTypesToReplace
and replaces them withreplaceWith
.- 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 indocumentsToReplace
and replaces them withreplaceWith
.- Throws:
MTAccessException
MTRemoteChangeException
- Since:
- 9.0
-
restoreSymbol
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
Re-creates a query that has been serialized to XML. -
createSymbol
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
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
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
Finds a model by prefix.- Parameters:
prefix
- The prefix.- Returns:
- The model with the given prefix or null if no such model exists.
-
findModelByReferenceID
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
Finds a symbol by prefix.- Parameters:
prefix
- The prefix.- Returns:
- The symbol with the given prefix or null if no such symbol exists.
-
findSymbolByReferenceID
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 tosearchModelsID
- the models to look inlanguage
- the language of the titles returnedincludedLayers
- 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 tolanguage
- the language of the titles returnedincludedLayers
- 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
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. Ifnull
all data for the provider will be returned.- Returns:
- The resulting plug-in data
- Throws:
MTAccessException
-
getPluginDataBulkOperations
MTPluginDataOperations getPluginDataBulkOperations()
-