|
|
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:
The Advisor
By matching content to information contained in the user profile, the Advisor ties together all the other services and components in the system to deliver personalized content.
To import the Advisor JSP tags, use the following code:
<%@ taglib uri="pz.tld" prefix="pz" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<pz:contentQuery>
The <pz:contentQuery> tag (Table 9-1) performs a content attribute search for content in a content manager. If the useCache attribute is set to true, the results of a content management query will be cached. The tag only has a begin tag and does not have a body or end tag. It returns an array of Content objects as determined by the Advisor.
Personalization content tags required for JSP developers to access the Content object returned might include:
Example:
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentQuery id="docs" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>" query="author = 'Hemingway'" />
<ul>
<es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printProperty id="aDoc"
name="Title" encode="html" />
</es:forEachInArray>
</ul>
<pz:contentSelector>
The <pz:contentSelector> tag allows arbitrary personalized content to be recommended based on a content selector rule. These rules are created and defined using the WebLogic Personalization Server rules editor. A content selector rule first determines whether a user fits the specified classification (for example, high income), and then selects content based on another qualifier (such as productType = diamond jewelry.)
To cache the results of the content selector rule, set the useCache attribute to true. If the cache has not timed out, subsequent calls to the contentSelector tag will return the cached results without re-executing the rule.
The ruleSet URI protocol is as follows:
protocol://RuleSetDefinition-home-JNDI-name/RuleSet-name
Example:
jdbc://com.beasys.commerce.axiom.reasoning.rules.RuleSheetDefinitionHome/AcmeRules
The <pz:contentSelector> tag (Table 9-2) only has a begin tag and does not have a body or end tag. It returns an array of Content objects as determined by the Advisor.
Tags possibly required for JSP developers to access the Content objects returned might include:
Example:
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="cm.tld" prefix="cm" %>
<%@ taglib uri="pz.tld" prefix="pz" %>
<%@ page input="com.beasys.commerce.content.ContentHelper" %>
.
.
.
<pz:contentSelector id="docs" ruleSet="jdbc://com.beasys.
commerce.axiom.reasoning.rules.
RuleSheetDefinitionHome/AcmeRules"
rule="PremierCustomerSpotlight"
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
<ul>
<es:forEachInArray array="<%=docs%>" id="aDoc"
type="com.beasys.commerce.axiom.content.Content">
<li>The document title is: <cm:printproperty id="aDoc"
name="Title" encode="html" />
</es:forEachInArray>
</ul>
Note: The sortBy attribute, when used in conjunction with the max attribute, works differently for explicit (system-defined) and implicit (user-defined) attributes. If you sort on explicit attributes (identifier, mimeType, size, version, author, creationDate, modifiedBy, modifiedDate, lockedBy, description, or comments) the sort is done on the database; therefore if you combine max="10" and sortBy, the system will perform the sort and then get the first 10 items. If you sort on implicit attributes, the sort is done after the max have been selected.
<pz:div>
The <pz:div> tag (Table 9-3) allows a user-provided piece of content to be turned on or off as a result of a classifier rule being executed by a rules advislet. If the result is true, the content is turned on; if false it is turned off. This tag has a begin tag, a body, and an end tag. If it evaluates true, the tag returns the Classification object determined by the rules engine.
Example:<%@ taglib uri="pz.tld" prefix="pz" %>
.
.
.
<pz:div ruleSet="jdbc://com.beasys.commerce.axiom.reasoning.rules.
RuleSheetDefinitionHome/AcmeRules" rule="PremierCustomer">
<p>Please check out our new Premier Customer bonus program.<p>
</pz:div>
Content Management
The Content Management component includes four JSP tags. These tags allow a JSP developer to include non-personalized content in a HTML-based page. The cm:select and cm:selectbyid tags support content caching for content searches. Note that none of the tags support or use a body.
To import the Content Management JSP tags, use the following code:
<%@ taglib uri="cm.tld" prefix="cm" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<cm:printDoc>
The <cm:printDoc> tag (Table 9-4) inlines the raw bytes of a Document object into the JSP output stream. This tag does not support a body and only supports Document objects. It does not differentiate between text and binary data.
Example: To get a Document object from an id in the request attributes and inline the Document's text:<cm:selectById contentHome="<%=contentHome%>" contentId="<%=contentId%>" id="doc"/>
<cm:printDoc id="doc" blockSize="1000" />
<cm:printProperty>
The <cm:printProperty> tag (Table 9-5) inlines the value of the specified content metadata property as a string. It does not have a body. This tag operates on any ConfigurableEntity, not just the Content object. However, it does not support ConfigurableEntity successors.
Example: To have a text input field's default value be the first 75 characters of the subject of a Content object stored at doc:<form action="javascript:void(0)">
Subject: <input type="text" size="75" name="subject"
value="<cm:printProperty id="doc" name="Subject" maxLength="75"
encode="html"/>" >
</form>
<cm:select>
This tag uses only the search expression query syntax to select content. It does not support or use a body. After this tag has returned the <es:forEachInArray> tag (see <es:forEachInArray>), zero can be used to iterate over the array of Content objects. This tag (Table 9-6) supports generic Content via a ContentManager interface.
Example: To find the first five text Content objects that are marked as news items for the evening using the ContentCache, and print out the titles in a list:<cm:select contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>" max="5" useCache="true" cacheTimeout="300000" cacheId="Evening News" sortBy="creationDate ASC, title ASC" query="
type = `News' && timeOfDay = `Evening' && mimetype like
`text/*' " id="newsList"/>
<ul>
<es:forEachInArray array="<%=newsList%>" id="newsItem"
type="com.beasys.commerce.axiom.content.Content">
<li><cm:printProperty id="newsItem" name="Title"
encode="html" />
</es:forEachInArray>
</ul>
<cm:selectById>
The <cm:selectById> tag (Table 9-7) retrieves content using the Content's unique identifier. This tag does not have a body. This tag is basically a wrapper around the select tag. It works against any Content object which has a string-capable primary key.
Example: To fetch the Document (using ContentCaching) with an identifier of 1234 and inline its content:<cm:selectById contentHome="<%=ContentHelper.DEF_CONTENT_MANAGER_HOME%>" id="doc" useCache="true" cacheTimeout="300000" cacheId="1234" />
<cm:printDoc id="doc" />
Flow Manager
Thr Flow Manager tags are used for accessing the session, session cache, or the global cache. For scalability reasons, it is best to limit what gets placed into the session. For large sessions, session replication across servers is very costly. This tag library will give the user the ability to write to data that can be scoped to the application or across applications.
<fm:getApplicationURI>
The <fm:getApplicationURI> tag (Table 9-8) gets the application
from the url: http://localhost:7001/portals/application/exampleportal
When includeContext="true", the tag returns /context/path/pathinfo, for example: /portals/application/exampleportal. This is required when a client browser needs to address the webapp context, for example, when using a form.
When includeContext="false", the tag returns /path/pathinfo, for example /application/exampleportal. This is required when using webapps and server side processing.
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<wl:process name="formSubmit">
<fm:getApplicationURI id="uri" includeContext="false"/>
<jsp:forward page="<%=uri%>"/>
</wl:process>
<fm:getCachedAttribute>
The <fm:getCachedAttribute> tag (Table 9-9) gets an attribute out of the session/global cache. This value can be scoped to the application or not.
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>
<fm:getSessionAttribute>
The <fm:getSessionAttribute> tag (Table 9-10) gets an attribute out of the HttpSession. The attribute may be scoped to the application (by default).
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<fm:getSessionAttribute id="username" name="portal.username"
scoped="true" />
The name is: <%=username%>
<fm:removeCachedAttribute>
The <fm:removeCachedAttribute> tag (Table 9-11) removes an attribute from the session/global cache. This value can be scoped to the application or not.
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<fm:removeCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>" global="true" />
<fm:removeSessionAttribute>
The <fm:removeSessionAttribute> tag (Table 9-12) removes an attribute from the HttpSession. The attribute may be scoped to the application (by default).
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<fm:removeSessionAttribute name="portal.username" scoped="true" />
<fm:setCachedAttribute>
The <fm:setCachedAttribute> tag (Table 9-13) sets an attribute in the session/global cache. This value can be scoped to the application or not.
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<%Portal portal = null;%>
<fm:getCachedAttribute id="tportal"
name="<%=PortalTagConstants.CACHED_PORTAL%>"
global="true" />
<es:isNull item="<%=tportal%>" >
<esp:portalManager action="get" id="myPortal"
portalName="<%=portalName%>"/>
<%tportal=myPortal;%>
<fm:setCachedAttribute
name="<%=PortalTagConstants.CACHED_PORTAL%>"
value="<%=myPortal%>" global="true" />
</es:isNull>
<%portal=(Portal)tportal;%>
<fm:setSessionAttribute>
The <fm:setSessionAttribute> tag (Table 9-14) sets an attribute in the HttpSession. The attribute may be scoped to the application (by default).
Example:<%@ taglib uri="fm.tld" prefix="fm" %>
<fm:setSessionAttribute name="portal.username"
value="joe developer" scoped="true" />
Internationalization
These tags are used in the localization of JSP pages that have an internationalization requirement.
Use the following code to import the utility tag library:
<%@ taglib uri="i18n.tld" prefix="i18n" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<i18n:localize>
This tag allows you to define the language, country, variant, and base bundle name to be used throughout a page when accessing resource bundles via the <i18n:getmessage> tag.
This tag (Table 9-15) also specifies a character encoding and content type to be specified for a JSP page. Because of this, the tag should be used as early in the page as possible-before anything is written to the output stream-so that the bytes are properly encoded.
Note: When an HTML page is included in a larger page, only the larger page can use the <i18n:localize> tag. This is because the <i18n:localize> tag sets the encoding for the page, and the encoding must be set in the parent (including) page before any bytes are written to the response's output stream. The parent page must set an encoding that is sufficient for all the content on that page as well as any included pages.
Note: Do not use the <i18n:localize> tag in conjunction with the <%@ page contentType="<something>" > page directive defined in the JSP specification. The directive is unnecessary if you are using this tag, and can result in inconsistent or wrong contentType declarations.
Example: <%@ taglib uri="i18n.tld" prefix="i18n" %> <%
// Array that defines two languages preferences - English and
// Spanish in that order of preference.
String[] languages = new String[] { "en", "es" }; // Definition of a single language preference
String language = "en";
%>
<i18n:localize language="<%=language%>" bundleName="i18nExampleResourceBundle"/>
<html>
<body>
<i18n:getMessage messageName="greeting"/>
</body>
</html>
<i18n:getMessage>
This tag (Table 9-16) is used in conjunction with the <i18:localize> tag to retrieve localized static text or messages from a JspMessageBundle.
Example: <%@ taglib uri="i18n.tld" prefix="i18n" %>
<%
// Definition of a single language preference
String language = "en";
// Creation of message arguments
Object[] args = new Object[]
{
new Integer(14),
new Integer(100)
};
%>
<i18n:localize language="<%=language%>" bundleName="i18nExampleResourceBundle"/>
<html>
<body>
<i18n:getMessage messageName="greeting"/>
<i18n:getMessage messageName="message" messageArgs="<%=args%>"/>
</body>
</html>
This code would produce this output:
Welcome To This Page! 14 out of 100 files have been saved.
Portal Management
The Portal Management component includes JSP tags for access to the fundamental data comprising a portal, such as portal and portlet properties.
To import the Portal Management JSP tags, use the following code:
<%@ taglib uri="esp.tld" prefix="esp" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<esp:eval>
The <esp:eval> tag (Table 9-17) is used to evaluate a conditional attribute of a portlet, for example, isMinimizeable. The tag expects a com.beasys.portal.Portlet to be accessible in the session with the key PortalTagConstants.PORTLET. If the conditional attribute evaluates to true, the body of the <esp:eval> tag is processed. Otherwise, it is not.
Example:
<esp:eval tag="isMinimizable">
<% titleBar.include(minimizeButton); %>
</esp:eval>
<esp:get>
The <esp:get> tag (Table 9-18) retrieves a String attribute of a portlet. This tag expects a com.beasys.portal.Portlet to be accessible in the session with the key PortalTagConstants.PORTLET.
Example:<tr>
<td>
<esp:get tag="title"/>
</td>
</tr>
<esp:getGroupsForPortal>
The <esp:getGroupsForPortal> tag (Table 9-19) retrieves the names of the groups associated with a Portal. The results are put into the variable declared in the id attribute of the tag, which is a String array.
Example:<esp:getGroupsForPortal id ="groups" portalName="<%=portalName%>">
for (i=0;i<groups.length;i++)
{
String groupName = groups[i];
}
</esp:getGroupsForPortal>
<esp:monitorSession>
The <esp:monitorSession> tag (Table 9-20) can be added to the beginning of any JSP page to disallow access to the page if the session is not valid or if the user is not logged in.
Example:<esp:monitorSession loginRequired="true" />
<esp:portalManager>
The <esp:portalManager> tag (Table 9-21) is used to perform create, get, getColumnInfo, update, and remove actions on com.beasys.portal.Portal objects. This tag is an empty tag.
Example:<esp:portalManager id="portal" action="get" portalName="BEAPortal"/>
<esp:portletManager>
The <esp:portletManager> tag (Table 9-22) is used to perform create, get, getArranged, update, and remove actions on com.beasys.portal.Portlet objects. This tag is an empty tag.
Example:<esp:portletManager id="arrangedPortlets" action="getArranged" userId="myUser" portalName="myPortal"/>
<esp:props>
The <esp:props> tag (Table 9-23) is used to get a property from the Portal Properties bean. The Portal Properties bean's deployment descriptor contains default values used by the Portal Administration tool.
Example:
<esp:props id="headerURL" propertyName="default.portal.headerURL" />
Property Sets
The Property Set tags allow access to the list of available properties and property sets. Manipulation of property sets can be done either programatically or through the administration tools.
Use the following code to import the utility tag library:
<%@ taglib uri="ps.tld" prefix="ps" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<ps:getPropertyNames>
The <ps:getPropertyNames> tag (Table 9-24) is used to get a list of property names given a property set.
Example:<ps:getPropertyNames propertySet="<%myPropertySet%>"
schemaGroupName="<%SchemaManagerConstants.USER_TYPE%>"
id="propertyNames" result="myResult"/>
<ps:getPropertySetNames>
The <ps:getPropertySetNames> tag (Table 9-25) is used to get a list of property sets given a property set type.
User Management
User Management tags allow access to user and group profile information, as well as operations such as creating and deleting users and groups, and managing user-group relationships.
To import the User Management JSP tags, use the following code:
<%@ taglib uri="um.tld" prefix="um" %>
Profile Management Tags
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<um:getProfile>
The <um:getProfile> tag (Table 9-26) retrieves the profile corresponding to the provided profile key and profile type. The tag has no enclosed body. The retrieved profile can be treated simply as a com.beasys.commerce.foundation.ConfigurableEntity, or can be cast to the particular implementation of ConfigurableEntity that it is. Along with the profile key and profile, an explicit successor key and successor type can be specified, as specified by the profileType attribute. This successor will then be used, along with the retrieved profile, in subsequent invocations of the <um:getProperty> tag to ensure property inheritance from the successor. If no successor is retrieved, standard ConfigurableEntity successor search patterns will apply to retrieved properties.
Example 1: This example shows a profile of type AcmeUser being retrieved with no successor specified, and an explicitly-supplied session scope.<um:getProfile profileKey="bob" profileType="AcmeUser" profileId="myProfile" scope="session"/>
Example 2:
This example shows a default profile type (com.beasys.commerce.axiom.contact.User) being retrieved with a default successor type (com.beasys.commerce.axiom.contact.Group), and an explicitly-supplied request scope.
<um:getProfile profileKey="bob" successorKey="engineering" scope="request"/>
Example 3:
This example shows a profile type of AcmeUser being retrieved with a successor type of AcmeGroup, and an implicitly-supplied session scope.
<um:getProfile profileKey="bob" profileType="AcmeUser"
successorKey="engineering" successorType="AcmeGroup"
profileId="myProfile"/>
<um:getProperty>
The <um:getProperty> tag (Table 9-27) retrieves the property value for a specified property set-property name pair. The tag has no enclosed body. The value returned is an Object. In typical cases, this tag is used after the <um:getProfile> tag is invoked to retrieve a profile for session use. The property to be retrieved is retrieved from the session profile. If the <um:getProfile> tag has not been used upon invoking the <um:getProperty> tag, the specified property value is retrieved from the Anonymous User Profile. See the chapter Creating and Managing Users in the WebLogic Personalization Server User's Guide
for more information.
Example 1: <um:getProperty id="myTitlebarBGColor" propertySet="exampleportal" propertyName="titlebar_bgcolor"/>
My titlebar bg color is <%=myTitlebarBGColor%>.
Example 2:
My titlebar bg color is <um:getProperty propertySet="exampleportal" propertyName="titlebar_bgcolor"/>.
<um:getPropertyAsString>
The <um:getPropertyAsString> tag (Table 9-28) works exactly like the <um:getProperty> tag above, but ensures that the retrieved property value is a String. The following example shows a multivalued property which returns a Collection, but presents a list of favorite colors.
Example: <um:getPropertyAsString id="myFaveColors" propertySet="exampleportal" propertyName="fave_colors"/>
My favorite colors are <%=myFaveColors%>.
<um:removeProperty>
The <um:removeProperty> tag (Table 9-29) removes the specified property from the current session's profile or from the Anonymous User Profile. The tag has no enclosed body. Subsequent calls to <um:getProperty> for a removed property would result in the default value for the property as prescribed by the property set, or from the Profile's successor.
Example:<um:removeProperty propertySet="<%=thePropertySet%>" propertyName="<%=thePropertyName%>"/>
<um:setProperty>
The <um:setProperty> tag (Table 9-30) updates a property value for either the session's current profile, or for the Anonymous User Profile. This tag has no enclosed body.
Example:<% String myName = request.getParameter("name"); %>
<um:setproperty propertySet="exampleportal" propertyName="name" value="<%=myName%>"/>
Group-User Management Tags
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<um:addGroupToGroup> The <um:addGroupToGroup> tag (Table 9-31) adds the group corresponding to the provided childGroupName to the group corresponding to the provided groupName. Since a group can only have one parent, any previous database records which reflect the group belonging to another parent will be destroyed. Both the parent group and the child group must previously exist for proper tag behavior. The tag has no enclosed body. Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:addGroupToGroup childGroupName="<%=childGroupName%>" parentGroupName="<%=parentGroupName%>" result="result"/>
<um:addUserToGroup>
The <um:addUserToGroup> tag (Table 9-32) adds the user corresponding to the provided username to the group corresponding to the provided groupName. Both the specified user and the specified group must previously exist for proper tag behavior. The tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:addUserToGroup userName="<%=userName%>" groupName="<%=groupName%>" result="result"/>
<um:changeGroupName>
The <um:changeGroupName> tag (Table 9-33) changes the name of the group corresponding to the specified oldGroupName to the specified newGroupName. This tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:changeGroupname oldGroupName="<%=oldGroupName%>" newGroupName="<%=changeGroupName%>" result="result"/>
<um:createGroup>
The <um:createGroup> tag (Table 9-34)creates a new com.beasys.commerce.axiom.contact.Group object. This tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:creategroup groupName="<%=groupName%>" result="result"/>
<um:createUser>
The <um:createUser> tag (Table 9-35) creates a new com.beasys.commerce.axiom.contact.User object. This tag has no enclosed body. Although classified as a Group-User management tag, this tag can be used in conjunction with run-time activities, in that it will persist any properties associated with a current Anonymous User Profile if specified.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:createUser userName="<%=username%>" password="<%=password"%> result="result"/>
<um:getChildGroupNames>
The <um:getChildGroupNames> tag (Table 9-36) returns the names of any groups that are children of the given group.
<um:getChildGroups> The <um:getChildGroups> tag (Table 9-37) retrieves an array of com.beasys.commerce.axiom.contact.Group objects that are children of the Group corresponding to the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. This tag has no enclosed body.
Example:<um:getchildgroups groupName="<%=groupName%>" id="childGroups"/>
<um:getGroupNamesForUser>
The <um:getGroupNamesForUser> tag (Table 9-38) retrieves a String array that contains the group names corresponding to groups to which the provided user immediately belongs. This tag has no enclosed body.
Example:<um:getGroupNamesForUser userName="<%=username%>" id="myGroups"/>
<um:getParentGroupName>
The <um:getParentGroupName> tag (Table 9-39) retrieves the name of the parent of the com.beasys.commerce.axiom.contact.Group object associated with the provided groupName. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. This tag has no enclosed body.
Example:<um:getParentGroupName groupName="<%=groupName%>" id="parentGroupName"/>
<um:getTopLevelGroups>
The <um:getTopLevelGroups> tag (Table 9-40) retrieves an array of com.beasys.commerce.axiom.contact.Group objects, each of which has no parent group. The information is taken from the personalization database tables, and reflects the group hierarchy information as set up from the Group administration and Realm Configuration administration tools. This tag has no enclosed body.
Example:<um:getTopLevelGroups id="topLevelGroups"/>
<um:getUsernames>
The <um:getUsernames> tag (Table 9-41) retrieves a String array that contains the usernames matching the provided search expression. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero. Example:<um:getUsernames userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users.");%>
<um:getUsernamesForGroup>
The <um:getUsernamesForGroup> tag (Table 9-42) retrieves a String array that contains the usernames matching the provided search expression and correspond to members of the provided group. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagerTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero. Example:<um:getUsernamesForGroup groupName="engineering" userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users in my group.");%>
<um:removeGroup>
The <um:removeGroup> tag (Table 9-43) removes the com.beasys.commerce.axiom.contact.Group object corresponding to the provided groupName. This tag has no enclosed body.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:removeGroup groupName="<%=groupName%>" result="result"/>
<um:removeGroupFromGroup>
The <um:removeGroupFromGroup> tag (Table 9-44) removes a child group from a parent group.
<um:removeUser> The <um:removeUser> tag (Table 9-45) removes the com.beasys.commerce.axiom.contact.User object corresponding to the provided username. It can remove any type of extended user that has its profileType set in the database. This tag has no enclosed body. Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Example:<um:removeUser userName="<%=username%>" result="result"/>
<um:removeUserFromGroup>
The <um:removeUserFromGroup> tag (Table 9-46) removes a user from a group.
Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Security Tags Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression. <um:login> The <um:login> tag (Table 9-47) provides weak authentication (username, password) against the current security realm, and sets the authenticated user as the current WebLogic user. This tag has no enclosed body. Note: The login tag requires a username attribute and a password attribute to be present in the HTTP request.
<um:logout> The <um:logout> tag (Table 9-48) ends the current user's WebLogic Server session. This is independent of the FlowManager's user session tracking, and should be used in combination with the <um:login> tag.
Tag Attribute |
Req'd |
Type |
Description |
R/C |
---|---|---|---|---|
No attributes |
|
|
|
|
<um:setPassword> The <um:setPassword> tag (Table 9-49) updates the password for the user corresponding to the provided username. Note: This tag should only be invoked when the weblogic.security.realmClass property in the weblogic.properties file is com.beasys.commerce.axiom.contact.security.RDBMSRealm.
Personalization Utilities
The <es:jsptaglib> tag contains generic tags you can use to create JSP pages.
Use the following code to import the utility tag library:
<%@ taglib uri="es.tld" prefix="es" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
<es:counter>
The <es:counter> tag (Table 9-50) is used to create a for loop.
Example: <es:counter id="iterator" minCount="0" maxCount="10">
<% System.out.println(iterator);%>
</es:counter>
<es:date>
The <es:date> tag (Table 9-51) is used to get a date- and time-formatted String based on the user's time zone preference.
Example:<es:date formatStr="MMMM dd yyyy" timeZoneId="MST" />
<es:forEachInArray>
The <es:forEachInArray> tag (Table 9-52) is used to iterate over an array.
Example: <es:forEachInArray id="item" array="<%=items%>" type="String" counterId="i">
<% System.out.println("items[" + i + "]: " + item);%>
</es:forEachInArray>
<es:isNull>
The <es:isNull> tag (Table 9-53) is used to check if a value is null. In the case of a String, the <es:isNull> tag is used to check if the String is null or has a value. An empty string will cause isNull to be false. (An empty string is not null.)
Tag Attribute |
Req'd |
Type |
Description |
R/C |
---|---|---|---|---|
item |
Yes |
Object |
The variable to evaluate. |
R |
Example: <es:isNull item="<%=value%>">
Error: the value is null.
</es:isNull>
<es:monitorSession>
The <es:monitorSession> tag (Table 9-54) can be added to the beginning of any JSP page to disallow access to the page if the session is not valid or if the user is not logged in.
Example:<es:monitorSession loginRequired="true" />
<es:notNull>
The <es:notNull> tag (Table 9-55) is used to check if a value is not null. In the case of a String, the <es:notNull> tag is used to check if the String is not null or has a value. An empty string will cause notNull to be true. (An empty string is treated as a value.)
Tag Attribute |
Req'd |
Type |
Description |
R/C |
---|---|---|---|---|
item |
Yes |
Object |
The variable to evaluate. |
R |
Example: <es:notNull item="<%=value%>">
The value is not null.
</es:notNull>
<es:preparedStatement>
The <es:preparedStatement> tag (Table 9-56) is used to create a JDBC prepared statement.
Tag Attribute |
Req'd |
Type |
Description |
R/C |
---|---|---|---|---|
id |
Yes |
String |
The variable in which the PreparedStatement is returned. |
R |
sql |
Yes |
String |
The SQL query statement. |
R |
Example: <es:preparedStatement id="ps" sql="<%=bookmarkBean.QUERY%>">
<%@ include file="startPreparedStatement.inc" %>
<%
bookmarkBean.createQuery(ps, owner);
java.sql.ResultSet resultSet = ps.executeQuery();
bookmarkBean.load(resultSet);
%>
<%@ include file="endPreparedStatement.inc" %>
</es:preparedStatement>
<es:simpleReport>
The <es:simpleReport> tag (Table 9-57) is used to create two-dimensional array out of a simple query.
Example: <es:simpleReport id="report" resultSet="<%=resultSet%>">
<%
for (int i=0; i<report.length; i++ )
{
for (int j=0; j<report[i].length; j++ )
{
...
}
}
%>
<es:transposeArray>
The <es:transposeArray> tag (Table 9-58) is used to transpose a standard [row][column] array to a [column][row] array.
Example: <es:transposeArray id="byColumnRow" array="<%=byRowColumn%>" type="String">
...
</es:transposeArray>
<es:uriContent>
The <es:uriContent> tag (Table 9-59) is used to pull content from a URL. It is best used for grabbing text-heavy pages.
Example: <es:uriContent id="uriContent" uri="http://www.beasys.com/index.html">
<%
out.print(uriContent);
%>
</es:uriContent>
Note: If you combine HTML pages with relative URL's, you must fully qualify them to the correct host in each URL, or else images (on other resources) may not be retrieved properly by the browser.
WebLogic Utilities
The <wl:jsptaglib> tag library contains custom JSP extension tags which are supplied as a part of the WebLogic server platform.
To import the WebLogic Utilities JSP tags, use the following code:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
Note: In the following tables, Req'd specifies if the attribute is required (yes) or optional (no). In the R/C column, C means that the attribute is a Compile time expression, and R means that the attribute can be either a Request time expression or a Compile time expression.
Note: Refer to the Javadoc for further descriptions of the wl tags.
<wl:process>
The <wl:process> tag (Table 9-60) is used for query attribute-based flow control. By using a combination of the four attributes, you can selectively execute the statements between the <wl:process> and </wl:process> tags.
Statements between the <wl:process> tags will be executed according to the matrix:
Example: <wl:process name="lastBookRead" value="A Man in Full">
<!-- This section of code will be executed
if lastBookRead exists and the value of lastBookRead is
"A Man in Full" -->
</wl:process>
<wl:repeat>
The <wl:repeat> tag (Table 9-61) is used to iterate over a variety of Java objects, as specified in the set attribute.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|