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 database
new
- evaluates the body of the tag if user's profile does not
exist in the user database
canChangeLoginName
- 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 String |
BLANK |
ATTR_CONTEXT, 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 String |
printGroups(WikiContext context)
Returns a sorted list of the
Group objects a user possesses
in his or her WikiSession. |
static String |
printRoles(WikiContext context)
Returns a sorted list of the
Role objects a user possesses
in his or her WikiSession. |
void |
setProperty(String property) |
doCatch, doEndTag, doFinally, doStartTag, setId, setPageContext
public static final String BLANK
public UserProfileTag()
public void initTag()
WikiTagBase
initTag
in class WikiTagBase
public final int doWikiStartTag() throws IOException, WikiSecurityException
WikiTagBase
doWikiStartTag
in class WikiTagBase
IOException
WikiSecurityException
public void setProperty(String property)
public static String printGroups(WikiContext context)
Group
objects a user possesses
in his or her WikiSession. The result is computed by consulting
WikiSession.getRoles()
and extracting those that are of type Group.public static String printRoles(WikiContext context)
Role
objects a user possesses
in his or her WikiSession. The result is computed by consulting
WikiSession.getRoles()
and extracting those that are of type Role.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.