Interface RelationshipService
- All Known Implementing Classes:
RelationshipServiceImpl
@AlfrescoPublicApi
public interface RelationshipService
The relationship service interface
- Since:
- 2.3
- Author:
- Tuna Aksoy
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRelationship
(String uniqueName, NodeRef source, NodeRef target) Adds a relationship from the given nodesource
to the give nodetarget
with the given unique namecreateRelationshipDefinition
(RelationshipDisplayName displayName) Creates a relationship definition using the display nameboolean
existsRelationshipDefinition
(String uniqueName) Checks if a relationship exists or notgetRelationshipDefinition
(String uniqueName) Gets the relationship definition for the given unique nameGets all the existing relationship definitionsgetRelationshipsFrom
(NodeRef nodeRef) Gets all the relationships that come out from the given node referencegetRelationshipsFrom
(NodeRef nodeRef, String nameFilter) Gets all the relationships that come out from the given node reference that match the a given name filter.getRelationshipsTo
(NodeRef nodeRef) Gets all the relationships that go into the given node referencegetRelationshipsTo
(NodeRef nodeRef, String nameFilter) Gets all the relationships that go into the given node reference that match the a given name filter.void
removeRelationship
(String uniqueName, NodeRef source, NodeRef target) Removes the relationship from the given nodesource
to the given nodetarget
with the given unique nameboolean
removeRelationshipDefinition
(String uniqueName) Removes a relationship definitionupdateRelationshipDefinition
(String uniqueName, RelationshipDisplayName displayName) Updates an existing relationship definition
-
Field Details
-
RELATIONSHIP_VERSIONS
System relationship names- See Also:
-
-
Method Details
-
getRelationshipDefinitions
Set<RelationshipDefinition> getRelationshipDefinitions()Gets all the existing relationship definitions- Returns:
- All existing relationship definitions
-
getRelationshipDefinition
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
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 definitiondisplayName
- The display name of the relationship definition- Returns:
- The updated relationship definition
-
removeRelationshipDefinition
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
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
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
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 referencenameFilter
- Name filter for results- Returns:
- All relationships that come out from the given node reference
- Since:
- 2.3.1
-
getRelationshipsTo
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
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 referencenameFilter
- Name filter for results- Returns:
- All relationships that go into the given node reference
- Since:
- 2.3.1
-
addRelationship
Adds a relationship from the given nodesource
to the give nodetarget
with the given unique name- Parameters:
uniqueName
- The unique name of the relationshipsource
- The node reference which the relationship come fromtarget
- The node reference which the relationship go to
-
removeRelationship
Removes the relationship from the given nodesource
to the given nodetarget
with the given unique name- Parameters:
uniqueName
- The unique name of the relationshipsource
- The node reference which the relationship come fromtarget
- The node reference which the relationship go to
-