Package se.conciliate.extensions.store
Interface MTSymbol
- All Superinterfaces:
Comparable<MTNamedObject>
,MTDataObject
,MTHistoryEnabled
,MTNamedObject
,MTSymbolHeader
- All Known Subinterfaces:
MTCompleteSymbol
Full interface for symbols. A symbol could be for example
a role, a process or an individual. Each symbol can be placed in
one or more models where they are represented by vertices.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from interface se.conciliate.extensions.store.MTSymbolHeader
LOCK_TIME_PERIOD
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocument
(MTDocument document) Adds a document to the symbol.boolean
boolean
Prepares for a change to the current revision of the symbol, i.e.default void
connectDocument
(Document document) Connects a document to a symbol.default void
Connects a document to a symbol.Prepares for creating a new revision of the symbol.default void
disconnectDocument
(Document document) Disconnects a document from the symbol.default void
Disconnects a document from the symbol.Returns the attribute of the given type.getAttributes
(Predicate<MTAttribute> filter) Returns all attributes connected to the symbol.Returns the UUID:s for all models that this symbol breaks down to.getGroup()
Returns the "access control" group of this object.Returns the user that last modified this object.getOwner()
Returns "access control" owner of this object.Returns "access control" permissions for this object.getProperty
(String provider, String name) Returns a property value.getPropertyKeys
(String provider) Returns the property names of all properties stored by a provider.Returns all providers that have stored properties.Returns the revision log for this revision of the symbol.boolean
Returns true if there is plug-in data connected to the entity.Prepares for locking the current revision of the symbol.void
queueSave
(MTRemoteChangeHandler exceptionHandler) Puts this symbol on a save queue, making this call safe to do from the event dispatch thread.void
removeDocument
(MTDocumentHeader document) Removes a document from the symbol.void
removeProperty
(String provider, String name) Removes a property.Prepares for reverting to an earlier revision of the symbol.void
save()
Saves a new symbol or changes to an existing one.void
setBreakdownUUIDs
(Collection<String> models) Sets the UUID:s for all models that this symbol breaks down to.void
setCreated
(Date date) Sets the creation date for the symbol.void
setCreatedBy
(MTUserHeader user) void
setGroup
(MTPermissionGroup group) Sets the group that the symbol belongs to.void
setLastModified
(Date date) Sets the last modified date for the symbol.void
Set the last user that modified this object.void
setOwner
(MTUserHeader owner) Sets the owner of the symbol.void
setPermissions
(int permissions) void
setPermissions
(MTPermissions permissions) Sets "access control" permissions for this object.void
Sets a prefix used to identify this symbol.void
setPrefixLocked
(boolean locked) Locks the current prefix so it cannot be modified.void
setProperty
(String provider, String name, String value) Sets a property value.void
setReferenceID
(String referenceID) Sets the reference ID of the model.void
Sets the title in the current language.void
setTitle
(MTLanguageHeader lang, String title) Sets the title in a given language.void
setTranslated
(MTLanguage lang, boolean translated) Marks this symbol as translated in the given language.void
setType
(SymbolType type) Sets the type of the symbol.void
setVariant
(SymbolVariant variant) Sets the variant for symbol types that have different variants.Methods inherited from interface se.conciliate.extensions.store.MTDataObject
getCreated, getLastModified, getLastModifiedByName, getOwnerName, getPrefix, getReferenceID, getTypeID, isPrefixLocked, isRevisionLocked, isTranslated, isTranslated
Methods inherited from interface se.conciliate.extensions.store.MTHistoryEnabled
getHistory, getID, getUUID
Methods inherited from interface se.conciliate.extensions.store.MTNamedObject
compareTo, getID, getParentRevisionID, getTitle, getTitle, getUUID
Methods inherited from interface se.conciliate.extensions.store.MTSymbolHeader
createPluginData, expand, findAttributeByType, findAttributeHeaders, findAttributes, findBreakdownHeaders, findBreakdowns, findDocumentHeaders, findDocumentIDs, findDocuments, findEdgeIDs, findExtensionDocuments, findParticipatesInModelIDs, findParticipatesInModels, findPluginData, findResponsibleForDocumentIDs, findRevisions, findVertexHeaders, findVertices, getGroupTitle, getNewPluginData, getNewPluginRelations, getPluginDataBulkOperations, getRawTitle, getRawTitle, getRevision, getType, getVariant, load, lock, releaseLock, remove, restore, setNewPluginData, setNewPluginRelations
-
Field Details
-
WEB_COMPONENT_PROVIDER
- See Also:
-
WEB_COMPONENT_URL_PROPERTY
- See Also:
-
WEB_COMPONENT_CONTENT_TYPE_PROPERTY
- See Also:
-
WEB_COMPONENT_ON_CLICK_URL_PROPERTY
- See Also:
-
-
Method Details
-
canUserRead
boolean canUserRead() -
canUserWrite
boolean canUserWrite() -
getOwner
MTUserHeader getOwner()Returns "access control" owner of this object.- Returns:
- owner of object
-
getGroup
MTPermissionGroup getGroup()Returns the "access control" group of this object.- Returns:
- object group
-
getLastModifiedBy
MTUserHeader getLastModifiedBy()Returns the user that last modified this object.- Returns:
- the last user that modified this object.
-
setLastModifiedBy
Set the last user that modified this object.- Parameters:
user
- the last user that modified this object.
-
getCreatedBy
MTUserHeader getCreatedBy() -
setCreatedBy
-
getPermissions
MTPermissions getPermissions()Returns "access control" permissions for this object.- Returns:
- permissions for object
-
setPermissions
Sets "access control" permissions for this object.- Parameters:
permissions
- permissions for this object
-
setPermissions
void setPermissions(int permissions) -
setLastModified
Sets the last modified date for the symbol. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the symbol is saved.- Parameters:
date
- The new last modified date
-
setCreated
Sets the creation date for the symbol. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the symbol is saved.- Parameters:
date
- The new last modified date
-
getPropertyProviders
Returns all providers that have stored properties.- Returns:
- A set of provider ID:s
- Since:
- 3.0
-
getPropertyKeys
Returns the property names of all properties stored by a provider.- Parameters:
provider
- The provider ID.- Returns:
- A set of property names.
-
getProperty
Returns a property value.- Parameters:
provider
- The provider ID.name
- The property name.- Returns:
- The property value or null.
- Since:
- 3.0
-
setProperty
Sets a property value.- Parameters:
provider
- The ID of the provider setting this property.name
- The property name.value
- The new property value. Values longer than 255 characters will be truncated.- Since:
- 3.0
-
removeProperty
Removes a property.- Parameters:
provider
- The ID of the provider setting this property.name
- The property name.
-
getAttributes
Returns all attributes connected to the symbol.- Parameters:
filter
- If this returns false for an MTAttribute, it will not be in the returned list.- Returns:
- All attributes connected to the symbol.
- Since:
- 5.0
-
getAttribute
Returns the attribute of the given type.- Parameters:
type
- the type of the attribute to return- Returns:
- the attribute of the given type
- Throws:
IllegalArgumentException
- If the attribute type is not connected to this symbol's type- Since:
- 5.0
-
getRevisionLog
List<MTRevisionLogEntry> getRevisionLog()Returns the revision log for this revision of the symbol.- Returns:
- The revision log.
- Since:
- 3.0
-
getBreakdownUUIDs
Collection<String> getBreakdownUUIDs()Returns the UUID:s for all models that this symbol breaks down to. The result does not take workspaces into account, so it is not guaranteed that all of the models exist in the current workspace.- Returns:
- The UUID:s of all models that this symbol breaks down to.
- Since:
- 3.0
-
setBreakdownUUIDs
Sets the UUID:s for all models that this symbol breaks down to. The new breakdowns will be saved when the symbol is saved.- Since:
- 3.0
-
setType
Sets the type of the symbol. This will not remove existing data but might prevent access to the data if the new type is not recognized as having that data. This is specifically the case for plugin data. Generally, one should not change the type defined by a certain model extension to a type defined by another model extension.- Parameters:
type
- The new type of the symbol
-
setTitle
Sets the title in the current language.- Parameters:
title
- The new title.- Since:
- 3.0
-
setTitle
Sets the title in a given language.- Parameters:
lang
- The language.title
- The new title.- Since:
- 3.0
-
setReferenceID
Sets the reference ID of the model. This is the reference ID used to identify the model for example when creating HTML pages. If no reference ID has been set the UUID will be used.- Parameters:
referenceID
- referenceID The new reference ID ornull
to clear the reference ID.- Since:
- 3.1
-
setVariant
Sets the variant for symbol types that have different variants. The variant must be one of the available variants for the current symbol type.- Parameters:
variant
- The new variant.- Throws:
IllegalArgumentException
- If the variant is not one of the available variants for the current symbol type.- Since:
- 3.0
-
setOwner
Sets the owner of the symbol.- Parameters:
owner
- The new owner.- Since:
- 3.0
-
setGroup
Sets the group that the symbol belongs to.- Parameters:
group
- The new group.- Since:
- 3.0
-
setTranslated
Marks this symbol as translated in the given language.- Since:
- 3.1
-
setPrefix
Sets a prefix used to identify this symbol. If used the prefix can be used for filtering/finding symbols easier. -
setPrefixLocked
void setPrefixLocked(boolean locked) Locks the current prefix so it cannot be modified. -
addDocument
Adds a document to the symbol.- Parameters:
document
- The document to add.- Since:
- 3.0
-
removeDocument
Removes a document from the symbol.- Parameters:
document
- The document to remove.- Since:
- 3.0
-
connectDocument
Connects a document to a symbol. -
connectDocument
Connects a document to a symbol. -
disconnectDocument
Disconnects a document from the symbol. -
disconnectDocument
Disconnects a document from the symbol. -
queueSave
Puts this symbol on a save queue, making this call safe to do from the event dispatch thread.- Parameters:
exceptionHandler
- an exception handler that is called if an exception is raised during save, or null to let the saving thread's own exception handler deal with an uncaught (wrapping) runtime exception.- Throws:
MTAccessException
-
save
Saves a new symbol or changes to an existing one. A symbol can only be saved in the current workspace.- Throws:
MTAccessException
MTRemoteChangeException
- Since:
- 3.0
-
hasPluginData
boolean hasPluginData()Returns true if there is plug-in data connected to the entity. -
lockRevision
MTRevisionOperation lockRevision()Prepares for locking the current revision of the symbol. Calling this method does not actually lock the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the lock operation.- Returns:
- A revision operation object that can be used to perform the lock operation assuming that locks could be obtained successfully.
-
changeRevision
MTRevisionOperation changeRevision()Prepares for a change to the current revision of the symbol, i.e. add a message to the revision log of the current revision. Calling this method does not actually change the revision. It obtains a lock on the model. The returned operation object can be used to actually commit the change to the revision.- Returns:
- A revision operation object that can be used to perform the change operation assuming that a lock could be obtained successfully.
-
createRevision
MTRevisionOperation createRevision()Prepares for creating a new revision of the symbol. Calling this method does not actually create the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the create operation.- Returns:
- A revision operation object that can be used to perform the create operation assuming that locks could be obtained successfully.
-
revertToRevision
Prepares for reverting to an earlier revision of the symbol. If the current revision of this symbol is open, the data from the earlier revision will be copied to this revision of the symbol. If the current revision is lost a new revision will be created in the current workspace and the data will be copied to this revision. This will also create new revisions of any models in the workspace that uses the symbol.- Parameters:
rev
- The revision to revert to.- Returns:
- A revision operation object that can be used to perform the revert operation assuming that locks could be obtained successfully.
-