Class RecordsManagementAdminServiceImpl
java.lang.Object
org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminBase
org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminServiceImpl
- All Implemented Interfaces:
EventListener,RecordsManagementAdminService,RecordsManagementCustomModel,NodeServicePolicies.OnAddAspectPolicy,NodeServicePolicies.OnCreateNodePolicy,NodeServicePolicies.OnRemoveAspectPolicy,ClassPolicy,Policy,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>,org.springframework.core.Ordered
public class RecordsManagementAdminServiceImpl
extends RecordsManagementAdminBase
implements RecordsManagementAdminService, RecordsManagementCustomModel, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnCreateNodePolicy, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.core.Ordered
Records Management AdminService Implementation.
- Author:
- Neil McErlean, janv
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg -
Field Summary
Fields inherited from class org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminBase
loggerFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRemoveAspectPolicy
QNAMEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel
ASPECT_CUSTOM_ASSOCIATIONS, ASPECT_SUPPLEMENTAL_MARKING_LIST, CONSTRAINT_CUSTOM_SMLIST, CUSTOM_REF_CROSSREFERENCE, CUSTOM_REF_OBSOLETES, CUSTOM_REF_RENDITION, CUSTOM_REF_SUPERSEDES, CUSTOM_REF_SUPPORTS, CUSTOM_REF_VERSIONS, PROP_SUPPLEMENTAL_MARKING_LIST, RM_CUSTOM_MODEL, RM_CUSTOM_PREFIX, RM_CUSTOM_URI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomAssocDefinition(String label) This method creates a new custom association, using the given label as the title.addCustomChildAssocDefinition(String source, String target) This method creates a new custom child association, combining the given source and target and using the combined String as the title.voidaddCustomConstraintDefinition(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 aspectName, 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 aspectName, String label, QName dataType, String title, String description, String defaultValue, boolean multiValued, boolean mandatory, boolean isProtected, QName lovConstraint) Add custom property definition with one optional constraint referencevoidaddCustomReference(NodeRef fromNode, NodeRef toNode, QName refId) This method adds the specified custom reference instance between the specified nodes.voidchangeCustomConstraintTitle(QName constraintName, String title) voidchangeCustomConstraintValues(QName constraintName, List<String> newAllowedValues) Update custom constraint definition with new list of values (replaces existing list, if any)booleanexistsCustomProperty(QName propertyName) 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.Fetches all child associations of the given source. i.e. all associations where the given node is the parent.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.Fetches all child associations where the given node is the child.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.This method returns the custom references that have been defined in the custom model.Fetches all associations from the given source.getCustomReferencesTo(NodeRef node) Returns a List of all associations to the given node.intgetOrder()Indicate that this application content listener must be executed with the lowest precedence.getQNameForClientId(String localName) This method iterates over the custom properties, references looking for one whose id exactly matches that specified.protected RelationshipServiceGets the relationship service instancebooleanisCustomisable(QName type) Indicates whether a type (or aspect) is customisable.booleanHelper method to indicate whether the custom map is initialised or not.voidmakeCustomisable(QName type) Makes a type customisable.voidonAddAspect(NodeRef nodeRef, QName aspectTypeQName) voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) Load the custom properties mapvoidonCreateNode(ChildAssociationRef childAssocRef) Make sure any custom property aspects are applied to newly created nodes.voidonRemoveAspect(NodeRef nodeRef, QName aspectTypeQName) voidremoveCustomConstraintDefinition(QName constraintName) Remove custom constraint definition - if not referenced (by any properties)voidremoveCustomPropertyDefinition(QName propQName) Remove custom property definitionremoveCustomPropertyDefinitionConstraints(QName propQName) Removes all list of values constraints from the custom property definition.voidremoveCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId) This method removes the specified custom reference instance from the specified node.voidsetCustomisableTypes(List<String> customisableTypes) 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).voidsetJobLockService(JobLockService jobLockService) voidsetRelationshipService(RelationshipService relationshipService) voidsetTransactionService(TransactionService transactionService) 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.voidunmakeCustomisable(QName type) Assuming the custom properties are not in use, makes a type no longer customisable.updateCustomAssocDefinition(QName refQName, String newLabel) This method updates the label value for the specified association.updateCustomChildAssocDefinition(QName refQName, String newSource, String newTarget) This method updates the source and target values for the specified child association.updateCustomPropertyDefinitionName(QName propQName, String newName) Update the name and label of the custom property definition.Methods inherited from class org.alfresco.module.org_alfresco_module_rm.admin.RecordsManagementAdminBase
composeAssociationDefinitionTitle, existsTitle, getContentService, getCustomAssociations, getCustomModelRef, getDictionaryRepositoryBootstrap, getDictionaryService, getNamespaceService, getNodeService, readCustomContentModel, setContentService, setDictionaryRepositoryBootstrap, setDictionaryService, setNamespaceService, setNodeService, splitAssociationDefinitionTitle, writeCustomContentModelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
RecordsManagementAdminServiceImpl
public RecordsManagementAdminServiceImpl()
-
-
Method Details
-
setTransactionService
- Parameters:
transactionService- transaction service
-
setRelationshipService
- Parameters:
relationshipService- The relationship service instance
-
getRelationshipService
Gets the relationship service instance- Returns:
- The relationship service instance
-
setJobLockService
- Parameters:
jobLockService- The Job Lock service
-
getOrder
public int getOrder()Indicate that this application content listener must be executed with the lowest precedence. (ie last)- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- See Also:
-
Ordered.getOrder()
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) Load the custom properties map- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>- See Also:
-
ApplicationListener.onApplicationEvent(org.springframework.context.ApplicationEvent)
-
isCustomMapInit
public boolean isCustomMapInit()Helper method to indicate whether the custom map is initialised or not.- Returns:
- boolean true if initialised, false otherwise
-
onAddAspect
-
onRemoveAspect
-
onCreateNode
Make sure any custom property aspects are applied to newly created nodes. -
setCustomisableTypes
- Parameters:
customisableTypes- list of string representations of the type qnames that are customisable
-
getCustomisable
Description copied from interface:RecordsManagementAdminServiceGet a list of all registered customisable types and aspects.- Specified by:
getCustomisablein interfaceRecordsManagementAdminService- Returns:
- Set of <
QName>s of customisable types and aspects - See Also:
-
getCustomisable
Description copied from interface:RecordsManagementAdminServiceGet a list of all the registered customisable types and aspects present on a given node reference.- Specified by:
getCustomisablein interfaceRecordsManagementAdminService- Parameters:
nodeRef- node reference- Returns:
- Set of <
QName>s of customisable types and aspects, empty if none - See Also:
-
isCustomisable
Description copied from interface:RecordsManagementAdminServiceIndicates whether a type (or aspect) is customisable.- Specified by:
isCustomisablein interfaceRecordsManagementAdminService- Parameters:
type- customisable typeQName- Returns:
- boolean true if type customisable, false otherwise
- See Also:
-
makeCustomisable
Description copied from interface:RecordsManagementAdminServiceMakes a type customisable.- Specified by:
makeCustomisablein interfaceRecordsManagementAdminService- Parameters:
type- typeQNameto make customisable- See Also:
-
unmakeCustomisable
Description copied from interface:RecordsManagementAdminServiceAssuming the custom properties are not in use, makes a type no longer customisable.- Specified by:
unmakeCustomisablein interfaceRecordsManagementAdminService- Parameters:
type- typeQNameto make customisable- See Also:
-
existsCustomProperty
Description copied from interface:RecordsManagementAdminServiceIndicates whether the custom property exists.- Specified by:
existsCustomPropertyin interfaceRecordsManagementAdminService- Parameters:
propertyName- propertiesQName- Returns:
- boolean true if property exists, false otherwise
- See Also:
-
getCustomPropertyDefinitions
Description copied from interface:RecordsManagementAdminServiceThis 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.
- Specified by:
getCustomPropertyDefinitionsin interfaceRecordsManagementAdminService- Returns:
- Map of <
QName,PropertyDefinition>s of custom properties definitions - See Also:
-
getCustomPropertyDefinitions
Description copied from interface:RecordsManagementAdminServiceThis 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.
- Specified by:
getCustomPropertyDefinitionsin interfaceRecordsManagementAdminService- Returns:
- Map of <
QName,PropertyDefinition>s of custom properties definitions - See Also:
-
addCustomPropertyDefinition
public QName addCustomPropertyDefinition(QName propId, QName aspectName, String label, QName dataType, String title, String description) throws CustomMetadataException Description copied from interface:RecordsManagementAdminServiceAdd custom property definition Note: no default value, single valued, optional, not system protected, no constraints- Specified by:
addCustomPropertyDefinitionin interfaceRecordsManagementAdminService- 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.aspectName- - 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- See Also:
-
addCustomPropertyDefinition
public QName addCustomPropertyDefinition(QName propId, QName aspectName, String label, QName dataType, String title, String description, String defaultValue, boolean multiValued, boolean mandatory, boolean isProtected, QName lovConstraint) throws CustomMetadataException Description copied from interface:RecordsManagementAdminServiceAdd custom property definition with one optional constraint reference- Specified by:
addCustomPropertyDefinitionin interfaceRecordsManagementAdminService- 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.aspectName- - 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 propertylovConstraint- - optional custom constraint- Returns:
- the propId, whether supplied as a parameter or generated.
- Throws:
CustomMetadataException- See Also:
-
updateCustomPropertyDefinitionName
public QName updateCustomPropertyDefinitionName(QName propQName, String newName) throws CustomMetadataException Description copied from interface:RecordsManagementAdminServiceUpdate the name and label of the custom property definition.- Specified by:
updateCustomPropertyDefinitionNamein interfaceRecordsManagementAdminService- Parameters:
propQName- The qname of the existing property definitionnewName- THe new name for both the custom property and its label.- Returns:
- Throws:
CustomMetadataException- See Also:
-
setCustomPropertyDefinitionLabel
Description copied from interface:RecordsManagementAdminServiceUpdate the custom property definition's label (title).- Specified by:
setCustomPropertyDefinitionLabelin interfaceRecordsManagementAdminService- Parameters:
propQName- the qname of the property definitionnewLabel- the new value for the label.- Returns:
- the propId.
- See Also:
-
setCustomPropertyDefinitionConstraint
Description copied from interface:RecordsManagementAdminServiceSets a new list of values constraint on the custom property definition.- Specified by:
setCustomPropertyDefinitionConstraintin interfaceRecordsManagementAdminService- Parameters:
propQName- the qname of the property definitionnewLovConstraint- the List-Of-Values constraintRef.- Returns:
- the propId.
- See Also:
-
removeCustomPropertyDefinitionConstraints
Description copied from interface:RecordsManagementAdminServiceRemoves all list of values constraints from the custom property definition.- Specified by:
removeCustomPropertyDefinitionConstraintsin interfaceRecordsManagementAdminService- Parameters:
propQName- the qname of the property definition- Returns:
- the propId.
- See Also:
-
removeCustomPropertyDefinition
Description copied from interface:RecordsManagementAdminServiceRemove custom property definition -
getCustomReferenceDefinitions
Description copied from interface:RecordsManagementAdminServiceThis 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.- Specified by:
getCustomReferenceDefinitionsin interfaceRecordsManagementAdminService- Returns:
- The Map of custom references (both parent-child and standard).
- See Also:
-
addCustomReference
Description copied from interface:RecordsManagementAdminServiceThis 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.- Specified by:
addCustomReferencein interfaceRecordsManagementAdminServicerefId- the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567- See Also:
-
removeCustomReference
Description copied from interface:RecordsManagementAdminServiceThis method removes the specified custom reference instance from the specified node.- Specified by:
removeCustomReferencein interfaceRecordsManagementAdminServiceassocId- the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567- See Also:
-
getCustomReferencesFrom
Description copied from interface:RecordsManagementAdminServiceFetches all associations from the given source.- Specified by:
getCustomReferencesFromin interfaceRecordsManagementAdminService- Parameters:
node- the node from which the associations start.- Returns:
- a List of associations.
- See Also:
-
getCustomChildReferences
Description copied from interface:RecordsManagementAdminServiceFetches all child associations of the given source. i.e. all associations where the given node is the parent.- Specified by:
getCustomChildReferencesin interfaceRecordsManagementAdminService- Returns:
- See Also:
-
getCustomReferencesTo
Description copied from interface:RecordsManagementAdminServiceReturns a List of all associations to the given node.- Specified by:
getCustomReferencesToin interfaceRecordsManagementAdminService- Parameters:
node- the node to which the associations point.- Returns:
- a List of associations.
- See Also:
-
getCustomParentReferences
Description copied from interface:RecordsManagementAdminServiceFetches all child associations where the given node is the child.- Specified by:
getCustomParentReferencesin interfaceRecordsManagementAdminService- Returns:
- See Also:
-
addCustomAssocDefinition
Description copied from interface:RecordsManagementAdminServiceThis method creates a new custom association, using the given label as the title.- Specified by:
addCustomAssocDefinitionin interfaceRecordsManagementAdminService- Parameters:
label- the title of the association definition- Returns:
- the QName of the newly-created association.
- See Also:
-
addCustomChildAssocDefinition
Description copied from interface:RecordsManagementAdminServiceThis method creates a new custom child association, combining the given source and target and using the combined String as the title.- Specified by:
addCustomChildAssocDefinitionin interfaceRecordsManagementAdminService- Returns:
- the QName of the newly-created association.
- See Also:
-
updateCustomChildAssocDefinition
Description copied from interface:RecordsManagementAdminServiceThis 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.- Specified by:
updateCustomChildAssocDefinitionin interfaceRecordsManagementAdminService- 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
Description copied from interface:RecordsManagementAdminServiceThis 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.- Specified by:
updateCustomAssocDefinitionin interfaceRecordsManagementAdminService- Parameters:
refQName- qname of the child association.newLabel- the new value for the label field.- See Also:
-
addCustomConstraintDefinition
public void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List<String> allowedValues, RMListOfValuesConstraint.MatchLogic matchLogic) Description copied from interface:RecordsManagementAdminServiceThis 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.- Specified by:
addCustomConstraintDefinitionin interfaceRecordsManagementAdminService- Parameters:
constraintName- the name e.g. rmc:footitle- the human-readable title e.g. My foo listallowedValues- the allowed values listmatchLogic- AND (all values must match), OR (at least one values must match)- See Also:
-
changeCustomConstraintValues
Description copied from interface:RecordsManagementAdminServiceUpdate custom constraint definition with new list of values (replaces existing list, if any)- Specified by:
changeCustomConstraintValuesin interfaceRecordsManagementAdminService- Parameters:
constraintName- the name e.g. rmc:foo- See Also:
-
changeCustomConstraintTitle
-
getCustomConstraintDefinitions
Description copied from interface:RecordsManagementAdminServiceThis 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. -
removeCustomConstraintDefinition
Description copied from interface:RecordsManagementAdminServiceRemove custom constraint definition - if not referenced (by any properties)- Specified by:
removeCustomConstraintDefinitionin interfaceRecordsManagementAdminService- Parameters:
constraintName- the name e.g. rmc:foo- See Also:
-
getQNameForClientId
Description copied from interface:RecordsManagementAdminServiceThis method iterates over the custom properties, references looking for one whose id exactly matches that specified.- Specified by:
getQNameForClientIdin interfaceRecordsManagementAdminService- 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.
- See Also:
-
splitSourceTargetId
Description copied from interface:RecordsManagementAdminServiceGiven 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.- Specified by:
splitSourceTargetIdin interfaceRecordsManagementAdminService- Parameters:
sourceTargetId- the compound ID.- Returns:
- a String array, where result[0] == sourceId and result[1] == targetId.
- See Also:
-
getCompoundIdFor
Description copied from interface:RecordsManagementAdminServiceThis method retrieves a compound ID (client-side) for the specified sourceId and targetId.- Specified by:
getCompoundIdForin interfaceRecordsManagementAdminService- Returns:
- See Also:
-