BEA Systems, Inc.

com.beasys.commerce.user.jsp.tags
Class GetProfileTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.beasys.commerce.user.jsp.tags.UserManagerTag
              |
              +--com.beasys.commerce.user.jsp.tags.ResultTag
                    |
                    +--com.beasys.commerce.user.jsp.tags.GetProfileTag

public class GetProfileTag
extends ResultTag

Corresponds to <um:getProfile>.

The <um:getProfile> tag retrieves the profile corresponding to the provided profile key and profile type. The tag has no enclosed body. The retrieved profile can be treated simply as a com.beasys.commerce.foundation.ConfigurableEntity, or can be cast to the particular implementation of ConfigurableEntity that it is. Along with the profile key and profile, an explicit successor key and successor type can be specified, as specified by the profileType attribute. This successor will then be used, along with the retrieved profile, in subsequent invocations of the <um:getProperty> tag to ensure property inheritance from the successor. If no successor is retrieved, standard ConfigurableEntity successor search patterns will apply to retrieved properties.

Tag Attribute

Required

Type

Description

profileKey

yes

String

A unique identifier that can be used to retrieve the profile which is sought.

Example: "<%=username%>"

profileType

no

String

The profile type to be retrieved. If specified, this profile type must correspond to a profile type registered via the Unified Profile Type tool in the User Management suite of administration tools, and its bean must conform to the rules of Unified User Profile creation.
By default, the tag retrieves a profile of type com.beasys.commerce.axiom.contact.User, unless otherwise specified. If the profie is a UUP and the profile type is specified in the deployment descriptor, this attribute is not necessary; the correct type will automatically be retrieved.

Example: "AcmeUser"

successorKey

no

String

A unique identifier that can be used to retrieve the profile successor.

Example: "<%=defaultGroup%>"

successorType

no

String

The profile successor type to be retrieved. If specified, this profile type must correspond to a profile type registered via the Unified Profile Type tool in the User Management suite of administration tools, and its bean must conform to the rules of Unified User Profile creation.
By default, the tag retrieves a profile of type com.beasys.commerce.axiom.contact.Group, unless otherwise specified.

Example: "AcmeGroup"

scope

no

String

The HTTP scope of the retreived profile. Pass "request" or "session" as the value.

Defaults to session.

groupOnly

no

String

Specifies to retrieve a com.beasys.commerce.axiom.contact.Group, rather than com.beasys.commerce.axiom.contact.User, for the default profile type. No successor will be retrieved when this value is true.
Defaults to false.

profileId

no

String

A variable name from which the retrieved profile is available for the duration of the JSP's page scope.

successorId

no

String

A variable name from which the retrieved successor is available for the duration of the JSP's page scope.

result

no

String

A variable name from which the result of the operation is available.

Possible Values:
Success:
UserManagerTagConstants.GET_PROFILE_OK

Informational/Partial Success:
UserManagerTagConstants.NO_SUCH_PROFILE
UserManagerTagConstants.NO_SUCH_SUCCESSOR

Error encountered:
UserManagerTagConstants.GET_PROFILE_FAILED

See Also:
Serialized Form

Fields inherited from class com.beasys.commerce.user.jsp.tags.ResultTag
result
 
Fields inherited from class com.beasys.commerce.user.jsp.tags.UserManagerTag
printStackTraces, verbose
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Constructor Summary
GetProfileTag()
           
 
Method Summary
 int doStartTag()
          Check to see if the profile has already been retrieved; if not, retrieve it and set it in the request or session so that it can be used by the getProperty and setProperty tags.
protected  ConfigurableEntity getEntity(java.lang.String typeName, java.lang.String key)
          Go through the DirectPropertyManager to get the entity specified by the given key and typeName
protected  long getEntityID(java.lang.String typeName, java.lang.String key)
          Go through the DirectPropertyManager to get the if of the entity specified by the given key and typeName
 java.lang.String getGroupOnly()
          Get the flag indicating to retrieve a group's profile
protected  ConfigurableEntity getProfile()
          Get the profile specified by profileKey
 java.lang.String getProfileId()
          Get the id to assign the retrieved profile to
 java.lang.String getProfileKey()
          Get the key of the profile to retrieve
 java.lang.String getProfileType()
          Get the profile type to retrieve
 java.lang.String getScope()
          Get the scope to use (request or session)
protected  ConfigurableEntity getSuccessor()
          Get the profile specified by successorKey
 java.lang.String getSuccessorId()
          Get the id to assign the retrieved successor to
 java.lang.String getSuccessorKey()
          Get the key of the successor to retrieve
 java.lang.String getSuccessorType()
          Get the profile type of the successor to retrieve
 void release()
          Reset the tag's attributes
 void setGroupOnly(java.lang.String s)
          Set the flag indicating to retrieve a group's profile
 void setProfileId(java.lang.String s)
          Set the id to assign the retrieved profile to
 void setProfileKey(java.lang.String s)
          Set the key of the profile to retrieve
 void setProfileType(java.lang.String s)
          Set the profile type to retrieve
 void setScope(java.lang.String s)
          Set the scope to use (request or session)
 void setSuccessorId(java.lang.String s)
          Set the id to assign the retrieved successor to
 void setSuccessorKey(java.lang.String s)
          Set the key of the successor to retrieve
 void setSuccessorType(java.lang.String s)
          Set the profile type of the successor to retrieve
protected  com.beasys.commerce.user.jsp.tags.GetProfileHelper setupTypeInfo()
          Setup class, home class, pk class, and jndi names for the profile and successor (if there is one) based on the tag attributes
 
Methods inherited from class com.beasys.commerce.user.jsp.tags.ResultTag
getResult, setResult
 
Methods inherited from class com.beasys.commerce.user.jsp.tags.UserManagerTag
getUserManager
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetProfileTag

public GetProfileTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Check to see if the profile has already been retrieved; if not, retrieve it and set it in the request or session so that it can be used by the getProperty and setProperty tags.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

getProfile

protected ConfigurableEntity getProfile()
                                 throws javax.servlet.jsp.JspException
Get the profile specified by profileKey

getSuccessor

protected ConfigurableEntity getSuccessor()
                                   throws javax.servlet.jsp.JspException
Get the profile specified by successorKey

getEntity

protected ConfigurableEntity getEntity(java.lang.String typeName,
                                       java.lang.String key)
                                throws java.lang.Exception
Go through the DirectPropertyManager to get the entity specified by the given key and typeName

getEntityID

protected long getEntityID(java.lang.String typeName,
                           java.lang.String key)
                    throws java.lang.Exception
Go through the DirectPropertyManager to get the if of the entity specified by the given key and typeName

setupTypeInfo

protected com.beasys.commerce.user.jsp.tags.GetProfileHelper setupTypeInfo()
                                                                    throws javax.servlet.jsp.JspException
Setup class, home class, pk class, and jndi names for the profile and successor (if there is one) based on the tag attributes

release

public void release()
Reset the tag's attributes
Overrides:
release in class ResultTag

getProfileId

public java.lang.String getProfileId()
Get the id to assign the retrieved profile to

setProfileId

public void setProfileId(java.lang.String s)
Set the id to assign the retrieved profile to

getSuccessorId

public java.lang.String getSuccessorId()
Get the id to assign the retrieved successor to

setSuccessorId

public void setSuccessorId(java.lang.String s)
Set the id to assign the retrieved successor to

getProfileKey

public java.lang.String getProfileKey()
Get the key of the profile to retrieve

setProfileKey

public void setProfileKey(java.lang.String s)
Set the key of the profile to retrieve

getSuccessorKey

public java.lang.String getSuccessorKey()
Get the key of the successor to retrieve

setSuccessorKey

public void setSuccessorKey(java.lang.String s)
Set the key of the successor to retrieve

getGroupOnly

public java.lang.String getGroupOnly()
Get the flag indicating to retrieve a group's profile

setGroupOnly

public void setGroupOnly(java.lang.String s)
Set the flag indicating to retrieve a group's profile

getProfileType

public java.lang.String getProfileType()
Get the profile type to retrieve

setProfileType

public void setProfileType(java.lang.String s)
Set the profile type to retrieve

getSuccessorType

public java.lang.String getSuccessorType()
Get the profile type of the successor to retrieve

setSuccessorType

public void setSuccessorType(java.lang.String s)
Set the profile type of the successor to retrieve

getScope

public java.lang.String getScope()
Get the scope to use (request or session)

setScope

public void setScope(java.lang.String s)
Set the scope to use (request or session)

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved