Interface RelationshipService
-
- All Known Implementing Classes:
RelationshipServiceImpl
@AlfrescoPublicApi public interface RelationshipService
The relationship service interface- Since:
- 2.3
- Author:
- Tuna Aksoy
-
-
Field Summary
Fields Modifier and Type Field Description static String
RELATIONSHIP_VERSIONS
System relationship names
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRelationship(String uniqueName, NodeRef source, NodeRef target)
Adds a relationship from the given nodesource
to the give nodetarget
with the given unique nameRelationshipDefinition
createRelationshipDefinition(RelationshipDisplayName displayName)
Creates a relationship definition using the display nameboolean
existsRelationshipDefinition(String uniqueName)
Checks if a relationship exists or notRelationshipDefinition
getRelationshipDefinition(String uniqueName)
Gets the relationship definition for the given unique nameSet<RelationshipDefinition>
getRelationshipDefinitions()
Gets all the existing relationship definitionsSet<Relationship>
getRelationshipsFrom(NodeRef nodeRef)
Gets all the relationships that come out from the given node referenceSet<Relationship>
getRelationshipsFrom(NodeRef nodeRef, String nameFilter)
Gets all the relationships that come out from the given node reference that match the a given name filter.Set<Relationship>
getRelationshipsTo(NodeRef nodeRef)
Gets all the relationships that go into the given node referenceSet<Relationship>
getRelationshipsTo(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 definitionRelationshipDefinition
updateRelationshipDefinition(String uniqueName, RelationshipDisplayName displayName)
Updates an existing relationship definition
-
-
-
Field Detail
-
RELATIONSHIP_VERSIONS
static final String RELATIONSHIP_VERSIONS
System relationship names- See Also:
- Constant Field Values
-
-
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 definitiondisplayName
- 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(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(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 referencenameFilter
- Name filter for results- Returns:
- All relationships that come out from the given node reference
- Since:
- 2.3.1
-
getRelationshipsTo
Set<Relationship> getRelationshipsTo(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(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 referencenameFilter
- Name filter for results- Returns:
- All relationships that go into the given node reference
- Since:
- 2.3.1
-
addRelationship
void addRelationship(String uniqueName, NodeRef source, NodeRef target)
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
void removeRelationship(String uniqueName, NodeRef source, NodeRef target)
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
-
-