public class UserProfileTag extends WikiTagBase
Returns user profile attributes, or empty strings if the user has not been
validated. This tag has a single attribute, "property."
The property attribute may contain one of the following
case-insensitive values:
created - creation dateemail - user's e-mail addressfullname - user's full namegroups - a sorted list of the groups a user belongs tologinname - user's login name. If the current user does not have a profile, the user's login principal (such as one
provided by a container login module, user cookie, or anonyous IP address), will supply the login name propertyroles - a sorted list of the roles a user possesseswikiname - user's wiki namemodified - last modification dateexists - evaluates the body of the tag if user's profile exists in the user databasenew - evaluates the body of the tag if user's profile does not exist in the user databasecanChangeLoginName - always true if custom auth used; also true for container auth and current
UserDatabase.isSharedWithContainer() is true.canChangePassword - always true if custom auth used; also true for container auth
and current UserDatabase.isSharedWithContainer() is true.In addition, the values exists, new, canChangeLoginName
and canChangeLoginName can also be prefixed with ! to indicate the
negative condition (for example, !exists).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BLANK |
m_wikiContext| Constructor and Description |
|---|
UserProfileTag() |
| Modifier and Type | Method and Description |
|---|---|
int |
doWikiStartTag()
This method is allowed to do pretty much whatever he wants.
|
void |
initTag()
This method is called when the tag is encountered within a new request, but before the setXXX() methods are called.
|
static java.lang.String |
printGroups(Context context)
Returns a sorted list of the
Group objects a user possesses
in his or her Session. |
static java.lang.String |
printRoles(Context context)
Returns a sorted list of the
Role objects a user possesses
in his or her Session. |
void |
setProperty(java.lang.String property) |
doCatch, doEndTag, doFinally, doStartTag, setId, setPageContextpublic static final java.lang.String BLANK
public UserProfileTag()
public void initTag()
WikiTagBaseinitTag in class WikiTagBasepublic final int doWikiStartTag() throws java.io.IOException
WikiTagBasedoWikiStartTag in class WikiTagBasejava.io.IOExceptionpublic void setProperty(java.lang.String property)
public static java.lang.String printGroups(Context context)
Group objects a user possesses
in his or her Session. The result is computed by consulting
Session.getRoles()
and extracting those that are of type Group.public static java.lang.String printRoles(Context context)
Role objects a user possesses
in his or her Session. The result is computed by consulting
Session.getRoles()
and extracting those that are of type Role.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.