Interface RecordsManagementAdminService
- All Known Subinterfaces:
RecordsManagementAdminService
- All Known Implementing Classes:
RecordsManagementAdminServiceImpl
public interface RecordsManagementAdminService
Records management custom model service interface. Implementations of this class are responsible
for the creation and maintenance of RM-related custom properties and custom associations.
- Since:
- 2.1
- Author:
- Neil McErlean, janv
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddCustomAssocDefinition
(String label) Deprecated.addCustomChildAssocDefinition
(String source, String target) Deprecated.as of RM 2.3, please useRelationshipService.createRelationshipDefinition(org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipDisplayName)
instead.void
addCustomConstraintDefinition
(QName constraintName, String title, boolean caseSensitive, List<String> allowedValues, RMListOfValuesConstraint.MatchLogic matchLogic) This method adds a Constraint definition to the custom model.addCustomPropertyDefinition
(QName propId, QName typeName, String label, QName dataType, String title, String description) Add custom property definition Note: no default value, single valued, optional, not system protected, no constraintsaddCustomPropertyDefinition
(QName propId, QName typeName, String label, QName dataType, String title, String description, String defaultValue, boolean multiValued, boolean mandatory, boolean isProtected, QName lovConstraintQName) Add custom property definition with one optional constraint referencevoid
addCustomReference
(NodeRef fromNode, NodeRef toNode, QName assocId) Deprecated.as of RM 2.3, please useRelationshipService.addRelationship(String, NodeRef, NodeRef)
instead.void
changeCustomConstraintTitle
(QName constraintName, String title) void
changeCustomConstraintValues
(QName constraintName, List<String> newValues) Update custom constraint definition with new list of values (replaces existing list, if any)boolean
existsCustomProperty
(QName property) Indicates whether the custom property exists.getCompoundIdFor
(String sourceId, String targetId) This method retrieves a compound ID (client-side) for the specified sourceId and targetId.Deprecated.as of RM 2.3, please useNodeService.getChildAssocs(NodeRef)
instead.getCustomConstraintDefinitions
(QName modelQName) This method returns ConstraintDefinition objects defined in the given model (note: not property references or in-line defs) The custom constraint definitions are retrieved from the dictionaryService which is notified of any newly created definitions on transaction commit.Get a list of all registered customisable types and aspects.getCustomisable
(NodeRef nodeRef) Get a list of all the registered customisable types and aspects present on a given node reference.Deprecated.as of RM 2.3, please useNodeService.getParentAssocs(NodeRef)
instead.This method returns the custom properties that have been defined for all of the specified customisable RM elements.getCustomPropertyDefinitions
(QName customisableType) This method returns the custom properties that have been defined for the specified customisable RM element.Deprecated.as of RM 2.3, please useRelationshipService.getRelationshipDefinitions()
instead.Deprecated.as of RM 2.3, please useNodeService.getTargetAssocs(NodeRef, QNamePattern)
with QNamePattern RegexQNamePattern.MATCH_ALL insteadgetCustomReferencesTo
(NodeRef node) Deprecated.as of RM 2.3, please useNodeService.getSourceAssocs(NodeRef, QNamePattern)
with QNamePattern RegexQNamePattern.MATCH_ALL instead.getQNameForClientId
(String localName) This method iterates over the custom properties, references looking for one whose id exactly matches that specified.boolean
isCustomisable
(QName type) Indicates whether a type (or aspect) is customisable.void
makeCustomisable
(QName type) Makes a type customisable.void
removeCustomConstraintDefinition
(QName constraintName) Remove custom constraint definition - if not referenced (by any properties)void
removeCustomPropertyDefinition
(QName propQName) Remove custom property definitionremoveCustomPropertyDefinitionConstraints
(QName propQName) Removes all list of values constraints from the custom property definition.void
removeCustomReference
(NodeRef fromNode, NodeRef toNode, QName assocId) Deprecated.as of RM 2.3, please useRelationshipService.removeRelationship(String, NodeRef, NodeRef)
instead.setCustomPropertyDefinitionConstraint
(QName propQName, QName newLovConstraint) Sets a new list of values constraint on the custom property definition.setCustomPropertyDefinitionLabel
(QName propQName, String newLabel) Update the custom property definition's label (title).String[]
splitSourceTargetId
(String sourceTargetId) Given a compound id for source and target strings (as used with parent/child custom references), this method splits the String and returns an array containing the source and target IDs separately.void
unmakeCustomisable
(QName type) Assuming the custom properties are not in use, makes a type no longer customisable.updateCustomAssocDefinition
(QName refQName, String newLabel) Deprecated.updateCustomChildAssocDefinition
(QName refQName, String newSource, String newTarget) Deprecated.updateCustomPropertyDefinitionName
(QName propQName, String newName) Update the name and label of the custom property definition.
-
Method Details
-
getCustomisable
Get a list of all registered customisable types and aspects.- Returns:
- Set of <
QName
>s of customisable types and aspects
-
getCustomisable
Get a list of all the registered customisable types and aspects present on a given node reference.- Parameters:
nodeRef
- node reference- Returns:
- Set of <
QName
>s of customisable types and aspects, empty if none
-
isCustomisable
Indicates whether a type (or aspect) is customisable.- Parameters:
type
- customisable typeQName
- Returns:
- boolean true if type customisable, false otherwise
-
makeCustomisable
Makes a type customisable.- Parameters:
type
- typeQName
to make customisable
-
unmakeCustomisable
Assuming the custom properties are not in use, makes a type no longer customisable.- Parameters:
type
- typeQName
to make customisable
-
existsCustomProperty
Indicates whether the custom property exists.- Parameters:
property
- propertiesQName
- Returns:
- boolean true if property exists, false otherwise
-
getCustomPropertyDefinitions
This method returns the custom properties that have been defined for the specified customisable RM element.Note: the custom property definitions are retrieved from the dictionaryService which is notified of any newly created definitions on transaction commit. Therefore custom properties created in the current transaction will not appear in the result of this method.
- Parameters:
customisableType
-- Returns:
- Map of <
QName
,PropertyDefinition
>s of custom properties definitions
-
getCustomPropertyDefinitions
Map<QName,PropertyDefinition> getCustomPropertyDefinitions()This method returns the custom properties that have been defined for all of the specified customisable RM elements.Note: the custom property definitions are retrieved from the dictionaryService which is notified of any newly created definitions on transaction commit. Therefore custom properties created in the current transaction will not appear in the result of this method.
- Returns:
- Map of <
QName
,PropertyDefinition
>s of custom properties definitions
-
addCustomPropertyDefinition
QName addCustomPropertyDefinition(QName propId, QName typeName, String label, QName dataType, String title, String description) throws CustomMetadataException Add custom property definition Note: no default value, single valued, optional, not system protected, no constraints- Parameters:
propId
- - If a value for propId is provided it will be used to identify property definitions within URLs and in QNames. Therefore it must contain URL/QName-valid characters only. It must also be unique. If a null value is passed, an id will be generated.typeName
- - mandatory. The aspect within which the property is to be defined. This must be one of the CustomisableRmElements.label
- - mandatorydataType
- - mandatorytitle
- - optionaldescription
- - optional- Returns:
- the propId, whether supplied as a parameter or generated.
- Throws:
CustomMetadataException
-
addCustomPropertyDefinition
QName addCustomPropertyDefinition(QName propId, QName typeName, String label, QName dataType, String title, String description, String defaultValue, boolean multiValued, boolean mandatory, boolean isProtected, QName lovConstraintQName) throws CustomMetadataException Add custom property definition with one optional constraint reference- Parameters:
propId
- - If a value for propId is provided it will be used to identify property definitions within URLs and in QNames. Therefore it must contain URL/QName-valid characters only. It must also be unique. If a null value is passed, an id will be generated.typeName
- - mandatory. The aspect within which the property is to be defined. This must be one of the CustomisableRmElements.label
- - mandatorydataType
- - mandatorytitle
- - optionaldescription
- - optionaldefaultValue
- - optionalmultiValued
- - TRUE if multi-valued propertymandatory
- - TRUE if mandatory propertyisProtected
- - TRUE if protected propertylovConstraintQName
- - optional custom constraint- Returns:
- the propId, whether supplied as a parameter or generated.
- Throws:
CustomMetadataException
-
setCustomPropertyDefinitionLabel
QName setCustomPropertyDefinitionLabel(QName propQName, String newLabel) throws PropertyAlreadyExistsMetadataException Update the custom property definition's label (title).- Parameters:
propQName
- the qname of the property definitionnewLabel
- the new value for the label.- Returns:
- the propId.
- Throws:
PropertyAlreadyExistsMetadataException
-
updateCustomPropertyDefinitionName
QName updateCustomPropertyDefinitionName(QName propQName, String newName) throws CustomMetadataException Update the name and label of the custom property definition.- Parameters:
propQName
- The qname of the existing property definitionnewName
- THe new name for both the custom property and its label.- Returns:
- Throws:
CustomMetadataException
-
setCustomPropertyDefinitionConstraint
Sets a new list of values constraint on the custom property definition.- Parameters:
propQName
- the qname of the property definitionnewLovConstraint
- the List-Of-Values constraintRef.- Returns:
- the propId.
-
removeCustomPropertyDefinitionConstraints
Removes all list of values constraints from the custom property definition.- Parameters:
propQName
- the qname of the property definition- Returns:
- the propId.
-
removeCustomPropertyDefinition
Remove custom property definition- Parameters:
propQName
-
-
getCustomReferenceDefinitions
Map<QName,AssociationDefinition> getCustomReferenceDefinitions()Deprecated.as of RM 2.3, please useRelationshipService.getRelationshipDefinitions()
instead.This method returns the custom references that have been defined in the custom model. Note: the custom reference definitions are retrieved from the dictionaryService which is notified of any newly created definitions on transaction commit. Therefore custom references created in the current transaction will not appear in the results.- Returns:
- The Map of custom references (both parent-child and standard).
-
getCustomReferencesFrom
Deprecated.as of RM 2.3, please useNodeService.getTargetAssocs(NodeRef, QNamePattern)
with QNamePattern RegexQNamePattern.MATCH_ALL insteadFetches all associations from the given source.- Parameters:
node
- the node from which the associations start.- Returns:
- a List of associations.
-
getCustomChildReferences
Deprecated.as of RM 2.3, please useNodeService.getChildAssocs(NodeRef)
instead.Fetches all child associations of the given source. i.e. all associations where the given node is the parent.- Parameters:
node
-- Returns:
-
getCustomReferencesTo
Deprecated.as of RM 2.3, please useNodeService.getSourceAssocs(NodeRef, QNamePattern)
with QNamePattern RegexQNamePattern.MATCH_ALL instead.Returns a List of all associations to the given node.- Parameters:
node
- the node to which the associations point.- Returns:
- a List of associations.
-
getCustomParentReferences
Deprecated.as of RM 2.3, please useNodeService.getParentAssocs(NodeRef)
instead.Fetches all child associations where the given node is the child.- Parameters:
node
-- Returns:
-
addCustomReference
Deprecated.as of RM 2.3, please useRelationshipService.addRelationship(String, NodeRef, NodeRef)
instead.This method adds the specified custom reference instance between the specified nodes. Only one instance of any custom reference type is allowed in a given direction between two given records.- Parameters:
fromNode
-toNode
-assocId
- the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567- Throws:
org.alfresco.error.AlfrescoRuntimeException
- if an instance of the specified reference type already exists from fromNode to toNode.
-
removeCustomReference
Deprecated.as of RM 2.3, please useRelationshipService.removeRelationship(String, NodeRef, NodeRef)
instead.This method removes the specified custom reference instance from the specified node.- Parameters:
fromNode
-toNode
-assocId
- the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567
-
addCustomAssocDefinition
Deprecated.as of RM 2.3, please useRelationshipService.createRelationshipDefinition(org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipDisplayName)
instead.This method creates a new custom association, using the given label as the title.- Parameters:
label
- the title of the association definition- Returns:
- the QName of the newly-created association.
-
addCustomChildAssocDefinition
Deprecated.as of RM 2.3, please useRelationshipService.createRelationshipDefinition(org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipDisplayName)
instead.This method creates a new custom child association, combining the given source and target and using the combined String as the title.- Parameters:
source
-target
-- Returns:
- the QName of the newly-created association.
-
updateCustomChildAssocDefinition
Deprecated.This method updates the source and target values for the specified child association. The source and target will be combined into a single string and stored in the title property. Source and target are String metadata for RM parent/child custom references.- Parameters:
refQName
- qname of the child association.newSource
- the new value for the source field.newTarget
- the new value for the target field.- See Also:
-
updateCustomAssocDefinition
Deprecated.This method updates the label value for the specified association. The label will be stored in the title property. Label is String metadata for bidirectional custom references.- Parameters:
refQName
- qname of the child association.newLabel
- the new value for the label field.
-
getCustomConstraintDefinitions
This method returns ConstraintDefinition objects defined in the given model (note: not property references or in-line defs) The custom constraint definitions are retrieved from the dictionaryService which is notified of any newly created definitions on transaction commit. Therefore custom constraints created in the current transaction will not appear in the results. -
addCustomConstraintDefinition
void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List<String> allowedValues, RMListOfValuesConstraint.MatchLogic matchLogic) This method adds a Constraint definition to the custom model. The implementation of this method would have to go into the M2Model and insert the relevant M2Objects for this new constraint. param type not included as it would always be RMListOfValuesConstraint for RM.- Parameters:
constraintName
- the name e.g. rmc:footitle
- the human-readable title e.g. My foo listcaseSensitive
-allowedValues
- the allowed values listmatchLogic
- AND (all values must match), OR (at least one values must match)
-
removeCustomConstraintDefinition
Remove custom constraint definition - if not referenced (by any properties)- Parameters:
constraintName
- the name e.g. rmc:foo
-
changeCustomConstraintValues
Update custom constraint definition with new list of values (replaces existing list, if any)- Parameters:
constraintName
- the name e.g. rmc:foonewValues
-
-
changeCustomConstraintTitle
- Parameters:
constraintName
-title
-
-
getQNameForClientId
This method iterates over the custom properties, references looking for one whose id exactly matches that specified.- Parameters:
localName
- the localName part of the qname of the property or reference definition.- Returns:
- the QName of the property, association definition which matches, or null.
-
splitSourceTargetId
Given a compound id for source and target strings (as used with parent/child custom references), this method splits the String and returns an array containing the source and target IDs separately.- Parameters:
sourceTargetId
- the compound ID.- Returns:
- a String array, where result[0] == sourceId and result[1] == targetId.
-
getCompoundIdFor
This method retrieves a compound ID (client-side) for the specified sourceId and targetId.- Parameters:
sourceId
-targetId
-- Returns:
-
RelationshipService.createRelationshipDefinition(org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipDisplayName)
instead.