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 Details

    • getCustomisable

      Set<QName> getCustomisable()
      Get a list of all registered customisable types and aspects.
      Returns:
      Set of <QName>s of customisable types and aspects
    • getCustomisable

      Set<QName> getCustomisable(NodeRef nodeRef)
      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

      boolean isCustomisable(QName type)
      Indicates whether a type (or aspect) is customisable.
      Parameters:
      type - customisable type QName
      Returns:
      boolean true if type customisable, false otherwise
    • makeCustomisable

      void makeCustomisable(QName type)
      Makes a type customisable.
      Parameters:
      type - type QName to make customisable
    • unmakeCustomisable

      void unmakeCustomisable(QName type)
      Assuming the custom properties are not in use, makes a type no longer customisable.
      Parameters:
      type - type QName to make customisable
    • existsCustomProperty

      boolean existsCustomProperty(QName property)
      Indicates whether the custom property exists.
      Parameters:
      property - properties QName
      Returns:
      boolean true if property exists, false otherwise
    • getCustomPropertyDefinitions

      Map<QName,PropertyDefinition> getCustomPropertyDefinitions(QName customisableType)
      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 - - mandatory
      dataType - - mandatory
      title - - optional
      description - - 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 - - mandatory
      dataType - - mandatory
      title - - optional
      description - - optional
      defaultValue - - optional
      multiValued - - TRUE if multi-valued property
      mandatory - - TRUE if mandatory property
      isProtected - - TRUE if protected property
      lovConstraintQName - - 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 definition
      newLabel - 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 definition
      newName - THe new name for both the custom property and its label.
      Returns:
      Throws:
      CustomMetadataException
    • setCustomPropertyDefinitionConstraint

      QName setCustomPropertyDefinitionConstraint(QName propQName, QName newLovConstraint)
      Sets a new list of values constraint on the custom property definition.
      Parameters:
      propQName - the qname of the property definition
      newLovConstraint - the List-Of-Values constraintRef.
      Returns:
      the propId.
    • removeCustomPropertyDefinitionConstraints

      QName removeCustomPropertyDefinitionConstraints(QName propQName)
      Removes all list of values constraints from the custom property definition.
      Parameters:
      propQName - the qname of the property definition
      Returns:
      the propId.
    • removeCustomPropertyDefinition

      void removeCustomPropertyDefinition(QName propQName)
      Remove custom property definition
      Parameters:
      propQName -
    • getCustomReferenceDefinitions

      Map<QName,AssociationDefinition> getCustomReferenceDefinitions()
      Deprecated.
      as of RM 2.3, please use RelationshipService.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

      List<AssociationRef> getCustomReferencesFrom(NodeRef node)
      Deprecated.
      as of RM 2.3, please useNodeService.getTargetAssocs(NodeRef, QNamePattern) with QNamePattern RegexQNamePattern.MATCH_ALL instead
      Fetches all associations from the given source.
      Parameters:
      node - the node from which the associations start.
      Returns:
      a List of associations.
    • getCustomChildReferences

      List<ChildAssociationRef> getCustomChildReferences(NodeRef node)
      Deprecated.
      as of RM 2.3, please use NodeService.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

      List<AssociationRef> getCustomReferencesTo(NodeRef node)
      Deprecated.
      as of RM 2.3, please use NodeService.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

      List<ChildAssociationRef> getCustomParentReferences(NodeRef node)
      Deprecated.
      as of RM 2.3, please use NodeService.getParentAssocs(NodeRef) instead.
      Fetches all child associations where the given node is the child.
      Parameters:
      node -
      Returns:
    • addCustomReference

      void addCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId)
      Deprecated.
      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

      void removeCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId)
      Deprecated.
      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

      QName addCustomAssocDefinition(String label)
      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

      QName 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.
      Parameters:
      source -
      target -
      Returns:
      the QName of the newly-created association.
    • updateCustomChildAssocDefinition

      QName updateCustomChildAssocDefinition(QName refQName, String newSource, String newTarget)
      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

      QName updateCustomAssocDefinition(QName refQName, String newLabel)
      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

      List<ConstraintDefinition> 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. 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:foo
      title - the human-readable title e.g. My foo list
      caseSensitive -
      allowedValues - the allowed values list
      matchLogic - AND (all values must match), OR (at least one values must match)
    • removeCustomConstraintDefinition

      void removeCustomConstraintDefinition(QName constraintName)
      Remove custom constraint definition - if not referenced (by any properties)
      Parameters:
      constraintName - the name e.g. rmc:foo
    • changeCustomConstraintValues

      void changeCustomConstraintValues(QName constraintName, List<String> newValues)
      Update custom constraint definition with new list of values (replaces existing list, if any)
      Parameters:
      constraintName - the name e.g. rmc:foo
      newValues -
    • changeCustomConstraintTitle

      void changeCustomConstraintTitle(QName constraintName, String title)
      Parameters:
      constraintName -
      title -
    • getQNameForClientId

      QName getQNameForClientId(String localName)
      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

      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.
      Parameters:
      sourceTargetId - the compound ID.
      Returns:
      a String array, where result[0] == sourceId and result[1] == targetId.
    • getCompoundIdFor

      String getCompoundIdFor(String sourceId, String targetId)
      This method retrieves a compound ID (client-side) for the specified sourceId and targetId.
      Parameters:
      sourceId -
      targetId -
      Returns: