Package org.ametys.plugins.core.user
Class UserHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.user.UserHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Simple user helper, for common function working on
User
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetUser
(UserIdentity userIdentity) Deprecated.getUserByEmail
(String populationId, String email) Deprecated.useUserManager.getUserByEmail(String, String)
insteadgetUserFullName
(UserIdentity userIdentity) Get the user's full name handling request cachegetUserSortableName
(UserIdentity userIdentity) Get the user's sortable name handling request cachejson2userIdentity
(Map<String, ? extends Object> json) Get the user identity from a JSON objectvoid
saxUser
(User user, ContentHandler handler) SAX an uservoid
saxUser
(User user, ContentHandler handler, String tagName) SAX an uservoid
saxUserIdentity
(UserIdentity userIdentity, ContentHandler handler) SAX an user identityvoid
saxUserIdentity
(UserIdentity userIdentity, ContentHandler handler, String tagName) SAX an user identityvoid
service
(ServiceManager smanager) Get the JSON object representing a useruser2json
(UserIdentity userIdentity) Get the JSON object representing a useruser2json
(UserIdentity userIdentity, boolean full) Get the JSON object representing a userGet the JSON object representing a userPopulate a list of map, where each map representing an user.users2json
(Collection<User> users) Populate a list of map, where each map representing an user.users2json
(Collection<User> users, boolean full) Populate a list of map, where each map representing an user.xml2userIdentity
(Configuration userConfiguration) Get the user identity from an XML configurationxml2userIdentity
(Node userNode) Get the user identity from a DOM Node objectMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
UserHelper
public UserHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getUserFullName
Get the user's full name handling request cache- Parameters:
userIdentity
- The user identity- Returns:
- user's full name or null if user does not exist
-
getUserSortableName
Get the user's sortable name handling request cache- Parameters:
userIdentity
- The user identity- Returns:
- user's full name or null if user does not exist
-
userIdentities2json
Populate a list of map, where each map representing an user.- Parameters:
users
- The list of users- Returns:
- The list of map.
-
users2json
Populate a list of map, where each map representing an user.- Parameters:
users
- The list of users- Returns:
- The list of map.
-
users2json
Populate a list of map, where each map representing an user.- Parameters:
users
- The list of usersfull
- Set totrue
to get full information on user- Returns:
- The list of map.
-
user2json
Get the JSON object representing a user- Parameters:
userIdentity
- The user identity- Returns:
- The user as JSON object
-
user2json
Get the JSON object representing a user- Parameters:
userIdentity
- The user identityfull
- Set totrue
to get full information on user- Returns:
- The user as JSON object
-
user2json
Get the JSON object representing a user- Parameters:
user
- The user- Returns:
- The user as JSON object
-
user2json
Get the JSON object representing a user- Parameters:
user
- The userfull
- Set totrue
to get full information on user- Returns:
- The user as JSON object or null, if the given user is null
-
json2userIdentity
Get the user identity from a JSON object- Parameters:
json
- the JSON object representing the user- Returns:
- the user identity
-
getUser
Deprecated.useUserManager.getUser(UserIdentity)
insteadGet the user from its identity- Parameters:
userIdentity
- The user identity- Returns:
- The user or null if not found
-
getUserByEmail
Deprecated.useUserManager.getUserByEmail(String, String)
insteadGet the user from its email- Parameters:
populationId
- The population idemail
- The email- Returns:
- The user or null if not found or if multiple user were found with this email
-
saxUserIdentity
SAX an user identity- Parameters:
userIdentity
- The user identity to SAXhandler
- The content handler- Throws:
SAXException
- If a SAX error occurs
-
saxUserIdentity
public void saxUserIdentity(UserIdentity userIdentity, ContentHandler handler, String tagName) throws SAXException SAX an user identity- Parameters:
userIdentity
- The user identity to SAXhandler
- The content handlertagName
- The XML tag for saxed user- Throws:
SAXException
- If a SAX error occurs
-
saxUser
SAX an user- Parameters:
user
- The user. If null no sax events will be generated.handler
- The content handler- Throws:
SAXException
- If a SAX error occurs
-
saxUser
SAX an user- Parameters:
user
- The user. If null no sax events will be generated.handler
- The content handlertagName
- The XML tag for saxed user- Throws:
SAXException
- If a SAX error occurs
-
xml2userIdentity
Get the user identity from an XML configuration- Parameters:
userConfiguration
- The configuration- Returns:
- The user identity
- Throws:
ConfigurationException
- if an error occurs during value retrieving
-
xml2userIdentity
Get the user identity from a DOM Node object- Parameters:
userNode
- The node- Returns:
- The user identity
- Throws:
TransformerException
- if an error occurs during value retrieving
-
UserManager.getUser(UserIdentity)
instead