BEA Logo BEA WLCS Release 3.1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLCS Doc Home   |   Personalization Server Developer's Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

JSP Tag Library Reference

 

The JSP tags included with WebLogic Personalization Server allow developers to create personalized applications without having to program using Java.

Note: The es: prefix stands for e-commerce services.
The esp: prefix stands for e-commerce services portal.
The pz: prefix stands for personalization.

This topic includes the following sections:

<pz:contentQuery>

<pz:contentSelector>

<pz:div>

<cm:printDoc>

<cm:printProperty>

<cm:select>

<cm:selectById>

<fm:getApplicationURI>

<fm:getCachedAttribute>

<fm:getSessionAttribute>

<fm:setCachedAttribute>

<fm:setSessionAttribute>

<fm:removeCachedAttribute>

<fm:removeSessionAttribute>

<i18n:localize>

<i18n:getMessage>

<esp:eval>

<esp:get>

<esp:getGroupsForPortal>

<esp:monitorSession>

<esp:portalManager>

<esp:portletManager>

<esp:props>

<ps:getPropertyNames>

<ps:getPropertySetNames>

Profile Management Tags

<um:getProfile>

<um:getProperty>

<um:getPropertyAsString>

<um:removeProperty>

<um:setProperty>

Group-User Management Tags

<um:addGroupToGroup>

<um:addUserToGroup>

<um:changeGroupName>

<um:createGroup>

<um:createUser>

<um:getChildGroupNames>

<um:getChildGroups>

<um:getGroupNamesForUser>

<um:getParentGroupName>

<um:getTopLevelGroups>

<um:getUsernames>

<um:getUsernamesForGroup>

<um:removeGroup>

<um:removeGroupFromGroup>

<um:removeUser>

<um:removeUserFromGroup>

Security Tags

<um:login>

<um:logout>

<um:setPassword>

<es:counter>

<es:date>

<es:forEachInArray>

<es:isNull>

<es:monitorSession>

<es:notNull>

<es:preparedStatement>

<es:simpleReport>

<es:transposeArray>

<es:uriContent>

<wl:process>

<wl:repeat>

 


The Advisor

By matching content to information contained in the user profile, the Advisor ties together all the other services and components in the system to deliver personalized content.

To import the Advisor JSP tags, use the following code:
<%@ taglib uri="pz.tld" prefix="pz" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<pz:contentQuery>

The <pz:contentQuery> tag (Table 9-1) performs a content attribute search for content in a content manager. If the useCache attribute is set to true, the results of a content management query will be cached. 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 Advisor.

Personalization content tags required for JSP developers to access the Content object returned might include:

Example:

<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentQuery id="docs" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>" query="author = 'Hemingway'" />

<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. These rules are created and defined using the WebLogic Personalization Server rules editor. A content selector rule first determines whether a user fits the specified classification (for example, high income), and then selects content based on another qualifier (such as productType = diamond jewelry.)

To cache the results of the content selector rule, set the useCache attribute to true. If the cache has not timed out, subsequent calls to the contentSelector tag will return the cached results without re-executing the rule.

The ruleSet URI protocol is as follows:

protocol://RuleSetDefinition-home-JNDI-name/RuleSet-name

Example:

jdbc://com.beasys.commerce.axiom.reasoning.rules.RuleSheetDefinitionHome/AcmeRules

The <pz:contentSelector> tag (Table 9-2) 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 Advisor.

Tags possibly required for JSP developers to access the Content objects returned might include:

Example:

<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentSelector id="docs" ruleSet="jdbc://com.beasys.
commerce.axiom.reasoning.rules.
RuleSheetDefinitionHome/AcmeRules"
rule="PremierCustomerSpotlight"
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
<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>

Note: The sortBy attribute, when used in conjunction with the max attribute, works differently for explicit (system-defined) and implicit (user-defined) attributes. If you sort on explicit attributes (identifier, mimeType, size, version, author, creationDate, modifiedBy, modifiedDate, lockedBy, description, or comments) the sort is done on the database; therefore if you combine max="10" and sortBy, the system will perform the sort and then get the first 10 items. If you sort on implicit attributes, the sort is done after the max have been selected.

<pz:div>

The <pz:div> tag (Table 9-3) 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 advislet. 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.

Table 9-3 <pz:div>

Tag Attribute

Req'd

Type

Description

R/C

ruleSet


Yes

String

The URI for the rule set that contains the Classifier rule.

R

rule


Yes

String

The rule is the name of the classifier rule in the ruleSet that the rules advislet uses to classify the user.

R

id

No

String

The variable name that will be placed in the classification object.

C

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>

 


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 content caching 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" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<cm:printDoc>

The <cm:printDoc> tag (Table 9-4) 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.

Table 9-4 <cm:printDoc>

Tag Attribute

Req'd

Type

Description

R/C

id



No

String

The JSP script variable name which contains the Content instance from which to get the properties.

R

blockSize


No

String, int


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.

R


start


No

String, int


Specifies the index in the bytes where to start reading. Defaults to 0.

R

end


No

String, int

Specifies the index in the bytes where to stop reading. The default is to read to the end of the bytes.

R


encode




No

String

Either html, url, or none:

R


document




No

Document

Specifies the com.beasys.commerce.axiom.document.Document to use. If this is specified and non-null, id will be ignored. Otherwise, id will be used.

R

failOnError





No

String, Boolean


This attribute 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.

R

Example:

To get a Document object from an id in the request attributes and inline the Document's text:

<cm:selectById contentHome="<%=contentHome%>" contentId="<%=contentId%>" id="doc"/>
<cm:printDoc id="doc" blockSize="1000" />

<cm:printProperty>

The <cm:printProperty> tag (Table 9-5) 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.

Table 9-5 <cm:printProperty>

Tag Attribute

Req'd

Type

Description

R/C

id


No

String

The JSP script variable name which contains the Content instance from which to get the properties.

R

name

Yes

String

The name of the property to print.

R

entity




No

ConfigurableEntity


Specifies the com.beasys.commerce.foundation. ConfigurableEntity object from which to get the property. If this is specified and non-null, id is ignored. Otherwise, id will be used.

R


scope


No

String

The scope name for the property to get. If not specified, null is passed in, which is what Document objects expect.

R

encode

No

String

Either html, url, or none:

R

default



No

String

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.

R

maxLength



No

String, int


The maximum length of the property's value to print. If specified, values longer than this will be truncated.

R

failOnError




No

String, Boolean


This attribute 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.

R

dateFormat



No

String

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.

R

numFormat





No

String

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.

R

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: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>), zero can be used to iterate over the array of Content objects. This tag (Table 9-6) supports generic Content via a ContentManager interface.

Table 9-6 <cm:select>

Tag Attribute

Req'd

Type

Description

R/C

contentHome




No

String

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.

R

max




No

String, long


Limits the maximum number of content items returned. If not present, or zero or less, it returns all of the content items found.


R

sortBy




No

String

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"

R

failOnError



No

String, Boolean


This attribute 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.

R

id


Yes

String

The JSP script variable name that will contain the array of Content objects after this tag finishes.

C

query



No

String

A content query string used to search for content.

Example: query="mimetype contains 'text' && author='Proulx'"

R

expr




No

Expression

The com.beasys.commerce.foundation.expression.Expression object to use to search for content. If this is null or not specified, then query must be specified. Otherwise, query is ignored.

R


useCache




No

String, Boolean


Determines whether Content is cached.

This attribute can have one of two values:

False (default value): ContentCache is not used. If false (not specified), the cacheId, cacheScope and cacheTimeout settings are ignored.

True: ContentCache is used.

R

cacheId




No

String

The identifier name used to cache the Content. Internally, the cache is implemented as a Map; this will become the key. If not specified, the id attribute of the tag is used.

R

cacheTimeout




No

String, long


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.

R

cacheScope






No

String

Specifies the lifecycle scope of the content cache. Similar to <jsp:useBean>.

Possible values:

R

readOnly




No

String, Boolean


This attribute can have one of two values:

If true, the ContentManager (specified via the ContentHome attribute) 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).

R

Example:

To find the first five text Content objects that are marked as news items for the evening using the ContentCache, and print out the titles in a list:

<cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>" 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 (Table 9-7) 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.

Table 9-7 <cm:selectById>

Tag Attribute

Req'd

Type

Description

R/C

contentHome






No

String

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.

R

contentId


Yes

String


The string identifier of the piece of content.

R

failOnError




No

String, Boolean


This attribute 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.

R

id



Yes

String

The JSP script variable name that contains the Content object after this tag finishes. If the Content object with the specified identifier does not exist, it contains null.

C

useCache




No

String, Boolean


Determines whether Content is cached.

This attribute can have one of two values:

False (default value): ContentCache is not used. If false (not specified), the cacheId, cacheScope and cacheTimeout settings are ignored.

True: ContentCache is used.

R

cacheId





No

String

The identifier name used to cache the Content. Internally, the cache is implemented as a Map; this will become the key.

If not specified, the id attribute of the tag is used.

R

cacheTimeout




No

String, long


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.

R

cacheScope





No

String

Specifies the lifecycle scope of the content cache. Similar to <jsp:useBean>.

Possible values:

R

readOnly

No

String, Boolean

This attribute can have one of two values:

If true, the ContentManager (specified via the ContentHome attribute) 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).

R

Example:

To fetch the Document (using ContentCaching) with an identifier of 1234 and inline its content:

<cm:selectById contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>" id="doc" useCache="true" cacheTimeout="300000" cacheId="1234" />
<cm:printDoc id="doc" />

 


Flow Manager

Thr Flow Manager tags are used for accessing the session, session cache, or the global cache. For scalability reasons, it is best to limit what gets placed into the session. For large sessions, session replication across servers is very costly. This tag library will give the user the ability to write to data that can be scoped to the application or across applications.

<fm:getApplicationURI>

The <fm:getApplicationURI> tag (Table 9-8) gets the application
from the url: http://localhost:7001/portals/application/exampleportal

When includeContext="true", the tag returns /context/path/pathinfo, for example: /portals/application/exampleportal. This is required when a client browser needs to address the webapp context, for example, when using a form.

When includeContext="false", the tag returns /path/pathinfo, for example /application/exampleportal. This is required when using webapps and server side processing.

Table 9-8 <fm:getApplicationURI>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

The application as referenced by the Flow Manager. It can either get the value with the context or without. When used within a WebApp, you must get the value without the context when using <jsp:forward>.

C

includeContext

No

boolean

Determines whether or not to include the servlet context with the application name.
Defaults to true.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>
<%@ taglib uri="weblogic.tld" prefix="wl" %>

<wl:process name="formSubmit">
<fm:getApplicationURI id="uri" includeContext="false"/>
<jsp:forward page="<%=uri%>"/>
</wl:process>

<fm:getCachedAttribute>

The <fm:getCachedAttribute> tag (Table 9-9) gets an attribute out of the session/global cache. This value can be scoped to the application or not.

Table 9-9 <fm:getCachedAttribute>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

Object

The variable to store the retrieved value.

C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

global

No

boolean

The value scoped to the session or the global scope.

Defaults to false.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

    <%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>

<fm:getSessionAttribute>

The <fm:getSessionAttribute> tag (Table 9-10) gets an attribute out of the HttpSession. The attribute may be scoped to the application (by default).

Table 9-10 <fm:getSessionAttribute>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

Object

The variable to store the retrieved value.

C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

<fm:getSessionAttribute id="username" name="portal.username"
scoped="true" />

The name is: <%=username%>

<fm:removeCachedAttribute>

The <fm:removeCachedAttribute> tag (Table 9-11) removes an attribute from the session/global cache. This value can be scoped to the application or not.

Table 9-11 <fm:removeCachedAttribute>

Tag Attribute

Req'd

Type

Description

R/C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

global

No

boolean

The value scoped to the session or the global scope.

Defaults to false.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

<fm:removeCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" global="true" />

<fm:removeSessionAttribute>

The <fm:removeSessionAttribute> tag (Table 9-12) removes an attribute from the HttpSession. The attribute may be scoped to the application (by default).

Table 9-12 <fm:removeSessionAttribute>

Tag Attribute

Req'd

Type

Description

R/C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

<fm:removeSessionAttribute name="portal.username" scoped="true" />

<fm:setCachedAttribute>

The <fm:setCachedAttribute> tag (Table 9-13) sets an attribute in the session/global cache. This value can be scoped to the application or not.

Table 9-13 <fm:setCachedAttribute>

Tag Attribute

Req'd

Type

Description

R/C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

global

No

boolean

The value scoped to the session or the global scope.

Defaults to false.

R

value

Yes

Object

The value to set.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

  <%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>"
value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>

<fm:setSessionAttribute>

The <fm:setSessionAttribute> tag (Table 9-14) sets an attribute in the HttpSession. The attribute may be scoped to the application (by default).

Table 9-14 <fm:setSessionAttribute>

Tag Attribute

Req'd

Type

Description

R/C

name

Yes

String

The name of the name/value pair.

R

scoped

No

boolean

The name/value pair scoped to the application.

Defaults to true.

R

value

Yes

Object

The value to set.

R

Example:

<%@ taglib uri="fm.tld" prefix="fm" %>

<fm:setSessionAttribute name="portal.username"
value="joe developer" scoped="true" />

 


Internationalization

These tags are used in the localization of JSP pages that have an internationalization requirement.

Use the following code to import the utility tag library:
<%@ taglib uri="i18n.tld" prefix="i18n" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<i18n:localize>

This tag allows you to define the language, country, variant, and base bundle name to be used throughout a page when accessing resource bundles via the <i18n:getmessage> tag.

This tag (Table 9-15) also specifies a character encoding and content type to be specified for a JSP page. Because of this, the tag should be used as early in the page as possible-before anything is written to the output stream-so that the bytes are properly encoded.

Note: When an HTML page is included in a larger page, only the larger page can use the <i18n:localize> tag. This is because the <i18n:localize> tag sets the encoding for the page, and the encoding must be set in the parent (including) page before any bytes are written to the response's output stream. The parent page must set an encoding that is sufficient for all the content on that page as well as any included pages.

Note: Do not use the <i18n:localize> tag in conjunction with the <%@ page contentType="<something>" > page directive defined in the JSP specification. The directive is unnecessary if you are using this tag, and can result in inconsistent or wrong contentType declarations.

Table 9-15 <i18n:localize>

Tag Attribute

Req'd

Type

Description

R/C

bundleName

No

String

The base name of the MessageBundle is to use to retrieve localized text for a JSP page.

R

language




No

String
or
String []


A String - two character ISO Language Code - denoting the user's preferred language, or a String[] containing a list of preferred language codes for a user, with stronger preferences indexed lower (earlier) in the array.

R

country




No


String

The two character ISO Country Code for a country. For example, this code would be used to look for a MessageBundle containing text localized to English speaking users in the U.S. as opposed to English speaking users in the U.K.

R

variant




No

String

A String representing a locale's variant. The variant is used when localization demands a more specific locale than can be denoted by having just language and a country.

R

locale




No

java.util.Locale


Instead of specifying language, country, and variant as Strings, a java.util.Locale object can be provided. If provided, the values in the Locale's language, country, and variant fields will negate any of the other language, country, and variant values passed to the tag as Strings.

R

charset




No

String

The name of the character encoding set to use for this page - defaults to "UTF-8" if no encoding can be determined for the chosen language, otherwise an encoding approprite for the chosen language is used.

R

contentType


No

String

The type of content contained in the page, defaults to "text/html".

R

Example:

<%@ taglib uri="i18n.tld" prefix="i18n" %>

<%
// Array that defines two languages preferences - English and
// Spanish in that order of preference.
String[] languages = new String[] { "en", "es" };

// Definition of a single language preference 
String language = "en";
%>

<i18n:localize language="<%=language%>" bundleName="i18nExampleResourceBundle"/> 
<html>
<body>
<i18n:getMessage messageName="greeting"/>
</body>
</html>

<i18n:getMessage>

This tag (Table 9-16) is used in conjunction with the <i18:localize> tag to retrieve localized static text or messages from a JspMessageBundle.

Table 9-16 <i18n:getMessage>

Tag Attribute

Req'd

Type

Description

R/C

id

No

String

Holds the value of the label (or message) in the JSP page.

C

messageName

Yes

String

The key for the message bundle.

R

messageArgs




No

Object []


The arguments to the message bundle. If no args are provided, it is assumed that static text (not a message) is to be returned.

For example, {"Wednesday", "78"}; might be used to construct the message "Today is Wednesday, and the temperature is 78 degrees Fahrenheit."

R

bundleName




No

String

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute unless it is desired to use a different bundle for a particular tag invocation

R

language



No

String

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different language for a particular tag invocation.

R

country




No

String

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different country for a particular tag invocation.

R

variant



No

String

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different variant for a particular tag invocation.

R

locale



No

java.util.Locale

If properly initialized in the <i18n:localize> tag, there is no need to pass this tag attribute, unless it is desired to use a different locale (language, country, and variant) for a particular tag invocation.

R

Example:

<%@ taglib uri="i18n.tld" prefix="i18n" %> 

<% 
// Definition of a single language preference
String language = "en";

// Creation of message arguments 
Object[] args = new Object[]
{
new Integer(14),
new Integer(100)
};
%>

<i18n:localize language="<%=language%>" bundleName="i18nExampleResourceBundle"/> 
<html>
<body>
<i18n:getMessage messageName="greeting"/>
<i18n:getMessage messageName="message" messageArgs="<%=args%>"/>
</body>
</html>

This code would produce this output:

Welcome To This Page! 14 out of 100 files have been saved.

 


Portal Management

The Portal Management component includes JSP tags for access to the fundamental data comprising a portal, such as portal and portlet properties.

To import the Portal Management JSP tags, use the following code:
<%@ taglib uri="esp.tld" prefix="esp" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<esp:eval>

The <esp:eval> tag (Table 9-17) 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 <esp:eval> tag is processed. Otherwise, it is not.

Table 9-17 <esp:eval>

Tag Attribute

Req'd

Type

Description

R/C

tag





Yes

String

The name of the portlet attribute to evaluate.

The following attributes can be retrieved:

R

target

No

Portlet

The com.beasys.portal.Portlet to be evaluated.

R

Example:

<esp:eval tag="isMinimizable">
<% titleBar.include(minimizeButton); %>
</esp:eval>

<esp:get>

The <esp:get> tag (Table 9-18) 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.

Table 9-18 <esp:get>

Tag Attribute

Req'd

Type

Description

R/C

tag

Yes

String

The name of the portlet attribute to retrieve.

The following attributes can be retrieved:

R

target

No

Portlet

The com.beasys.portal.Portlet to be evaluated.

R

Example:

<tr>
<td>
<esp:get tag="title"/>
</td>
</tr>

<esp:getGroupsForPortal>

The <esp:getGroupsForPortal> tag (Table 9-19) retrieves the names of the groups associated with a Portal. The results are put into the variable declared in the id attribute of the tag, which is a String array.

Table 9-19 <esp:getGroupsForPortal>

Tag Attribute

Req'd

Type

Description

R/C

id


Yes

String

A resulting string array containing the names of the groups associated with the given Portal.

R

portalName


Yes

String

The name of the Portal to be checked for associated groups.

R


Example:

<esp:getGroupsForPortal id ="groups" portalName="<%=portalName%>"> 
for (i=0;i<groups.length;i++)
{

String groupName = groups[i];
}
</esp:getGroupsForPortal>

<esp:monitorSession>

The <esp:monitorSession> tag (Table 9-20) 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.

Table 9-20 <esp:monitorSession>

Tag Attribute

Req'd

Type

Description

R/C

goToPage



No

String

The error page that you want displayed if the page is not accessible.

The default value is portalerror.jsp.

R

loginRequired



No

String

Indicates whether the user is required to be logged in to access the JSP page including the tag.

The default value is false.

R

Example:

<esp:monitorSession loginRequired="true" />

<esp:portalManager>

The <esp:portalManager> tag (Table 9-21) is used to perform create, get, getColumnInfo, update, and remove actions on com.beasys.portal.Portal objects. This tag is an empty tag.

Table 9-21 <esp:portalManager>

Tag Attribute

Req'd

Type

Description

R/C

id


When action
equals get or
getColumnInfo

String

The name to which resultant information is assigned for subsequent use in the JSP page.

R


action






No

String

The action to perform. Allowed values include:

create: Creates a new portal.

get: (default value) Retrieves an object of type com.beasys.portal.Portal.

getColumnInfo: Retrieves a com.beasys.portal.PortalColumnInformation[]

update: Updates the provided target com.beasys.portal.Portal.

remove: Removes the provided target com.beasys.portal.Portal.

R

portalName





No

String

The name of the portal to retrieve, or whose column information is to be retrieved. The default value is session.getValue(com.beasys.commerce.portal.admin.PortalAdminHelper.qualifiedName(PortalTagConstants.PORTAL_NAME, request))

R

target



When action
equals create, update, or
remove

Portal

The com.beasys.portal.Portal to be created, updated, or removed.


R

Example:

<esp:portalManager id="portal" action="get" portalName="BEAPortal"/>

<esp:portletManager>

The <esp:portletManager> tag (Table 9-22) is used to perform create, get, getArranged, update, and remove actions on com.beasys.portal.Portlet objects. This tag is an empty tag.

Table 9-22 <esp:portletManager>

Tag Attribute

Req'd

Type

Description

R/C

id


When action
equals get or
getArranged

String

The name to which resultant information is assigned for subsequent use in the JSP page.

R

action




No


String

The action to perform. Allowed values include:

create: Creates a new portlet.

get: Retrieves an object of type com.beasys.portal.Portlet.

getArranged: Retrieves a com.beasys.portal.Portlet[][] that prescribes the row-column layout of portlets for the provided portal-user-group combination.

update (default value): Updates the provided target com.beasys.portal.Portlet.

remove: Removes the provided target com.beasys.portal.Portlet.

R

portalName




No

String

The name of the portal corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is session.getValue(com.beasys.commerce.portal.admin.PortalAdminHelper.qualifiedName(PortalTagConstants.PORTAL_NAME, request)).

R


portletName



No

String

The name of the portlet corresponding to the target portlet or to the portlet(s) to be retrieved.

There is no default value.

R

groupId




No

Long

The name of the group corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is com.beasys.commerce.axiom.jsp.JspHelper.getSessionValue(com.beasys.commerce.user.tags.UserManagerTagConstants.PROFILE_SUCCESSOR_UID, request)

R


userId





No

Long

The name of the user corresponding to the target portlet or to the portlet(s) to be retrieved. The default value is com.beasys.commerce.axiom.jsp.JspHelper.getSessionValue(com.beasys.commerce.user.tags.UserManagerTagConstants.PROFILE_USER_UID, request)

R

target




When action
equals
create,
update, or
remove

Portlet

The com.beasys.portal.Portlet to be created, updated, or removed.


R

scope





No

String

The scope to be applied to the provided action. Allowed values include:

global (default value): Specifies that portlet creation, removal, retrieval, or update should apply across all portals, groups, and users.

portal: Specifies that portlet creation, removal, retrieval, or update applies to the provided portal.

group: Specifies that portlet creation, removal, retrieval, or update applies to the provided portal-group combination.

user: Specifies that portlet creation, removal, retrieval, or update applies to the provided portal-group-user combination.

R

Example:

<esp:portletManager id="arrangedPortlets" action="getArranged" userId="myUser" portalName="myPortal"/>

<esp:props>

The <esp:props> tag (Table 9-23) 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.

Table 9-23 <esp:props>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

A java.lang.String variable name for the property value.

R

propertyName

Yes

String

The name of the property to get in the Portal Property Bean.

R


Example:
<esp:props id="headerURL" propertyName="default.portal.headerURL" />

 


Property Sets

The Property Set tags allow access to the list of available properties and property sets. Manipulation of property sets can be done either programatically or through the administration tools.

Use the following code to import the utility tag library:
<%@ taglib uri="ps.tld" prefix="ps" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<ps:getPropertyNames>

The <ps:getPropertyNames> tag (Table 9-24) is used to get a list of property names given a property set.

Table 9-24 <ps:getPropertyNames>

Tag Attribute

Req'd

Type

Description

R/C

propertySet


Yes

String

The name of the property set to add the new search.

R


schemaGroupName


Yes

String

Type of property set to search (as defined in com.beasys.commerce.foundation.property.
SchemaManagerConstants).

R

id


Yes

String

The id of the variable to hold the list of property names, as a String array.

C

result



Yes

String

The identifier of an Integer variable that will be created and initialized with the result of the operation.

Possible values:

Query is successful:
PropertySetTagConstants.PROPERTY_SEARCH_OK

Problem getting the list of property names:
PropertySetTagConstants.PROPERTY_SEARCH_FAILED

Property set named by propertySetName and schemaGroupName could not be found:
PropertySetTagConstants.INVALID_PROPERTY_SET

C

Example:

<ps:getPropertyNames propertySet="<%myPropertySet%>"
schemaGroupName="<%SchemaManagerConstants.USER_TYPE%>"
id="propertyNames" result="myResult"/>

<ps:getPropertySetNames>

The <ps:getPropertySetNames> tag (Table 9-25) is used to get a list of property sets given a property set type.

Table 9-25 <ps:getPropertySetNames>

Tag Attribute

Req'd

Type

Description

R/C

schemaGroupName


Yes

String

The type of the property set to search (as defined in com.beasys.commerce.foundation.property.
SchemaManagerConstants).

R

id

Yes

String

The identifier of the variable to hold the list of property names, as a String array.

C

result



Yes

String

The identifier of an Integer variable that will be created and initialized with the result of the operation.

Possible values:

Query is successful:
PropertySetTagConstants.PROPERTY_SET_SEARCH_OK

Problem getting the list of property names:
PropertySetTagConstants.PROPERTY_SET_SEARCH_FAILED

Property set named by propertySetName and schemaGroupName could not be found:
PropertySetTagConstants.INVALID_PROPERTY_SET

C

 


User Management

User Management tags allow access to user and group profile information, as well as operations such as creating and deleting users and groups, and managing user-group relationships.

To import the User Management JSP tags, use the following code:
<%@ taglib uri="um.tld" prefix="um" %>

Profile Management Tags

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<um:getProfile>

The <um:getProfile> tag (Table 9-26) 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.

Table 9-26 <um:getProfile>

Tag Attribute

Req'd

Type

Description

R/C

profileKey


Yes

String

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

Example: "<%=username%>"

R

successorKey


No

String

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

Example: "<%=defaultGroup%>"

R

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"

C

scope


No

String

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

Defaults to session.

C

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.

C

profileId


No

String

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

C

profileType

No

String

Allows the jsp developer to specify what type of User profile object to return. If the given profileKey refers to a baseUser object, this attribute should be left blank. Otherwise, if it returns to an extended User object defined by a Unified Profile Type, the name of the Unified Profile Type should be supplied in this field.

C

successorId


No

String

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

C

result


No

String

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

Possible values:

Success: userManagerTagConstants.GET_PROFILE_OK

Error encountered: userManagerTagConstants.GET_PROFILE_FAILED

userManagerTagConstants.NO_SUCH_PROFILE

userManagerTagConstants.NO_SUCH_SUCCESSOR


C

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 (Table 9-27) 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 chapter Creating and Managing Users in the WebLogic Personalization Server User's Guide for more information.

Table 9-27 <um:getProperty>

Tag Attribute

Req'd

Type

Description

R/C

propertySet


No

String

The Property Set from which the property's value is to be retrieved.

Example: "Demo Portal"

Note: If no property set is provided, the property is retrieved from the profile's default (unscoped) properties.

R

propertyName


Yes

String

The name of the property to be retrieved.

Example: "background_color"

R

id


No

String

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.

C

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 (Table 9-28) works exactly like the <um:getProperty> tag above, but ensures that the retrieved property value is a String. The following example shows a multivalued property which returns a Collection, but presents a list of favorite colors.

Table 9-28 <um:getPropertyAsString>

Tag Attribute

Req'd

Type

Description

R/C

propertySet


No

String

The Property Set from which the property's value is to be retrieved.

Example: "Demo Portal"

Note: If no property set is provided, the property is retrieved from the profile's default (unscoped) properties.

R

propertyName


Yes

String

The name of the property to be retrieved.

Example: "background_color"

R

id


No

String

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.

C

Example:

<um:getPropertyAsString id="myFaveColors" propertySet="exampleportal" propertyName="fave_colors"/>
My favorite colors are <%=myFaveColors%>.

<um:removeProperty>

The <um:removeProperty> tag (Table 9-29) removes the specified property from the current session's 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 Profile's successor.

Table 9-29 <um:removeProperty>

Tag Attribute

Req'd

Type

Description

R/C

propertySet


No

String

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.

R

propertyName


Yes

String

The name of the property to be removed.

Example: "background_color"

R

Example:

<um:removeProperty propertySet="<%=thePropertySet%>" propertyName="<%=thePropertyName%>"/>

<um:setProperty>

The <um:setProperty> tag (Table 9-30) updates a property value for either the session's current profile, or for the Anonymous User Profile. This tag has no enclosed body.

Table 9-30 <um:setProperty>

Tag Attribute

Req'd

Type

Description

R/C

propertySet


No

String

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.

R

propertyName


Yes

String

The name of the property to be set.

Example: "background_color"

R

value

Yes

Object

The new property value.

C

Example:

<% String myName = request.getParameter("name"); %>
<um:setproperty propertySet="exampleportal" propertyName="name" value="<%=myName%>"/>

Group-User Management Tags

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<um:addGroupToGroup>

The <um:addGroupToGroup> tag (Table 9-31) adds the group corresponding to the provided childGroupName to the group corresponding to the provided groupName. 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.

Table 9-31 <um:addGroupToGroup>

Tag Attribute

Req'd

Type

Description

R/C

childGroupName

Yes

String

The name of the child group.

Example: "<%=childGroupName%>"

R

parentGroupName

Yes

String

The name of the parent group.

Example: "<%=parentGroupName%>"

R

result


Yes

String

The name of an Integer variable to which the result of the add group to group operation is assigned.

Possible values:

Success: UserManagerTagConstants.ADD_GROUP_OK

Error encountered: UserManagerTagConstants.ADD_GROUP_FAILED

C

Example:

<um:addGroupToGroup childGroupName="<%=childGroupName%>" parentGroupName="<%=parentGroupName%>" result="result"/>

<um:addUserToGroup>

The <um:addUserToGroup> tag (Table 9-32) adds the user corresponding to the provided username to the group corresponding to the provided groupName. 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.

Table 9-32 <um:addUserToGroup>

Tag Attribute

Req'd

Type

Description

R/C

username



Yes

String

The name of the user to be added to the group.

Example: "<%=username%>"


R

groupName


Yes

String

The name of the group to which the user is being added.

Example: "<%=groupName%>"


R

result



Yes

String

The name of an Integer variable to which the result of the add user to group operation is assigned.

Possible values:

Success:
UserManagerTagConstants.ADD_USER_OK

Error encountered:
UserManagerTagConstants.ADD_USER_FAILED

C

Example:

<um:addUserToGroup userName="<%=userName%>" groupName="<%=groupName%>" result="result"/>

<um:changeGroupName>

The <um:changeGroupName> tag (Table 9-33) changes the name of the group corresponding to the specified oldGroupName to the specified newGroupName. This 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.

Table 9-33 <um:changeGroupName>

Tag Attribute

Req'd

Type

Description

R/C

oldGroupName


Yes

String

The old group name.

Example: "<%=oldGroupName%>"

R

newGroupName


Yes

String

The new group name.

Example: "<%=newGroupName%>"

R

result


Yes

String

The name of an Integer variable to which the result of the change group name operation is assigned.

Possible values:

Success:
UserManagerTagConstants.GROUP_CHANGE_OK

Error encountered:
UserManagerTagConstants.GROUP_CHANGE_FAILED

C

Example:

<um:changeGroupname oldGroupName="<%=oldGroupName%>" newGroupName="<%=changeGroupName%>" result="result"/>

<um:createGroup>

The <um:createGroup> tag (Table 9-34)creates a new com.beasys.commerce.axiom.contact.Group object. This 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.

Table 9-34 <um:createGroup>

Tag Attribute

Req'd

Type

Description

R/C

groupName


Yes

String

The name of the new group.

Example: "<%=groupName%>"

R

id


No

String

A variable name to which the created Group object is available for the duration of the page's scope.

C

parentName


No

String

The name of the group to set as the parent of the new group.

R

result


Yes

String

The name of an Integer variable to which the result of the create group operation is assigned.

Possible Values:

Success:
UserManagerTagConstants.CREATE_GROUP_OK

Error encountered:
UserManagerTagConstants.CREATE_GROUP_FAILED

A group with the specified group name already exists:
UserManagerTagConstants.GROUP_EXISTS

C

Example:

<um:creategroup groupName="<%=groupName%>" result="result"/>

<um:createUser>

The <um:createUser> tag (Table 9-35) creates a new com.beasys.commerce.axiom.contact.User object. This 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.

Table 9-35 <um:createUser>

Tag Attribute

Req'd

Type

Description

R/C

username


Yes

String

The name of the new user.

Example: "<%=username%>"

R

password


No

String

The password for the new user.

Example: "<%=password%>"

R

profileType


No

String

Specifies the extended type of user (for example, WLCS_Customer) to create a user of that type.

R

saveAnonymous


No

String

Whether to persist current anonymous user profile attributes in the newly-created user's profile.

Defaults to false.

Example: "false"

R

id


No

String

A variable name to which the created User object is available for the duration of the page's scope.

C

result


Yes

String

The name of an Integer variable to which the result of the create user operation is assigned.

Possible values:

Success:
UserManagerTagConstants.CREATE_USER_OK

Error encountered:
UserManagerTagConstants.CREATE_USER_FAILED

A user with the specified username already exists:
UserManagerTagConstants.USER_EXISTS

C

Example:

<um:createUser userName="<%=username%>" password="<%=password"%> result="result"/>

<um:getChildGroupNames>

The <um:getChildGroupNames> tag (Table 9-36) returns the names of any groups that are children of the given group.

Table 9-36 <um:getChildGroupNames>

Tag Attribute

Req'd

Type

Description

R/C

groupName


Yes

String

The name of the group to search for child groups.

R

id


Yes

String

The name of the identfier which will be assigned the String array of child group names.

C

<um:getChildGroups>

The <um:getChildGroups> tag (Table 9-37) 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. This tag has no enclosed body.

Table 9-37 <um:getChildGroups>

Tag Attribute

Req'd

Type

Description

R/C

groupName


Yes

String

The name of the group whose children are sought.

Example: "<%=groupName%>"

R

id


Yes

String

A variable name to which the child Group objects are available for the duration of the page's scope.

Example: "childGroups"

C

Example:

<um:getchildgroups groupName="<%=groupName%>" id="childGroups"/>

<um:getGroupNamesForUser>

The <um:getGroupNamesForUser> tag (Table 9-38) retrieves a String array that contains the group names corresponding to groups to which the provided user immediately belongs. This tag has no enclosed body.

Table 9-38 <um:getGroupNamesForUser>

Tag Attribute

Req'd

Type

Description

R/C

username


Yes

String

The name of the user whose matching groups are sought.

Example: "<%=username%>"

R

id


Yes

String

A variable name to which the resultant group names are assigned.

Example: "myGroups"

C

Example:

<um:getGroupNamesForUser userName="<%=username%>" id="myGroups"/>

<um:getParentGroupName>

The <um:getParentGroupName> tag (Table 9-39) 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. This tag has no enclosed body.

Table 9-39 <um:getParentGroupName>

Tag Attribute

Req'd

Type

Description

R/C

groupName


Yes

String

The name of the group whose parent group name is sought.

Example: "<%=groupName%>"

R

id


Yes

String

A variable name to which the name of the parent is available for the duration of the page's scope.

Example: "parentGroupName"

C

Example:

<um:getParentGroupName groupName="<%=groupName%>" id="parentGroupName"/>

<um:getTopLevelGroups>

The <um:getTopLevelGroups> tag (Table 9-40) retrieves an 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. This tag has no enclosed body.

Table 9-40 <um:getTopLevelGroups>

Tag Attribute

Req'd

Type

Description

R/C

id


Yes

String

A variable name to which the top-level Group objects are available for the duration of the page's scope.

Example: "topLevelGroups"

C

Example:

<um:getTopLevelGroups id="topLevelGroups"/>

<um:getUsernames>

The <um:getUsernames> tag (Table 9-41) 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. This 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.

Table 9-41 <um:getUsernames>

Tag Attribute

Req'd

Type

Description

R/C

searchExp


No

String

The search expression to apply to the user name search. Defaults to `*'

Example: "t*"

R

userLimit


No

String (representing
an Integer)


String
The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf.) Defaults to 100.

If user count exceeds userLimit, the length of the array in id is truncated to the length of userLimit.

Example: "500"

R

id


Yes

String

A variable name to which the resultant user names are assigned.

Example: "myUsers"

C

result


No

String

The name of an Integer variable to which the result of the getUsernames operation is assigned.

Possible values:

Success:
UserManagerTagConstants.USER_SEARCH_OK

General error:
UserManagerTagConstants.USER_SEARCH_FAILED

C

Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

Example:

<um:getUsernames userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users.");%>

<um:getUsernamesForGroup>

The <um:getUsernamesForGroup> tag (Table 9-42) 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. This 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.

Table 9-42 <um:getUsernamesForGroup>

Tag Attribute

Req'd

Type

Description

R/C

searchExp


No

String

The search expression to apply to the user name search.

Defaults to" *".

Example: "t*"

R

groupName


Yes

String

The name of the group whose matching members are sought.

Example: "engineering"

R

userLimit


No

String
(representing
an Integer)


The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf.) Defaults to 100.

If user count exceeds userLimit, the length of the array in id is truncated to the length of userLimit.


Example: "500"

R

id


Yes

String

A variable name to which the resultant user names are assigned.

Example: "myUsers"

C

result


No

String

The name of an Integer variable to which the result of the get usernames for group operation is assigned.

Possible values:

Success:
UserManagerTagConstants.USER_SEARCH_OK

General error:
UserManagerTagConstants.USER_SEARCH_FAILED

C

Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

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 (Table 9-43) removes the com.beasys.commerce.axiom.contact.Group object corresponding to the provided groupName. This 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.

Table 9-43 <um:removeGroup>

Tag Attribute

Req'd

Type

Description

R/C

groupName


Yes

String

The name of the user to be removed.

Example: "<%=groupName%>"

R

result



Yes

String

The name of an Integer variable to which the result of the remove group operation is assigned.

Possible values:

Success:
UserManagerTagConstants.REMOVE_GROUP_OK

Error encountered:
UserManagerTagConstants.REMOVE_GROUP_FAILED

C

Example:

<um:removeGroup groupName="<%=groupName%>" result="result"/>

<um:removeGroupFromGroup>

The <um:removeGroupFromGroup> tag (Table 9-44) removes a child group from a parent group.

Table 9-44 <um:removeGroupFromGroup>

Tag Attribute

Req'd

Type

Description

R/C

childGroupName

Yes

String

The name of the child group to remove from its parent.

R

parentGroupName

Yes

String

The name of the parent group from which the child group will be removed.

R

result


Yes

String

The name of an Integer variable to which the result of the remove group from group operation is assigned.

Possible values:

Success:
UserManagerTagConstants.REMOVE_GROUP_OK

Failure:
UserManagerTagConstants.REMOVE_GROUP_FAILED

C

<um:removeUser>

The <um:removeUser> tag (Table 9-45) removes the com.beasys.commerce.axiom.contact.User object corresponding to the provided username. It can remove any type of extended user that has its profileType set in the database. This 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.

Table 9-45 <um:removeUser>

Tag Attribute

Req'd

Type

Description

R/C

username


Yes

String

The username of the user to be removed.

Example: "<%=username%>"


R

result


Yes

String

The name of an Integer variable to which the result of the remove user operation is assigned.

Possible values:

Success:
UserManagerTagConstants.REMOVE_USER_OK

Error encountered:
UserManagerTagConstants.REMOVE_USER_FAILED

C

Example:

<um:removeUser userName="<%=username%>" result="result"/>

<um:removeUserFromGroup>

The <um:removeUserFromGroup> tag (Table 9-46) removes a user from a group.

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.

Table 9-46 <um:removeUserFromGroup>

Tag Attribute

Req'd

Type

Description

R/C

username


Yes

String

The username of the user to remove from the given group.

R

groupName


Yes

String

The name of the group from which the given user will be removed.

R

result



Yes

String

The name of an Integer variable to which the result of the remove user from group operation is assigned.

Possible values:

Success:
UserManagerTagConstants.REMOVE_USER_OK

Failure:
UserManagerTagConstants.REMOVE_USER_FAILED

C

Security Tags

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<um:login>

The <um:login> tag (Table 9-47) provides weak authentication (username, password) against the current security realm, and sets the authenticated user as the current WebLogic user. This tag has no enclosed body.

Note: The login tag requires a username attribute and a password attribute to be present in the HTTP request.

Table 9-47 <um:login>

Tag Attribute

Req'd

Type

Description

R/C

result


Yes

String

The name of an Integer variable to which the result of the login operation is assigned.

Possible values:

Success:
UserManagerTagConstants.LOGIN_OK

General error when performing authentication:
UserManagerTagConstants.LOGIN_ERROR

Authentication failed because of invalid username/password combination:
UserManagerTagConstants.LOGIN_FAILED

C

<um:logout>

The <um:logout> tag (Table 9-48) ends the current user's WebLogic Server session. This is independent of the FlowManager's user session tracking, and should be used in combination with the <um:login> tag.

Table 9-48 <um:logout>

Tag Attribute

Req'd

Type

Description

R/C

No attributes





.

<um:setPassword>

The <um:setPassword> tag (Table 9-49) 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.

Table 9-49 <um:setPassword>

Tag Attribute

Req'd

Type

Description

R/C

username


Yes

String

The username of the user whose password is to be changed.

R

password

Yes

String

The new user password.

R

result


No

String

The name of an Integer variable to which the result of the set password operation is assigned.

Possible values:

Success:
UserManagerTagConstants.SET_PASSWORD_OK

Failure:
UserManagerTagConstants.SET_PASSWORD_FAILED

C

 


Personalization Utilities

The <es:jsptaglib> tag contains generic tags you can use to create JSP pages.

Use the following code to import the utility tag library:
<%@ taglib uri="es.tld" prefix="es" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

<es:counter>

The <es:counter> tag (Table 9-50) is used to create a for loop.

Table 9-50 <es:counter>

Tag Attribute

Req'd

Type

Description

R/C

type


No

String

The type of the counter. Possible values are int or long. Default is int.

R

id

Yes

String

A unique name for the variable.

R

minCount

Yes

Int

The start position for the loop.

R

maxCount

Yes

Int

The end position for the loop.

R

Example:

<es:counter id="iterator" minCount="0" maxCount="10">
<% System.out.println(iterator);%>
</es:counter>

<es:date>

The <es:date> tag (Table 9-51) is used to get a date- and time-formatted String based on the user's time zone preference.

Table 9-51 <es:date>

Tag Attribute

Req'd

Type

Description

R/C

timeZoneId

No

String

Defaults to the time zone on the server.

R

formatStr


No

String

A date and time format string that adheres to the java.text.SimpleDateFormat. The default value is MM/dd/yyyy HH:mmss:z.

R

Example:

<es:date formatStr="MMMM dd yyyy" timeZoneId="MST" />

<es:forEachInArray>

The <es:forEachInArray> tag (Table 9-52) is used to iterate over an array.

Table 9-52 <es:forEachInArray>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

The variable for each value in the array.

R

type

Yes

String

The type of each value in the array.

R

array

Yes

Object []

The array to iterate over.

R

counterId

No

String

The position in the array.

R

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 (Table 9-53) 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 has a value. An empty string will cause isNull to be false. (An empty string is not null.)

Table 9-53 <es:isNull>

Tag Attribute

Req'd

Type

Description

R/C

item

Yes

Object

The variable to evaluate.

R

Example:

<es:isNull item="<%=value%>">
Error: the value is null.
</es:isNull>

<es:monitorSession>

The <es:monitorSession> tag (Table 9-54) 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.

Table 9-54 <es:monitorSession>

Tag Attribute

Req'd

Type

Description

R/C

goToPage


No

String

The error page that you want displayed if the page is not accessible.

The default value is portalerror.jsp.

R

loginRequired


No

String

Indicates whether the user is required to be logged in to access the JSP page including the tag.

The default value is false.

R

Example:

<es:monitorSession loginRequired="true" />

<es:notNull>

The <es:notNull> tag (Table 9-55) 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 has a value. An empty string will cause notNull to be true. (An empty string is treated as a value.)

Table 9-55 <es:notNull>

Tag Attribute

Req'd

Type

Description

R/C

item

Yes

Object

The variable to evaluate.

R

Example:

<es:notNull item="<%=value%>">
The value is not null.
</es:notNull>

<es:preparedStatement>

The <es:preparedStatement> tag (Table 9-56) is used to create a JDBC prepared statement.

Table 9-56 <es:preparedStatement>

Tag Attribute

Req'd

Type

Description

R/C

id


Yes

String

The variable in which the PreparedStatement is returned.

R

sql

Yes

String

The SQL query statement.

R

Example:

<es:preparedStatement id="ps" sql="<%=bookmarkBean.QUERY%>">
<%@ include file="startPreparedStatement.inc" %>
<%
bookmarkBean.createQuery(ps, owner);
java.sql.ResultSet resultSet = ps.executeQuery();
bookmarkBean.load(resultSet);
%>
<%@ include file="endPreparedStatement.inc" %>
</es:preparedStatement>

<es:simpleReport>

The <es:simpleReport> tag (Table 9-57) is used to create two-dimensional array out of a simple query.

Table 9-57 <es:simpleReport>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

The variable that holds the resultant two-dimensional array converted from the java.sql.ResultSet specified by the resultSet tag attribute.

R

resultSet

Yes

java.sql.ResultSet

The result set that holds the java.sql.ResultSet.

R

Example:

<es:simpleReport id="report" resultSet="<%=resultSet%>">
<%
for (int i=0; i<report.length; i++ )
{
for (int j=0; j<report[i].length; j++ )
{
...
}
}
%>

<es:transposeArray>

The <es:transposeArray> tag (Table 9-58) is used to transpose a standard [row][column] array to a [column][row] array.

Table 9-58 <es:transposeArray>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

The variable that holds the [c][r] array.

R

type


Yes

String

The type of variable in the [r][c] array, such as String.

R

array

Yes

Object[][]

The variable that holds the [r][c] array.

R

Example:

<es:transposeArray id="byColumnRow" array="<%=byRowColumn%>" type="String">
...
</es:transposeArray>

<es:uriContent>

The <es:uriContent> tag (Table 9-59) is used to pull content from a URL. It is best used for grabbing text-heavy pages.

Table 9-59 <es:uriContent>

Tag Attribute

Req'd

Type

Description

R/C

id

Yes

String

The variable that holds the downloaded content of the URI.

R

uri


Yes

String

The fully qualified URI from which to get the content.

R

Example:

<es:uriContent id="uriContent" uri="http://www.beasys.com/index.html">
<%
out.print(uriContent);
%>
</es:uriContent>

Note: If you combine HTML pages with relative URL's, you must fully qualify them to the correct host in each URL, or else images (on other resources) may not be retrieved properly by the browser.

 


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="weblogic.tld" prefix="wl" %>

Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.

Note: Refer to the Javadoc for further descriptions of the wl tags.

<wl:process>

The <wl:process> tag (Table 9-60) is used for query attribute-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.

Table 9-60 <wl:process>

Tag Attribute

Req'd

Type

Description

R/C

name

No

String

The name of a query attribute.

R

notName

No

String

The name of a query attribute.

R

value

No

String

The value of a query attribute.

R

notValue

No

String

The value of a query attribute.

R

Statements between the <wl:process> tags will be executed according to the matrix:

Value

notValue

Neither "value" nor "notValue"

name

Named attribute is equal to the value.

Named attribute does not equal the value.


Name attribute's value is not null.


not Name


notName attribute's value is null.


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>

<wl:repeat>

The <wl:repeat> tag (Table 9-61) is used to iterate over a variety of Java objects, as specified in the set attribute.

Table 9-61 <wl:repeat>

Tag Attribute

Req'd

Type

Description

R/C

set


No

Object

The set of objects that includes:

R

counter

No

Int

Iterate over first "count" entries in the set.

R

id

No

String

Variable to contain current object being iterated over.

C

type

No

String

Type of object that results from iterating over the set you passed in. Defaults to Object. This type must be fully qualified.

C