Package se.conciliate.extensions.store
Interface MTSymbolStore
public interface MTSymbolStore
Utility methods for symbols.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a symbol store listener that will be notified when a symbol is added, removed or changed through the store api.void
batchLock
(Collection<? extends MTSymbolHeader> symbols) Locks all supplied symbols and returns normally or locks no symbol and throws an exception.createSymbol
(SymbolVariant symbolVariant, String uuid, String title) Creates a new symbol, with default settings.findAttributes
(Collection<MTSymbol> symbols, Collection<? extends MTAttributeTypeHeader> types) Finds all attributes for a collection of symbols.findEntityProperties
(List<Long> idList) Finds entity properties for symbols in information models.findRevisionLogEntries
(String symbolUUID) Finds all entries made in the revision log for a symbol in the current repository.findSymbol
(long id) Finds a symbol by ID.findSymbolHeaders
(List<Long> idList) Finds symbols in the current repository from a list of symbol ID:s, as headers.findSymbols
(List<Long> idList) Finds symbols in the current repository from a list of symbol ID:s.void
Removes a symbol store listener.
-
Method Details
-
addMTSymbolStoreListener
Adds a symbol store listener that will be notified when a symbol is added, removed or changed through the store api.- Parameters:
l
- a MTModelStoreListener
-
removeMTSymbolStoreListener
Removes a symbol store listener.- Parameters:
l
- The MTModelStoreListener to remove.
-
createSymbol
MTSymbol createSymbol(SymbolVariant symbolVariant, String uuid, String title) throws MTAccessException Creates a new symbol, with default settings.- Parameters:
symbolVariant
- The symbol variant to create.title
- The title of the new symbol.- Returns:
- A new
MTSymbol
. - Throws:
MTAccessException
- Since:
- 3.0
-
findSymbols
Finds symbols in the current repository from a list of symbol ID:s. The symbols will be returned in the same order as the ID list. Symbols which the current user does not have read access to will be filtered out of the result.- Parameters:
idList
- The ID:s of symbols to find.- Returns:
- A list of symbols with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
findEntityProperties
Finds entity properties for symbols in information models.- Parameters:
idList
- List of ID:s of entity property plugin data.- Returns:
- A list of entity properties
-
findSymbol
Finds a symbol by ID.- Parameters:
id
- The symbol ID.- Returns:
- A symbol or
null
if no such model exists. - Throws:
MTAccessException
- Since:
- 3.3
-
findSymbolHeaders
Finds symbols in the current repository from a list of symbol ID:s, as headers. The symbols will be returned in the same order as the ID list. Symbols which the current user does not have read access to will be filtered out of the result.- Parameters:
idList
- The ID:s of symbols to find.- Returns:
- A list of symbols with the ID:s in
idList
. - Throws:
MTAccessException
- Since:
- 3.0
-
batchLock
void batchLock(Collection<? extends MTSymbolHeader> symbols) throws MTAccessException, MTRemoteChangeException Locks all supplied symbols and returns normally or locks no symbol and throws an exception. This is the preferred way to lock multiple symbols. Looping over a collection of symbols and invokingMTSymbolHeader.lock()
is discourage since it is not possible to either lock all or none. This method is able to either lock all or none.- Parameters:
symbols
- The symbols to lock.- Throws:
MTAccessException
- If the current user lacks access rights to one of the supplied symbols.MTRemoteChangeException
- If one of the supplied symbols has been locked by someone else or if one of the supplied symbols is out of date.
-
findRevisionLogEntries
Finds all entries made in the revision log for a symbol in the current repository. This includes entries for all revisions made of the symbol.- Parameters:
symbolUUID
- The UUID of the symbol.- Returns:
- All revision log entries for the symbol.
-
findAttributes
Map<MTSymbol,List<MTAttribute>> findAttributes(Collection<MTSymbol> symbols, Collection<? extends MTAttributeTypeHeader> types) Finds all attributes for a collection of symbols.
-