|
|
JSP Tag Reference
The following topics are included:
The JSP tags included with WebLogic Personalization Server 2.0 allow developers to create personalized applications without having to program using Java.
Personalization Advisor
To import the Personalization Advisor JSP tags, use the following code:
<%@ taglib uri="pz.tld" prefix="pz" %>
<pz:div>
The <pz:div> tag allows a user-provided piece of content to be turned on or off as a result of a classifier rule being executed by a rules agent. If the result is true, the content is turned on; if false it is turned off. This tag has a begin tag, a body, and an end tag. If it evaluates true, the tag returns the Classification object determined by the rules engine.
Tag Attribute |
Required |
Description |
ruleset |
yes |
The URI for the rule set that contains the Classifier rule. For release 2.0, support exists only for the EJB protocol for locating a ruleset. Example: ruleset= "ejb://RuleSetDefinitionHome/AcmePortal/rulesets/ruleset1.xml" |
rule |
yes |
The rule is the name of the classifier rule in the ruleset that the rules agent uses to classify the user. |
id |
no |
The variable name that will be placed in the classification object. |
Example:
<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<pz:div ruleset="jdbc://com.beasys.commerce.axiom.reasoning.rules.
RuleSheetDefinitionHome/AcmeRules" rule="PremierCustomer">
<p>Please check out our new Premier Customer bonus program<p>
</pz:div>
<pz:contentquery>
The <pz:contentquery> tag performs a content attribute search for content in a content manager. The tag only has a begin tag and does not have a body or end tag. It returns an array of Content objects as determined by the Personalization Advisor.
Personalization content tags required for JSP developers to access the Content object returned might include:
Tag Attribute |
Required |
Description |
max |
no |
Limits the maximum number of content items returned. If not present, it returns all of the content items found. |
sortby |
no |
A list of document attribute to sort the content by. The syntax follows the SQL order by clause. The sort specification is limited to a list of the metadata attribute names and the keywords ASC and DESC. Examples: sortBy="creationDate" sortBy="creationDate ASC, title DESC" |
query |
yes |
A content query string used to search for content. Example: query="mimetype contains 'text' && author='Proulx'" |
contenthome |
yes |
The name of the content home bean. This maps to a JNDI name for the content home that handles a specific type of content (e.g., documents) and its provider (Documentum vs. Interwoven). |
id |
yes |
The array variable name that contains the content objects found. If it finds no objects, it returns an empty array (not null) of Content objects. |
Example:
<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<pz:contentquery id="docs" contenthome="com.beasys.commerce.axiom.document.DocumentManager" query="author = 'Hemmingway'" />
<ul>
<es:foreachinarray array="docs" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printproperty id="aDoc"
name="Title" encode="html" />
</es:foreachinarray>
</ul>
<pz:contentselector>
The <pz:contentselector> tag allows arbitrary personalized content to be recommended based on a content selector rule. A content selector rule determines if the user matches the classification part of content selector rule. If a match, then a content query is performed based on the query in the rule.
Note: The terms rulesheet and ruleset refer to the same object and are used interchangeably throughout this documentation.
The ruleset URI protocol is as follows:
protocol://RuleSetDefinition-home-JNDI-name/RuleSheet-Name
Example:
ejb://com.beasys.commerce.axiom.reasoning.rules.RuleSheetDefinitionHome/AcmeRules
The <pz:contentselector> tag only has a begin tag and does not have a body or end tag. It returns an array of Document objects as determined by the Personalization Advisor.
Tags possibly required for JSP developers to access the Content objects returned might include:
Tag Attribute |
Required |
Description |
ruleset |
yes |
The URI for the rule set that contains the ContentSelector rule. For release 2.0, support exists only for the EJB protocol for locating a rule set. Example: ruleset= "ejb://RuleSetDefinitionHome/AcmePortal/ruleset/ruleset1.xml" |
rule |
yes |
The rule is the name of the contentSelector rule in the rule set to be used by the rules agent to recommend content based on the rule. |
max |
no |
Limits the maximum number of content items returned. If not present, it returns all of the content items found. |
sortby |
no |
A list of document attribute to sort the content by. The syntax follows the SQL order by clause. The sort specification is limited to a list of the metadata attribute names and the keywords ASC and DESC. Examples: sortBy="creationDate" sortBy="creationDate ASC, title DESC" |
query |
no |
A content query string that can be appended as an and phrase to the content query in the contentSelector rule. This allows the JSP developer to add a runtime query to the content selector rule. Example: query="mimetype contains like 'text/*'" |
contenthome |
yes |
The name of the content home bean. This maps to a JNDI name for the content home that handles a specific type of content (documents vs. catalog items) and its provider (Documentum vs. Interwoven). |
id |
yes |
The array variable name that contains the content objects found. If it finds no objects, it returns an empty array (not null) of Content objects. |
Example:
<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<pz:contentselector id="docs" ruleset="ejb://com.beasys.
commerce.axiom.reasoning.rules.
RulesheetDefinitionHome/AcmeRules"
rule="PremierCustomerSpotlight"
contenthome="com.beasys.commerce.axiom.document.
DocumentManager" />
<ul>
<es:foreachinarray array="docs" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printproperty id="aDoc"
name="Title" encode="html" />
</es:foreachinarray>
</ul>
Content Management
The Content Management component includes four JSP tags. These tags allow a JSP developer to include non-personalized content in a HTML-based page. The cm:select and cm:selectbyid tags support a per-user, HTTP session-based Content cache for content searches. Note that none of the tags support or use a body.
To import the Content Management JSP tags, use the following code:
<%@ taglib uri="cm.tld" prefix="cm" %>
<cm:select>
This tag uses only the search expression query syntax to select content. It does not support or use a body. After this tag has returned, the <es:foreachinarray> tag (see <es:foreachinarray>)can be used to iterate over the array of Content objects. This tag supports generic Content via a ContentManager interface.
Tag Attribute |
Required |
Description |
contentHome |
no |
The JNDI name of the ContentManager EJB Home to use to find content. The object in JNDI at this name must implement a create method which returns an object which implements the ContentManager interface. If not specified, the system searches the default content home. |
max |
no |
Limits the maximum number of content items returned. If not present, it returns all of the content items found. |
sortBy |
no |
A list of document attributes by which to sort the content. The syntax follows the SQL order by clause. The sort specification is limited to a list of the metadata attribute names and the keywords ASC and DESC. Examples: sortBy="creationDate" sortBy="creationDate ASC, title DESC" |
failOnError |
no |
This parameter can have one of two values: false (default value): Handles JSP processing errors gracefully and returns an empty array if an error occurs. true: Throws an exception that causes the JSP page to stop. You can handle the exception in the code, let the page proceed to the normal error page, or let the application server handle it less gracefully. |
id |
yes |
The JSP script variable name that will contain the array of Content objects after this tag finishes. |
query |
yes |
A content query string used to search for content. Example: query="mimetype contains 'text' && author='Proulx'" |
useCache |
no |
Determines whether Content is cached. This parameter can have one of two values: false (default value): ContentCache is not used. If false (not specified), cacheId and cacheTimeout settings are ignored. true: ContentCache is used. Cached Content is stored in the user's HttpSession. |
cacheId |
no |
The id name used to cache the Content. Internally, the cache is implemented as a Map; this will become the key. If not specified, the id parameter of the tag is used. |
cacheTimeout |
no |
The time, in milliseconds, for which the cached Content is valid. If more than this amount of time has passed since the Content was cached, the cached Content will be cleared, retrieved, and placed back into the cache. Use -1 for no-timeout (always use the cached Content.) Default = -1. |
readOnly |
no |
If true, the ContentManager (specified via the ContentHome parameter) will try to return only lightweight (non-EJB) objects where possible. If false (not specified), the default value is used. Default= ContentHelper.DEF_CONTENT_READONLY, which is loaded from the commerce.content.defaultReadOnly property in the weblogiccommerce.properties file. |
Example:
To find the first five text Content objects at bea.eDocs.CMgr that are marked as news items for the evening using the ContentCache, and print out the titles in a list:
<cm:select contentHome="bea.eDocs.CMgr" max="5" useCache="true" cacheTimeout="300000" cacheId="Evening News" sortBy="creationDate ASC, title ASC" query="
type = `News' && timeOfDay = `Evening' && mimetype like
`text/*' " id="newsList"/>
<ul>
<es:foreachinarray array="newsList" id="newsItem"
type="com.beasys.commerce.axiom.content.Content">
<li><cm:printproperty id="newsItem" name="Title"
encode="html" />
</es:foreachinarray>
</ul>
<cm:selectbyid>
The <cm:selectbyid> tag retrieves content using the Content's unique identifier. This tag does not have a body.This tag is basically a wrapper around the select tag. It works against any Content object which has a string-capable primary key.
Tag Attribute |
Required |
Description |
contentHome |
no |
The JNDI name of the ContentManager EJB Home to use to find content. The object in JNDI at this name must implement a create method which returns an object that implements the ContentManager interface. If not specified, the system searches the default content home. |
contentId |
yes |
The string identifier of the piece of content. |
failOnError |
no |
This parameter can have one of two values: false (default value): Handles JSP processing errors gracefully and returns null if an error occurs. true: Throws an exception that causes the JSP page to stop. You can handle the exception in the code, let the page proceed to the normal error page, or let the application server handle it less gracefully. |
id |
yes |
The JSP script variable name that contains the Content object after this tag finishes. If the Content object with the specified id does not exist, it contains null. |
useCache |
no |
Determines whether Content is cached. This parameter can have one of two values: false (default value): ContentCache is not used. If false (not specified), cacheId and cacheTimeout settings are ignored. true: ContentCache is used. Cached Content is stored in the user's HttpSession. |
cacheId |
no |
The id name used to cache the Content. Internally, the cache is implemented as a Map; this will become the key. If not specified, the id parameter of the tag is used. |
cacheTimeout |
no |
The time, in milliseconds, for which the cached Content is valid. If more than this amount of time has passed since the Content was cached, the cached Content will be cleared, retrieved, and placed back into the cache. Use -1 for no-timeout (always use the cached Content.) Default = -1. |
readOnly |
no |
If true, the ContentManager (specified via the ContentHome parameter) will try to return only lightweight (non-EJB) objects where possible. If false (not specified), the default value is used. Default= ContentHelper.DEF_CONTENT_READONLY, which is loaded from the commerce.content.defaultReadOnly property in the weblogiccommerce.properties file. |
Example:
To fetch the Document from bea.eDocs.CMgr (using ContentCaching) with id of 1234 and inline its content:
<cm:selectbyid contentHome="bea.eDocs.CMgr" contentId="1234" id="doc" useCache="true" cacheTimeout="300000" cacheId="1234" />
<cm:printdoc id="doc" />
<cm:printproperty>
The <cm:printproperty> tag inlines the value of the specified content metadata property as a string. It does not have a body. This tag operates on any ConfigurableEntity, not just the Content object. However, it does not support ConfigurableEntity successors.
Tag Attribute |
Required |
Description |
id |
yes |
The JSP script variable name which contains the Content instance from which to get the properties. |
name |
yes |
The name of the property to print. |
scope |
no |
The scope name for the property to get. If not specified, null is passed in, which is what Document objects expect. |
encode |
no |
Either html, url, or none.
|
default |
no |
The value to print if the property is not found or has a null value. If this is not specified and the property value is null, nothing is printed. |
maxLength |
no |
The maximum length of the property's value to print. If specified, values longer than this will be truncated. |
failOnError |
no |
This parameter can have one of two values: false (default value): Handles JSP processing errors gracefully and prints nothing if an error occurs. true: Throws an exception. You can handle the exception in the code, let the page proceed to the normal error page, or let the application server handle it less gracefully. |
dateFormat |
no |
The java.text.SimpleDateFormat string to use to print the property, if it is a java.util.Date. If the property is not a Date, this is ignored. If this is not set, the Date's default toString method is used. |
numFormat |
no |
The java.text.DecimalFormat string to use to print the property, if it is a java.lang.Number. If the property is not a Number, this is ignored. If this is not set, the Number's default toString method is used. |
Example:
To have a text input field's default value be the first 75 characters of the subject of a Content object stored at doc:
<form action="javascript:void(0)">
Subject: <input type="text" size="75" name="subject"
value="<cm:printproperty id="doc" name="Subject" maxLength="75"
encode="html"/>" >
</form>
<cm:printdoc>
The <cm:printdoc> tag inlines the raw bytes of a Document object into the JSP output stream. This tag does not support a body and only supports Document objects. It does not differentiate between text and binary data.
Tag Attribute |
Required |
Description |
id |
yes |
The JSP script variable name which contains the Content instance from which to get the properties. |
blockSize |
no |
The size of the blocks of data to read. The default is 8K. Use 0 or less to read the entire block of bytes in one operation. |
start |
no |
Specifies the index in the bytes where to start reading. Defaults to 0. |
end |
no |
Specifies the index in the bytes where to stop reading. The default is to read to the end of the bytes. |
failOnError |
no |
This parameter can have one of two values: false (default value): Handles JSP processing errors gracefully and prints nothing if an error occurs. true: Throws an exception. You can handle the exception in the code, let the page proceed to the normal error page, or let the application server handle it less gracefully. |
Example:
To get a Document object from an id in the request parameters and inline the Document's text:
<cm:selectbyid contentHome="<%=contentHome%>" contentId="<%=contentId%>" id="doc"/>
<cm:printdoc id="doc" blockSize="1000" />
Portal Management
To import the Portal Management JSP tags, use the following code:
<%@ taglib uri="lib/esportal.jar" prefix="pt" %>
<pt:portalmanager>
The <pt:portalmanager> tag is used to perform create, get, getColumnInfo, update, and remove actions on com.beasys.portal.Portal objects. This tag is an empty tag.
Tag Attribute |
Required |
Description |
id |
when action equals get or getColumnInfo |
The name to which resultant information is assigned for subsequent use in the JSP page. |
action |
no |
The action to perform. Allowed values include:
|
portalName |
no |
The name of the portal to retrieve, or whose column information is to be retrieved. The default value is the value returned by PortalJspBase.getSessionValue(PortalJsp.Base.PORTAL_NAME). |
target |
when action equals create, update, or remove |
The com.beasys.portal.Portal to be created, updated, or removed. |
Example:
<pt:portalmanager id="portal" action="get" portalName="BEAPortal"/>
<pt:portletmanager>
The <pt:portletmanager> tag is used to perform create, get, getArranged, update, and remove actions on com.beasys.portal.Portlet objects. This tag is an empty tag.
Tag Attribute |
Required |
Description |
id |
when action equals get or getArranged |
The name to which resultant information is assigned for subsequent use in the JSP page. |
action |
no |
The action to perform. Allowed values include:
|
portalName |
no |
The name of the portal corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is the value returned by PortalJspBase.getSessionValue(PortalJsp.Base.PORTAL_NAME). |
portletName |
no |
The name of the portlet corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is the value returned by PortalJspBase.getSessionValue(PortalJsp.Base. PORTLET_NAME). |
groupId |
no |
The name of the group corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is GROUP_ID. |
userId |
no |
The name of the user corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is USER_ID. |
target |
when action equals create, update, or remove |
The com.beasys.portal.Portlet to be created, updated, or removed. |
scope |
no |
The scope to be applied to the provided action. Allowed values include:
|
Example:
<pt:portletmanager id="arrangedPortlets" action="getArranged" userName="myUser" portalName="myPortal"/>
This is how <pt:portletmanager> is used in portalcontent.jsp:
<pt:portletmanager action="getArranged" id ="allPortlets" userId="<%=portalUserUID.longValue()%>" groupId="<%=portalGroupUID.longValue()%>" portalName="<%=portalName%>"/>
<pt:eval>
The <pt:eval> tag is used to evaluate a conditional attribute of a portlet, for example, isMinimizeable. The tag expects a com.beasys.portal.Portlet to be accessible in the session with the key PortalTagConstants.PORTLET. If the conditional attribute evaluates to true, the body of the <pt:eval> tag is processed. Otherwise, it is not.
Tag Attribute |
Required |
Description |
tag |
yes |
The name of the portlet attribute to evaluate. |
Example:
<pt:eval tag="isMinimizeable">
<% titleBar.include(minimizeButton); %>
</pt:eval>
<pt:get>
The <pt:get> tag retrieves a String attribute of a portlet. This tag expects a com.beasys.portal.Portlet to be accessible in the session with the key PortalTagConstants.PORTLET.
Tag Attribute |
Required |
Description |
tag |
yes |
The name of the portlet attribute to retrieve. |
Example:
<tr>
<td>
<pt:get tag="title"/>
</td>
</tr>
<pt:monitorsession>
The <pt:monitorsession> tag can be added to the beginning of any JSP page to disallow access to the page if the session is not valid or if the user is not logged in.
Tag Attribute |
Required |
Description |
goToPage |
no |
The error page that you want displayed if the page is not accessible. The default value is portalerror.jsp. |
loginRequired |
no |
Indicates whether the user is required to be logged in to access the JSP page including the tag. The default value is FALSE. |
Example:
<pt:monitorsession loginRequired="true" />
<pt:props>
The <pt:props> tag is used to get a property from the Portal Properties bean. The Portal Properties bean's deployment descriptor contains default values used by the Portal Administration Tool.
Tag Attribute |
Required |
Description |
id |
yes |
A java.lang.String variable name for the property value. |
portalName |
yes |
The name of the property to get in the Portal Property Bean. |
Example:
<pt:props id="headerURL" propertyName="default.portal.headerURL" />
<pt: getgroupsforportal>
The <pt:getgroupsforportal> tag retrieves the names of the groups associated with a Portal. The results are put into the variable declared in the id parameter of the tag, which is a String array.
Tag Attribute |
Required |
Description |
id |
yes |
A resulting string array containing the names of the groups associated with the given Portal. |
portalName |
yes |
The name of the Portal to be checked for associated groups. |
User Management
To import the User Management JSP tags, use the following code:
<%@ taglib uri="lib/um_tags.jar" prefix="um" %>
Profile management tags
<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 as 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 |
Description |
profileKey |
yes |
A unique identifier that can be used to retrieve the profile which is sought. Example: "<%=username%>" |
profileType |
no |
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. Example: "AcmeUser" |
successorKey |
no |
A unique identifier that can be used to retrieve the profile successor. Example: "<%=defaultGroup%>" |
successorType |
no |
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 - defaults to session |
The HTTP scope of the retreived profile. Pass Request or Session as the values. |
groupOnly |
no - defaults to false |
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. |
profileId |
no |
A variable name from which the retrieved profile is available for the duration of the JSP's page scope. |
successorId |
no |
A variable name from which the retrieved successor is available for the duration of the JSP's page scope. |
Example 1:
This example shows a profile of type AcmeUser being retrieved with no successor specified, and an explicitly-supplied session scope.
<um:getprofile profileKey="bob" profileType="AcmeUser" profileId="myProfile" scope="session"/>
Example 2:
This example shows a default profile type (com.beasys.commerce.axiom.contact.User) being retrieved with a default successor type (com.beasys.commerce.axiom.contact.Group), and an explicitly-supplied request scope.
<um:getprofile profileKey="bob" successorKey="engineering" scope="request"/>
Example 3:
This example shows a profile type of AcmeUser being retrieved with a successor type of AcmeGroup, and an implicitly-supplied session scope.
<um:getprofile profileKey="bob" profileType="AcmeUser"
successorKey="engineering" successorType="AcmeGroup"
profileId="myProfile"/>
<um:getproperty>
The <um:getproperty> tag retrieves the property value for a specified property set-property name pair. The tag has no enclosed body. The value returned is an Object. In typical cases, this tag is used after the <um:getprofile> tag is invoked to retrieve a profile for session use. The property to be retrieved is retrieved from the session profile. If the <um:getprofile> tag has not been used upon invoking the <um:getproperty> tag, the specified property value is retrieved from the Anonymous User Profile. See the User Management documentation for more information.
Tag Attribute |
Required |
Description |
propertySet |
no - the property is retrieved from the profile's default (unscoped ) properties if no property set is provided. |
The Property Set from which the property's value is to be retrieved. Example: "Demo Portal" |
propertyName |
yes |
The name of the property to be retrieved. Example: "background_color". |
useCache |
no - defaults to false. |
Prescribes whether to first search the local cache of property values for the property, and whether to cache the value locally once retrieved remotely. This attribute can be set to true to significantly enhance performance. |
id |
no |
If the id attribute is supplied, the value of the retrieved property will be available in the variable name to which id is assigned. Otherwise, the value of the property is inlined. |
Example 1:
<um:getproperty id="myTitlebarBGColor" propertySet="exampleportal" propertyName="titlebar_bgcolor"/>
My titlebar bg color is <%=myTitlebarBGColor%>.
Example 2:
My titlebar bg color is <um:getproperty propertySet="exampleportal" propertyName="titlebar_bgcolor"/>.
<um:getpropertyasstring>
The <um:getpropertyasstring> tag works exactly as the <um:getproperty> tag, but ensures that the retrieved property value is a String. The following example shows a multi-valued property which returns a Collection, but presents a list of favorite colors.
Example:
<um:getpropertyasstring id="myFaveColors" propertySet="exampleportal" propertyName="fave_colors"/>
My favorite colors are <%=myFaveColors%>.
<um:removeproperty>
The <um:removeproperty> tag removes the specified property from the current session profile or from the Anonymous User Profile. The tag has no enclosed body. Subsequent calls to <um:getproperty> for a removed property would result in the default value for the property as prescribed by the property set, or from the Session's successor.
Tag Attribute |
Required |
Description |
propertySet |
no |
The Property Set from which the property's value is to be retrieved. Example: "Demo Portal" Note: The property is removed from the profile's default (unscoped) properties if no property set is provided. |
propertyName |
yes |
The name of the property to be removed. Example: "background_color". |
Example:
<um:removeproperty propertySet="<%=thePropertySet%>" propertyName="<%=thePropertyName%>"/>
<um:setproperty>
The <um:setproperty> tag updates a property value for either the current session profile, or for the Anonymous User Profile. The tag has no enclosed body.
Tag Attribute |
Required |
Description |
propertySet |
no |
The Property Set in which the property's value is to be set. Example: "Demo Portal" Note: The property is set for the profile's default (unscoped) properties if no property set is provided. |
propertyName |
yes |
The name of the property to be set. Example: "background_color". |
useCache |
no - defaults to false |
Prescribes whether to set the value for the property in the local cache after setting the property for the current profile. |
value |
yes |
The new property value. This attribute must be a previously-declared variable, as shown in the example. |
Example:
<% String myName = request.getParameter("name"); %>
<um:setproperty propertySet="exampleportal" propertyName="name" value="<%=myName%>"/>
Group-user management tags
<um:addgrouptogroup>
The <um:addgrouptogroup> tag adds the group corresponding to the provided childGroupName to the group corresponding to the provided parentGroupName. Since a group can only have one parent, any previous database records which reflect the group belonging to another parent will be destroyed. Both the parent group and the child group must previously exist for proper tag behavior. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
childGroupName |
yes |
The name of the child group. Example: "<%=childGroupName%>" |
parentGroupName |
yes |
The name of the parent group. Example: "<%=parentGroupName%>" |
resultId |
yes |
The possible results of the add group to group operation. Possible values include:
|
Example:
<um:addgrouptogroup childGroupName="<%=childGroupName%>" parentGroupName="<%=parentGroupName%>" resultId="result"/>
<um:addusertogroup>
The <um:addusertogroup> tag adds the user corresponding to the provided userName to the group corresponding to the provided parentGroupName. Both the specified user and the specified group must previously exist for proper tag behavior. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
userName |
yes |
The name of the user to be added to the group. Example: "<%=username%>" |
groupName |
yes |
The name of the group to which the user is being added. Example: "<%=groupName%>" |
resultId |
yes |
The possible results of the add user to group operation. Possible values include:
|
Example:
<um:addusertogroup userName="<%=userName%>" groupName="<%=groupName%>" resultId="result"/>
<um:changegroupname>
The <um:changegroupname> tag changes the a name of the group corresponding to the specified oldGroupName to the specified newGroupName. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
oldGroupName |
yes |
The old group name. Example: "<%=oldGroupName%>" |
newGroupName |
yes |
The new group name. Example: "<%=newGroupName%>" |
resultId |
yes |
The name of an Integer variable to which the result of the change group name operation is assigned. Possible values include:
|
Example:
<um:changeGroupname oldGroupName="<%=oldGroupName%>" newGroupName="<%=changeGroupName%>" resultId="result"/>
<um:creategroup>
The <um:creategroup> tag creates a new com.beasys.commerce.axiom.contact.Group object. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
groupName |
yes |
The name of the new group. Example: "<%=groupName%>" |
id |
no |
A variable name to which the created Group object is available for the duration of the page's scope. |
resultId |
yes |
The possible results of the create user operation. Possible Values: UserManagerTagConstants. UserManagerTagConstants. UserManagerTagConstants. |
Example:
<um:creategroup groupName="<%=groupName%>" resultId="result"/>
<um:createuser>
The <um:createuser> tag creates a new com.beasys.commerce.axiom.contact.User object. The tag has no enclosed body. Although classified as a Group-User management tag, this tag can be used in conjunction with run time activities, in that it will persist any properties associated with a current Anonymous User Profile if specified.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
userName |
yes |
The name of the new user. Example: "<%=username%>" |
password |
no |
The password for the new user. Example: "<%=password%>" |
saveAnonymous |
no - defaults to false |
Whether to persist current anonymous user profile attributes in the newly-created user's profile. Example: "false" |
id |
no |
A variable name to which the created User object is available for the duration of the page's scope. |
resultId |
yes |
The possible results of the create user operation. Possible Values: UserManagerTagConstants.CREATE_USER_OK: Success UserManagerTagConstants.CREATE_USER_FAILED: Error encountered UserManagerTagConstants.USER_EXISTS: A user with the specified username already exists |
Example:
<um:createuser userName="<%=username%>" password="<%=password"%> resultId="result"/>
<um:getchildgroups>
The <um:getchildgroups> tag retrieves an array of com.beasys.commerce.axiom.contact.Group objects that are children of the Group corresponding to the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. The tag has no enclosed body.
Tag Attribute |
Required |
Description |
groupName |
yes |
The name of the group whose children are sought. Example: "<%=groupName%>" |
id |
yes |
A variable name to which the child Group objects are available for the duration of the page's scope. Example: "childGroups" |
Example:
<um:getchildgroups groupName="<%=groupName%>" id="childGroups"/>
<um:getgroupnamesforuser>
The <um:getgroupnamesforuser> tag retrieves a String array that contains the group names matching the provided search expression and corresponding to groups to which the provided user belongs. The tag has no enclosed body.
Tag Attribute |
Required |
Description |
userName |
yes |
The name of the user whose matching groups are sought. Example: "<%=username%>" |
id |
yes |
A variable name to which the resultant group names are assigned. Example: "myGroups" |
Example:
<um:getgroupnamesforuser userName="<%=username%>" id="myGroups"/>
<um:getparentgroupname>
The <um:getparentgroupname> tag retrieves the name of the parent of the com.beasys.commerce.axiom.contact.Group object associated with the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. The tag has no enclosed body.
Tag Attribute |
Required |
Description |
groupName |
yes |
The name of the group whose parent group name is sought. Example: "<%=groupName%>" |
id |
yes |
A variable name to which the to which the name of the parent is available for the duration of the page's scope. Example: "parentGroupName" |
Example:
<um:getparentgroupname groupName="<%=groupName%>" id="parentGroupName"/>
<um:gettoplevelgroups>
The <um:gettoplevelgroups> tag retrieves and array of com.beasys.commerce.axiom.contact.Group objects, each of which has no parent group. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. The tag has no enclosed body.
Tag Attribute |
Required |
Description |
id |
yes |
A variable name to which the top-level Group objects are available for the duration of the page's scope. Example: "topLevelGroups" |
Example:
<um:gettoplevelgroups id="topLevelGroups"/>
<um:getusernames>
The <um:getusernames> tag retrieves a String array that contains the usernames matching the provided search expression. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
searchExp |
no - defaults to `*' |
The search expression to apply to the user name search. Example: "t*" |
userLimit |
no - defaults to 100 |
The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf) Example: "500" |
id |
yes |
A variable name to which the resultant user names are assigned. Example: "myUsers" |
resultId |
yes |
The possible results of the get user names operation. Possible Values: UserManagerTagConstants.USER_SEARCH_ UserManagerTagConstants.USER_SEARCH_ UserManagerTagConstants.USER_LIMIT_ |
Example:
<um:getusernames userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users.");%>
<um:getusernamesforgroup>
The <um:getusernamesforgroup> tag retrieves a String array that contains the usernames matching the provided search expression and correspond to members of the provided group. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
searchExp |
no - defaults to * |
The search expression to apply to the user name search. Example: "t*" |
groupName |
yes |
The name of the group whose matching members are sought. Example: "engineering" |
userLimit |
no - defaults to 100 |
The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf) Example: "500" |
id |
yes |
A variable name to which the resultant user names are assigned. Example: "myUsers" |
resultId |
yes |
The possible results of the get user names for group operation. Possible Values: UserManagerTagConstants.USER_SEARCH_ UserManagerTagConstants.USER_SEARCH_ UserManagerTagConstants.USER_LIMIT_ |
Example:
<um:getusernamesforgroup groupName="engineering" userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users in my group.");%>
<um:removegroup>
The <um:removegroup> tag removes the com.beasys.commerce.axiom.contact.Group object corresponding to the provided groupName. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
groupName |
yes |
The name of the user to be removed. Example: "<%=groupName%>" |
resultId |
yes |
The possible results of the remove group operation. Possible values include:
|
Example:
<um:removegroup groupName="<%=groupNamename%>" resultId="result"/>
<um:removeuser>
The <um:removeuser> tag removes the com.beasys.commerce.axiom.contact.User object corresponding to the provided userName. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
userName |
yes |
The name of the user to be removed. Example: "<%=username%>" |
resultId |
yes |
The possible results of the remove user operation. Possible values include:
|
Example:
<um:removeuser userName="<%=username%>" resultId="result"/>
Security tags
<um:login>
The <um:login> tag provides weak authentication (username, password) against the current security realm, and sets the authenticated user as the current WebLogic user. The tag has no enclosed body.
Note: The login tag requires a username parameter and a password parameter to be present in the HTTP request.
Tag Attribute |
Required |
Description |
resultId |
yes |
The possible results of the login operation. UserManagerTagConstants.LOGIN_FAILED - username/password combo invalid UserManagerTagConstants.LOGIN_ERROR - an error occurred when performing authentication. Possible values:
|
The <um:setpassword> tag updates the password for the user corresponding to the provided username.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Tag Attribute |
Required |
Description |
userName |
yes |
The name of the user whose password is to be changed. |
password |
no |
The new user password. |
resultId |
no |
The possible results of the set password operation.
|
Personalization Utilities
The <es:jsptaglib> contains generic tags you can use to create JSP pages. Use the following code to import the utility tag library:
<%@ taglib uri="lib/esjsp.jar" prefix="es" %>
<es:condition>
The <es:condition> tag is used to evaluate a Boolean expression. The tag can either be an empty tag or a tag whose body is executed if the condition evaluates to true.
Tag Attribute |
Required |
Description |
test |
no |
The expression to test. |
id |
When the tag is empty. |
The variable name to assign. The default value is id. |
Example:
<es:condition id="isYes" test="a.equals(b)"/>
<es:counter>
The <es:counter> is used to create a for loop.
Tag Attribute |
Required |
Description |
type |
no |
The type of the counter. This can either be an int or a long. Default is int. |
id |
yes |
A unique name for the variable. |
minCount |
yes |
The start position for the loop. |
maxCount |
yes |
The end position for the loop. |
Example:
<es:counter id="iterator" minCount="0" maxCount="10">
<% System.out.println(iterator);%>
</es:counter>
<es:foreachinarray>
The <es:foreachinarray> tag is used to iterate over an array.
Tag Attribute |
Required |
Description |
id |
yes |
The variable for each value in the array. |
type |
yes |
The type of each value in the array. |
array |
yes |
The array to iterate over. |
counterId |
no |
The position in the array. |
Example:
<es:foreachinarray id="item" array="items" type="String" counterId="i">
<% System.out.println("items[" + i + "]: " + item);%>
</es:foreachinarray>
<es:isnull>
The <es:isnull> tag is used to check if a value is null. In the case of a String, the <es:isnull> tag is used to check if the String is null or empty.
Tag Attribute |
Required |
Description |
id |
yes |
The variable to evaluate. |
Example:
<es:isnull id="value">
Error: the value is null.
</es:isnull>
<es:notnull>
The <es:notnull> tag is used to check if a value is not null. In the case of a String, the <es:notnull> tag is used to check if the String is not null or empty.
Tag Attribute |
Required |
Description |
id |
yes |
The variable to evaluate. |
Example:
<es:notnull id="value">
The value is not null.
</es:notnull>
<es:preparedstatement>
The <es:preparedstatement> tag is used to create a JDBC prepared statement.
Tag Attribute |
Required |
Description |
id |
yes |
The variable in which the PreparedStatement is returned. |
sql |
yes |
The SQL with <es:preparedstatement> tags. |
pool |
yes |
The JDBC connection pool from which to get a connection. |
Example:
<es:preparedstatement id="ps" sql="select last_name from user where id=?" pool="jdbcPool">
<%
ps.setInt(1, 1234);
ResultSet rs = ps.execute();
if (rs.next())
{
System.out.println(rs.getString(1));
}
%>
</es:preparedstatement>
<es:simplereport>
The <es:simplereport> tag is used to create two-dimensional array out of a simple query.
Tag Attribute |
Required |
Description |
id |
yes |
The variable that holds the [ ] array. |
resultSet |
yes |
The result set that turns two-dimensional. |
Example:
<es:simplereport id="report" resultSet="resultSet">
<%
for (int i=0; ireport[i].length; j++ )
{
...
}
}
%>
</es:simplereport>
<es:transposearray>
The <es:transposearray> tag is used to transpose a standard [row][column] array to a [column][row] array.
Tag Attribute |
Required |
Description |
id |
yes |
The variable that holds the [c][r] array. |
type |
yes |
The type of variable in the [r][c] array, such as String. |
array |
yes |
The variable that holds the [r][c] array. |
Example:
<es:transposearray id="byColumnRow" array="byRowColumn" type="String">
...
</es:transposearray>
<es:uricontent>
The <es:uricontent> tag is used to pull content from a URL. It is best used for grabbing text-heavy pages.
Tag Attribute |
Required |
Description |
id |
yes |
The variable that holds the downloaded content of the URI. |
uri |
yes |
The fully-qualified URI from which to get the content. |
<es:uricontent id="uriContent" uri="http://www.beasys.com/index.html">
<%
out.print(uriContent);
%>
</es:uricontent>
<es:date>
The <es:date> tag is used to get a date- and time-formatted String based on the user's time zone preference.
Tag Attribute |
Required |
Description |
timeZoneId |
no |
Defaults to the time zone on the server. |
formatStr |
no |
A date and time format string that adheres to the java.text.SimpleDateFormat. The default value is MM/dd/yyyy HH:mmss:z. |
Example:
<es:date formatStr="MMMM dd yyyy" timeZoneId="MST" />
<es:usertransaction>
The <es:usertransaction> tag is used to wrap database-intensive code within one efficient transaction.
Note: Do not nest these calls. The system does not support nested transactions.
Tag Attribute |
Required |
Description |
timeout |
no |
The user transaction timeout in seconds. The default value is 600. |
Example:
<es:usertransaction>
<% //database inserts %>
</es:usertransaction>
WebLogic Utilities
The <wl:jsptaglib> tag library contains custom JSP extension tags which are supplied as a part of the WebLogic server platform. To import the WebLogic Utilities JSP tags, use the following code:
<%@ taglib uri="lib/wljsp.jar" prefix="wl" %>
<wl:process>
The <wl:process> tag is used for query parameter-based flow control. By using a combination of the four attributes, you can selectively execute the statements between the <wl:process> and </wl:process> tags.
Tag Attribute |
Required |
Description |
name |
no |
The name of a query parameter. |
notname |
no |
The name of a query parameter. |
value |
no |
The value of a query parameter. |
notvalue |
no |
The value of a query parameter. |
Statements between the <wl:process> tags will be executed according to the matrix:
|
value |
notvalue |
(none) |
name |
named parameter is equal to the value |
named parameter does not equal the value |
named parameter is empty |
notname |
|
|
named parameter is not empty |
Example:
<wl:process name="lastBookRead" value="A Man in Full">
<!-- This section of code will be executed
if lastBookRead exists and the value of lastBookRead is
"A Man in Full" -->
</wl:process>
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|