Package se.conciliate.extensions.store
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 Summary
Modifier and TypeMethodDescriptioncreateAttributeType
(String uuid, String inputType, String dataType) Creates a new attribute type.default MTCachedList
createCachedList
(MTList list) createCachedList
(MTList list, boolean lockedRevisions, boolean includeInitialRevisions) Creates and returns a cached list for a relative list.void
Creates the default description type for a repository and connects it to all currently available symbol types.createDocument
(String uuid) Creates a new document, with default settings.createDocumentType
(String uuid) Creates a new document type in the repository.createExtensionDocument
(String uuid, String href, String name, String provider, Date created, boolean isLeaf, byte[] icon) Creates a new MTExtensionDocument instance with the supplied values.createImage
(String uuid) Creates a new image in storage.Creates a new language for the repository.createLayerType
(String uuid) Creates a new layer type in the repository.createList
(boolean staticList, String uuid) Creates and returns a new list.createPluginData
(MTDataProvider provider, String key) Creates a new plug-in data connected to this repository.createPublishProfile
(String type) Creates a new publish profile in this repository.createTimestamp
(String uuid, String type) Creates a new timestamp.createVariable
(String type, String key) Creates a new variable.Creates a helper object for substituting variables in the repository, properties and enviroment variables.Creates a helper object for substituting variables in the repository, properties or enviroment variables.createVariableSubstitution
(String[] types) Creates a helper object for substituting variables in the repository.expand()
Returns aMTRepository
for this status.Finds all groups with access to this repository.Finds all users with access to this repository, directly or through groups.Finds all attributes in this repository as headers.Finds all attributes in this repository associated with the given attribute type as headers.Finds all attributes in this repository.findAttributeType
(String uuid) Finds an attribute type by UUID in this repository.Finds all attribute types in this repository as headers.Finds all attribute types in this repository.findAttributeTypes
(ModelType type) Finds all attribute types for the model type.findAttributeTypes
(SymbolType type) Finds all attribute types for the symbol type.Finds the color scheme for this repository.findDocument
(String uuid) Finds a MT document by UUID in this repository.Finds a document by its global document id.findDocumentByPrefix
(String prefix) Finds a document by prefix.Finds all documents in this repository as headers.Finds the ID:s of all documents in this repository.Finds all documents in this repository.findDocuments
(String searchString, MTLanguage lang) Searches through existing documents looking for a document that has a title in the given language containing the supplied string.findDocuments
(List<Long> ids) Returns a list of document headers with the ids of the supplied list.findDocumentsByName
(String searchString, Collection<? extends MTLanguage> searchedLanguages, boolean exactMatch, boolean caseSensitive) Finds documents in this repository by name.findDocumentsByUUID
(List<String> uuidList) Finds documents in this repository from a list of document UUID:s.findDocumentType
(String uuid) Finds a document type by UUID in this repository.Finds all document types in this repository as headers.Finds the ID:s of all document types in this repository.Finds all document types in this repository.Finds an image that has been stored in this repository.Returns the UUID:s of all available images.Finds all languages in the repository as headers.Finds all languages in the repository.Finds all layer types available, as headers.findLayerTypeHeaders
(ModelType modelType) Finds all layer types available for a given model type, as headers.Finds all layer types available.findLayerTypes
(ModelType modelType) Finds all layer types available for a given model type.Finds a list that has been stored in this repository.Returns all lists that are in this repository.findListsFor
(String objectType) Returns all lists that act on the specified objectType.long
Finds number of models in this repository.Finds all permission groups available in this repository.findPluginData
(MTDataProvider provider, String key) Finds plug-in data connected to this repository.Deprecated.For internal use only, replaced by PublishProfileLocatorServiceReturns all non-static lists for this repository.Returns all static lists for this repository.long
Finds number of symbols in this repository.Finds all users with direct access to this repository.Finds all variables in this repository, enviroment variables and java properties.findVariables
(String type) Finds all variables in this repository of a given type.findVariables
(String[] types) Finds all variables in this repository that has at least one of the given types.Finds all workspaces in this repository as headers.Finds all workspaces in this repository.Returns the creation date of the repository.Returns the parent directory for the repository, or null if this repository has no parent i.e.long
getID()
Returns the ID of the repository.Returns the last modification date of the repository.Returns status of this repository.getTitle()
Returns the title of the repository.getUUID()
Returns this repositorys unique identifier.boolean
isDraft()
boolean
Returns true if permissions are enabled in the repository.boolean
Returns true if this repository is a template.Tries to get an exclusive lock for editing in this repository.boolean
unlock
(short lockID) Unlocks a locked repository.
-
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 aMTRepository
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
Creates a new variable.- Parameters:
type
- The variable type. 'env' is reserved for enviroment variables and 'propery' is reserved for java propertieskey
- The variable key.- Returns:
- A new
MTVariable
. - Since:
- 3.0
-
createTimestamp
Creates a new timestamp.- Parameters:
type
- The timestamp type.- Returns:
- A new
MTVariable
.
-
findVariables
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
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
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
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
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
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
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
Returns the UUID:s of all available images.- Returns:
- All image UUID:s
-
createImage
Creates a new image in storage.- Parameters:
uuid
- The uuid of the new image.
-
findLanguageHeaders
Finds all languages in the repository as headers.- Returns:
- All languages in the repository.
- Throws:
MTAccessException
- Since:
- 3.0
-
findLanguages
Finds all languages in the repository.- Returns:
- All languages in the repository.
- Throws:
MTAccessException
- Since:
- 3.0
-
findWorkspaceHeaders
Finds all workspaces in this repository as headers.- Returns:
- A list of workspace headers.
- Throws:
MTAccessException
- Since:
- 3.0
-
findWorkspaces
Finds all workspaces in this repository.- Returns:
- A list of workspaces.
- Throws:
MTAccessException
- Since:
- 3.0
-
findModelCount
Finds number of models in this repository.- Returns:
- number of models.
- Throws:
MTAccessException
- Since:
- 3.0
-
findSymbolCount
Finds number of symbols in this repository.- Returns:
- number of symbols.
- Throws:
MTAccessException
- Since:
- 4.0
-
findAttributeTypeHeaders
Finds all attribute types in this repository as headers.- Returns:
- A list of attribute type headers.
- Throws:
MTAccessException
- Since:
- 5.0
-
findAttributeTypes
Finds all attribute types in this repository.- Returns:
- A list of attribute types.
- Throws:
MTAccessException
- Since:
- 5.0
-
findAttributeTypes
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
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
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
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
MTIterator<MTAttributeHeader> findAttributeHeaders(MTAttributeTypeHeader type) throws MTAccessException 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
Finds all attributes in this repository as headers.- Returns:
- An iterator over all attributes in the repository.
- Throws:
MTAccessException
- Since:
- 5.0
-
findAttributes
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
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 isspace
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 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 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
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
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
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
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
Finds all documents in this repository as headers.- Returns:
- An iterator over all documents in this repository.
- Throws:
MTAccessException
- Since:
- 3.0
-
findDocuments
Finds all documents in this repository.- Returns:
- An iterator over all documents in this repository.
- Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentsByUUID
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
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
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
Finds all document types in this repository.- Returns:
- An iterator over all document types in the repository.
- Throws:
MTAccessException
- Since:
- 3.0
-
findDocumentTypeHeaders
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
Finds all users with direct access to this repository. -
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
Deprecated.For internal use only, replaced by PublishProfileLocatorServiceReturns a all publish profiles in the repository.- Returns:
- Profiles in repository
- Throws:
MTAccessException
- Since:
- 3.2
-
findLists
Returns all lists that are in this repository.- Returns:
- all lists that are in this repository.
- Since:
- 3.0
-
findList
Finds a list that has been stored in this repository.- Returns:
- The list or
null
if no list was found. - Since:
- 5.0
-
findListsFor
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
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
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
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. Ifnull
all data for the provider will be returned.- Returns:
- The resulting plug-in data
- Throws:
MTAccessException
- Since:
- 3.1
-
createPublishProfile
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
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
-
createLayerType
Creates a new layer type in the repository.- Parameters:
uuid
- The UUID of the created layer type.- Returns:
- A new category.
-
createDocument
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 documenthref
- The url in string representation of the documentname
- The name of the documentprovider
- The name/id of the provider of the documentcreated
- The creation time of the documentisLeaf
- 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
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
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
Finds all layer types available, as headers.- Returns:
- A list of layer type headers.
- Throws:
MTAccessException
- Since:
- 3.0
-
findLayerTypes
Finds all layer types available.- Returns:
- A list of layer type headers.
- Throws:
MTAccessException
- Since:
- 3.0
-
findColorScheme
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
Creates a new document type in the repository.- Returns:
- A new document type.
-
getPluginDataBulkOperations
MTPluginDataOperations getPluginDataBulkOperations() -
lock
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
Finds a document by prefix.- Parameters:
prefix
- The prefix.- Returns:
- The document with the given prefix or null if no such document exists.
-
findImages
-
isDraft
boolean isDraft()
-