Previous     Contents     Index     Next     
iPlanet Portal Server: Mobile Access Pack Programmer's Guide



Chapter 6   JSP Tag Libraries


This chapter discusses the Java Server Page (JSP) tag libraries that facilitate the delivery of content from the iPlanet Messaging Server, iPlanet Calendar Server, and the iPlanet Personal Address Book to the user's mobile device.

For detailed information on the usage of these tags within the Mobile Access Pack applications, see Chapter 5 "Application JSPs".



Introduction

The JSP tag libraries for these applications:

  • Maintain client session state using the iPlanet Portal Server session mechanism.

  • Use the iPlanet Portal Server profile interface to retrieve profile information such as configuration (such as, backend service host/port), authentication (such as, credentials), and preferences (such as, address book sorting).

  • Log error and warning messages through the iPlanet Portal Server logging interface.



Tag Patterns

A tag typically follows one of the following patterns:


Context Tag

A context tag represents the session state for a valid authenticated connection to a backend service. This tag verifies that the session is still valid and provides a context for other tags to make requests to that service. The object a context tag gives reference to is called the service context.

At the first request, a connection is made to the backend service using the configuration and authentication information from the portal profile service. The service context is based upon the current portal session so that it is available across multiple requests.


Bean Tags

A bean tag represents a java bean object to store on the current page context. The bean properties are retrieved or modified with the get or set tags. The following tag attributes specify how the bean is found:

  • The id attribute creates a new empty bean and stores it in the page context using the attribute's value.

  • The name attribute value is a bean object. This attribute looks for a property with the attribute's value in the page context.

If neither one of these attributes are set, then the current item in an enclosing collection parent tag is used.


Get tag
The get tag retrieves the value of a property of a bean object and writes it to the page output.

The property attribute specifies the name of the property to retrieve. If the property attribute is not specified, the results of the toString() method of the identified object will be returned as the results of the get tag.

If there is a name attribute, it is used to locate the bean in the page context. If there is no name attribute, then the enclosing bean parent tag is used to find the bean object.


Set Tag
The set tag modifies the value of a property of a bean object. The property attribute specifies the name of the property to modify. The value attribute specifies the value to set the property to. The tag body content is executed only if the tag fails to modify the bean property.


Collection Tags

These tags provide access to a collection of beans constructed by a preceding command tag. Information about the collection can be accessed by the properties of a collection tag.

This collection is typically stored within a particular service context and is referenced implicitly by the name of the particular collection tag. For example, the <mail:messages> tag refers to the current messages collection stored within the current mail service context.

The id and name attributes permit bean tag like access to the properties of the collection. This is useful for constructing paginated access to a collection from within a Java Server Page. The optional beanid attribute, when specified when the collection is in iterative mode, stores the "current" bean from the collection onto the page context using the name specified by the beanid attribute.

The collection tags operate in non-iterative and iterative modes, as specified by the iterate attribute.

In the non-iterative mode, various properties of the collection can be set or retrieved and the body of a collection tag is processed only once.

In the iterative mode, the body is evaluated until a count property is exhausted (but at least once), and the iteration begins at an index in the collection as specified by the start property.


Usage Examples
The following reference to a collection tag establishes iteration parameters:

<collection-tag id="example">

   <util:set property="start" value="$(start)"/>

   <util:set property="count" value="10"/>

</collection-tag>

The following iterates through the collection in the specified manner:

<collection-tag name="example" iterate="true">

   Item#<util:get property="indexOne"/>   

   <bean-tag>

      <util:get property="some-bean-specific-property-name"/>

   </bean-tag>

</collection-tag>

The following is a demonstration of the construction of a "next page" link

<collection-tag name="example">

   <util:if property="nextPage">

      <util:link tagstart="<a" tagend=">">

         <util:attr attr="href">

            <url comp="whatever" file="next.jsp">

               <parm name="start"><util:get property="nextStart"/></util:parm>

            </url>

         </util:attr>

      </util:link>

      Next Page</a>

   </util:if>

</collection-tag>


Command Tags

A command tag makes a request to a backend service. It uses the service context to make the request. The request arguments come from the tag attributes, request parameters, or iPlanet Portal Server profile settings. The request stores the results as properties in a service context and/or as beans on the page context. The tag body content is executed only if the request fails.


Content Tag

The content tag is used to set the content type and charset of the Java Server Page output stream. The charset is read and set from the user's iPlanet Portal Server profile. The content tag, combined with the catalog tags, enables JSP template files with no localized content to generate localized output (based on message catalogs) in the correct charset.


Session Tags

This tag provides access to session attributes.


Message Catalog Tags

These tags provide a way to store beans, that are beyond the scope of a page context, within the scope of a session.


Link Tags

These tags construct dynamically generated link type tags.



Tag Attribute Evaluation

Before processing a tag, the attributes of most tags in the tag libraries are subject to the following rules of evaluation. If an attribute contains:

  • $(parameterName) - This is replaced by the value of the HTTP request parameter identified by parameterName.

  • ${beanName:propertyName} - This is replaced by the value of the bean property identified by beanName and propertyName. The bean is assumed to exist on the current page context.

  • $[catalogName:key] - This is replaced by the value of the message catalog entry identified by catalogName and key. The catalogName refers to a catalog bean placed on the page context by a preceeding catalog tag.

  • $/componentName:attributeName[:defaultValue]/ - This is replaced by the client (device) specific value of the iPlanet Portal Server profile attribute as identified by componentName and attributeName. If the attribute does not exist, a null string is returned, unless defaultValue is specified as well.


Examples

The following are sample evaluation of some tag attribute values:


Example 1
<mail:message id="newmsg">

   <mail:set property="to" value="$(to)"/>

</mail:message>

In the above example, the value of the attribute evaluates to the value of the HTTP request parameter named to.


Example 2
<mail:message name="newmsg">

   <mail:set property="to" value="${newmsg:to} $(to)"/>

</mail:message>

In the above example, the value of the attribute evaluates to the value of the to property of the newmsg bean, followed by a space, and then followed by the value of the HTTP request parameter named to.



Tag Library Error Logging

The Mobile Access Pack tag libraries log error and warning messages in:

/var/opt/SUNWips/debug/mapJsp

This logging functionality is controlled by a property in the iPlanet Portal Server configuration file:

/etc/opt/SUNWips/platform.conf

For JSP debugging, edit this file. For example, open the platform.conf file and modify the following property:

ips.debug=warning



Tag Library Quick Reference

This section provides an abbreviated list of each tag in the Mobile Access Pack tag libraries. For detailed information on each library and its collection of tags, refer to the relevant section in this chapter.

Table 6-1 contains a list of tags from the utilities tag library.


Utilities Tag Library"> Table 6-1    Utilities Tag Library

Tag

Description

Context Tag

context  

This tag provides reference to the state of the utility service for a given session.  

Link Tags

link  

This tag constructs a link.  

attr  

This tag adds attributes to a link tag.  

url  

This tag aids in the construction of URLs.  

parm  

This tag adds requests to URLs.  

Collection Tags

beans  

This tag operates on a collection of the specified bean objects, iterates through that collection, and makes that bean collection available to the page.  

Bean Tags

bean  

This tag makes a bean object available to the page.  

get  

This tag retrieves the specified property and writes its value to the page output.  

set  

This tag updates the specified property.  

copy  

This tag copies the specified property value from the source bean to the target bean.  

if  

This tag tests the specified property and includes the tag body if the property evaluates to true.  

ifnot  

This tag tests the specified property and includes the tag body if the property evaluates to false.  

list  

This tag lists all properties of the specified bean to the page output.  

Content Tag

session  

This tag gives a bean scope to be stored in the session.  

Message Catalog Tags

catalog  

This tag loads a message catalog specified by the resource attribute and makes it available to the page.  

msg  

This tag gets a message specified by the key attribute from a message catalog and writes it to the page output.  

Content Tag

content  

This tag is used to set the content type and charset of the JSP output stream from the user's iPlanet Portal Server profile.  

Command Tags

edit  

This tag refers to an "edit" bean which specifies that certain editing be performed upon the enclosed body.  

forward  

This tag performs a "forward" operation, similar to <jsp:forward>.  

include  

This tag performs an "include" operation, similar to <jsp:include>.  

Table 6-2 contains a library of tags for the calendar server.


iPlanet Calendar Server Client Tag Library"> Table 6-2    iPlanet Calendar Server Client Tag Library

Tag

Description

Context Tag

context  

This tag represents the state of the session to the calendar service.  

Command Tags

fetch  

This tag fetches the specified range of events into the calendar context.  

store  

This tag stores the specified event into the current calendar set.  

delete  

This tag deletes the specified event from the current calendar set.  

dateformat  

This tag either formats a datetime for output or parses one from an input.  

dateroll  

This tag rolls the specified datetime attribute value forward or backward.  

Bean Tags

datetime  

This tag provides the date and time bean properties.  

event  

This tag provides the event properties.  

get  

This tag gets the specified event bean property or field.  

set  

This tag sets or updates the specified event bean property or field.  

Collection Tags

events  

This tag contains a collection of event beans in the calendar context.  

Table 6-3 contains a library of tags for the mail server.


iPlanet Messaging Server Client Tag Library"> Table 6-3    iPlanet Messaging Server Client Tag Library

Tag

Description

Context Tag

context  

This tag provides reference to the state of the mail service for a given session.  

Command Tags

fetch  

This tag fetches a collection of folders (a collection of messages), messages (a collection of lines), or lines into the context.  

sendmessage  

This tag sends or forwards an email message.  

deletemessage  

This tag deletes an email message from the current folder.  

Bean Tags

folder  

This tag refers to the current bean or folder within an enclosing collection or folders <mail:folders>.  

message  

This tag refers to the current bean or message within an enclosing collection of messages <mail:messages>.  

line  

This tag refers to the current bean or line within an enclosing collection of lines <mail:lines>.  

presetmsg  

This tag refers to a preset message from a collection of preset messages.  

get  

This tag retrieves the specified property and writes its value to the page output.  

set  

This tag updates the specified property.  

Collection Tags

folders  

This tag refers to a collection of folders.  

messages  

This tag refers to a collection of message beans.  

lines  

This tag refers to a collection of line beans.  

presetmsgs  

This tag refers to a collection of preset messages.  

Table 6-4 contains a list of tags from the address book tag library.


Personal Address Book Client Tag Library"> Table 6-4    Personal Address Book Client Tag Library

Tag

Description

Context Tag

context  

This tag is used to maintain state between requests. It ensures that the address book context is present within the current pageContext.  

Command Tags

fetch  

This tag fetches a collection of address book entries and sets the current collection within the current address book context (AbContext).  

add  

This tag adds an entry to the address book.  

delete  

This tag deletes an address book entry.  

modify  

This tag modifies an address book entry.  

Bean Tags

entry  

This tag refers to an address book entry within a collection of address book entries <ab:entries>.  

get  

This tag retrieves the specified bean property.  

set  

This tag sets a bean property or updates the specified bean property.  

Collection Tags

entries  

This tag refers to a collection of address book entries or beans.  



Utilities Tag Library

This tag library implements a collection of utility tags. The Utility Tag Libraries consists of the following tags:


context


Description
The context tag provides reference to the state of the utility service for a given session. Use of this tag without a body verifies correct operation of the utility service.


Tag Body
Java Server Page


Properties
The tag has the following properties:


Table 6-5    ipsMail message Tag Properties

Property

Description

Access

rfc2396  

Indicates whether or not the url tag is escaped. If the value is set to true, the url generated by the url tag is escaped according to the RFC2396 rules; otherwise, the URL is not escaped. The default value is true.  

Get/Set  

urlAmpEntity  

If value is set to true, the "&" separator in a query string parameter list constructed by the url tag is rendered as "&amp;", otherwise, it is rendered as "&". The default value is true.  

Get/Set  


Example
The following is an example of the context tag:

<util:context>

   <util:set property="rfc2396" value="false"/>

   <util:set property="urlAmpEntity" value="false"/>

</util:context>


link


Description
This tag constructs a link. The content of the link is dynamically generated.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-6    ipsUtils link Tag Attributes

Attribute

Description

Required?

tagstart  

Specifies the fragment of text to include prior to the body of the tag  

Yes  

tagend  

Specifies the fragment of text to include after or at the end of the tag body  

Yes  


Example
<util:link tagstart="<a" tagend=">">

<util:attr attr="href">

   <util:url path="/DesktopServlet"></util:url>

</util:attr>

<util:attr attr="method">GET</util:attr>

</util:link>RETURN HOME</a>

In the above example, the tag generates a link that includes session encoding, if needed. The path attribute is not subject to the rules of file lookup. The following is an example of the emitted markup:

<a href="/DesktopServlet?sid=1a34" method="GET">RETURN HOME</a>


attr


Description
This tag adds attributes to a link tag. The content of this tag is dynamically generated.


Tag Body
Java Server Page


Tag Parent
<utilsPrefix:link>


Attributes
The tag has the following attributes:


Table 6-7    ipsUtils attr Tag Attributes

Attribute

Description

Required?

attr  

Specifies the fragment of text to include before the body of the tag.  

Yes  


Example
<util:link tagstart="<a" tagend=">">

<util:attr attr="href">

   <util:url path="/DesktopServlet"></util:url>

</util:attr>

<util:attr attr="method">GET</util:attr>

</util:link>RETURN HOME</a>

In the above example, the tag generates a link that includes session encoding, if needed. The path attribute is not subject to the rules of file lookup. The following is an example of the emitted markup:

<a href="/DesktopServlet?sid=1a34" method="GET"/>


url


Description
This tag aids in the construction of URLs. The path to the URL can be specified in the following ways:

  • The path attribute can specify a path to be used during the construction of the URL. Client specific rewriting can not be applied to this value.

  • The file and comp attributes can together specify a JSP resource that will be resolved using client data driven file lookup rules.

Also, query string parameters can be appended to the URL by including the appropriate parm tags within the body of the url tag. All body content is discarded except the value of the parm tag.


Tag Body
Java Server Page


Tag Parent
<utilsPrefix:attr>


Restrictions
Either the path attribute, or comp and file attributes must be specified.


Attributes
The tag has the following attributes:


Table 6-8    ipsUtil url Tag Attributes

Attribute

Description

Required?

file  

Specifies the file to which to generate the URL reference to. If file is specified, comp must be specified and path must not be specified  

No  

comp  

Specifies the component (such as mail, calendar, address book) that the target file belongs to.  

No  

path  

Specifies the path component of the URL. If path is specified, neither file nor comp must be specified  

No  


Examples
The following are examples of the URL tag:

Example 1: The following is an example of url tag usage, with the path attribute:

<util:link tagstart="<a" tagend=">">

<util:attr attr="href">

   <util:url path="/DesktopServlet"></util:url>

</util:attr>

<util:attr attr="method">GET</util:attr>

</util:link>RETURN HOME</a>

In the above example, the tag generates a link that includes session encoding, if needed. The path attribute is not subject to the rules of file lookup. The following is an example of the emitted markup:

<a href="/DesktopServlet?sid=1a34" method="GET"/>

Example 2: The following is an example of url tag usage, with file and comp attributes:

<util:link tagstart="<a" tagend=">">

<util:attr attr="href">

   <util:url file="inbox.jsp" comp="mail"></util:url>

</util:attr>

<util:attr attr="method">GET</util:attr>

</util:link>GO HOME</a>

In the above example, this tag generates a link that has been resolved to the correct path for the client that has requested the page. The session encoding is added as needed. The following is an example of the emitted markup:

<a href="/jsp/default/mail/wml/inbox.jsp?sid=1a34" method="GET"/>


parm


Description
This tag adds request parameters to URLs. The following will be added as a query string parameter to the URL being constructed by an enclosing url tag:

name=BODY

Here, name is a value specified by the parm tag's name attribute and BODY is whatever is evaluated as the parm tag's body.

The urlAmpEntity property of the utility context controls whether the query string parameter separator is generated as "&" or "&amp;".


Tag Body
Java Server Page


Tag Parent
<utilsPrefix:url> or <utilsPrefix:forward>


Attributes
The tag has the following attributes:


Table 6-9    ipsUtil parm Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the URL argument to be generated  

Yes  


Example
<util:link tagstart="<a" tagend=">">

<util:attr attr="href">

<util:url path="/DesktopServlet">

   <util:parm name="op1">stuff</util:parm>

</util:url>

</util:attr>

<util:attr attr="method">GET</util:attr>

</util:link>GO HOME</a>

In the above example, the tag generates a link that includes session encoding, if needed. The path attribute is not subject to the rules of file lookup. The following is an example of the resultant markup:

<a href="/DesktopServlet?sid=1a34&op1=stuff" method="GET"/>


beans


Description
This tag operates on a collection of the specified bean objects, iterates through that collection, and makes that bean collection available to the page.


Tag Body
Java Server Page


Restrictions
If the id attribute is specified, then a collection of type and size is created. If the name attribute is specified, then the collection is restored from the page context. The type attribute specifies the java class name of the object to create for the collection.


Attributes
The tag has the following attributes:


Table 6-10    ipsUtil beans Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the bean collection to create  

No  

name  

Specifies the name of the bean collection to use  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

Specifies whether or not to iterate. By default, it is set to false, and the collection will not iterate  

No  

type  

Specifies the type of the bean; a java class name  

No  

size  

Specifies the number of beans to create for the collection  

Yes  


Properties


Table 6-11    ipsUtil beans Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Examples
The following are examples of beans collection:

Example 1: The following example creates a list of five dates and sets the seconds to the index:

<util:beans id="dates" size="5" type="java.util.Date" iterate="true">

<util:get property="index" id="index"/>

<util:bean>

<util:set property="seconds" id="index"/>

</util:bean>

</util:beans>

Example 2: The following example iterates through the dates collection:

<util:beans name="dates" iterate="true"/>

<util:bean>

date = <util:get/>

</util:bean>

</util:beans>


bean


Description
This tag makes a bean object available to the page. It is similar to the <jsp:useBean> except that it interoperates with the other bean tags in this tag library.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The type attribute specifies the java class name of the object to use or create.


Attributes
The tag has the following attributes:


Table 6-12    ipsUtil bean Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the bean to create  

No  

name  

Specifies the name of the bean to use  

No  

type  

Specifies the type of the bean; a java class name  

No  


Examples
The following are examples of the bean tag:

Example 1: The following example makes a date available:

<util:bean type="java.util.Date">

date = <util:get/>

</util:bean>

Example 2: The following example makes a specified date available:

<util:bean id="date" type="java.util.Date"/>

date = <util:get name="date"/>

</util:bean>


get


Description
This tag retrieves the specified property and writes its value to the page output.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute must be used to specify what to retrieve. If the property attribute is not specified, then the bean object itself is retrieved as a string. The id attribute specifies the name to save the retrieved property as. If the eval attribute is specified, then the value of the attribute is evaluated and written to the page output.


Attributes
The tag has the following attributes:


Table 6-13    ipsUtil get Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to retrieve. If not specified, then the bean itself is retrieved as a string.  

Yes  

id  

Specifies the name to save the retrieved value as  

No  

eval  

Indicates the attribute to evaluate and write to page output  

No  

edit  

Specifies the edit bean that will be applied to the returned value  

No  


Examples
The following are examples of the get tag:

Example 1: The following example gets the date time property from the parent bean:

<util:bean type="java.util.Date">

time = <util:get property="time"/>

</util:bean>

Example 2: The following example gets the date time property from the specified bean:

<util:bean id="date" type="java.util.Date"/>

...

time = <util:get name="date" property="time"/>

Example 3: The following example gets the date bean itself as a string:

<util:bean type="java.util.Date">

date = <util:get/>

</util:bean>

Example 4: The following example gets a non-string bean property:

<util:bean: type="Bean">

<util:get property="prop" id="handle"/>

</util:bean>

Example 5: The following example gets an evaluated attribute:

<util:catalog id="catalog" resource="catalog"/>

<util:bean id="bean" type="java.util.Date"/>

Msg = <util:get eval="$[catalog:msg]"/>

Param = <util:get eval="$(requestparam)"/>

Bean = <util:get eval="{bean}"/>


set


Description
This tag updates the specified property.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute specifies what to update. The value attribute specifies the string value to update the property. The id specifies the bean object value to update the property. Either value or id must be specified.


Attributes
The tag has the following attributes:


Table 6-14    ipsUtil set Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to update  

Yes  

value  

Specifies the string value of the property to update  

No  

id  

Specifies the bean object value of the property to update  

No  

edit  

Specifies the edit bean that will be applied to the value prior to storage  

No  


Examples
The following are examples of the set tag:

Example 1: The following example sets the date time property on the parent bean:

<util:bean type="java.util.Date">

<util:set property="time" value="0"/>

</util:bean>

Example 2: The following example sets the date time property on the named bean:

<util:bean id="date" type="java.util.Date"/>

...

<util:set name="date" property="time" value="0"/>

Example 3: The following example sets a bean onto another bean property:

<util:bean id="one" type="BeanOne"/>

<util:bean id="two" type="Beantwo"/>

<util:set name="two" id="one" property="one"/>


copy


Description
This tag copies the specified property value from the source bean to the target bean.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate.


Attributes
The tag has the following attributes:


Table 6-15    ipsUtil copy Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

source  

Specifies the name of the bean to copy from  

Yes  

property  

Specifies the name of the property to copy  

Yes  


Example
The following example copies the time property from d1 to d2:

<util:bean name="d1" type="java.util.Date"/>

...

<util:bean name="d2" type="java.util.Date"/>

...

<util:copy name="d2" property="time" source="d1"/>


if


Description
This tag tests the specified property and includes the tag body if the property evaluates to true.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute specifies what to test. The value attribute specifies the string value to test the property. The id attribute specifies the bean object value to test the property. If neither value or id is specified, then the test is true if the property value is non-null.


Attributes
The tag has the following attributes:


Table 6-16    ipsUtil if Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to test  

Yes  

value  

Specifies the string value of the property to test  

No  

id  

Specifies the bean value of the property to test  

No  


Examples
The following are examples of the if bean:

Example 1: The following example tests if the date time equals to zero on the parent bean:

<util:bean type="java.util.Date">

<util:if property="time" value="0">

... date.time == 0

</util:if>

</util:bean>

Example 2: The following example tests if the date time == 0 on named bean:

<util:bean id="date" type="java.util.Date"/>

...

<util:if name="date" property="time" value="0">

... date.time == 0

</util:if>

Example 3: The following example tests if the bean property is non-null:

<util:bean type="Bean">

<util:if property="name">

... Bean.name != null </util:if>

</util:bean>

Example 4: The following example tests using two beans:

<util:bean id="one" type="BeanOne"/>

<util:bean id="two" type="BeanTwo"/>

<util:if name="one" property="bean" id="two">

... one.bean == two

</util:if>


ifnot


Description
This tag tests the specified property and includes the tag body if the property evaluates to false.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute specifies what to test. The value attribute specifies the string value to test the property. The id attribute specifies the bean object value to test the property. If neither value or id is specified, then the test is true if the property value is non-null.


Attributes
The tag has the following attributes:


Table 6-17    ipsUtil ifnot Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to test  

Yes  

value  

Specifies the string value of the property to test  

No  

id  

Specifies the bean object value of the property to test  

No  


Examples
The following are examples of the ifnot bean:

Example 1: The following example tests if the date time does not equal to zero on the parent bean:

<util:bean type="java.util.Date">

<util:ifnot property="time" value="0">

... date.time != 0

</util:ifnot>

</util:bean>

Example 2: The following example tests if the date time does not equal to zero on the named bean:

<util:bean id="date" type="java.util.Date"/>

...

<util:ifnot name="date" property="time" value="0">

... date.time != 0

</util:ifnot>

Example 3: The following example tests if the bean property is null:

<util:bean type="Bean">

<util:ifnot property="name">

... Bean.name == null

</util:ifnot>

</util:bean>

Example 4: The following example tests using two beans:

<util:bean id="one" type="BeanOne"/>

<util:bean id="two" type="BeanTwo"/>

<util:ifnot name="one" property="bean" id="two">

... one.bean != two

</util:ifnot>


list


Description
This tag lists all properties of the specified bean to the page output. The list format may not be suitable for markup and should be contained in <PRE> or equivalent tags.


Tag Body
Empty


Restrictions
If the name attribute is not specified, a parent bean tag is used to locate the bean on which to operate.


Examples
The following are examples of the list bean:

Example 1: The following example lists the properties of a parent bean:

<util:bean type="java.util.Date">

<util:list/>

</util:bean>

Example 2: The following example lists the properties of a named bean:

<util:bean id="date" type="java.util.Date"/>

...

<util:list name="date"/>


session


Description
This tag provides access to session attributes.


Tag Body
Empty


Restrictions
If the id attribute is specified, then the page attribute is restored using the session attribute. If the name attribute is specified, then the session attribute is saved using the page attribute. If neither attribute is specified, then the session attribute is removed.


Attributes
The tag has the following attributes:


Table 6-18    ipsUtil session Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the page attribute to restore from the session attribute  

No  

name  

Specifies the name of the page attribute to save into the session attribute  

No  

attribute  

Specifies the name of the session attribute to operate on  

Yes  


Examples
The following are examples of the session bean:

Example 1: The following example creates a date bean to use:

<util:bean id="now" type="java.util.Date"/>

Example 2: The following example saves that bean into the session attributes:

<util:session name="now" attribute="viewDay"/>

Example 3: The following example restores from the session attributes:

<util:session id="now" attribute="viewDay"/>

Example 4: The following example removes the bean from the session attributes:

<util:session attribute="viewDay"/>


catalog


Description
This tag loads a message catalog specified by the resource attribute and makes it available to the page. A message catalog is a locale specific java.util.ResourceBundle object.


Tag Body
Java Server Page


Restrictions
The id attribute is used to make the message catalog available after the catalog end tag. The name attribute is used to make an existing catalog available.

This tag also makes a scripting variable, specified by the id attribute, available. Use the getMsg(String key) method to get the message string.


Attributes
The tag has the following attributes:


Table 6-19    ipsUtil catalog Tag Attributes

Attribute

Description

Required?

id  

Specifies the name to save the catalog as when saving the catalog on the page context. This is also the name for the scripting variable  

No  

name  

Specifies the name to use to retrieve the catalog when retrieving the catalog from the page context  

No  

resource  

Specifies the resource name to locate the message catalog  

No  


Examples
The following are examples of the message catalog:

Example 1: The following example gets a message from a sample catalog:

<util:catalog resource="sample">

Message = <util:msg key="message"/>

</util:catalog>

Example 2: The following example gets a key from a named catalog:

<util:catalog id="sample" resource="sample"/>

...

Message = <util:msg name="sample" key="message"/>

Example 3: The following example gets a key using scripting:

<util:catalog id="sample" resource="sample"/>

...

Message = <%= sample.getMsg("message") %>


msg


Description
This tag gets a message specified by the key attribute from a message catalog and writes it to the page output.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then a parent catalog is used to locate the message catalog.


Attributes
The tag has the following attributes:


Table 6-20    ipsUtil msg Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the message catalog to use  

No  

key  

Specifies the key used to locate the message in the catalog  

Yes  


Examples
The following are examples of the msg command:

Example 1: The following example gets a message from a sample catalog:

<util:catalog resource="sample">

Message = <util:msg key="message"/>

</util:catalog>

Example 2: The following example gets a key from a named catalog:

<util:catalog id="sample" resource="sample"/>

...

Message = <util:msg name="sample" key="message"/>


content


Description
The content tag is used to set the contentType and character set of the JSP output stream from the user's iPlanet Portal Server profile. The character set used when the JSP is compiled does not matter since there is no localized content in the JSP. The content tag enables generating localized output (based on message catalogs) in the correct character set.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-21    ipsUtil content Tag Attributes

Attribute

Description

Required?

type  

It sets the contentType for the output stream  

Yes  


Example
The following is an example of the content tag usage:

<?xml version="1.0"?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<%@ taglib uri="/taglibs/ips_taglib_util.jar" prefix="util" %>

<util:content type="text/vnd.wap.wml"/>

<util:catalog resource="mail" id="i18n" />

<wml>

<util:link tagstart="<card" tagend=">"><%

   %><util:attr attr="ontimer"><%

      %><util:url file="doInbox.jsp" comp="mail"></util:url><%

   %></util:attr><%

%></util:link>

<timer value="30"/>

<do type="accept"><%

%><util:link tagstart="<go" tagend="/>"><%

   %><util:attr attr="href"><%

      %><util:url file="doInbox.jsp" comp="mail"></util:url><%

   %></util:attr><%

%></util:link>

</do>

<p>

   <b><util:msg name="i18n" key="sendcancel"/></b>

</p>

</card>

</wml>


edit


Description
This tag is used to perform limited editing on the tag body. The edit tag refers to an "edit" bean which specifies that certain editing be performed upon the enclosed body. The edit will be performed in the following order:

  1. String substitution, if any specified.

  2. String truncation, if any specified.

  3. Character entity escaping, if any specified.

The edit bean can also be referenced by the get and/or set tags which results in the appropriate modifications to the values being get or set.


Tag Body
Java Server Page


Restrictions
At least one attribute must be specified and both the attributes must not be specified together.


Attributes
The tag has the following attributes:


Table 6-22    ipsUtil edit Tag Attributes

Attribute

Description

Required?

id  

Specifies the id of the bean to edit  

No  

name  

Specifies the name of the bean to use  

No  


Properties


Table 6-23    ipsUtil edit Tag Properties

Property

Description

Access

truncation  

Specifies the number of characters to truncate the body to  

Get/Set  

escape  

Specifies whether or not to apply XML style character entity escaping to the body. For a non-WML device, the characters that will be escaped are: `<`, `>', `&', and `"'. For a WML device, the characters that will be escaped, in addition to those for a non-WML device, are: "$" and "`".  

Get/Set  

from  

If present, specifies that all instances of the indicated value be replaced by the value specified by the to attribute  

Get/Set  

to  

Specifies the string with which to replace all occurrences of the string specified by the from attribute. If to is not specified, it defaults to a null string.  

Get/Set  


Example
The following is an example to truncate a mail subject line:

<util:edit id="t1">

<util:set property="truncation" value="20"/>

<util:set property="escape" value="true"/>

</util:edit>

...

<util:edit name="t1">

<mail:message>

<mail:get property="subject"/>

</mail:message>

</util:edit>

...

<mail:get property="subject" edit="t1"/>


forward


Description
This tag performs a "forward" operation, similar to <jsp:forward>, but constructs the JSP resource name in one of the following two ways:

  1. The path attribute can specify a path to be used verbatim during the construction of the URL. Client data specific rewriting will not be applied to this value.

  2. The file and comp attributes together can specify a JSP resource that will be resolved using client data driven file lookup rules.

Additionally, query string parameters can be appended to the URL by including the appropriate parm tags within the body of the forward tag. With the exception of the parm tags, all body content is discarded.

The parameters that are ultimately passed to the destination resource are the concatenation of those present in the original request, and those specified in the body of the forward tag.


Tag Body
Java Server Page


Restrictions
At least one of the attributes must be specified.


Attributes
The tag has the following attributes:


Table 6-24    ipsUtil forward Tag Attributes

Attribute

Description

Required?

file  

Specifies the file to lookup and forward  

No  

comp  

Specifies the component that the target file belongs to such as "mail", "cal" (for calendar), or "ab" (for address book)  

No  

path  

Specifies the path component of the URL. If path is specified, neither file nor comp must be specified  

No  


Example
The following is a forward tag example usage:

<util:forward file="inbox.jsp" comp="mail"/>

<util:forward file="inbox.jsp" comp="mail">

   <util:parm name="parm1">abc</util:parm>

</util:forward>


include


Description
This tag performs an "include" operation, similar to <jsp:include>, but will construct the JSP resource name in one of the following two ways:

  • The path attribute may specify a path to be used verbatim during the construction of the URL. Client data specific rewriting will not be applied to this value.

  • The file and comp attributes together can specify a JSP resource that will be resolved using client data driven file lookup rules.


Tag Body
Empty


Restrictions
At least one of the attributes must be specified.


Attributes
The tag has the following attributes:


Table 6-25    ipsUtil include Tag Attributes

Attribute

Description

Required?

file  

Specifies the file to lookup and include  

No  

comp  

Specifies the component that the target file belongs to such as "mail", "cal" (for calendar), or "ab" (for address book)  

No  

path  

Specifies the path component of the URL. If path is specified, neither file nor comp must be specified  

No  


Example
The following is an example of the include tag usage:

<util:include file="inbox-common.jsp" comp="mail"/>



iPlanet Calendar Server Client Tag Library

This tag library consists of a collection of tags that enables calendar access to any class of device that utilizes a markup style presentation system. The calendar tag libraries consists of the following tags.


context


Description
The context tag represents the state of the session to the calendar service. If no connection exists, then an authenticated session is created and the context for that session is saved for use across requests.

Pages must have this tag near the top of the page and before using any other tags in the calendar tag library.


Tag Body
Empty


Properties
The tag provides the following page properties:


Table 6-26    Calendar context Tag Properties

Property

Description

Access

events  

Indicates the list of current events. This is typically updated by the fetch tag.  

Get  

eventSize  

Indicates the size of the current event list as an integer  

Get  

event  

Indicates the specified event in the current event list as an index property  

Get  

viewDay  

Indicates the current view day. This can be set by the java server page to carry the day view across requests  

Get/Set  

viewDaySet  

Specifies whether the viewDay property is set or not  

Get  


Examples
The following is an example of the calendar context tag:

<cal:context/>


fetch


Description
This tag fetches the specified range of events into the calendar context. The range is specified using datetime tags with the id attribute. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Restrictions
Use either day or both start and end attributes to specify the range of events to fetch. If no attributes are specified, all events for the current day are retrieved.


Attributes
The tag has the following attributes:


Table 6-27    Calendar fetch Tag Attributes

Attribute

Description

Required?

day  

Specifies an entire day to retrieve  

No  

start  

Specifies the start time of the range to retrieve  

No  

end  

Specifies the end time of the range to retrieve  

No  


Examples
The following are examples of the fetch command:

Example 1: The following example fetches todays events:

<cal:fetch>

   ... fetch failed ...

</cal:fetch>

Example 2: The following example fetches events for a day:

<cal:datetime id="start"/>

   ... set start time ...

   <cal:fetch day="start">

      ... fetch failed ...

   </cal:fetch>

Example 3: The following example fetches events for a range:

<cal:datetime id="start"/>

<cal:datetime id="end"/>

   ... set start & end times ...

   <cal:fetch start="start" end="end">

      ... fetch failed ...

   </cal:fetch>


store


Description
This tag stores the specified event into the current calendar set. It can either store a new event or update an existing event. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified, then a parent event tag is used to find the event to operate on. The modifier attribute can only be used to update an existing event.


Attributes
The tag has the following attributes:


Table 6-28    Calendar store Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the event bean to store  

No  

modifier  

Specifies how to update an existing event (see Table 6-29)  

No  

The modifier attribute can accept either the string or number as follows:


Table 6-29    Modifier Attribute Values

String

Number

Description

THISINSTANCE  

0  

Modify this event instance only  

THISANDALL  

1  

Modify this and all occurrences  

THISANDFUTURE  

2  

Modify this and all future occurrences  

THISANDPRIOR  

3  

Modify this and previous occurrences  


Examples
The following are examples of the store command:

Example 1: The following example stores an event by name:

<cal:event id="event1">

   <cal:store name="event1">

      ...store failed...

   </cal:store>

</cal:event>

Example 2: The following example stores an event and all future occurrences:

<cal:event>

   <cal:store modifier="THISANDFUTURE">

      ...store failed...

   </cal:store>

</cal:event>


delete


Description
This tag deletes the specified event from the current calendar database. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified then a parent event tag is used to find the event to operate on. The modifier attribute can only be used to update an existing event.


Attributes
The tag has the following attributes:


Table 6-30    Calendar delete Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the event bean to delete  

No  

modifier  

Specifies how to modify future events (see Table 6-31)  

No  

The modifier attribute can accept either the string or number as follows:


Table 6-31    Modifier Attribute Values

String

Number

Description

THISINSTANCE  

0  

This event instance only  

THISANDALL  

1  

This and all occurrences  

THISANDFUTURE  

2  

This and all future occurrences  

THISANDPRIOR  

3  

This and previous occurrences  


Examples
The following are examples of the delete command:

Example 1: The following example deletes an event by name

<cal:event id="event1"/>

   <cal:delete name="event1">

      ...delete failed...

   </cal:delete>

</cal:event>

Example 2: The following example deletes an event and all future occurrences

<cal:event>

   <cal:delete modifier="THISANDFUTURE">

      ...delete failed...

   </cal:delete>

</cal:event>


dateformat


Description
The dateformat tag either formats a datetime (see "datetime") for output or parses one from an input. The format attribute specifies the format to use to format the output or to parse from input. If the parse attribute is specified, then that value is used as the parse string to set the specified datetime. If the parse attribute is not specified, then the datetime is formatted to the page output.


Tag Body
Java Server Page


Restrictions
If the name attribute is specified, then that datetime bean is used. Otherwise the parent datetime tag is used.


Attributes
The tag has the following attributes:


Table 6-32    Calendar dateformat Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the datetime bean to use. If the datetime bean is not specified, then it searches for a datetime parent tag  

No  

format  

Specifies the java.text.SimpleDateFormat format string to use to format or parse the datetime bean  

Yes  

parse  

Indicates the string to parse into a datetime bean using the format attribute  

No  


Properties
The tag provides the following bean properties:


Table 6-33    ipsCal dateformat Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure and CAL_001 indicates that an invalid date has been entered.  

Get  


Examples
The following are examples of the dateformat command:

Example 1: The following is an example to create a "now" datetime and output in hours and minutes:

<cal:datetime id="now">

   <cal:dateformat name="now" format="hh:mm"/>

</cal:datetime>

Example 2: The following is an example to set datetime from hours and minutes to parse string:

<cal:datetime>

   <cal:dateformat format="hh:mm" parse="10:30"/>

</cal:datetime>


dateroll


Description
The dateroll tag rolls the specified datetime (see "datetime") attribute value forward or backward. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-34    Calendar dateroll Tag Attributes

Attribute

Description

Required?

name  

Specifies the datetime bean to operate on. If the datetime bean is not specified, then it searches for a datetime parent tag.  

No  

field  

Specifies the field of the roll and by default, it is set to DATE. These correspond to fields in java.util.Calendar (see Table 6-35)  

No  

amount  

Specifies the amount of the roll. The amount of roll must be an integer value. By default, it is set to one. Note that positive values roll forward and negative values roll backward.  

No  


Table 6-35    java.util.Calendar field values

Field

Description

HOUR  

hour of the day  

HOUR_OF_DAY  

hour of the day in 24 hour clock  

MINUTE  

minute within hour  

SECOND  

second within minute  

DATE  

day of month  

DATE_OF_MONTH  

day of month  

DATE_OF_WEEK  

day of week; 0-6  

DATE_OF_YEAR  

day of year; 0-365  

MONTH  

month of year  

YEAR  

year  

WEEK_OF_MONTH  

week number in month  

WEEK_OF_YEAR  

week number in year  


Examples
The following are examples of the dateroll command:

Example 1: The following is an example to roll forward one day from today

<cal:datetime id="now"/>

<cal:dateroll name="now"/>

Example 2: The following is an example to roll forward 2 weeks

<cal:datetime id="now"/>

<cal:dateroll name="now"

amount="2" field="WEEK_OF_YEAR"/>

Example 3: The following is an example to roll back 5 hours

<cal:datetime id="now"/>

<cal:dateroll name="now"

amount="-5" field="HOUR"/>


datetime


Description
The datetime tag provides the date and time bean properties.


Tag Body
Java Server Page


Restrictions
Only one attribute must be used at a time. The datetime properties are only valid from the start tag to the end tag.


Attributes
The tag has the following attributes:


Table 6-36    Calendar datetime Tag Attributes

Attribute

Description

Required?

id  

Specifies the id of the bean to create  

No  

name  

Specifies the name of the bean to use  

No  


Properties
The tag provides the following bean properties:


Table 6-37    Calendar datetime Tag Properties

Property

Description

Access

hours  

Indicates the hour of the time in a 24 hour clock  

Get/Set  

minutes  

Indicates the minute of the time  

Get/Set  

seconds  

Indicates the second of the time  

Get/Set  

day  

Indicates the day of the date  

Get/Set  

month  

Indicates the month of the date  

Get/Set  

year  

Indicates the 4 digit year of the date  

Get/Set  


Examples
The following are examples of the datetime bean:

Example 1: The following is an example is to create a 'now' datetime at the current time

<cal:datetime id="now"/>

Example 2: The following is an example is to create a 'start' datetime with today at 10:30

<cal:datetime id="start">

   <cal:set property="hours" value="10"/>

   <cal:set property="minutes" value="30"/>

</cal:datetime>

Example 3: The following example uses an existing datetime

<cal:datetime name="now">

   Day = <cal:get property="day"/>

   Month = <cal:get property="month"/>

   Year = <cal:get property="Year"/>

</cal:datetime>


event


Description
This tag provides the event properties.


Tag Body
Java Server Page


Restrictions
Only one attribute must be used at a time. If no attributes are specified, then the current event in the parent collection is used. The event properties are only valid from the start tag to the end tag.


Attributes
The tag has the following attributes:


Table 6-38    Calendar event Tag Attributes

Attribute

Description

Required?

id  

Specifies the id of the bean to create  

No  

name  

Specifies the name of the bean to use  

No  

index  

Specifies the index into the current event list of the event bean to find  

No  


Properties
The tag provides the following bean properties:


Table 6-39    Calendar event Tag Properties

Property

Description

Access

id  

Indicates the event id in the current calendar set  

Get  

startTime  

Indicates the start time of the event  

Get/Set  

endTime  

Indicates the end time of the event  

Get/Set  

description  

Indicates the long description of the event  

Get/Set  

summary  

Indicates the short summary of the event  

Get/Set  

location  

Indicates the location of the event  

Get/Set  

allDay  

Indicates whether or not the event lasts all day  

Get/Set  

recurrence  

Indicates whether the event is part of a recurring series of events  

Get  

creationTime  

Indicates the creation time of the event; that is, the datetime  

Get  

modificationTime  

Indicates the modification time of the event; that is, the datetime  

Get  


Examples
The following are examples of the event bean:

Example 1: The following is an example to create a 'new' event

<cal:event id="new"/>

Example 2: The following is an example to create a 'new' event with a summary

<cal:event id="new">

   <cal:set property="summary" value="Event Summary"/>

</cal:event>

Example 3: The following example uses an existing event:

<cal:event name="now">

   Start = <cal:get property="startTime"/>

   End = <cal:get property="endTime"/>

   Summary = <cal:get property="summary"/>

</cal:event>

Example 4: The following example retrieves an event by id

<cal:event id="event" eventid="$(eid)">

   <cal:set property="summary" value="new summary"/>

</cal:event>

Example 5: The following example refers to a current event in the event collection:

<cal:events>

   <cal:event>

      ...

   </cal:event>

</cal:events>


events


Description
This tag refers to a collection of event beans in the calendar context. This tag iterates on its body until the collection is exhausted or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
The current event collection on the calendar context is used.


Attributes
The tag has the following attributes:


Table 6-40    Calendar events Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the entries collection to create.  

No  

name  

Specifies the name of the entries collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

Specifies iteration. It takes a boolean value and is, by default, set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-41    Calendar events Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 events)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 events)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Example
The following example enumerates through the event bean collection:

<cal:events iterate="true">

   <cal:event>

      ...

   </cal:event>

</cal:events>


get


Description
This tag gets the specified event bean property or field.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. Either property or field attribute can be used to specify what to retrieve. The id attribute specifies the name to save the retrieved property.


Attributes
The tag has the following attributes:


Table 6-42    Calendar get Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the datetime bean to use  

No  

property  

Specifies the name of the property to retrieve. If no property is specified, then the bean is retrieved as a string.  

No  

field  

Specifies the name of the java.util.Calendar field to retrieve  

No  

id  

Specifies the name to save the retrieved result as  

No  


Examples
The following are examples of the get bean:

Example 1: The following is an example to get the event summary property:

<cal:event>

   summary=<cal:get property="summary"/>

</cal:event>

Example 2: The following is an example to get the datetime HOURS field:

<cal:datetime>

   hours=<cal:get field="HOURS"/>

</cal:datetime>


set


Description
This tag sets or updates the specified event bean property or field. If the property is already successfully set, it skips the body content. Otherwise, it evaluates the body content.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. Either the property or field attribute must be used to specify what to update. Either the value or id attribute is used to specify the value of the property to update.


Attributes
The tag has the following attributes:


Table 6-43    Calendar set Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the datetime bean to use  

No  

property  

Specifies the name of the property to update  

No  

field  

Specifies the name of the java.util.Calendar field to update  

No  

value  

Specifies the value of the property to update  

No  

id  

Specifies the bean object value of the property to update  

No  


Examples
The following are examples of the set bean:

Example 1: The following is an example to set the event summary property:

<cal:event>

   <cal:set property="summary" value="new summary"/>

</cal:event>

Example 2: The following is an example to set the datetime HOURS field:

<cal:datetime>

   <cal:set field="HOURS" value="10"/>

</cal:datetime>

Example 3: The following is an example to set the event start time to a datetime bean:

<cal:datetime id="now"/>

<cal:event>

   <cal:set property="startTime" id="now"/>

</cal:event>



iPlanet Messaging Server Client Tag Library

The tags in this library enable email access to WML and cHTML clients. It consists of the following tags.


context


Description
This tag provides reference to the state of the mail service for a given session. Use of this tag without a body verifies the correct operation of the mail service.


Tag Body
Java Server Page


Properties
The tag provides the following bean properties:


Table 6-44    ipsMail context Tag Properties

Property

Description

Access

inboxNumMsgs  

Specifies the number of messages in the INBOX  

Get  

inboxNumUnreadMsgs  

Specifies the number of unread messages in the INBOX  

Get  

inboxNumNewMsgs  

Specifies the number of new messages in the INBOX  

Get  

numMsgs  

Specifies the number of messages in the current folder  

Get  

numUnreadMsgs  

Specifies the number of unread messages in the current folder  

Get  

numNewMsgs  

Specifies the number of new messages in the current folder  

Get  

signature  

Specifies the user's predefined signature  

Get  

atmsgstart  

Specifies whether or not there is a message prior to the current message  

Get  

atmsgend  

Specifies the whether or not there is a message following the current message  

Get  

nextmsgidx  

Specifies the index of the message following the message from which was fetched the current lines collection  

Get  

prevmsgidx  

Specifies the index of the message preceding the message from which was fetched the current lines collection  

Get  

presetEmpty  

Specifies whether or not the user has any predefined messages  

Get  

doMsgInclude  

Specifies whether or not to include the original message within a reply message  

Set  

includeSig  

Specifies whether or not to append the user's signature onto an outbound message  

Set  


Example
The following is an example of the context tag usage:

<mail:context/>

...

<mail:context>

   <p>Number of New Messages:<mail:get property="inboxNumNewMsgs"/>

</mail:context>


fetch


Description
The mail fetch tag builds a collection of the type specified by the collection attribute. This tag can fetch into the context a collection of:

  • Folders, which are a collection of messages from the user's inbox

  • Messages, which are a collection of lines from the user's message

  • Lines

A fetch of any given collection type creates a "current" collection of that type; for example, a fetch of a "messages" collection creates the current "messages" collection. These "current" collections are associated with the current Mail context.

A fetch of a "lines" collection assumes that id refers to a message within a "messages" collection that was fetched previously, using the same mail context.

If an error occurs during processing, the tag body is evaluated and the remainder of the page will be skipped.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-45    ipsMail fetch Tag Attributes

Attribute

Description

Required?

collection  

Identifies the type of collection to fetch  

Yes.  

id  

Identifies which collection to fetch  

If collection is:

Folders, the attribute value is ignored

Messages, the attribute identifies the folder to fetch the messages from

Lines, the attribute identifies which message to fetch  

sb  

Indicates which field to Sort By. See Table 6-46 for information on possible values for this attribute.  

If collection is:

Folders, the attribute value is ignored

Messages, the attribute identifies by which message field to sort by

Lines, the attribute value is ignored  

sd  

Specifies the Sort Direction as either upwards or downwards  

If collection is:

Folders, the attribute value can be up or down

Messages, the attribute value can be up or down

Lines, the attribute value is ignored  


Table 6-46    ipsMail sb Attribute Values

Possible Values

Description

inbox  

collection left as order of inbox  

subject  

collection sorted by the "subject" field  

from  

collection sorted by the "from" field  

date  

collection sorted by the received date  

id  

collection sorted by the message id  

seen  

collection sorted by the "seen" message flag  

recent  

collection sorted by the "recent" message flag  


Properties
The tag provides the following bean properties:


Table 6-47    ipsMail fetch Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failed error.  

Get  


Example
The following is an example of the fetch command:

<mail:context/>

...

<mail:fetch collection="messages" id="INBOX" sb="date" sd="down">

<p>Fail.

</mail:fetch>

...

<mail:fetch collection="lines" id="0">

<p>Fail.

</mail:fetch>

...

<mail:lines>

   <mail:line>

      <mail:get property="text"/>

   </mail:line>

</mail:lines>


sendmessage


Description
This tag sends or forwards an email message. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-48    ipsMail sendmessage Tag Attributes

Attribute

Description

Required?

msgname  

Indicates the name of message bean to send or forward  

Yes  

fwdindex  

Specifies the index of the message to forward  

No  

replyindex  

Specifies the index of the message to reply to  

No  


Properties
The tag provides the following bean properties:


Table 6-49    ipsMail sendmessage Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure, MAIL_001 indicates that the server was unable to send message because of invalid email address, and MAIL_002 indicates that the server was unable to send message.  

Get  


Example
The following is an example of the sendmessage command:

<mail:context/>

...

<mail:message id="foo">

   <mail:set property="to" value="$(to)"/>

   <mail:set property="subject" value="$(subject)"/>

   <mail:set property="text" value="$(text)"/>

</mail:message>

...

<mail:sendmessage msgname="foo">

   <p>Fail.

</mail:sendmessage>


deletemessage


Description
This tag deletes an email message from the current folder. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-50    ipsMail deletemessage Tag Attributes

Attribute

Description

Required?

index  

Specifies the message to delete. The index specifies an entry within the current messages collection.  

Yes  


Properties
The tag provides the following bean properties:


Table 6-51    ipsMail deletemessage Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure.  

Get  


Example
The following is an example of the deletemessage command:

<mail:context/>

...

<mail:deletemessage index="$(idx)">

   <p>Fail.

</mail:deletemessage>


folder


Description
This tag provides the folder properties. This tag refers to the current bean or folder within an enclosing collection of folders <mail:folders>. The body of this tag can contain get tags to generate the contents of the specified bean tag or current folder.


Tag Body
Java Server Page


Tag Parent
<mailPrefix:folders>


Properties
The tag provides the following bean properties:


Table 6-52    ipsMail folder Tag Properties

Property

Description

Access

name  

Indicates the name of the folder  

Get  


Example
The following is an example of the folder tag:

<mail:context/>

...

<mail:fetch collection="folders"/>

...

<mail:folders iterate="true">

   <mail:folder>

      <p>Folder Name:<mail:get property="name"/>

   </mail:folder>

</mail:folders>


folders


Description
This tag refers to a collection of folders in the mail context. This tag iterates upon its body until the collection is exhausted or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
The start and count properties must be set only when the iterate attribute is set to false.


Attributes
The tag has the following attributes:


Table 6-53    ipsMail folders Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the entries collection to create.  

No  

name  

Specifies the name of the entries collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

A boolean that selects iteration. By default, it is set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-54    ipsMail folders Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection  

Get  

count  

An integer that indicates the number of iterations that the collection must perform  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

size  

An integer that indicates the size of the collection being browsed  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Examples
The following are examples of the folders tag:

<mail:folders id="folderlist">

   <mail:set property="start" value="$(start)"/>

   <mail:set property="count" value="5"/>

</mail:folders>   

<mail:folders name="folderlist" iterate="true">

   <mail:folder>

      <p>Folder Name:<mail:get property="name"/>

   </mail:folder>

</mail:folders>


message


Description
This tag provides the message properties. It refers to the current bean or message within an enclosing collection of messages <mail:messages>. A message bean can be created and referenced by using the id or name attributes. The body of this tag can contain get or set tags to generate the contents of the specified bean tag or the current message.


Tag Body
Java Server Page


Tag Parent
<mailPrefix:messages>


Attributes
The tag has the following attributes:


Table 6-55    ipsMail message Tag Attributes

Attribute

Description

Required?

id  

Indicates the name of the bean to create  

No  

name  

Specifies the name of the bean to use  

No  


Properties
The tag provides the following bean properties:


Table 6-56    ipsMail message Tag Properties

Property

Description

Access

from  

Provides access to the full address specified in the "From:" header (for example, John Doe <jdoe@somedomain.com>).  

Get/Set  

fromAddress  

Provides access to just the address specified in the "From:" header, excluding the comment field (for example, <jdoe@somedomain.com>).  

Get  

fromPersonal  

Provides access to the comment specified in the "From:" header if there is one, excluding the actual address (for example, John Doe).  

Get  

replyTo  

Provides access to the "Reply-To:" header if the header exists. If the header does not exist, the same value as the from property is returned.  

Get  

replyToAddress  

Provides access to just the address portions of the "Reply-To:" header if the header exists. If the header does not exist, the same value as the fromAddress property is returned.  

Get  

replyToPersonal  

Provides access to just the comment portions of the "Reply-To:" header if the header exists and has a comment. If the header does not exist, the same value as the fromPersonal property is returned.  

Get  

to  

Provides access to the entire "To:" message header.  

Get/Set  

toAddress  

Provides access to just the address portions of the "To:" header.  

Get  

toAddressReply  

Provides access to just the address portions of the "To:" header, excluding any address that matches the user's.  

Get  

cc  

Provides access to the entire "Cc:" message header.  

Get/Set  

ccAddress  

Provides access to just the address portions of the "Cc:" header.  

Get  

ccAddressReply  

Provides access to just the address portions of the "Cc:" header, excluding any address that matches the sender's.  

Get  

bcc  

Identifies the blind carbon copy target.  

Get  

seen  

A boolean that indicates if the message has been seen.  

Get  

recent  

A boolean that indicates if the message is recent.  

Get  

deleted  

A boolean that indicates if the message is deleted.  

Get  

subject  

Identifies the message subject  

Get/Set  

date  

Identifies the message date  

Get/Set  

index  

Message index  

Get  

text  

Message text  

Get/Set  


Examples
The following are examples of the message tag:

<mail:context/>

...

<mail:fetch collection="messages" id="INBOX" sb="date" sd="down"/>

...

<mail:messages id="msgs">

   <mail:set property="start" value="$(start)"/>

   <mail:set property="count" value="5"/>

</mail:messages>

<mail:messages iterate="true">

   <mail:message>

      <p>Subject: <mail:get property="subject"/>

   </mail:message>

</mail:messages>


messages


Description
This tag refers to a collection of message beans in the mail context. This tag iterates upon its body until the collection is exhausted or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
The start and count properties must be set only when the iterate attribute is set to false.


Attributes
The tag has the following attributes:


Table 6-57    ipsMail messages Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the entries collection to create.  

No  

name  

Specifies the name of the entries collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

A boolean that selects iteration. By default, it is set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-58    ipsMail messages Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 messages)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Example
The following are examples of the messages tag:

<mail:context/>

...

<mail:fetch collection="messages" id="INBOX" sb="date" sd="down"/>

...

<mail:messages id="msgs">

   <mail:set property="start" value="$(start)"/>

   <mail:set property="count" value="5"/>

</mail:messages>

<mail:messages name="msgs" iterate="true">

   <mail:message>

      <p>Subject: <mail:get property="subject"/>

   </mail:message>

</mail:messages>


line


Description
This tag provides the line properties. This tag refers to the current bean or line within an enclosing collection of lines <mail:lines>. The body of this tag can contain get tag to generate output derived from the contents of the line tag.


Tag Body
Java Server Page


Tag Parent
<mailPrefix:lines>


Properties
The tag provides the following bean properties:


Table 6-59    ipsMail line Tag Properties

Property

Description

Access

text  

Refers to the current line of text  

Get  


Example
The following is an example of the line tag:

<mail:context/>

...

<mail:fetch collection="lines" id="$(msgidx)"/>

...

<mail:lines id="list">

   <mail:set property="start" value="$(start)"/>

   <mail:set property="count" value="5"/>

</mail:lines>

<mail:lines iterate="true">

   <mail:line>

      <mail:get property="text"/>

   </mail:line>

</mail:lines>


lines


Description
This tag refers to a collection of line beans. This tag iterates upon its body until the collection is exhausted or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
The start and count properties must be set only when the iterate attribute is set to false.


Attributes
The tag has the following attributes:


Table 6-60    ipsMail lines Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the entries collection to create.  

No  

name  

Specifies the name of the entries collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

A boolean that selects iteration. By default, it is set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-61    ipsMail lines Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 lines)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 lines)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Examples
The following are examples of the lines tag:

<mail:context/>

...

<mail:fetch collection="lines" id="$(msgidx)"/>

...

<mail:lines id="list">

   <mail:set property="start" value="$(start)"/>

   <mail:set property="count" value="5"/>

</mail:lines>

<mail:lines name="list" iterate="true">

   <mail:line>

      <mail:get property="text"/>

   </mail:line>

</mail:lines>


presetmsg


Description
This tag refers to a preset message from a collection of preset messages. It provides access to the properties of the current message from the preset messages collection.


Tag Body
Java Server Page


Restrictions
The presetmsg tag can only be used with the presetmsgs collection tag to provide access to the current preset message in the collection.


Properties
The tag provides the following bean properties:


Table 6-62    ipsMail presetmsg Tag Properties

Property

Description

Access

msg  

Refers to the text of the preset message.  

Get  

number  

Refers to the number of the preset message  

Get  


Example
The following is an example of the presetmsg bean:

<mail:presetmsgs iterate="true">

   <mail:presetmsg>

      preset msg text = <mail:get property="msg"/>

   </mail:presetmsg>

</mail:presetmsgs>


presetmsgs


Description
This tag refers to a collection of preset messages. It provides access to the collection of preset messages. The tag body is evaluated once for each item in the collection or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
Use the presetmsg tag to access a preset message from the collection. The start and count properties must be set only when the iterate attribute is set to false.


Attributes
The tag has the following attributes:


Table 6-63    ipsMail presetmsgs Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the presetmsgs collection to create.  

No  

name  

Specifies the name of the presetmsgs collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

A boolean that selects iteration. By default, it is set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-64    ipsMail presetmsgs Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 1 to 9 messages)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 1 to 9 messages)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Example
The following is an example of the presetmsgs collection:

<mail:presetmsgs iterate="true">

   <mail:presetmsg>

      preset msg text = <mail:get property="msg"/>

   </mail:presetmsg>

</mail:presetmsgs>


get


Description
This tag retrieves the specified property and writes its value to the page output.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute must be used to specify what to retrieve. If the property attribute is not specified, then the bean object itself is retrieved as a string. The id attribute specifies the name to save the retrieved property. If the eval attribute is specified, then the value of the attribute is evaluated and written to the page output.


Attributes
The tag has the following attributes:


Table 6-65    ipsMail get Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to retrieve. If not specified, then the bean itself is retrieved as a string.  

Yes  

id  

Specifies the name to save the retrieved value as  

No  

eval  

Indicates the attribute to evaluate and write to page output  

No  

edit  

Specifies the edit bean that will be applied to the returned value  

No  


Example
The following is an example to get the subject property:

<mail:message>

   <mail:get property="subject"/>

</mail:message>


set


Description
This tag updates the specified property.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute specifies what to update. The value attribute specifies the string value to update the property. The id specifies the bean object value to update the property. Either value or id must be specified.


Attributes
The tag has the following attributes:


Table 6-66    ipsMail set Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to update  

Yes  

value  

Specifies the string value of the property to update  

No  

id  

Specifies the bean object value of the property to update  

No  

edit  

Specifies the edit bean that will be applied to the value prior to storage  

No  


Example
The following is an example to set the message subject property:

<mail:message>

   <mail:set property="subject" value="new subject"/>

</mail:message>



Personal Address Book Client Tag Library

This address book tag library consists of a collection of tags that enables address book access to WML and cHTML clients. The address book tag library consists of the following tags:


context


Description
This tag is used to maintain address book state between requests. It must appear before all other tags within the ipsAb tag library.


Tag Body
Java Server Page or Empty


Properties
The tag provides the following bean properties:


Table 6-67    ipsAb context Tag Properties

Property

Description

Access

numEntries  

Specifies the number of entries in the address book  

Get  

entriesEmpty  

Specifies whether or not the address book is empty  

Get  


Example
The following is an example of the context tag usage:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:fetch any="$(any)" ln="$(ln)" fn="$(fn)" bp="$(bp)" em="$(em)" hp="$(hp)" fp="$(fp)" mp="$(mp)" pp="$(pp)" sb="ln" sd="up">

Error in Looking up address book.

</ab:fetch>

Number of Address Book entries:

<ab:context>

   <ab:get property="numEntries"/>

</ab:context>


fetch


Description
The fetch tag sets the current collection within the current address book context. If no attributes (see Table 6-68) are specified, the entire address book is returned within the collection. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.

All of the search attributes support simple wildcard expressions, using the '*' character. If the wildcard is not specified, the '*' character is prepended and appended to the search expression to yield a search pattern that produces results that match any entry that at least contains the requested string.


Tag Body
Java Server Page


Restrictions
Only sb and sd attributes can be used with the any attribute.


Attributes
The tag has the following attributes:


Table 6-68    ipsAB fetch Tag Attributes

Attribute

Description

Required?

sb  

Sort By attribute specifies how to sort the address book entries  

No  

sd  

Sort Direction attribute specifies WHAT DIRECTION?  

No  

fn  

First Name attribute indicates that search must be performed by first name  

No  

ln  

Last Name attribute indicates that the search must be performed by last name  

No  

em  

Email Address attribute indicates that the search must be performed by email address  

No  

bp  

Business Phone attribute indicates that the search must be performed by business phone number  

No  

hp  

Home Phone attribute indicates that the search must be performed by home phone number  

No  

fp  

Fax Phone attribute indicates that the search must be performed by fax phone number  

No  

mp  

Mobile Phone attribute indicates that the search must be performed by mobile phone number  

No  

pp  

Pager Phone attribute indicates that the search must be performed by pager phone number  

No  

any  

This attribute indicates that all the fields must be searched for any match  

No  


Properties
The tag provides the following bean properties:


Table 6-69    ipsAb fetch Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure.  

Get  


Example
The following is an example of the fetch command:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:fetch ln="$(ln)" fn="$(fn)" bp="$(bp)" em="$(em)" hp="$(

hp)" fp="$(fp)" mp="$(mp)" pp="$(pp)" sb="ln" sd="up">

   Error in Looking up address book.

</ab:fetch>


add


Description
The add tag adds an entry to the address book. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Attributes
The tag has the following attributes:


Table 6-70    ipsAb add Tag attributes

Attribute

Description

Required?

name  

Indicates the name of the address book entry bean to add and store  

Yes  


Properties
The tag provides the following bean properties:


Table 6-71    ipsAb add Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure and AB_001 indicates that the add command failed because last name was not entered.  

Get  


Example
The following is an example of the add command:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:entry id="addentry">

   <ab:set property="fn" value="$(fn)"/>

   <ab:set property="ln" value="$(ln)"/>

   <ab:set property="em" value="$(em)"/>

</ab:entry>

<ab:add name="addentry">

   Problem adding Entry

</ab:add>

   Entry added successfully


delete


Description
The delete tag deletes an address book entry. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Restrictions
This tag must be used before a fetch or collection tag.


Attributes
The tag has the following attributes:


Table 6-72    ipsAb delete Tag Attributes

Attribute

Description

Required?

entryid  

Specifies the address book entry to delete  

Yes  


Properties
The tag provides the following bean properties:


Table 6-73    ipsAb delete Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure.  

Get  


Example
The following is an example of the delete command:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:delete entryid="$(entryid)">

   Problem deleting Entry

</ab:delete>

   Entry deleted successfully


modify


Description
The modify tag modifies an address book entry. If an error occurs during processing, the tag body is evaluated and the remainder of the page is skipped.


Tag Body
Java Server Page


Restrictions
This tag must be used before a fetch or collection tag.


Attributes
The tag has the following attributes:


Table 6-74    ipsAb modify Tag Attributes

Attribute

Description

Required?

name  

Indicates the name of the address book entry bean that requires the modifications.  

Yes  

entryid  

Specifies the address book entry to modify.  

Yes  


Properties
The tag provides the following bean properties:


Table 6-75    ipsAb modify Tag Properties

Property

Description

Access

errorCode  

Indicates the error code in case the execution of the tag fails. An empty error code indicates a generic tag execution failure and AB_001 indicates that the modification failed because last name was not entered.  

Get  


Example
The following is an example of the modify command:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:entry id="modentry">

   <ab:set property="fn" value="$(fn)"/>

   <ab:set property="ln" value="$(ln)"/>

   <ab:set property="em" value="$(em)"/>

</ab:entry>

<ab:modify name="modentry" entryid="$(entryid)">

   Problem modifying Entry

</ab:modify>

   Entry modified successfully


entry


Description
This tag provides the properties for an address book entry. This tag refers to an address book entry within a collection of address book entries <ab:entries>. The body of this tag can contain get or set tags to generate the contents of the specified bean tag or entry.


Tag Body
Java Server Page


Tag Parent
<abPrefix: entries>


Restrictions
Only one attribute must be used at a time. If no attributes are specified, then the current entry in the parent collection is used.


Attributes
The tag has the following attributes:


Table 6-76    ipsAb entry Tag Attributes

Attribute

Description

Required?

id  

Specifies the id of the bean or entry to create  

No  

name  

Specifies the name of the bean or entry to use  

No  

entryid  

Specifies the address book entry id to use  

No  


Properties
The tag provides the following bean properties:


Table 6-77    ipsAb entry Tag Properties

Property

Description

Access

fn  

Refers to the first name  

Get/Set  

ln  

Refers to the last name  

Get/Set  

em  

Refers to the email address  

Get/Set  

bp  

Refers to the business phone  

Get/Set  

hp  

Refers to the home phone  

Get/Set  

fp  

Refers to the fax phone  

Get/Set  

mp  

Refers to the mobile phone  

Get/Set  

pp  

Refers to the pager phone  

Get/Set  

entryid  

Refers to the id of an address book entry  

Get/Set  


Examples
The following are examples of the entry bean:

Example 1: The following is an example of the current entry in the entries collection:

<ab:context>

   <ab:get property="numEntries"/>

</ab:context>

<ab:entries iterate="true">

   <ab:entry>

      Entry Id: <ab:get property="entryid"/>

      First Name: <ab:get property="fn"/>

      Last Name: <ab:get property="ln"/>

      Email: <ab:get property="em"/>

   </ab:entry>

</ab:entries>

Example 2: The following example retrieves an entry by entryid:

<ab:entries iterate="true">

   <ab:entry entryid="$(entryid)">

      First Name: <ab:get property="fn"/>

      Last Name: <ab:get property="ln"/>

      Email: <ab:get property="em"/>

   </ab:entry>

</ab:entries>


entries


Description
This tag refers to a collection of address book entries or beans in the address book context. This tag iterates upon its body until the collection is exhausted or as constrained by the start and count properties.


Tag Body
Java Server Page


Restrictions
The Address Book fetch command must be sent before invoking this tag. The start and count properties must be set only when the iterate attribute is set to false.


Attributes
The tag has the following attributes:


Table 6-78    ipsAb entries Tag Attributes

Attribute

Description

Required?

id  

Specifies the name of the entries collection to create.  

No  

name  

Specifies the name of the entries collection to use.  

No  

beanid  

In iterative mode, stores the "current" bean from the collection onto the page context using the name specified by this attribute  

No  

iterate  

A boolean that selects iteration. By default, it is set to false and the collection will not iterate.  

No  


Properties
The tag provides the following bean properties:


Table 6-79    ipsAb entries Tag Properties

Property

Description

Access

index  

An integer that indicates the index of the current bean in the collection.  

Get  

count  

An integer that indicates the number of iterations that the collection must perform.  

Get/Set  

start  

An integer that indicates the zero based index from which to begin the iteration.  

Get/Set  

end  

An integer that indicates the zero based index that denotes the item upon which the iteration will terminate.  

Get  

startOne  

Used to indicate the beginning of range of the current collection that is displayed (such as 10 to 20 entries)  

Get  

endOne  

Used to indicate the end of the range of the current collection that is displayed (such as 10 to 20 entries)  

Get  

size  

An integer that indicates the size of the collection being browsed.  

Get  

nextPage  

A boolean that indicates whether or not there are more items in the collection beyond the current iterations.  

Get  

prevPage  

A boolean that indicates whether or not there are items in the collection preceding the current iterations.  

Get  


Example
The following is an example of the entries tag:

<ab:context>

   <ab:get property="numEntries"/>

</ab:context>

<ab:entries iterate="true">

   <ab:entry>

      Entry Id: <ab:get property="entryid"/>

      First Name: <ab:get property="fn"/>

      Last Name: <ab:get property="ln"/>

      Email: <ab:get property="em"/>

   </ab:entry>

</ab:entries>


get


Description
This tag retrieves the specified bean property.


Tag Body
Empty


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute must be used to specify what to retrieve. If the property to retrieve is not specified, then the bean object itself is retrieved as a string. The id attribute specifies the name to save the retrieved property as. If the eval attribute is specified, then the value of the attribute is evaluated and written to the page output.


Attributes
The tag has the following attributes:


Table 6-80    ipsAb get Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to retrieve  

Yes  

id  

Specifies the name to save the retrieved value as  

No  

eval  

Specifies the attribute to evaluate and write to page output  

No  

edit  

Specifies the edit bean that will be applied to the returned value  

No  


Examples
The following is an example of the get bean:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

<ab:fetch ln="$(ln)" fn="$(fn)" bp="$(bp)" em="$(em)" hp="$(

hp)" fp="$(fp)" mp="$(mp)" pp="$(pp)" sb="ln" sd="up">

   Error in Looking up address book.

</ab:fetch>

Number of Address Book entries:

<ab:context>

   <ab:get property="numEntries"/>

</ab:context>

<ab:entries>

   <ab:entry>

      Entry Id: <ab:get property="entryid"/>

      First Name: <ab:get property="fn"/>

      Last Name: <ab:get property="ln"/>

      Email: <ab:get property="em"/>

   </ab:entry>

</ab:entries>


set


Description
This tag sets a bean property or updates the specified bean property.


Tag Body
Java Server Page


Restrictions
If the name attribute is not specified, then it uses a parent bean tag to locate the bean on which to operate. The property attribute specifies what to update. The value attribute specifies the string value to update the property with. The id attribute specifies the bean object value to update the property with. Either value or id attribute must be specified.


Attributes
The tag has the following attributes:


Table 6-81    ipsAb set Tag Attributes

Attribute

Description

Required?

name  

Specifies the name of the bean to use  

No  

property  

Specifies the name of the property to set or update  

Yes  

value  

Specifies the string value of the property to set or update  

No  

id  

Specifies the bean object value of the property to update  

No  

edit  

Specifies the edit bean that will be applied to value prior to storage  

No  


Examples
The following is an example of the set bean:

<%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %>

<ab:context/>

   <ab:entry id="addentry">

      <ab:set property="fn" value="$(fn)"/>

      <ab:set property="ln" value="$(ln)"/>

      <ab:set property="em" value="$(em)"/>

   </ab:entry>

   <ab:add name="addentry">

      Problem saving Entry

   </ab:add>

      Entry saved successfully


Previous     Contents     Index     Next     
Copyright © 2001 Sun Microsystems, Inc. All rights reserved.

Last Updated November 14, 2001