bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

JavaServer Page Guide

 Previous Next Contents View as PDF  

Personalization JSP Tags

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

This section includes information on the following JSP tags:

 


Ads

The Ad tag queries the content management system and displays ads.

In the following tables, the Required column 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.

<ad:adTarget>

Tag Library

ad.tld

Import Statement

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

Classes Implemented

adTargetTag


 

The <ad:adTarget> (Table  3-1) uses the Ad Service to send an ad query to the content management system. Unlike the <ph:placeholder> tag, the query in the <ad:adTarget> tag does not compete with other queries in an ad placeholder.

Use this tag if you need to make sure that a given ad displays to customers in a specific location. Depending on how narrowly you construct the query, you might have to remove or modify this tag when you want to display a different ad.

If the ad query returns more than one ad, the Ad Service uses the adWeight attribute of each ad to determine which ad to display.


 

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

EJB/Data Object

SPI

1. AdService.getContent()

2. DocumentManager.getContent()

8. Document.getProperty() ... (other get* methods)

9. Document.getContent()

10. DocumentManager.getContentBlock()

3. DocumentProvider.findDocumentMetadata()

4. DocumentMetadataDef.getID()

5. DocumentMetadataDef.getName() ... (other get* methods)

6. DocumentMetadataDef.getAttributeNames()

7. DocumentMetadataDef.getAttribute()

11. DocumentProvider.getDocument()

12. DocumentDef.openStream()

Tag Attributes

Table  3-1 describes the <ad:adTarget> tag attributes.

Table 3-1 <ad:adTarget> Tag Attributes

Tag Attribute

Req'd

Type

Description

R/C

query

Yes

String

Contains a query that the Ad Service uses to find content. Use the query syntax described in the Javadoc for com.beasys.commerce.util.ExpressionHelper.

For details on constructing queries, see "Constructing Content Queries" in the Development Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/dev/conmgmt.htm.

R

height

No

int

Specifies the height (in pixels) that the placeholder uses when generating the HTML that the browser requires to display a document.

The placeholder uses this value only for content types to which display dimensions apply and only if other attributes have not already defined dimensions for a given document.

If you do not specify this value and other attributes have not already been defined, the browser behavior determines the height of the document.

R

width

No

int

Specifies the width (in pixels) that the placeholder uses when generating the HTML that the browser requires to display a document.

The placeholder uses this value only for content types to which display dimensions apply and only if other attributes have not already defined dimensions for a given document.

If you do not specify this value and other attributes have not already been defined, the browser behavior determines the width of the document.

R


 

Example

Listing  3-1 picks one of the ads in the ad group "Car" and renders it in a space measuring 200 x 400 pixels.

Listing 3-1 Using <ad:adTarget>

<%@ taglib uri="ad.tld" prefix="ad" %>
.
.
.
<ad:adTarget query="group == 'ads'" />

 


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.

In the following tables, the Required column 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:getProperty>

Tag Library

cm.tld

Import Statement

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

Classes Implemented

getPropertyTag

getPropertyExtraInfo


 

The <cm:getProperty> tag retrieves the value of the specified content metadata property into a variable specified by resultId. It does not have a body. If resultId is not specified, the value will be inlined into the page, similar to the <cm:printProperty> tag. This tag operates on any ConfigurableEntity, not just the Content object. However, it does not support ConfigurableEntity successors.

How the Tag Maps to the Content Management Service Provider Interface

Because this tag receives data that has already been retrieved from the content management system, it makes no calls to the content management service provider interface (SPI).

Tag Attributes

Table  3-2 describes the <cm:getProperty> tag attributes.

Table 3-2 <cm:getProperty>  

Tag Attribute

Required

Type

Description

R/C

id


No

String

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

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


name

Yes

String

The name of the property to print.

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

resultId

no

String

The name of the JSP script variable which will be populated with the value of the property. If this is not specified, then the value of the property will be inlined into the body of the JSP. If this is specified, then encode, default, maxLength, dateFormat, and numFormat are ignored.

C

resultType

no

String

The Java type of the property. If this is not specified, then java.lang.Object is used.

C

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

Listing  3-2 shows how to use <cm:getProperty> to get the String value of the name property from the Content object stored at doc and place it in the contentName variable.

Listing 3-2 Using <cm:getProperty>

<%@ taglib uri="cm.tld" prefix="cm" %>
.
.
.
<cm:getProperty resultId="contentName" resultType="String"
id="content" name="name" />
<es:notNull item="<%=contentName%>">
The name is not null.
</es:notNull>

<cm:printDoc>

Tag Library

cm.tld

Import Statement

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

Classes Implemented

printDocTag


 

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.


 

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

EJB/Data Object

SPI

1. Document.getIdentifier()

2. Document.getPropertyAsString()

3. Document.getContent()

4. DocumentManager.getContentBlock()

7. Document.getSize()

5. DocumentProvider.getDocument()

6. DocumentDef.openStream()

Tag Attributes

Table  3-3 describes the <cm:printDoc> tag attributes.

Table 3-3 <cm:printDoc> Tag Attributes  

Tag Attribute

Required

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.bea.p13n.content.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

baseHref

No

String

The URL of the document's BASE HREF. This can be either an absolute URL or a relative URL.

R


 

Note: If baseHref is provided, then the <cm:printDoc> tag will output a starting <BASE HREF> using the value of the baseHref parameter. If baseHref is not a fully complete URL, the missing parts will be filled in based upon the URL of the outermost page.

Additionally, if baseHref is provided, then, after printing the document, the <cm:printDoc> tag will output a <BASE HREF> based upon the URL of the outermost page.

Example

Listing  3-3 shows how to use <cm:printDoc> to get a Document object from an id in the request attributes and inline the Document's text (which might contain relative links).

Listing 3-3 Using <cm:printDoc>

<%@ taglib uri="cm.tld" prefix="cm" %>
.
.
.
.<% String contentId = request.getParameter("contentId"); %>
<cm:selectById contentId="<%=contentId%>" id="doc" />
<cm:printDoc id="doc" blockSize="1000" baseHref="/ShowDocServlet" />

<cm:printProperty>

Tag Library

cm.tld

Import Statement

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

Classes Implemented

printPropertyTag


 

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.


 

How the Tag Maps to the Content Management Service Provider Interface

Because this tag receives data that has already been retrieved from the content management system, it makes no calls to the content management service provider interface (SPI).

Tag Attributes

Table  3-4 describes the <cm:printProperty> tag attributes.

Table 3-4 <cm:printProperty>  

Tag Attribute

Required

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

Listing  3-4 shows how to use <cm:printProperty> to have a text input field's default value be the first 75 characters of the subject of a Content object stored at doc:

Listing 3-4 Using <cm:printProperty>

<%@ taglib uri="cm.tld" prefix="cm" %>
.
.
.
<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>

Tag Library

cm.tld

Import Statement

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

Classes Implemented

selectTag

selectExtraInfo


 

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 supports generic Content via a ContentManager interface.


 

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

Tag Attributes

Table  3-5 describes the <cm:select> tag attributes.

Table 3-5 <cm:select> Tag Attributes  

Tag Attribute

Required

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'".

For details on constructing queries, see "Constructing Content Queries" in the Development Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/dev/conmgmt.htm.

R

expression



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

contextParams



No

String or java.util.Map

Additional search parameters to pass to the ContentManager. Some ContentManager implementations may support this.

R

readOnly




Ignored


This attribute is deprecated and no longer used. When found, it is ignored.



 

Example

Listing  3-5 shows how to use <cm:select> 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:

Listing 3-5 Using <cm:select>

<%@ taglib uri="cm.tld" prefix="cm" %>
.
.
.
<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.bea.p13n.content.Content">
<li><cm:printProperty id="newsItem" name="Title"
encode="html" />
</es:forEachInArray>
</ul>

<cm:selectById>

Tag Library

cm.tld

Import Statement

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

Classes Implemented

selectByIDTag

selectByIDExtraInfo


 

The <cm:selectById> tag (Table  3-6) 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.


 

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

Tag Attributes

Table  3-6 describes the <cm:selectById> tag attributes.

Table 3-6 <cm:selectById>  

Tag Attribute

Required

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

onNotFound



No

String


If the content object specified by contentId cannot be found, this controls the behavior. If this is set, then an Exception will be thrown with the value as the message; if this is not set, the tag will return null.

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

contextParams



No

String or java.util.Map

Additional search parameters to pass to the ContentManager. Some ContentManager implementations may support this.

R

readOnly

Ignored


This attribute is deprecated and no longer used. When found, it is ignored.



 

Example

Listing  3-6 shows how to use <cm:selectById > to fetch the Document (using ContentCaching) with an identifier of 1234 and inline its content.

Listing 3-6 Using <cm:selectById >

<%@ taglib uri="cm.tld" prefix="cm" %>
.
.
.
<cm:selectById contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>"
contentId="contentportlet/sports1.htm"
id="doc" useCache="true" cacheTimeout="300000" cacheId="1234" />
<cm:printDoc id="doc" />

 


Internationalization

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

In the following tables, the Required column 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: With the <i18n> tags, you can point to resource bundle files that contain localized content for display in your JSPs. For information on setting the interval at which WebLogic Portal checks for updated resource bundle content, see "Internationalization Performance Tuning" in the Administration Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/admin/sysadmin.htm.

<i18n:localize>

Tag Library

i18n.tld

Import Statement

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

Classes Implemented

LocalizeTag

LocalizeExtraInfo


 

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


 

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.

The preferred approach is to retrieve all strings dynamically from the <i18n:getMessage> tag, and avoid embedding strings statically (that is, avoid hard-coding them) in your JSP page.

If your page contains only dynamic strings (strings retrieved using the <i18n:getMessage tag>), then 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 the <i18n:localize> tag, and can result in inconsistent or wrong contentType declarations.

If you must mix static strings and dynamic strings on the same page, then you will need to use the page directive. Ensure that the character set specified by the <i18n:localize> tag is compatible with the character set specified in the page directive.

Tag Attributes

Table  3-7 describes the <i18n:localize> tag attributes.

Table 3-7 <i18n:localize>  Tag Attributes

Tag Attribute

Required

Type

Description

R/C

bundleName

No

String

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

For information on setting the interval at which WebLogic Portal checks for updated resource bundle content, see "Internationalization Performance Tuning" in the Administration Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/admin/sysadmin.htm.

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 appropriate for the chosen language is used.

R

contentType

No

String

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

R


 

Example 1

Listing  3-7 shows how to use <i18n:localize> to define a single language preference.

Listing 3-7 Using <i18n:localize>; Example 1

<%@ taglib uri="i18n.tld" prefix="i18n" %>
.
.
.
<%
// Definition of a single language preference
String language = "en";
%>

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

Example 2

Listing  3-8 shows how to use <i18n:localize> to define two language preferences, English and Spanish.

Listing 3-8 Using <i18n:localize>; Example 2

<%@ 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" };

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

<i18n:getMessage>

Tag Library

i18n.tld

Import Statement

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

Classes Implemented

GetMessageTag

GetMessageExtraInfo


 

This tag is used in conjunction with the <i18n:localize> tag to retrieve localized static text or messages from a JspMessageBundle.


 

Tag Attributes

Table  3-8 describes the <i18n:getMessage> tag attributes.

Table 3-8 <i18n:getMessage> Tag Attributes  

Tag Attribute

Required

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.

For information on setting the interval at which WebLogic Portal checks for updated resource bundle content, see "Internationalization Performance Tuning" in the Administration Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/admin/sysadmin.htm.

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 1

Listing  3-9 produces this output:

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

when included in a JSP.

Listing 3-9

<%@ 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>

The following code shows the entries in the property file named i18nExampleResourceBundle. properties:

greeting=Welcome To This Page!
message={0} out of {1} files have been saved.

 


Personalization Tags

The <pz:div> tag, <pz:contentSelector> tag, and <pz:contentQuery> tag use the Advisor to classify the user, select content, and retrieve content, respectively.

In the following tables, the Required column 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.

This section contains information on the following subjects:

pz Tags and the Internal Cache

Content search contextParams support per-search configuration attributes and can be used to determine whether to use the internal cache. The <cm:select> and <cm:selectById> tags support setting the contextParams, but the pz tags do not. In order to control whether a <pz:contentSelector> uses the internal cache, use the following approach.

Add the following to a <pz:content*> tag:
contextParams="someName=someValue"

A runtime expression like the following should be used:
contextParams='<%="aName=aValue bName=bValue cName=cValue"%>'

<pz:contentQuery>

Tag Library

pz.tld

Import Statement

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

Classes Implemented

ContentQueryTag

ContentQueryExtraInfo


 

The <pz:contentQuery> tag 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 returned from the content manager as the result of executing the content query.

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

An object array iterator tag. This tag provides a way to iterate over the Content objects in the array. Use the <es:forEachInArray> tag to iterate over an array of Objects. (See <es:forEachInArray> for more information.)

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

Tag Attributes

Table  3-9 describes the <pz:contentQuery> tag attributes.


 

Table 3-9 <pz:contentQuery> Tag Attributes  

Tag Attribute

Required

Type

Description

R/C

max

No

String, long

Limits the maximum number of content items returned. If not present, 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

query

Yes

String

A content query string used to search for content.

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

For details on constructing queries, see "Constructing Content Queries" in the Development Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/dev/conmgmt.htm.

R

contentHome



Yes


String


The JNDI name of the ContentManager EJB Home. The object in the JNDI at this name must implement a create method which returns an object which implements the ContentManager interface.

For more information, see the section Specify a Value for contentHome.

R

id



Yes

String


The array variable name that contains the content objects found. If no content is found, the variable is assigned an empty array (not null) of Content objects.

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



 

Example

Listing  3-10 shows how to use <pz:contentQuery>.

Listing 3-10 Using <pz:contentQuery>

<%@ page import="bea.p13n.content.ContentHelper" %>
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<pz:contentQuery id="docs" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
query="author = 'Hemingway'" />
<ul>
 <es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.bea.p13n.content.Content">
<li>The document title is: <cm:printProperty id="aDoc"
name="Title" encode="html" />
</es:forEachInArray>
</ul>

<pz:contentSelector>

Tag Library

pz.tld

Import Statement

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

Classes Implemented

ContentSelectorTag

ContentSelectorExtraInfo


 

The <pz:contentSelector> tag allows arbitrary personalized content to be recommended based on a content selector rule.

A content selector rule first evaluates a set of conditions that you define in the E-Business Control Center (for example, whether or not a user fits a specified classification). If the conditions evaluate to true, content is retrieved from the Content Manager based on a content query defined in the E-Business Control Center.

Note: Rules are created in the E-Business Control Center. This GUI tool is designed to allow Business Analysts to develop their own customer segments. Because the Business Analysts are not exposed to the concept of rules, you will see content selector rules called simply "content selectors" and classifier rules referred to as "customer segmentation."

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 <pz:contentSelector> tag will return the cached results without re-evaluating the content query.

The <pz:contentSelector> tag only has a begin tag and does not have a body or end tag. It returns an array of Content objects returned from the Content Manager as a result of executing the content query.

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

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

Tag Attributes

Table  3-10 describes the <pz:contentSelector> tag attributes.

Table 3-10 <pz:contentSelector> Tag Attributes

Tag Attribute

Req'd

Type

Description

R/C

rule

Yes

String

The name of the content selector in the content selector definitions created in the E-Business Control Center.

R

contentHome

Yes

String

The JNDI name of the ContentManager EJB Home. The object in the JNDI at this name must implement a create method which returns an object which implements the ContentManager interface.

For more information, see the section Specify a Value for contentHome.

R

max

No

String, long

Limits the maximum number of content items returned. If not present, or if equal to -1L, 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

query

No

String

A content query string used to search for content. This query overrides any query that a Business Analyst creates in the E-Business Control Center.

Example: query="mimetype contains 'text' && author='Salinger'".

For details on constructing queries, see "Constructing Content Queries" in the Development Guide at http://download.oracle.com/docs/cd/E13218_01/wlp/docs70/dev/conmgmt.htm.

R

id

Yes

String

The array variable name that contains the content objects found. If no content is found, the variable is assigned an empty array (not null) of Content objects.

C

useCache

No

String, Boolean

Determines whether Content is cached.

This attribute can have one of two values:

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

True: Content cache 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



 

Specify a Value for contentHome

The content selector tag must use the contentHome attribute to specify the JNDI home of the content management system. If you use the reference content management system or a third-party integration, you can use a scriptlet to refer to the default content home. Because the scriptlet uses the ContentHelper class, you must first use the following tag to import the class into the JSP:

<%@ page import="com.bea.p13n.content.ContentHelper"%>

Then, when you use the content selector tag, specify the contentHome as follows:

<pz:contentSelector
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME %>"
... />

If you create your own content management system, you must specify the JNDI home for your system instead of using the ContentHelper scriptlet. In addition, if your content management system provides a JNDI home, you can specify that one instead of using the ContentHelper scriptlet.

Example

Listing  3-10 shows how to use <pz:contentSelector>.

Listing 3-11 Using <pz:contentSelector>

<%@ page import="com.bea.p13n.content.ContentHelper" %>
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob"
profileId="myProfile" scope="session"/>
<pz:contentSelector rule="PremierCustomerSpotlight"
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME %>"
id="docs" />
<ul>
<es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.bea.p13n.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>

Tag Library

pz.tld

Import Statement

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

Classes Implemented

DivTag

DivTagExtraInfo


 

The <pz:div> tag allows a piece of content to be conditionally included as a result of a classifier rule being executed by the rules engine. If the user's profile matches the classification specified in the E-Business Control Center, then the conditional content is included. This tag has a begin tag, a body, and an end tag. The tag returns a list of Classification objects that the user belongs to.

Tag Attributes

Table  3-11 describes the <pz:div> tag attributes.

Table 3-11 <pz:div> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

rule


Yes

String

The name of the classifier rule in the customer segment definitions created in the E-Business Control Center.

R

id

No

String

A collection that contains the Classification objects that apply to the user for the given classifier rule.

C


 

Example

<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ taglib uri="um.tld" prefix="um" %>

<um:getProfile profileKey="bob"
profileId="myProfile" scope="session"/>
<pz:div id="classifications" rule="PremierCustomer">
<% 
//if the user is classified as a Premier Customer, a list with one entry should be returned//
java.util.Iterator iterator=classifications.iterator();
while (iterator.hasNext())
{
com.bea.p13n.user. Classification classification=(Classification) iterator.next();
out.println (classification.getName());
}
%>
   <p>Please check out our new Premier Customer bonus program.<p>
</pz:div>

 


Placeholders

The placeholder tag is a named location on a JSP. You use the E-Business Control Center to define the behavior of a placeholder.

In the following tables, the Required column 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.

<ph:placeholder>

Tag Library

ph.tld

Import Statement

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

Classes Implemented

PlaceholderTag


 

The <ph:placeholder> tag implements a placeholder, which describes the behavior for a location on a JSP page. You use the E-Business Control Center to define a placeholder.

Multiple placeholder tags can refer to the same placeholder. Each instance of a placeholder tag invokes its placeholder definition separately. If the placeholder definition specifies multiple queries, each placeholder tag instance can display different ads, even though each instance shares the same definition.

When WebLogic Portal receives a request for a JSP that contains an ad placeholder, the placeholder tag contacts the Ad Service, a session EJB that invokes business logic to determine which ad to display.

For information on a related tag, see <ad:adTarget>.

How the Tag Maps to the Content Management Service Provider Interface

The following table shows how the tag accesses methods in the content management service provider interface (SPI). The table also shows the sequence of calls.

Tag Attributes

Table  3-12 describes the <ph:placeholder> tag attributes.

Table 3-12 <ph:placeholder> Tag Attributes

Tag Attribute

Req'd

Type

Description

R/C

name


Yes


String


A string that refers to a placeholder definition.

R

height

No

int

Specifies the height (in pixels) that the placeholder uses when generating the HTML that the browser requires to display a document.

The placeholder uses this value only for content types to which display dimensions apply and only if other attributes have not already defined dimensions for a given document.

If you do not specify this value and other attributes have not already been defined, the browser behavior determines the height of the document.

R

width

No

int

Specifies the width (in pixels) that the placeholder uses when generating the HTML that the browser requires to display a document.

The placeholder uses this value only for content types to which display dimensions apply and only if other attributes have not already defined dimensions for a given document.

If you do not specify this value and other attributes have not already been defined, the browser behavior determines the height of the document.

R


 

Example

Listing  3-12 displays the ad specified in the MainPageBanner placeholder.

Listing 3-12 Using <ph:placeholder>

<%@ taglib uri="ph.tld" prefix="ph" %>
.
.
.
<ph:placeholder name="/placeholders/MainPageBanner.pla"/>

 


Property Sets

The Property Set tags allow access to the list of available properties and property sets. Property sets are manipulated through the E-Business Control Center.

All Property Sets tags send results to the same file. If you are checking for results, include this import directive at the top of the page:

<%@ page import="com.bea.p13n.property.servlets.jsp.taglib.PropertySetTag-
Constants" %>

In the following tables, the Required column 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>

Tag Library

ps.tld

Import Statement

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

Classes Implemented

GetPropertyNamesTag

GetPropertyNamesExtraInfo


 

The <ps:getPropertyNames> tag is used to get a list of property names given a property set.


 

Tag Attributes

Table  3-13 describes the <ps:getPropertyNames> tag attributes.

Table 3-13 <ps:getPropertyNames>  

Tag Attribute

Required

Type

Description

R/C

propertySetName

Yes

String

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

R

propertySetType

Yes

String

Type of property set to search.

R

id

Yes

String

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

C

result

no

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 propertySetType could not be found:
PropertySetTagConstants.INVALID_PROPERTY_SET

C


 

Example

Listing  3-13 shows how to use <ps:getPropertyNames>.

Listing 3-13 Using <ps:getPropertyNames>

<%@ taglib uri="ps.tld" prefix="ps" %>
<%@ page import= 
"com.bea.p13n.property.servlets.jsp.taglib.PropertySetTagConstants"
%>
<% String myPropertySet="Demographics"; %>
<p> ------- <b>ps:getPropertyNames</b> ------------- 
<br>
<ps:getPropertyNames propertySetName="<%= myPropertySet %>"
propertySetType="USER" id="propertyNames" result="myResult"/>
<% for (int i=0; i<propertyNames.length; i++) 
out.println(propertyNames[i] + "<br>"); 
%>

<ps:getPropertySetNames>

Tag Library

ps.tld

Import Statement

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

Classes Implemented

GetPropertySetNamesTag

GetPropertySetNamesExtraInfo


 

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

Tag Attributes

Table  3-14 describes the <ps:getPropertySetNames> tag attributes.

Table 3-14 <ps:getPropertySetNames>  

Tag Attribute

Required

Type

Description

R/C

propertySetType

Yes

String

Type of property set to search.

R

id

Yes

String

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

C

result



No

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 propertySetType could not be found:
PropertySetTagConstants.INVALID_PROPERTY_SET

C


 

Example

Listing  3-14 shows how to use <ps:getPropertySetNames>.

Listing 3-14 Using <ps:getPropertySetNames>

<%@ taglib uri="ps.tld" prefix="ps" %>
.
.
.
<ps:getPropertySetNames propertySetType="USER"
id="userPropertySets" result="myResult" />

<ps:getRestrictedPropertyValues>

Tag Library

ps.tld

Import Statement

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

Classes Implemented

GetRestrictedPropertyValuesTag

GetRestrictedPropertyValuesExtraInfo


 

The <ps:getRestrictedPropertyValues> tag returns a list of restricted values for a specific property definition, converted into Strings. These values will be returned as an array of Strings.

Tag Attributes

Table  3-15 describes the <ps:getRestrictedPropertyValues> tag attributes.

Table 3-15 <ps:getRestrictedPropertyValues>  

Tag Attribute

Required

Type

Description

R/C

propertySetName

Yes

String

The name of the property set containing the property.

R

propertySetType

Yes

String

Type of property set containing the property.

R

propertyName

Yes

String

The name of the property to inspect.

R

id

Yes

String

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

C

result

No

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 accessing the property:
PropertySetTagConstants.
PROPERTY_SEARCH_FAILED

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

The requested property is not restricted:

PropertySetTagConstants.
PROPERTY_NOT_RESTRICTED

C


 

Example

Listing  3-15 shows how to use <ps:getRestrictedPropertyValues>.

Listing 3-15 Using <ps:getRestrictedPropertyValues>

<%@ taglib uri="ps.tld" prefix="ps" %>
<%@ page import= 
"com.bea.p13n.property.servlets.jsp.taglib.PropertySetTagConstants"
%>
<p> ---- <b>ps:getRestrictedPropertyValues</b> -----
<br>Possible values for PreferredLanguage:
<ps:getRestrictedPropertyValues propertySetName="Demographics"
propertySetType="USER" propertyName="PreferredLanguage"
id="values" result="myResult"/>
<ul>
<% if (myResult.intValue() == PropertySetTagConstants.PROPERTY_SEARCH_OK)
{
for ( int i=0; i<values.length; i++ ) {
%><li><%=values[i]%>
<% }
}
%>
</ul>

 


User Management:
Profile Management Tags

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.

In the following tables, the Required column 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>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagementTag-
Constants" %>

Classes Implemented

GetProfileTag

GetProfileExtraInfo


 

The <um:getProfile> tag (Table  3-16) retrieves the profile corresponding to the provided profile key and profile type. The tag has no enclosed body. The retrieved profile can be treated as a com.bea.p13n.usermgmt.profile.ProfileWrapper. 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 Attributes

Table  3-16 describes the <um:getProfile> tag attributes.

Table 3-16 <um:getProfile> Tag Attributes

Tag Attribute

Required

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

scope


No

String

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

Defaults to session.

C

groupOnly


No

String

Specifies to retrieve a group profile named by the profileKey, rather than a user profile. 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

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:
UserManagementTagConstants.GET_PROFILE_OK

Error encountered:
UserManagementTagConstants.GET_PROFILE_FAILED

UserManagementTagConstants.NO_SUCH_PROFILE

UserManagementTagConstants.NO_SUCH_SUCCESSOR

C


 

Example 1

Listing  3-16 shows a profile being retrieved with no successor specified and an explicitly-supplied session scope.

Listing 3-16 Using <um:getProfile>; Example 1

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob" profileType="AcmeUser"
profileId="myProfile" scope="session"/>

Example 2

Listing  3-17 shows a default user profile type being retrieved with a default successor type and an explicitly-supplied request scope.

Listing 3-17 Using <um:getProfile>; Example 2

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob" successorKey="engineering" scope="request"/>

<um:getProperty>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagementTag-
Constants" %>

Classes Implemented

GetPropertyTag

GetPropertyExtraInfo


 

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.

Tag Attributes

Table  3-17 describes the <um:getProperty> tag attributes.

Table 3-17 <um:getProperty> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

propertySet


No

String

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

Example: "Demographics"

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: "Date_of_Birth"

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

Listing  3-18 shows how to use <um:getProperty>.

Listing 3-18 Using <um:getProperty>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProperty id="myBirthDate" propertySet="Demographics" propertyName="Date_of_Birth"/>
My birthday is <%=myBirthDate%>.

<um:getPropertyAsString>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagementTag-
Constants" %>

Classes Implemented

GetPropertyAsStringTag

GetPropertyAsStringExtraInfo


 

The <um:getPropertyAsString> tag works exactly like the <um:getProperty> tag above, 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.

Tag Attributes

Table  3-18 describes the <um:getPropertyAsString> tag attributes.

Table 3-18 <um:getPropertyAsString> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

propertySet


No

String

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

Example: "Demographics"

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: "Date_of_Birth"

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

Listing  3-19 shows how to use <um:getPropertyAsString>.

Listing 3-19 Using <um:getPropertyAsString>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getPropertyAsString id="myBirthDate" propertySet="Demographics" propertyName="Date_of_Birth"/>
My birthday is <%=myBirthDate%>.

<um:removeProperty>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagementTag-
Constants" %>

Classes Implemented

RemovePropertyTag


 

The <um:removeProperty> tag (Table  3-19) 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.

Tag Attributes

Table  3-19 describes the <um:removeProperty> tag attributes.

Table 3-19 <um:removeProperty> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

propertySet


No

String

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

Example: "Demographics"

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: "Income_Range"

R


 

Example

Listing  3-20 shows how to use <um:removeProperty> to remove a property.

Listing 3-20 Using <um:removeProperty>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeProperty propertySet="<%=thePropertySet%>" propertyName="<%=thePropertyName%>"/>

<um:setProperty>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagementTag-
Constants" %>

Classes Implemented

SetPropertyTag

ResultTagExtraInfo


 

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

Tag Attributes

Table  3-20 describes the <um:setProperty> tag attributes.

Table 3-20 <um:setProperty> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

propertySet


No

String

The Property Set in which the property's value is to be set.

Example: "Demographics"

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: "Gender"

R

value

Yes

Object

The new property value.

R

result

No

String

The name of an Integer object to which the result of the set property operation is assigned.

Success: UserManagementTagConstants.SET_PROPERTY_OK

Error encountered: UserManagementTagConstants.SET_PROPERTY_FAILED

C


 

Example

Listing  3-21 shows how to use <um:setProperty>.

Listing 3-21 Using <um:setProperty>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<% String myGender = request.getParameter("gender"); %>
<um:setProperty propertySet="Demographics" propertyName="Gender" value="<%=myGender%>"/>

 


User Management:
Group-User Management Tags

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.

In the following tables, the Required column 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>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

AddGroupToGroupTag

ResultTagExtraInfo


 

The <um:addGroupToGroup> tag (Table  3-21) 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 current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-21 describes the <um:addGroupToGroup> tag attributes.

Table 3-21 <um:addGroupToGroup>

Tag Attribute

Required

Type

Description

R/C

childGroupName

Yes

String

The name of the child group.

Example: "<%=childGroupName%>"

R

parentGroupName

No

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: UserManagementTagConstants.ADD_GROUP_OK

Error encountered: UserManagementTagConstants.ADD_GROUP_FAILED

C


 

Example

Listing  3-22 shows how to use <um:addGroupToGroup> to add a new group of users to an existing group of users.

Listing 3-22 Using <um:addGroupToGroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:addGroupToGroup childGroupName="<%=childGroupName%>" parentGroupName="<%=parentGroupName%>" result="result"/>

<um:addUserToGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

AddUserToGroupTag

ResultTagExtraInfo


 

The <um:addUserToGroup> tag 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 current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-22 describes the <um:addUserToGroup> tag attributes.

Table 3-22 <um:addUserToGroup>  

Tag Attribute

Required

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:
UserManagementTagConstants.ADD_USER_OK

Error encountered:
UserManagementTagConstants.ADD_USER_FAILED

C


 

Example

Listing  3-23 shows how to use <um:addUserToGroup> to add a new user to an existing group.

Listing 3-23 Using <um:addUserToGroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:addUserToGroup username="<%=username%>" groupName="<%=groupName%>" result="result"/>

<um:createGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

CreateGroupTag

CreateGroupExtraInfo


 

The <um:createGroup> tag (Table  3-23) creates a new group in the realm, and a corresponding group profile in the personalization database. This tag has no enclosed body.

Note: This tag should only be invoked when the current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-23 describes the <um:createGroup> tag attributes.

Table 3-23 <um:createGroup> Tag Attributes

Tag Attribute

Required

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:
UserManagementTagConstants.CREATE_GROUP_OK

Error encountered:
UserManagementTagConstants.CREATE_GROUP_FAILED

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

C


 

Example

Listing  3-24 shows how to use <um:creategroup> to create a new group.

Listing 3-24 Using <um:creategroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:creategroup groupName="<%=groupName%>" result="result"/>

<um:createUser>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

CreateUserTag

CreateUserExtraInfo


 

The <um:createUser> tag creates a new user profile. 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 current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-24 describes the <um:createUser> tag attributes.

Table 3-24 <um:createUser> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

username


Yes

String

The name of the new user.

Example: "<%=username%>"

R

password


Yes

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.

You can set a default profile type for each Web application by setting a context parameter in web.xml for DEFAULT_USER_PROFILE_TYPE. For example:

<context-param>
<param-name>DEFAULT_USER_PROFILE_TYPE</param-name>
<param-value>WLCS_Customer</param-value>
</context-param>

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:
UserManagementTagConstants.CREATE_USER_OK

Error encountered:
UserManagementTagConstants.CREATE_USER_FAILED

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

C


 

Example

Listing  3-25 shows how to use <um:createUser> to create a new user.

Listing 3-25 Using <um:createUser>

<%@ taglib uri="um.tld" prefix="um" %>
.
<um:createUser username="<%=username%>" password="<%=password"%> result="result"/>

<um:getChildGroupNames>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetChildGroupNamesTag

GetChildGroupNamesExtraInfo


 

The <um:getChildGroupNames> tag returns the names of any groups that are children of the given group.

Tag Attributes

Table  3-25 describes the <um:getChildGroupNames> tag attributes.

Table 3-25 <um:getChildGroupNames>

Tag Attribute

Required

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 identifier which will be assigned the String array of child group names.

C


 

Example

Listing  3-26 shows how to use <um:getChildGroupNames> to retrieve the names of a child group for the group SomeGroup.

Listing 3-26 Using <um:getChildGroupNames>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getChildGroupNames groupName="SomeGroup"
id="childrenOfSomeGroup" />

<um:getGroupNamesForUser>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetGroupNamesForUserTag

GetGroupNamesForUserExtraInfo


 

The <um:getGroupNamesForUser> tag 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.

Tag Attributes

Table  3-26 describes the <um:getGroupNamesForUser> tag attributes.

Table 3-26 <um:getGroupNamesForUser> Tag Attributes

Tag Attribute

Required

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

Listing  3-27 shows how to use <um:getGroupNamesForUser> to retrieve a group name to apply to a user.

Listing 3-27 Using <um:getGroupNamesForUser>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getGroupNamesForUser username="<%=username%>" id="myGroups"/>

<um:getParentGroupName>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetParentGroupNameTag

GetParentGroupNameExtraInfo


 

The <um:getParentGroupName> tag retrieves the name of the parent of the group associated with the provided groupName. The information is taken from the realm. This tag has no enclosed body.

Tag Attributes

Table  3-27 describes the <um:getParentGroupName> tag attributes.

Table 3-27 <um:getParentGroupName>

Tag Attribute

Required

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

Listing  3-28 shows how to use <um:getParentGroupName> to retrieve a parent group name.

Listing 3-28 Using <um:getParentGroupName>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getParentGroupName groupName="<%=groupName%>" id="parentGroupName"/>

<um:getTopLevelGroups>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetTopLevelGroupsTag

GetTopLevelGroupsExtraInfo


 

The <um:getTopLevelGroups> tag retrieves an array of group names, each of which has no parent group. The information is taken from the realm. This tag has no enclosed body.

Tag Attributes

Table  3-28 describes the <um:getTopLevelGroups> tag attributes.

Table 3-28 <um:getTopLevelGroups>

Tag Attribute

Required

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

Listing  3-29 shows how to use <um:getTopLevelGroups>.

Listing 3-29 Using <um:getTopLevelGroups>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getTopLevelGroups id="topLevelGroups"/>

<um:getUsernames>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetUsernamesTag

GetUsernamesExtraInfo


 

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. This tag has no enclosed body.

Tag Attributes

Table  3-29 describes the <um:getUsernames> tag attributes.

Table 3-29 <um:getUsernames> Tag Attributes

Tag Attribute

Required

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)


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 (such as a database connection failure that occurred during the search):

UserManagerTagConstants.
USER_SEARCH_FAILED

Note: If no users match the search criteria, then the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length of the array returned in "id" will be zero.

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 UserManagementTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

Example

Listing  3-30 shows how to use <um:getUsernames> to retrieve a username.

Listing 3-30 Using <um:getUsernames>

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

<um:getUsernamesForGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

GetUsernamesForGroupTag

GetUsernamesForGroupExtraInfo


 

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. This tag has no enclosed body.

Tag Attributes

Table  3-30 describes the <um:getUsernamesForGroup> tag attributes.

Table 3-30 <um:getUsernamesForGroup> Tag Attributes

Tag Attribute

Required

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:
UserManagementTagConstants.USER_SEARCH_OK

General error:
UserManagementTagConstants.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 UserManagementTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

Example

Listing  3-31 shows how to use <um:getUsernamesForGroup> to retrieve usernames that match the provided search expression and correspond to members of the provided group.

Listing 3-31 Using <um:getUsernamesForGroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getUsernamesForGroup groupName="engineering" userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users in my group.");%>

<um:removeGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

RemoveGroupTag

ResultTagExtraInfo


 

The <um:removeGroup> tag removes the group corresponding to the provided groupName. This tag has no enclosed body.

Note: This tag should only be invoked when the current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-31 describes the <um:removeGroup> tag attributes.

Table 3-31 <um:removeGroup>  

Tag Attribute

Required

Type

Description

R/C

groupName


Yes

String

The name of the group 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:
UserManagementTagConstants.REMOVE_GROUP_OK

Error encountered:
UserManagementTagConstants.REMOVE_GROUP_FAILED

C


 

Example

Listing  3-32 shows how to use <um:removeGroup> to remove a group that corresponds to the provided groupName.

Listing 3-32 Using <um:removeGroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeGroup groupName="<%=groupName%>" result="result"/>

<um:removeGroupFromGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

RemoveGroupFromGroupTag

ResultTagExtraInfo


 

The <um:removeGroupFromGroup> tag removes a child group from a parent group.

Tag Attributes

Table  3-32 describes the <um:removeGroupFromGroup> tag attributes.

Table 3-32 <um:removeGroupFromGroup>  

Tag Attribute

Required

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:
UserManagementTagConstants.REMOVE_GROUP_OK

Failure:
UserManagementTagConstants.REMOVE_GROUP_FAILED

C


 

Example

Listing  3-33 shows how to use <um:removeGroupFromGroup> to remove a child group from a parent group.

Listing 3-33 Using <um:removeGroupFromGroup>

<um:removeUser>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

RemoveUserTag

ResultTagExtraInfo


 

The <um:removeUser> tag removes the user 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 current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-33 describes the <um:removeUser> tag attributes.

Table 3-33 <um:removeUser>  

Tag Attribute

Required

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:
UserManagementTagConstants.REMOVE_USER_OK

Error encountered:
UserManagementTagConstants.REMOVE_USER_FAILED

C


 

Example

Listing  3-34 shows how to use <um:removeUser> to remove a user.

Listing 3-34 Using <um:removeUser>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeUser username="<%=username%>" result="result"/>

<um:removeUserFromGroup>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.tags.UserManagementTag-
Constants" %>

Classes Implemented

RemoveUserFromGroupTag

ResultTagExtraInfo


 

The <um:removeUserFromGroup> tag removes a user from a group.

Note: This tag should only be invoked when the current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm).

Tag Attributes

Table  3-34 describes the <um:removeUserFromGroup> tag attributes.

Table 3-34 <um:removeUserFromGroup>  

Tag Attribute

Required

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:
UserManagementTagConstants.REMOVE_USER_OK

Failure:
UserManagementTagConstants.REMOVE_USER_FAILED

C


 

Example

Listing  3-35 shows how to use <um:removeUserFromGroup> to remove a specified user from a specified group.

Listing 3-35 Using <um:removeUserFromGroup>

<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeUserFromGroup username="UserToRemove"
groupName="SomeGroup" result="myResult" />

 


User Management: Security Tags

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.

In the following tables, the Required column 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>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagement-
TagConstants" %>

Classes Implemented

LoginTag

ResultTagExtraInfo


 

The <um:login> tag 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 parameter and a password parameter to be present in the HTTP request.

Tag Attributes

Table  3-35 describes the <um:login> tag attributes.

Table 3-35 <um:login> Tag Attributes

Tag Attribute

Required

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:
UserManagementTagConstants.LOGIN_OK

General error when performing authentication:
UserManagementTagConstants.LOGIN_ERROR

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

C


 

<um:logout>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagement-
TagConstants" %>

Classes Implemented

LogoutTag

ResultTagExtraInfo


 

The <um:logout> tag ends the current user's WebLogic Server session. This tag should be used in combination with the <um:login> tag.

Tag Attributes

Table  3-36 describes the <um:logout> tag attributes.

Table 3-36 <um:logout>

Tag Attribute

Required

Type

Description

R/C

No attributes





.
 

<um:setPassword>

Tag Library

um.tld

Import Statement

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

All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page:

<%@ page import="com.bea.p13n.usermgmt.
servlets.jsp.taglib.UserManagement-
TagConstants" %>

Classes Implemented

SetPasswordTag

ResultTagExtraInfo


 

The <um:setPassword> tag updates the password for the user corresponding to the provided username.

Note: This tag should only be invoked when the current realm is an implementation of weblogic.security.acl.ManageableRealm. This interface is implemented by the default WebLogic Portal realm (com.bea.p13n.security.realm.RDBMSRealm). In addition, the user object used by the current realm must implement weblogic.security.acl.CredentialChanger.

Tag Attributes

Table  3-37 describes the <um:setPassword> tag attributes.

Table 3-37 <um:setPassword> Tag Attributes

Tag Attribute

Required

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


Yes

String

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

Possible values:

Success:
UserManagementTagConstants.SET_PASSWORD_OK

Failure:
UserManagementTagConstants.SET_PASSWORD_FAILED

C


 

 


Personalization Utilities

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

In the following tables, the Required column 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:convertSpecialChars>

Tag Library

es.tld

Import Statement

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

Classes Implemented

ConvertSpecialCharsTag


 

The <es:convertSpecialChars> tag converts characters which would normally signify special meaning to an HTML browser into characters which can be displayed as intended.

For example, the following sentence must be converted because it uses the "<" and ">"characters, which signify tag opening and closing to the browser:

Enter <filename> here:

Tag Attributes

Table  3-38 describes the <es:convertSpecialChars> tag attributes.

Table 3-38 <es:convertSpecialChars>  

Tag Attribute

Required

Type

Description

R/C

string

Yes

String

The string to be converted.

R


 

Example

Listing  3-36 allows a string containing a less-than sign to be rendered in HTML.

Listing 3-36 Using <es:convertSpecialChars>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:convertSpecialChars string="<thisString>"/>

<es:counter>

Tag Library

es.tld

Import Statement

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

Classes Implemented

CounterTag

CounterTagExtraInfo


 

The <es:counter> tag is used to create a for loop.

Tag Attributes

Table  3-39 describes the <es:counter> tag attributes.

Table 3-39 <es:counter>  

Tag Attribute

Required

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

Listing  3-37 shows how to use <es:counter>.

Listing 3-37 Using <es:counter>

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

<es:date>

Tag Library

es.tld

Import Statement

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

Classes Implemented

DateTag


 

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

Tag Attributes

Table  3-40 describes the <es:date> tag attributes.

Table 3-40 <es:date>

Tag Attribute

Required

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

Listing  3-38 shows how <es:date> is used to retrieve a time and date.

Listing 3-38 Using <es:date>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:date formatStr="MMMM dd yyyy" timeZoneId="MST" />

<es:forEachInArray>

Tag Library

es.tld

Import Statement

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

Classes Implemented

ForEachInArrayTag

ForEachInArrayTagExtraInfor


 

The <es:forEachInArray> tag is used to iterate over an array.

Tag Attributes

Table  3-41 describes the <es:forEachInArray> tag attributes.

Table 3-41 <es:forEachInArray>

Tag Attribute

Required

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

Listing  3-39 shows how to use <es:forEachInArray> to iterate over an array.

Listing 3-39 Using <es:forEachInArray>

<es:forEachInArray id="item" array="<%=items%>" type="String" counterId="i">
<% System.out.println("items[" + i + "]: " + item);%>
</es:forEachInArray>

<es:isNull>

Tag Library

es.tld

Import Statement

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

Classes Implemented

IsNullTag


 

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

Tag Attributes

Table  3-42 describes the <es:isNull> tag attributes.

Table 3-42 <es:isNull> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

item

Yes

Object

The variable to evaluate.

R


 

Example

Listing  3-40 shows how to use <es:isNull> to check if a value is null.

Listing 3-40 Using <es:isNull>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:isNull item="<%=value%>">
Error: the value is null.
</es:isNull>

<es:notNull>

Tag Library

es.tld

Import Statement

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

Classes Implemented

NotNullTag


 

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 has a value. An empty string will cause notNull to be true. (An empty string is treated as a value.)

Tag Attributes

Table  3-43 describes the <es:notNull> tag attributes.

Table 3-43 <es:notNull>

Tag Attribute

Required

Type

Description

R/C

item

Yes

Object

The variable to evaluate.

R


 

Example

Listing  3-41 shows how to use <es:notNull> to check if a value is not null.

Listing 3-41 Using <es:notNull>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:notNull item="<%=value%>">
The value is not null.
</es:notNull>

<es:transposeArray>

Tag Library

es.tld

Import Statement

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

Classes Implemented

TransposeArrayTag

TransposeArrayTagExtraInfo


 

The <es:transposeArray> tag is used to transpose a standard [row][column] array to a [column][row] array.

Tag Attributes

Table  3-44 describes the <es:transposeArray> tag attributes.

Table 3-44 <es:transposeArray>

Tag Attribute

Required

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

Listing  3-42 shows how to use <es:transposeArray>.

Listing 3-42 Using <es:transposeArray>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:transposeArray id="byColumnRow" array="<%=byRowColumn%>" type="String">
...
</es:transposeArray>

<es:uriContent>

Tag Library

es.tld

Import Statement

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

Classes Implemented

UriContentTag

UriContentTagExtraInfo


 

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

Tag Attributes

Table  3-45 describes the <es:uriContent> tag attributes.

Table 3-45 <es:uriContent>

Tag Attribute

Required

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

Listing  3-43 shows how to use <es:uriContent> to pull content from a URL.

Listing 3-43 Using <es:uriContent>

<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<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.

In the following tables, the Required column 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.

<wl:cache>

Tag Library

wl.tld

Import Statement

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

Classes Implemented

CacheTag

CacheTagInfo


 

The <wl:cache> tag specifies that its contents do not necessarily need to be updated every time it is displayed.

Tag Attributes

Table  3-46 describes the <wl:cache> tag attributes.

Table 3-46 <wl:cache>

Tag Attribute

Required

Type

Description

R/C

timeout

No

Integer

Controls the time-to-live of the data, or how often the data must be updated independent of all other controls. This value is in seconds.

R

scope

No

String

Controls the time-to-live of the data, or how often the data must be updated independent of all other controls. This value is in seconds

C

name

No

String

Uniquely identifies this cache. If you do not specify a name a random name will be generated.

C

size

No

Integer

The maximum number of entries that can be in the cache. It defaults to an unlimited cache. It is only relevant for when there is an associated key.

R

vars

No

String

In addition to caching the transformed output of the cache, you can also cache calculated values within the block. These variables are specified exactly the same way as the cache keys. This type of caching is called Input caching.

C

key

No

String

Specifies a comma separated list of values accessible from the current page that the data depends on. These values act as additional keys into the cache.

C

async

No

String

If the async parameter is set to true, the cache will be updated asynchronously, if possible. The user that initiates the cache hit sees the old data.

C


 

<wl:process>

Tag Library

wl.tld

Import Statement

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

Classes Implemented

ProcessTag


 

The <wl:process> tag 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, as shown in Listing  3-44.

Tag Attributes

Table  3-47 describes the <wl:process> tag attributes.

Table 3-47 <wl:process>

Tag Attribute

Required

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 below:

Attribute

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

Listing  3-44 shows how to use <wl:process>. It will execute if lastBookRead exists and the value of lastBookRead is A Man in Full.

Listing 3-44 Using <wl:process>

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

Tag Library

wl.tld

Import Statement

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

Classes Implemented

RepeatTag

RepeatTagInfo


 

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

Tag Attributes

Table  3-48 describes the <wl:repeat> tag attributes.

Table 3-48 <wl:repeat> Tag Attributes

Tag Attribute

Required

Type

Description

R/C

set


No

Object

The set of objects that includes:

R

count

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


 

 

Back to Top Previous Next