public class RelationshipServiceImpl extends DefaultComponent implements RelationshipService
RelationshipService
.Modifier and Type | Field and Description |
---|---|
static String |
KINDS_EXTENSION_POINT |
Constructor and Description |
---|
RelationshipServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
Boolean |
addRelation(String actorId,
String targetId,
RelationshipKind kind)
Adds a relation between two entities.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
List<RelationshipKind> |
getRegisteredKinds(String group)
Gets registered (contributed with the extension point) relationship kinds
depending of a group
|
List<RelationshipKind> |
getRelationshipKinds(String actorId,
String targetId)
Gets all existing relationship kinds between an actor and a target.
|
List<String> |
getTargets(String actorId)
Gets all targets of an actor.
|
List<String> |
getTargetsOfKind(String actorId,
RelationshipKind kind)
Gets all targets of a specific relation.
|
List<String> |
getTargetsWithFulltext(String actorId,
RelationshipKind kind,
String targetPattern)
Gets all targets that match the targetPattern with the given kind.
|
List<String> |
getTargetsWithFulltext(String actorId,
String targetPattern)
Gets all targets that match the targetPattern.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
Boolean |
removeRelation(String actorId,
String targetId,
RelationshipKind kind)
Removes a relationship composed by parameters
|
applicationStarted, getAdapter, registerExtension, unregisterContribution, unregisterExtension
public static final String KINDS_EXTENSION_POINT
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public List<RelationshipKind> getRelationshipKinds(String actorId, String targetId)
RelationshipService
getRelationshipKinds
in interface RelationshipService
public List<String> getTargetsOfKind(String actorId, RelationshipKind kind)
RelationshipService
getTargetsOfKind
in interface RelationshipService
kind
- if null, it will return all targets RelationshipService.getTargets(java.lang.String)
, it
can be only filled with the group or the namepublic List<String> getTargets(String actorId)
RelationshipService
getTargets
in interface RelationshipService
public List<String> getTargetsWithFulltext(String actorId, String targetPattern)
RelationshipService
getTargetsWithFulltext
in interface RelationshipService
public List<String> getTargetsWithFulltext(String actorId, RelationshipKind kind, String targetPattern)
RelationshipService
getTargetsWithFulltext
in interface RelationshipService
public List<RelationshipKind> getRegisteredKinds(String group)
RelationshipService
getRegisteredKinds
in interface RelationshipService
group
- can be null, or empty if you want to get all kindspublic Boolean addRelation(String actorId, String targetId, RelationshipKind kind)
RelationshipService
addRelation
in interface RelationshipService
true
if a new relation is created, false
otherwise.public Boolean removeRelation(String actorId, String targetId, RelationshipKind kind)
RelationshipService
removeRelation
in interface RelationshipService
Copyright © 2011 Nuxeo SA. All Rights Reserved.