Interface RelationshipService

  • All Known Implementing Classes:
    RelationshipServiceImpl

    @AlfrescoPublicApi
    public interface RelationshipService
    The relationship service interface
    Since:
    2.3
    Author:
    Tuna Aksoy
    • Method Detail

      • getRelationshipDefinitions

        Set<RelationshipDefinition> getRelationshipDefinitions()
        Gets all the existing relationship definitions
        Returns:
        All existing relationship definitions
      • getRelationshipDefinition

        RelationshipDefinition getRelationshipDefinition​(String uniqueName)
        Gets the relationship definition for the given unique name
        Parameters:
        uniqueName - The unique name of the relationship definition
        Returns:
        The relationship definition for the given unique name if it exist, null otherwise
      • createRelationshipDefinition

        RelationshipDefinition createRelationshipDefinition​(RelationshipDisplayName displayName)
        Creates a relationship definition using the display name
        Parameters:
        displayName - The display name of the relationship definition
        Returns:
        The new relationship definition
      • updateRelationshipDefinition

        RelationshipDefinition updateRelationshipDefinition​(String uniqueName,
                                                            RelationshipDisplayName displayName)
        Updates an existing relationship definition
        Parameters:
        uniqueName - The unique name of the relationship definition
        displayName - The display name of the relationship definition
        Returns:
        The updated relationship definition
      • removeRelationshipDefinition

        boolean removeRelationshipDefinition​(String uniqueName)
        Removes a relationship definition
        Parameters:
        uniqueName - The unique name of the relationship definition
        Returns:
        true if the relationship definition was removed successfully, false otherwise
      • existsRelationshipDefinition

        boolean existsRelationshipDefinition​(String uniqueName)
        Checks if a relationship exists or not
        Parameters:
        uniqueName - The unique name of the relationship definition
        Returns:
        true if the relationship definition exists, false otherwise
      • getRelationshipsFrom

        Set<Relationship> getRelationshipsFrom​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Gets all the relationships that come out from the given node reference
        Parameters:
        nodeRef - The node reference
        Returns:
        All relationships that come out from the given node reference
      • getRelationshipsFrom

        Set<Relationship> getRelationshipsFrom​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                               String nameFilter)
        Gets all the relationships that come out from the given node reference that match the a given name filter.

        Exact match only.

        Parameters:
        nodeRef - The node reference
        nameFilter - Name filter for results
        Returns:
        All relationships that come out from the given node reference
        Since:
        2.3.1
      • getRelationshipsTo

        Set<Relationship> getRelationshipsTo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Gets all the relationships that go into the given node reference
        Parameters:
        nodeRef - The node reference
        Returns:
        All relationships that go into the given node reference
      • getRelationshipsTo

        Set<Relationship> getRelationshipsTo​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                             String nameFilter)
        Gets all the relationships that go into the given node reference that match the a given name filter.

        Exact match only.

        Parameters:
        nodeRef - The node reference
        nameFilter - Name filter for results
        Returns:
        All relationships that go into the given node reference
        Since:
        2.3.1
      • addRelationship

        void addRelationship​(String uniqueName,
                             org.alfresco.service.cmr.repository.NodeRef source,
                             org.alfresco.service.cmr.repository.NodeRef target)
        Adds a relationship from the given node source to the give node target with the given unique name
        Parameters:
        uniqueName - The unique name of the relationship
        source - The node reference which the relationship come from
        target - The node reference which the relationship go to
      • removeRelationship

        void removeRelationship​(String uniqueName,
                                org.alfresco.service.cmr.repository.NodeRef source,
                                org.alfresco.service.cmr.repository.NodeRef target)
        Removes the relationship from the given node source to the given node target with the given unique name
        Parameters:
        uniqueName - The unique name of the relationship
        source - The node reference which the relationship come from
        target - The node reference which the relationship go to