1 package org.argeo.people;
2
3 import java.util.List;
4
5 import javax.jcr.Node;
6 import javax.jcr.RepositoryException;
7
8 import org.argeo.connect.AppService;
9
10 /** Provides method interfaces to manage a people repository */
11 public interface PeopleService extends AppService {
12
13 /**
14 * Returns the corresponding people entity using the People UID that is
15 * stored under propName. Returns null if the property is undefined or if
16 * there is no entity with this people UID
17 */
18 public Node getEntityFromNodeReference(Node node, String propName);
19
20 /**
21 * Creates and returns a model specific Node to store a reference, depending
22 * on the two object we want to link together
23 */
24 public Node createEntityReference(Node referencingNode, Node referencedNode, String role);
25
26 /**
27 * Returns all entities with the given NodeType related to this entity or
28 * null if none has been found. Key for relation is implementation specific:
29 * it might be a JCR Identifier but must not.
30 *
31 * @param relatedEntityType
32 * Optionally, the type of the grand-parent node typically to
33 * choose between an organisation, a group or a person in a group
34 */
35 public List<Node> getRelatedEntities(Node entity, String linkNodeType, String relatedEntityType);
36
37 /**
38 * Simply look for primary information and update primary cache if needed
39 */
40 public void updatePrimaryCache(Node entity) throws PeopleException, RepositoryException;
41
42 /* EXPOSE THE VARIOUS BUSINESS SERVICES */
43 /** Returns the corresponding {@link PersonService} */
44 public PersonService getPersonService();
45
46 /** Returns the corresponding {@link ContactService} */
47 public ContactService getContactService();
48
49 }