Interface RecordsManagementAdminService

    • Method Detail

      • getCustomisable

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

        Set<org.alfresco.service.namespace.QName> getCustomisable​(org.alfresco.service.cmr.repository.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​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.QName type)
        Makes a type customisable.
        Parameters:
        type - type QName to make customisable
      • unmakeCustomisable

        void unmakeCustomisable​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.QName property)
        Indicates whether the custom property exists.
        Parameters:
        property - properties QName
        Returns:
        boolean true if property exists, false otherwise
      • getCustomPropertyDefinitions

        Map<org.alfresco.service.namespace.QName,​org.alfresco.service.cmr.dictionary.PropertyDefinition> getCustomPropertyDefinitions​(org.alfresco.service.namespace.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<org.alfresco.service.namespace.QName,​org.alfresco.service.cmr.dictionary.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

        org.alfresco.service.namespace.QName addCustomPropertyDefinition​(org.alfresco.service.namespace.QName propId,
                                                                         org.alfresco.service.namespace.QName typeName,
                                                                         String label,
                                                                         org.alfresco.service.namespace.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

        org.alfresco.service.namespace.QName addCustomPropertyDefinition​(org.alfresco.service.namespace.QName propId,
                                                                         org.alfresco.service.namespace.QName typeName,
                                                                         String label,
                                                                         org.alfresco.service.namespace.QName dataType,
                                                                         String title,
                                                                         String description,
                                                                         String defaultValue,
                                                                         boolean multiValued,
                                                                         boolean mandatory,
                                                                         boolean isProtected,
                                                                         org.alfresco.service.namespace.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

        org.alfresco.service.namespace.QName setCustomPropertyDefinitionLabel​(org.alfresco.service.namespace.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

        org.alfresco.service.namespace.QName updateCustomPropertyDefinitionName​(org.alfresco.service.namespace.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

        org.alfresco.service.namespace.QName setCustomPropertyDefinitionConstraint​(org.alfresco.service.namespace.QName propQName,
                                                                                   org.alfresco.service.namespace.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

        org.alfresco.service.namespace.QName removeCustomPropertyDefinitionConstraints​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.QName propQName)
        Remove custom property definition
        Parameters:
        propQName -
      • getCustomReferenceDefinitions

        Map<org.alfresco.service.namespace.QName,​org.alfresco.service.cmr.dictionary.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<org.alfresco.service.cmr.repository.AssociationRef> getCustomReferencesFrom​(org.alfresco.service.cmr.repository.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<org.alfresco.service.cmr.repository.ChildAssociationRef> getCustomChildReferences​(org.alfresco.service.cmr.repository.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<org.alfresco.service.cmr.repository.AssociationRef> getCustomReferencesTo​(org.alfresco.service.cmr.repository.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<org.alfresco.service.cmr.repository.ChildAssociationRef> getCustomParentReferences​(org.alfresco.service.cmr.repository.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​(org.alfresco.service.cmr.repository.NodeRef fromNode,
                                org.alfresco.service.cmr.repository.NodeRef toNode,
                                org.alfresco.service.namespace.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​(org.alfresco.service.cmr.repository.NodeRef fromNode,
                                   org.alfresco.service.cmr.repository.NodeRef toNode,
                                   org.alfresco.service.namespace.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
      • getCustomConstraintDefinitions

        List<org.alfresco.service.cmr.dictionary.ConstraintDefinition> getCustomConstraintDefinitions​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.QName constraintName)
        Remove custom constraint definition - if not referenced (by any properties)
        Parameters:
        constraintName - the name e.g. rmc:foo
      • changeCustomConstraintValues

        void changeCustomConstraintValues​(org.alfresco.service.namespace.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​(org.alfresco.service.namespace.QName constraintName,
                                         String title)
        Parameters:
        constraintName -
        title -
      • getQNameForClientId

        org.alfresco.service.namespace.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: