|
|
Personalization Server JSP Tag Library Reference
The JSP tags included with WebLogic Personalization Server allow developers to create personalized applications without having to program using Java.
Note: The es: prefix stands for e-commerce services.
The esp: prefix stands for e-commerce services portal.
The pz: prefix stands for personalization.
This topic includes the following sections:
Ads
The Ad tag queries the content management system and displays ads.
Use the following code to import the utility tag library:
<%@ taglib uri="ad.tld" prefix="ad" %>
Note: 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>
The <ad:adTarget> (Table 4-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.
Content Management
The Content Management component includes four JSP tags. These tags allow a JSP developer to include non-personalized content in a HTML-based page. The cm:select and cm:selectbyid tags support content caching for content searches. Note that none of the tags support or use a body.
To import the Content Management JSP tags, use the following code:
<%@ taglib uri="cm.tld" prefix="cm" %>
Note: In the following tables, 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>
The <cm:get Property> tag (Table 4-2) retrives 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.
Example
Get the String value of the name property from the Content object stored at doc and place it in the contentName variable:
<%@ 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>
The <cm:printDoc> tag (Table 4-3) 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.
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, the <cm:printDoc> will use the FlowManagerHelper.getAppliactionFlowManager() method to determine if the tag is operating under a FlowManager instance (a personalized application, a WebFlowed application, a portal).
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
To get a Document object from an id in the request attributes and inline the Document's text (which might contain relative links):
<%@ 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>
The <cm:printProperty> tag (Table 4-4) 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.
Example
To have a text input field's default value be the first 75 characters of the subject of a Content object stored at doc:
<%@ 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>
This tag uses only the search expression query syntax to select content. It does not support or use a body. After this tag has returned the <es:forEachInArray> tag (see <es:forEachInArray>), zero can be used to iterate over the array of Content objects. This tag (Table 4-5) supports generic Content via a ContentManager interface.
Example
To find the first five text Content objects that are marked as news items for the evening using the ContentCache, and print out the titles in a list:
<%@ 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.beasys.commerce.axiom.content.Content">
<li><cm:printProperty id="newsItem" name="Title"
encode="html" />
</es:forEachInArray>
</ul>
<cm:selectById>
The <cm:selectById> tag (Table 4-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.
Example
To fetch the Document (using ContentCaching) with an identifier of 1234 and inline its content:
<%@ 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" />
Flow Manager
Thr Flow Manager tags are used for accessing the session, session cache, or the global cache. For scalability reasons, it is best to limit what gets placed into the session. For large sessions, session replication across servers is very costly. This tag library will give the user the ability to write to data that can be scoped to the application or across applications.
<fm:getApplicationURI>
The <fm:getApplicationURI> tag (Table 4-7) gets the application
from the URL: http://localhost:7001/portals/application/exampleportal.
When includeContext="true", the tag returns /context/path/pathinfo, for example: /portals/application/exampleportal. This is required when a client browser needs to address the Web application context, for example, when using a form.
When includeContext="false", the tag returns /path/pathinfo, for example /application/exampleportal. This is required when using Web applications and server side processing.
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
<%@ taglib uri="weblogic.tld" prefix="wl" %>
.
.
.
<wl:process name="formSubmit">
<fm:getApplicationURI id="uri" includeContext="false"/>
<jsp:forward page="<%=uri%>"/>
</wl:process>
<fm:getCachedAttribute>
The <fm:getCachedAttribute> tag (Table 4-8) gets an attribute out of the session/global cache. This value can be scoped to the application or not.
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
.
.
.
<%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>
<fm:getSessionAttribute>
The <fm:getSessionAttribute> tag (Table 4-9) gets an attribute out of the HttpSession. The attribute may be scoped to the application (by default).
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
.
.
.
<fm:getSessionAttribute id="username" name="portal.username"
scoped="true" />
The name is: <%=username%>
<fm:removeCachedAttribute>
The <fm:removeCachedAttribute> tag (Table 4-10) removes an attribute from the session/global cache. This value can be scoped to the application or not.
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
.
.
.
<fm:removeCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" global="true" />
<fm:removeSessionAttribute>
The <fm:removeSessionAttribute> tag (Table 4-11) removes an attribute from the HttpSession. The attribute may be scoped to the application (by default).
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
.
.
.
<fm:removeSessionAttribute name="portal.username" scoped="true" />
<fm:setCachedAttribute>
The <fm:setCachedAttribute> tag (Table 4-12) sets an attribute in the session/global cache. This value can be scoped to the application or not.
Example
<%@ taglib uri="fm.tld" prefix="fm" %
.
.
.
<%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>"
value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>
<fm:setSessionAttribute>
The <fm:setSessionAttribute> tag (Table 4-13) sets an attribute in the HttpSession. The attribute may be scoped to the application (by default).
Example
<%@ taglib uri="fm.tld" prefix="fm" %>
.
.
.
<% String val = "joe developer"; %>
<fm:setSessionAttribute name="portal.username"
value="<%= val %>" scoped="true" />
Internationalization
These tags are used in the localization of JSP pages that have an internationalization requirement.
Use the following code to import the utility tag library:
<%@ taglib uri="i18n.tld" prefix="i18n" %>
Note: In the following tables, 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.
<i18n:localize>
This tag allows you to define the language, country, variant, and base bundle name to be used throughout a page when accessing resource bundles via the <i18n:getmessage> tag.
This tag (Table 4-14) also specifies a character encoding and content type to be specified for a JSP page. Because of this, the tag should be used as early in the page as possible-before anything is written to the output stream-so that the bytes are properly encoded.
Note: When an HTML page is included in a larger page, only the larger page can use the <i18n:localize> tag. This is because the <i18n:localize> tag sets the encoding for the page, and the encoding must be set in the parent (including) page before any bytes are written to the response's output stream. The parent page must set an encoding that is sufficient for all the content on that page as well as any included pages.
Note: Do not use the <i18n:localize> tag in conjunction with the <%@ page contentType="<something>" > page directive defined in the JSP specification. The directive is unnecessary if you are using this tag, and can result in inconsistent or wrong contentType declarations.
Example
<%@ taglib uri="i18n.tld" prefix="i18n" %>
.
.
.
<%
// Array that defines two languages preferences - English and
// Spanish in that order of preference.
String[] languages = new String[] { "en", "es" };
// Definition of a single language preference
String language = "en";
%>
<i18n:localize language="<%=language%>" bundleName="i18nExampleResourceBundle"/>
<html>
<body>
<i18n:getMessage messageName="greeting"/>
</body>
</html>
<i18n:getMessage>
This tag (Table 4-15) is used in conjunction with the <i18:localize> tag to retrieve localized static text or messages from a JspMessageBundle.
Example
JSP File
This code produces this output:
Welcome To This Page! 14 out of 100 files have been saved.
<%@ 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>
Properies file
Here are the entries in the properties 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 retreive content, respectively.
To import the Personalization JSP tags, use the following code:
<%@ taglib uri="pz.tld" prefix="pz" %>
Note: 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.
<pz:contentQuery>
The <pz:contentQuery> tag (Table 4-16) performs a content attribute search for content in a content manager. If the useCache attribute is set to true, the results of a content management query will be cached. The tag only has a begin tag and does not have a body or end tag. It returns an array of Content objects as determined by the Advisor.
Personalization content tags required for JSP developers to access the Content object returned might include:
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.)
Example
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentQuery id="docs" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
query="author = 'Hemingway'" />
<ul>
<es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printProperty id="aDoc"
name="Title" encode="html" />
</es:forEachInArray>
</ul>
<pz:contentSelector>
The <pz:contentSelector> tag (Table 4-17) allows arbitrary personalized content to be recommended based on a content selector rule.
A content selector rule first determines whether a user fits the specified classification (for example, high income), and then selects content based on another qualifier (such as productType = sports cars.) It then evaluates a set of conditions that you define 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 segmentation. Because the Business Analysts are not exposed to the concept of rules, you will see content selector rules called simply "content selectors" and classifer 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 contentSelector tag will return the cached results without re-evaluating the rule and 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 as determined by the Advisor.
Tags possibly required for JSP developers to access the Content objects returned might include:
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.beasys.commerce.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
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentSelector rule="PremierCustomerSpotlight"
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME %>"
id="docs" />
<ul>
<es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printproperty id="aDoc"
name="Title" encode="html" />
</es:forEachInArray>
</ul>
Note: The sortBy attribute, when used in conjunction with the max attribute, works differently for explicit (system-defined) and implicit (user-defined) attributes. If you sort on explicit attributes (identifier, mimeType, size, version, author, creationDate, modifiedBy, modifiedDate, lockedBy, description, or comments) the sort is done on the database; therefore if you combine max="10" and sortBy, the system will perform the sort and then get the first 10 items. If you sort on implicit attributes, the sort is done after the max have been selected.
For more information about using this tag, see the section "Using Content-Selector Tags and Associated JSP Tags" in Working with Content Selectors, in this guide.
<pz:div>
The <pz:div> tag (Table 4-18) allows a piece of content to be conditionally included as a result of a classifier rule being executed by a rules advislet. 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.
Example
<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<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())
{
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.
Use the following code to import the utility tag library:
<%@ taglib uri="ph.tld" prefix="ph" %>
Note: 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>
The <ph:placeholder> tag (Table 4-19) 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. For more information, see "Displaying Ads" in Using the E-Business Control Center.
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 Personalization Server 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 more information, see the section "How Placeholders Select and Display Ads" in Working with Content Selectors, in this guide.
For information on a related tag, see <ad:adTarget>.
Property Sets
The Property Set tags allow access to the list of available properties and property sets. Manipulation of property sets can be done either programatically or through the administration tools.
Use the following code to import the utility tag library:
<%@ taglib uri="ps.tld" prefix="ps" %>
Note: In the following tables, 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>
The <ps:getPropertyNames> tag (Table 4-20) is used to get a list of property names given a property set.
Example
<%@ taglib uri="ps.tld" prefix="ps" %>
.
.
.
<ps:getPropertyNames propertySet="<%myPropertySet%>"
schemaGroupName="<%SchemaManagerConstants.USER_TYPE%>"
id="propertyNames" result="myResult"/>
<ps:getPropertySetNames>
The <ps:getPropertySetNames> tag (Table 4-21) is used to get a list of property sets given a property set type.
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.
To import the User Management JSP tags, use the following code:
<%@ 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 directive at the top of the page:
<%@ page import="com.beasys.commerce.user.jsp.tags.UserManagerTagConstants" %>
Note: 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>
The <um:getProfile> tag (Table 4-22) retrieves the profile corresponding to the provided profile key and profile type. The tag has no enclosed body. The retrieved profile can be treated simply as a com.beasys.commerce.foundation.ConfigurableEntity, or can be cast to the particular implementation of ConfigurableEntity that it is. Along with the profile key and profile, an explicit successor key and successor type can be specified, as specified by the profileType attribute. This successor will then be used, along with the retrieved profile, in subsequent invocations of the <um:getProperty> tag to ensure property inheritance from the successor. If no successor is retrieved, standard ConfigurableEntity successor search patterns will apply to retrieved properties.
Example 1
This example shows a profile of type AcmeUser being retrieved with no successor specified, and an explicitly-supplied session scope.
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob" profileType="AcmeUser"
profileId="myProfile" scope="session"/>
Example 2
This example shows a default profile type (com.beasys.commerce.axiom.contact.User) being retrieved with a default successor type (com.beasys.commerce.axiom.contact.Group), and an explicitly-supplied request scope.
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob" successorKey="engineering" scope="request"/>
Example 3
This example shows a profile type of AcmeUser being retrieved with a successor type of AcmeGroup, and an implicitly-supplied session scope.
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProfile profileKey="bob" profileType="AcmeUser"
successorKey="engineering" successorType="AcmeGroup"
profileId="myProfile"/>
<um:getProperty>
The <um:getProperty> tag (Table 4-23) 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. For more information, see Creating and Managing Users, in this guide.
Example 1
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getProperty id="myTitlebarBGColor" propertySet="exampleportal" propertyName="titlebar_bgcolor"/>
My titlebar bg color is <%=myTitlebarBGColor%>.
Example 2
My titlebar bg color is <um:getProperty propertySet="exampleportal" propertyName="titlebar_bgcolor"/>.
<um:getPropertyAsString>
The <um:getPropertyAsString> tag (Table 4-24) 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.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getPropertyAsString id="myFaveColors" propertySet="exampleportal" propertyName="fave_colors"/>
My favorite colors are <%=myFaveColors%>.
<um:removeProperty>
The <um:removeProperty> tag (Table 4-25) 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.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeProperty propertySet="<%=thePropertySet%>" propertyName="<%=thePropertyName%>"/>
<um:setProperty>
The <um:setProperty> tag (Table 4-26) updates a property value for either the session's current profile, or for the Anonymous User Profile. This tag has no enclosed body.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<% String myName = request.getParameter("name"); %>
<um:setProperty propertySet="exampleportal" propertyName="name" value="<%=myName%>"/>
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.
To import the User Management JSP tags, use the following code:
<%@ 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 directive at the top of the page:
<%@ page import="com.beasys.commerce.user.jsp.tags.UserManagerTagConstants" %>
Note: 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>
The <um:addGroupToGroup> tag (Table 4-27) 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 class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Server Administration Console.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:addGroupToGroup childGroupName="<%=childGroupName%>" parentGroupName="<%=parentGroupName%>" result="result"/>
<um:addUserToGroup>
The <um:addUserToGroup> tag (Table 4-28) 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 customRealm element in config.xml is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:addUserToGroup userName="<%=userName%>" groupName="<%=groupName%>" result="result"/>
<um:changeGroupName>
The <um:changeGroupName> tag (Table 4-29) changes the name of the group corresponding to the specified oldGroupName to the specified newGroupName. This tag has no enclosed body.
Note: This tag should only be invoked when the customRealm element in config.xml is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:changeGroupname oldGroupName="<%=oldGroupName%>" newGroupName="<%=changeGroupName%>" result="result"/>
<um:createGroup>
The <um:createGroup> tag (Table 4-30) creates a new com.beasys.commerce.axiom.contact.Group object. This tag has no enclosed body.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Administration Console.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:creategroup groupName="<%=groupName%>" result="result"/>
<um:createUser>
The <um:createUser> tag (Table 4-31) creates a new com.beasys.commerce.axiom.contact.User object. This tag has no enclosed body. Although classified as a Group-User management tag, this tag can be used in conjunction with run-time activities, in that it will persist any properties associated with a current Anonymous User Profile if specified.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Administration Console.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:createUser userName="<%=username%>" password="<%=password"%> result="result"/>
<um:getChildGroupNames>
The <um:getChildGroupNames> tag (Table 4-32) returns the names of any groups that are children of the given group.
<um:getChildGroups>
The <um:getChildGroups> tag (Table 4-33) retrieves an array of com.beasys.commerce.axiom.contact.Group objects that are children of the Group corresponding to the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group Administration and Realm Configuration Administration Tools. This tag has no enclosed body.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getchildgroups groupName="<%=groupName%>" id="childGroups"/>
<um:getGroupNamesForUser>
The <um:getGroupNamesForUser> tag (Table 4-34) 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.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getGroupNamesForUser userName="<%=username%>" id="myGroups"/>
<um:getParentGroupName>
The <um:getParentGroupName> tag (Table 4-35) retrieves the name of the parent of the com.beasys.commerce.axiom.contact.Group object associated with the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group Administration and Realm Configuration Administration Tools. This tag has no enclosed body.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getParentGroupName groupName="<%=groupName%>" id="parentGroupName"/>
<um:getTopLevelGroups>
The <um:getTopLevelGroups> tag (Table 4-36) retrieves an array of com.beasys.commerce.axiom.contact.Group objects, each of which has no parent group. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group Administration and Realm Configuration Administration Tools. This tag has no enclosed body.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getTopLevelGroups id="topLevelGroups"/>
<um:getUsernames>
The <um:getUsernames> tag (Table 4-38) retrieves a String array that contains the usernames matching the provided search expression. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Administration Console.
Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:getUsernames userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users.");%>
<um:getUsernamesForGroup>
The <um:getUsernamesForGroup> tag (Table 4-39) retrieves a String array that contains the usernames matching the provided search expression and correspond to members of the provided group. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WLS administration console.
Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.
Example
<%@ 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>
The <um:removeGroup> tag (Table 4-40) removes the com.beasys.commerce.axiom.contact.Group object corresponding to the provided groupName. This tag has no enclosed body.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Server Administration Console.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeGroup groupName="<%=groupName%>" result="result"/>
<um:removeGroupFromGroup>
The <um:removeGroupFromGroup> tag (Table 4-41) removes a child group from a parent group.
<um:removeUser>
The <um:removeUser> tag (Table 4-42) removes the com.beasys.commerce.axiom.contact.User object corresponding to the provided username. It can remove any type of extended user that has its profileType set in the database. This tag has no enclosed body.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Server Administration Console.
Example
<%@ taglib uri="um.tld" prefix="um" %>
.
.
.
<um:removeUser userName="<%=username%>" result="result"/>
<um:removeUserFromGroup>
The <um:removeUserFromGroup> tag (Table 4-43) removes a user from a group.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Server Administration Console.
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.
To import the User Management JSP tags, use the following code:
<%@ 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 directive at the top of the page:
<%@ page import="com.beasys.commerce.user.jsp.tags.UserManagerTagConstants" %>
Note: 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>
The <um:login> tag (Table 4-44) 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.
<um:logout>
The <um:logout> tag (Table 4-45) ends the current user's WebLogic Server session. This is independent of the FlowManager's user session tracking, and should be used in combination with the <um:login> tag.
Tag Attribute |
Required |
Type |
Description |
R/C |
---|---|---|---|---|
No attributes |
|
|
|
|
<um:setPassword>
The <um:setPassword> tag (Table 4-46) updates the password for the user corresponding to the provided username.
Note: This tag should only be invoked when the class com.beasys.commerce.axiom.contact.security.RDBMSRealm is defined as the active security realm. This can be verified through the WebLogic Server Administration Console.
Personalization Utilities
The <es:jsptaglib> tag contains generic tags you can use to create JSP pages.
Use the following code to import the utility tag library:
<%@ taglib uri="es.tld" prefix="es" %>
Note: In the following tables, 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:counter>
The <es:counter> tag (Table 4-47) is used to create a for loop.
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:counter id="iterator" minCount="0" maxCount="10">
<% System.out.println(iterator);%>
</es:counter>
<es:date>
The <es:date> tag (Table 4-48) is used to get a date- and time-formatted String based on the user's time zone preference.
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:date formatStr="MMMM dd yyyy" timeZoneId="MST" />
<es:forEachInArray>
The <es:forEachInArray> tag (Table 4-49) is used to iterate over an array.
Example
<es:forEachInArray id="item" array="<%=items%>" type="String" counterId="i">
<% System.out.println("items[" + i + "]: " + item);%>
</es:forEachInArray>
<es:isNull>
The <es:isNull> tag (Table 4-50) 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 Attribute |
Required |
Type |
Description |
R/C |
---|---|---|---|---|
item |
Yes |
Object |
The variable to evaluate. |
R |
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:isNull item="<%=value%>">
Error: the value is null.
</es:isNull>
<es:monitorSession>
The <es:monitorSession> tag (Table 4-51) can be added to the beginning of any JSP page to disallow access to the page if the session is not valid or if the user is not logged in.
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:monitorSession loginRequired="true" />
<es:notNull>
The <es:notNull> tag (Table 4-52) 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 Attribute |
Required |
Type |
Description |
R/C |
---|---|---|---|---|
item |
Yes |
Object |
The variable to evaluate. |
R |
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:notNull item="<%=value%>">
The value is not null.
</es:notNull>
<es:simpleReport>
The <es:simpleReport> tag (Table 4-53) is used to create two-dimensional array out of a simple query.
Example
<es:simpleReport id="report" resultSet="<%=resultSet%>">
<%
for (int i=0; i<report.length; i++ )
{
for (int j=0; j<report[i].length; j++ )
{
...
}
}
%>
<es:transposeArray>
The <es:transposeArray> tag (Table 4-54) is used to transpose a standard [row][column] array to a [column][row] array.
Example
<%@ taglib uri="es.tld" prefix="es" %>
.
.
.
<es:transposeArray id="byColumnRow" array="<%=byRowColumn%>" type="String">
...
</es:transposeArray>
<es:uriContent>
The <es:uriContent> tag (Table 4-55) is used to pull content from a URL. It is best used for grabbing text-heavy pages.
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
<%@ 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.
To import the WebLogic Utilities JSP tags, use the following code:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
Note: 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: See the Javadoc for further descriptions of the wl tags.
<wl:process>
The <wl:process> tag (Table 4-56) 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.
Statements between the <wl:process> tags will be executed according to the matrix below:
Example
<%@ 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>
The <wl:repeat> tag (Table 4-57) is used to iterate over a variety of Java objects, as specified in the set attribute.
<wl:cache>
The <wl:cache> tag specifies that its contents do not necessarily need to be updated every time it is displayed.
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|