public class PeopleJcrUtils extends java.lang.Object implements PeopleNames
PEOPLE_ACCOUNT_HOLDER, PEOPLE_ACCOUNT_NB, PEOPLE_ALT_LANGS, PEOPLE_BANK_NAME, PEOPLE_BANK_NB, PEOPLE_BIC, PEOPLE_BIRTH_DATE, PEOPLE_CITY, PEOPLE_CONTACT_VALUE, PEOPLE_CONTACTS, PEOPLE_COUNTRY, PEOPLE_CURRENCY, PEOPLE_DATE_BEGIN, PEOPLE_DATE_END, PEOPLE_DEPARTMENT, PEOPLE_DISPLAY_NAME, PEOPLE_FIRST_NAME, PEOPLE_GENDER, PEOPLE_GEOPOINT, PEOPLE_HONORIFIC_TITLE, PEOPLE_IBAN, PEOPLE_IS_CURRENT, PEOPLE_IS_PRIMARY, PEOPLE_JOBS, PEOPLE_LAST_NAME, PEOPLE_LATIN_PHONETIC_SPELLING, PEOPLE_LEGAL_FORM, PEOPLE_LEGAL_NAME, PEOPLE_MAIDEN_NAME, PEOPLE_MAILING_LISTS, PEOPLE_MEMBERS, PEOPLE_MIDDLE_NAME, PEOPLE_NAME_SUFFIX, PEOPLE_NICKNAME, PEOPLE_ORG_REF_UID, PEOPLE_PAYMENT_ACCOUNTS, PEOPLE_PMAIL, PEOPLE_PMOBILE, PEOPLE_PORG, PEOPLE_POSTAL_ADDRESS_PROPS, PEOPLE_PPOSTAL_ADDRESS, PEOPLE_PRIMARY_EMAIL, PEOPLE_PTELEPHONE_NUMBER, PEOPLE_PURL, PEOPLE_REF_TITLE, PEOPLE_REF_UID, PEOPLE_ROLE, PEOPLE_SALUTATION, PEOPLE_SPOKEN_LANGUAGES, PEOPLE_STATE, PEOPLE_STREET, PEOPLE_STREET_COMPLEMENT, PEOPLE_TIME_ZONE, PEOPLE_UNSUBSCRIBED_MAILING_LISTS, PEOPLE_USE_POLITE_FORM, PEOPLE_USERNAME, PEOPLE_VAT_ID_NB, PEOPLE_ZIP_CODE
Constructor and Description |
---|
PeopleJcrUtils() |
Modifier and Type | Method and Description |
---|---|
static Node |
addEntityToGroup(Node group,
Node entity,
java.lang.String role,
java.lang.String title,
java.util.Calendar dateBegin,
java.util.Calendar dateEnd,
java.lang.Boolean isCurrent)
Add an entity to a given group
|
static Node |
createAddress(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.util.Dictionary<java.lang.String,java.lang.Object> p,
boolean isPrimary,
java.lang.String title,
java.lang.String description) |
static Node |
createAddress(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String street1,
java.lang.String street2,
java.lang.String zipCode,
java.lang.String city,
java.lang.String state,
java.lang.String country,
boolean isPrimary,
java.lang.String title,
java.lang.String description)
Create an address for the current entity
|
static Node |
createAddress(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String street1,
java.lang.String street2,
java.lang.String zipCode,
java.lang.String city,
java.lang.String state,
java.lang.String country,
java.lang.String geopoint,
boolean isPrimary,
java.lang.String title,
java.lang.String description)
Create an address with a geopoint for the current entity
|
static Node |
createContact(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String contactType,
java.lang.String value,
boolean isPrimary,
Node linkedOrg,
java.lang.String title,
java.lang.String description)
Create a contact node and add basic info
|
static Node |
createContact(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String contactType,
java.lang.String value,
boolean isPrimary,
java.lang.String title,
java.lang.String description)
Create a contact node and add basic info
|
static Node |
createEmail(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String emailAddress,
boolean isPrimary,
java.lang.String title,
java.lang.String description)
Create a mail address node.
|
static Node |
createImportTmpParent(Session session,
AppService appService) |
static Node |
createImpp(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String urlString,
boolean isPrimary,
java.lang.String title,
java.lang.String description) |
static Node |
createPhone(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String phoneNumber,
boolean isPrimary,
java.lang.String title,
java.lang.String description)
Create a landline phone number node for the current entity
|
static Node |
createSocialMedia(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
java.lang.String urlString,
boolean isPrimary,
java.lang.String title,
java.lang.String description) |
static Node |
createWebsite(ResourcesService resourcesService,
PeopleService peopleService,
Node parentNode,
java.lang.String urlString,
boolean isPrimary,
java.lang.String title)
Create a web site URL node.
|
static Node |
createWorkAddress(ResourcesService resourcesService,
PeopleService peopleService,
Node contactable,
boolean isPrimary,
Node linkedOrg,
java.lang.String title,
java.lang.String description)
Create an address with a geopoint for the current entity
|
static java.util.List<Node> |
getContactOfType(Node contactable,
java.lang.String contactType)
Returns a list of contact for the given entity and type
|
static java.lang.String |
getCountryFromItem(PeopleService peopleService,
Node contactable)
Returns the country of an entity relying on its primary address, if defined
|
static java.lang.String |
getPostalAddress(ResourcesService resourcesService,
Node contactNode) |
static Node |
getPrimaryContact(Node contactable,
java.lang.String contactType)
Returns the primary contact for the type or null if no node with this type is
defined as primary
|
static java.lang.String |
getPrimaryContactValue(Node contactable,
java.lang.String contactType)
Returns the primary contact value given a type or an empty String if no node
with this type is defined as primary
|
static Node |
getProfile(Session session,
java.lang.String username)
Deprecated.
|
static java.lang.String |
getTownFromItem(PeopleService peopleService,
Node contactable)
Returns the country of an entity relying on its primary address, if defined
|
static boolean |
isPrimary(Node parentNode,
Node primaryChild)
Check if current child is primary
|
static boolean |
markAsPrimary(ResourcesService resourcesService,
PeopleService peopleService,
Node parentNode,
Node primaryChild)
Marks the given node as primary using people specific mechanism, that is
it moves the corresponding node as first childnode of this node's
parent
if this node has people:orderable mixin, it sets the isPrimary flag to
true for this node and to false for all siblings that have the same node
type
it returns true only if some changes have been performed.
|
static void |
markAsPro(Node contactNode,
Node orga)
Marks a contact as pro if orga in not null by adding a mixin and setting
corresponding values.
|
static java.lang.String |
replaceInvalidChars(java.lang.String string)
Calls JcrUtils
|
static void |
setContactCategory(Node contactNode,
java.lang.String contactType,
java.lang.String category) |
static void |
setEntityPicture(Node entity,
java.io.InputStream picture,
java.lang.String fileName)
Set the default picture for the current entity, overwrite without asking but
do not save and check in corresponding node
|
static void |
syncPerson(java.util.Dictionary<java.lang.String,java.lang.Object> user,
Node person) |
static void |
updateDisplayAddress(ResourcesService resourcesService,
Node contactNode) |
static void |
updatePrimaryCache(ResourcesService resourcesService,
PeopleService peopleService,
Node parentNode,
Node primaryChild,
boolean isPrimary)
After setting a given node as primary, it tries to update parent node
corresponding cache properties.
|
@Deprecated public static Node getProfile(Session session, java.lang.String username) throws RepositoryException
PersonJcrUtils.getPersonWithUsername(Session, String)
RepositoryException
public static Node addEntityToGroup(Node group, Node entity, java.lang.String role, java.lang.String title, java.util.Calendar dateBegin, java.util.Calendar dateEnd, java.lang.Boolean isCurrent) throws RepositoryException
role
- the role of the given entity in this group. Cannot be nulltitle
- OPTIONAL: the nature of the subject in this relation, for instance
"Actor" or "Engineer"RepositoryException
public static void setContactCategory(Node contactNode, java.lang.String contactType, java.lang.String category) throws RepositoryException
RepositoryException
public static void markAsPro(Node contactNode, Node orga) throws RepositoryException
contactNode
- orga
- RepositoryException
public static java.lang.String getCountryFromItem(PeopleService peopleService, Node contactable)
public static java.lang.String getTownFromItem(PeopleService peopleService, Node contactable)
public static Node getPrimaryContact(Node contactable, java.lang.String contactType)
public static java.util.List<Node> getContactOfType(Node contactable, java.lang.String contactType)
public static java.lang.String getPrimaryContactValue(Node contactable, java.lang.String contactType)
contactable
- contactType
- public static boolean markAsPrimary(ResourcesService resourcesService, PeopleService peopleService, Node parentNode, Node primaryChild)
public static boolean isPrimary(Node parentNode, Node primaryChild)
public static void updatePrimaryCache(ResourcesService resourcesService, PeopleService peopleService, Node parentNode, Node primaryChild, boolean isPrimary)
public static Node createContact(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String contactType, java.lang.String value, boolean isPrimary, java.lang.String title, java.lang.String description)
contactable
- contactType
- value
- isPrimary
- title
- business type of the current contact, for instance for social
media, tweeter, linkedin, ... or otherdescription
- an optional descriptionname
- public static Node createContact(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String contactType, java.lang.String value, boolean isPrimary, Node linkedOrg, java.lang.String title, java.lang.String description)
contactable
- contactType
- value
- isPrimary
- linkedOrg
- if nature = pro, then we can pass an optional organisation linked
to this contacttitle
- business type of the current contact, for instance for social
media, tweeter, linkedin, ... or otherdescription
- an optional labelname
- nature
- for a person related contact, pro or privatepublic static Node createEmail(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String emailAddress, boolean isPrimary, java.lang.String title, java.lang.String description)
resourcesService
- peopleService
- contactable
- the parent item on which we want to add the emailemailAddress
- the valuetitle
- the generic label for this emaildescription
- an optional descriptionpublic static Node createWebsite(ResourcesService resourcesService, PeopleService peopleService, Node parentNode, java.lang.String urlString, boolean isPrimary, java.lang.String title)
parentNode
- the parent item on which we want to add a contacturlString
- isPrimary
- title
- an optional labelpublic static Node createSocialMedia(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String urlString, boolean isPrimary, java.lang.String title, java.lang.String description)
public static Node createImpp(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String urlString, boolean isPrimary, java.lang.String title, java.lang.String description)
public static Node createPhone(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String phoneNumber, boolean isPrimary, java.lang.String title, java.lang.String description)
contactable
- phoneNumber
- isPrimary
- title
- description
- an optional labelpublic static Node createAddress(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String street1, java.lang.String street2, java.lang.String zipCode, java.lang.String city, java.lang.String state, java.lang.String country, boolean isPrimary, java.lang.String title, java.lang.String description)
contactable
- street1
- street2
- zipCode
- city
- state
- country
- isPrimary
- title
- description
- an optional labelpublic static Node createAddress(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.util.Dictionary<java.lang.String,java.lang.Object> p, boolean isPrimary, java.lang.String title, java.lang.String description)
public static Node createWorkAddress(ResourcesService resourcesService, PeopleService peopleService, Node contactable, boolean isPrimary, Node linkedOrg, java.lang.String title, java.lang.String description)
contactable
- isPrimary
- title
- description
- an optional labelstreet1
- street2
- zipCode
- city
- state
- country
- nature
- optional: if parent node type is a person, then precise private or
propublic static Node createAddress(ResourcesService resourcesService, PeopleService peopleService, Node contactable, java.lang.String street1, java.lang.String street2, java.lang.String zipCode, java.lang.String city, java.lang.String state, java.lang.String country, java.lang.String geopoint, boolean isPrimary, java.lang.String title, java.lang.String description)
contactable
- street1
- street2
- zipCode
- city
- state
- country
- geopoint
- isPrimary
- title
- description
- an optional labelpublic static void updateDisplayAddress(ResourcesService resourcesService, Node contactNode)
public static java.lang.String getPostalAddress(ResourcesService resourcesService, Node contactNode)
public static void setEntityPicture(Node entity, java.io.InputStream picture, java.lang.String fileName) throws RepositoryException
RepositoryException
public static java.lang.String replaceInvalidChars(java.lang.String string)
public static Node createImportTmpParent(Session session, AppService appService) throws RepositoryException
RepositoryException
public static void syncPerson(java.util.Dictionary<java.lang.String,java.lang.Object> user, Node person) throws RepositoryException
RepositoryException
Copyright © 2007–2020. All rights reserved.