public class PrincipalViewHelper extends Object implements Serializable
Title: Principal output formating view helper
Description: The role of this class is to prepare and format user and group data for display according to the JSP files needs in administration and engines.
The output can be formated to the following string sequence :Copyright: MAP (Jahia Solutions S?rl 2003)
Company: Jahia Solutions S?rl
| Modifier and Type | Field and Description |
|---|---|
static String |
INHERITANCE |
static String |
NAME |
static String |
PERMISSIONS |
static String |
PRINCIPAL |
static String |
PROPERTIES |
static String |
PROVIDER |
static String |
SITEKEY |
static String |
SITETITLE |
| Constructor and Description |
|---|
PrincipalViewHelper(String[] textFormat)
Create the view helper with a given string format given by the following
syntax :
textFormat ::= (principal)? (permissions)? (provider)? (name)? (properties)?
principal ::= "Principal"
permissions ::= "Permissions"
provider ::= "Provider," size
name ::= "Name," size
properties ::= "Properties," size
size ::= number{2..n}
|
| Modifier and Type | Method and Description |
|---|---|
static String |
getDisplayName(Object p)
Return a displayable name, using resource bundles for the guest user and group.
|
static String |
getDisplayName(Object p,
Locale locale)
Return a displayable name, using resource bundles for the guest user and group.
|
static String |
getFullName(Object p)
Builds the full user name, which is build the following way :
- for a Group, simply calls getDisplayName(p)
- for a JahiaUser, if the firstName and lastName properties are defined, they are concatenated and this method
returns that result.
|
static String |
getGroupDisplayName(String groupName)
Returns the displayable name for a group based on the group name.
|
static String |
getGroupDisplayName(String groupName,
Locale locale)
Returns the displayable name for a group based on the group name.
|
static Set<JCRGroupNode> |
getGroupSearchResult(javax.servlet.ServletRequest request,
String siteKey)
Get the group search result from the parameter form given by the request.
|
static Set<JCRGroupNode> |
getGroupSearchResult(String searchIn,
String siteKey,
String searchString,
String[] searchInProps,
String storedOn,
String[] providers) |
static Set<JCRGroupNode> |
getGroupSearchResult(String searchIn,
String siteKey,
String searchString,
String[] searchInProps,
String storedOn,
String[] providers,
boolean includeGlobalUsers) |
static String |
getName(JCRNodeWrapper p,
Integer size)
Construct a displayable principal name string
|
static String |
getPrincipal(JCRNodeWrapper p,
Integer size)
Get the kind of principal given by one char u = user, g = group
|
String |
getPrincipalTextOption(JCRNodeWrapper p)
Prepare the princiapl string output for display according to the "textFormat".
|
static char |
getPrincipalType(Principal p)
Get the kind of principal given by one char u = user, g = group
|
String |
getPrincipalValueOption(Object p)
Prepare the "value" string output.
|
static String |
getProperties(JCRNodeWrapper p,
Integer size)
Get a principal displayable properties.
|
static String |
getProvider(JCRNodeWrapper p,
Integer size)
Construct a displayable provider name string
|
static Set<JCRUserNode> |
getSearchResult(javax.servlet.ServletRequest request)
Get the user search result from the parameter form given by the request.
|
static Set<JCRUserNode> |
getSearchResult(String searchIn,
String searchString,
String[] searchInProps,
String storedOn,
String[] providers) |
static Set<JCRUserNode> |
getSearchResult(String searchIn,
String siteKey,
String searchString,
String[] searchInProps,
String storedOn,
String[] providers) |
static Set<JCRUserNode> |
getSearchResult(String searchIn,
String siteKey,
String searchString,
String[] searchInProps,
String storedOn,
String[] providers,
boolean includeGlobalUsers) |
static String |
getSiteKey(JCRNodeWrapper p,
Integer size)
Construct a displayable site key string
|
static String |
getSiteTitle(JCRNodeWrapper p,
Integer size)
Construct a displayable site title string
|
static String |
getUserDisplayName(String userName)
Returns the displayable name for a user based on the user name.
|
static String |
getUserDisplayName(String userName,
Locale locale)
Returns the displayable name for a user based on the user name.
|
static Set<JCRUserNode> |
removeJahiaAdministrators(Set<JCRUserNode> users)
Utility method to remove from a set of users all the members of the
Jahia Administrators group.
|
public static final String PRINCIPAL
public static final String PERMISSIONS
public static final String PROVIDER
public static final String SITEKEY
public static final String SITETITLE
public static final String NAME
public static final String PROPERTIES
public static final String INHERITANCE
public PrincipalViewHelper(String[] textFormat)
textFormat - The string format given by the above syntax.public String getPrincipalTextOption(JCRNodeWrapper p)
p - The principal (user or group) to formatpublic String getPrincipalValueOption(Object p)
p - The principal (user or group) to formatpublic static String getFullName(Object p)
p - getDisplayName(java.lang.Object)public static String getDisplayName(Object p)
p - the principal for which to build the displayable namepublic static String getDisplayName(Object p, Locale locale)
p - the principal for which to build the displayable namelocale - the locale to use for looking up resource bundle valuespublic static String getGroupDisplayName(String groupName)
groupName - the group name to localizepublic static String getGroupDisplayName(String groupName, Locale locale)
groupName - the group name to localizelocale - the locale to use for looking up resource bundle valuespublic static String getUserDisplayName(String userName)
userName - the user name to localizepublic static String getUserDisplayName(String userName, Locale locale)
userName - the user name to localizelocale - the locale to use for looking up resource bundle valuespublic static String getName(JCRNodeWrapper p, Integer size)
p - The user objectsize - The principal string size that should be displayed.public static String getProvider(JCRNodeWrapper p, Integer size)
p - The principal objectsize - The provider string size that should be displayed.public static String getSiteKey(JCRNodeWrapper p, Integer size) throws javax.jcr.RepositoryException
p - The principal objectsize - The provider string size that should be displayed.javax.jcr.RepositoryExceptionpublic static String getSiteTitle(JCRNodeWrapper p, Integer size) throws javax.jcr.RepositoryException
p - The principal objectsize - The provider string size that should be displayed.javax.jcr.RepositoryExceptionpublic static String getPrincipal(JCRNodeWrapper p, Integer size)
p - The principal objectsize - For method call compatibilitypublic static char getPrincipalType(Principal p)
p - The principal objectpublic static String getProperties(JCRNodeWrapper p, Integer size)
p - The principal objectsize - The size the properties should be displayedpublic static Set<JCRUserNode> getSearchResult(javax.servlet.ServletRequest request)
request - the request that should contain the HTML formular with the
following fields :
- searchString
- searchIn
- properties
- storedOn
- providerspublic static Set<JCRUserNode> getSearchResult(String searchIn, String searchString, String[] searchInProps, String storedOn, String[] providers)
public static Set<JCRUserNode> getSearchResult(String searchIn, String siteKey, String searchString, String[] searchInProps, String storedOn, String[] providers)
public static Set<JCRUserNode> getSearchResult(String searchIn, String siteKey, String searchString, String[] searchInProps, String storedOn, String[] providers, boolean includeGlobalUsers)
public static Set<JCRGroupNode> getGroupSearchResult(javax.servlet.ServletRequest request, String siteKey)
request - the request that should contain the HTML formular with the
following fields :
- searchString
- searchIn
- properties
- storedOn
- providerssiteKey - The site ID containing the principal to searchpublic static Set<JCRGroupNode> getGroupSearchResult(String searchIn, String siteKey, String searchString, String[] searchInProps, String storedOn, String[] providers)
public static Set<JCRGroupNode> getGroupSearchResult(String searchIn, String siteKey, String searchString, String[] searchInProps, String storedOn, String[] providers, boolean includeGlobalUsers)
public static Set<JCRUserNode> removeJahiaAdministrators(Set<JCRUserNode> users)
users - a set of users that we will remove the Jahia administrators
fromCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.