This chapter describes the Tag Library Address Book. This tag library implements a collection of tags that enable address book access to any class of device that utilizes a markup style presentation system.
The Address Book Tag Libraries consists of the following tags:
Adds an address book entry. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.
JSP
n/a
n/a
This tag has a single attribute for which the value of the Required section is Yes:
Name of a contact or group bean which has been previously stored on the page context.
n/a
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:entry id="addentry"> <ab:set property="fn" value="$(fn)"/><br> <ab:set property="ln" value="$(ln)"/><br> <ab:set property="em" value="$(em)"/><br> </ab:entry> <ab:add name="addentry"> Problem adding Entry </ab:add> Entry added successfully <ab:fetch> 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>
Sets the list of members in a group bean. If the resulting group bean is later used in conjunction with the <ab:modify> tag, the specified group's contents are augmented by those of the group bean.
JSP or Empty
n/a
n/a
This tag has the following attributes, which are all not required:
The name of the group bean, stored on the page context, in which a list of members is being set.
The name of the edit bean, whose actions will be applied to the value specified in the members attribute.
A comma separated list of entry ids, taken from the memberchoices collection.
n/a
n/a
This tag denotes a reference to the current contact bean within an enclosing collection tag, for example, <ab:contacts>. The body of this tag may contain get or set tags that will generate output derived from the contents of this bean tag.
JSP
<abPrefix:contacts>
Only one of id, name, or entryid should be used at a time. If no attributes are specified, the current entry in the parent collection is used.
This tag has the following attributes, which are not required:
Specifies the bean id of the bean to create.
Specifies the bean id of the bean to use.
Specifies the address book entry id to use.
This tag provides the following bean properties, which have the Type, String and Access, Get/Set:
First name.
last name.
Email address.
Business phone.
Home phone.
Fax phone.
Mobile phone.
Pager phone.
Id of address book entry.
Type of entry bean. May be contact or group.
<%-- Example 1 Current contact in the contacts collection --%> <%@ page errorPage="/jsp/errorpage.jsp" %> <%@ 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:contacts iterate="true"> <ab:contact> Entry Id: <ab:get property="entryid"/> First Name: <ab:get property="fn"/> Last Name: <ab:get property="ln"/> Email: <ab:get property="em"/> </ab:contact> </ab:contacts> <%-- Example 2 Retrieve a contact by entryid --%> <ab:contact entryid="$(entryid)"> First Name: <ab:get property="fn"/> Last Name: <ab:get property="ln"/> Email: <ab:get property="em"/> </ab:contact>
This tag denotes a reference to the "contacts" collection, as constructed by an appropriate fetch tag. This tag will iterate upon its body until the collection is exhausted, or as constrained by the start and count properties. The start and count properties should only be set when the iterate attribute is set to "false".
JSP
n/a
Address Book fetch should have happened prior to the invocation of this tag.
This tag has the following attributes, which are not required:
Name of the contacts collection to create.
Name of the contacts collection to use.
A boolean that selects iteration. Default is "false"; the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
This tag provides the following bean properties, which have the Type as Integer and Access as Get. The count and start attributes has Access as Get/Set:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero based index from which to begin iteration.
The zero based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:fetch collection="contacts" elementType="all" groupid="${gid}"> Error in Looking up address book. </ab:fetch> Number of Address Book entries: <ab:contacts iterate="true"> <ab:contact> Name: <ab:get property="cn"/> </ab:contact> /ab:contacts>
context | ||
Description |
Ensures that an address book context is present within the current pageContext. This tag must appear, at least once, before all other tags within the AddressBook taglib. If config is not specified, then a search for a useable configuration name is performed in the following fashion: Attempt to retrieve the current addressbook configuration name from the page context. If that succeeds, use it. If the retrieval fails... Attempt to retrieve the current addressbook configuration name from the session. If that succeeds, store it on the page context and use it. If the retrieval fails... From the list of all SSOAdapter configuration names, try to find the first useable addressbook configuration name. If that succeeds, store it in the session and page context and use it. If it is not possible to find a useable addressbook configuration name, the context tag will fail. Once a configuration name has been determined, an attempt is made to acquire an appropriate addressbook context object. This is done in the following fashion: Attempt to retrieve an addressbook context from the page context, and verify that it matches the configuration (using the previously acquired configuration name). If that succeeds, use it. If that fails... Attempt to retrieve an addressbook context from the user's cache of addressbook contexts. If that succeeds, store it on the page context and use it. If the retrieval fails... Create an SSOAdapter object using the previously acquired configuration name. Create an addressbook context, and bind it with the SSOAdapter object. Store the addressbook context in the context cache as well as the page context. This way, if an addressbook context has been previously referenced on a page, or within the session, then the config attribute may be omitted, and the most recently referenced context will be retrieved. | |
Tag Body |
JSP or Empty | |
Tag Parent |
n/a | |
Restrictions |
n/a | |
Attributes |
This tag has the following attributes: |
No |
Property |
Description |
Type |
Access |
errorCode |
Returns error status of a failed command tag. Empty error code indicates a generic tag execution failed error. AB_001 - Add/Modify failed because last name not entered. |
String |
|
numEntries |
Number of items in the entries collection. |
Integer |
Get |
entriesEmpty |
Whether or not the entries collection is empty. |
Boolean |
Get |
numGroupmembers |
Number of items in the groupmembers collection. |
Integer |
Get |
groupmembersEmpty |
Whether or not the groupmembers collection is empty. |
Boolean |
Get |
numMemberchoices |
Number of items in the memberchoices collection. |
Integer |
Get |
memberchoicesEmpty |
Whether or not the memberchoices collection is empty. |
Boolean |
Get |
numContacts |
Number of items in the contacts collection. |
Integer |
Get |
contactsEmpty |
Whether or not the contacts collection is empty. |
Boolean |
Get |
Deletes an address book entry. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.
JSP
n/a
n/a
This tag has a single attribute for which the value of Required field is Yes:
The id of an entry bean within the entries collection.
n/a
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:delete entryid="$(entryid)"> Problem deleting Entry </ab:delete> Entry deleted successfully <ab:fetch> 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>
Deletes entries from a specified group.
JSP or Empty
n/a
n/a
This tag has the following attributes in which the Required value for groupid is Yes:
The id of a group bean within the entries collection.
The name of the edit bean, whose actions will be applied to the value specified in the members attribute.
A comma separated list of entry ids, taken from the groupmembers collection.
n/a
n/a
This tag denotes a reference to the "entries" collection, as constructed by an appropriate fetch tag. This tag will iterate upon its body until the collection is exhausted, or as constrained by the start and count properties. The start and count properties should only be set when the iterate attribute is set to "false". This collection is typically used to contain the entries from the top level of an addressbook, which may contain contacts and groups.
JSP
n/a
Address Book fetch should have happened prior to the invocation of this tag.
This tag has the following attributes for which the required values are No:
Name of the entries collection to create.
Name of the entries collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
This tag provides the following bean properties, which has Integer value for Type and Get/Set for Access:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero-based index from which to begin iteration.
The zero-based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ 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 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>
This tag denotes a reference to the current entry bean within an enclosing collection tag. For example, <ab:entries>. The body of this tag may contain get/set tags that generates output derived from the contents of this bean tag.
JSP
<abPrefix:entries>
Only one of the id, name, or the entryid should be used at a time. If no attributes are specified then the current entry in the parent collection is used.
This tag has the following attributes for which the Required value is “No”:
Specifies the bean id of the bean to create.
Specifies the bean id of the bean to use.
Specifies the address book entry id to use.
When used in conjunction with id, specifies what type of entry bean to create. It can be "contact" or "group".
The tag provides the following bean properties for which the Defined for Enter Type is “Contact”, Type is “String”, and Access is “Get/Set”:
First name.
Last name.
Email address.
Business phone.
Home phone.
Fax phone.
Mobile phone.
Pager phone.
Entry CN.
id of address book entry.
Type of entry bean. It can be "contact" or "group".
<%-- Example 1 Current entry in the entries collection --%> <%@ page errorPage="/jsp/errorpage.jsp" %> <%@ 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 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 Retrieve an entry by entryid --%> <ab:entry entryid="$(entryid)"> First Name: <ab:get property="fn"/> Last Name: <ab:get property="ln"/> Email: <ab:get property="em"/> </ab:entry>
The fetch tag loads the specified collection within the current addressbook context. If no attributes are specified, the entire addressbook will be returned within the entries collection. All of the search attributes support simple wildcard expressions, using the '*' character. If no wildcard is specified, the '*' character is prepended and appended to the search expression, thus yielding a search pattern that produces results matching any entry that at least contains the requested string. If an error occurs during processing, the tag body will be evaluated, and the remainder of the page will be skipped.
JSP
n/a
If the fetch tag uses the 'any' attribute, then no other attribute other than 'sb' and 'sd' can be used.
This tag has the following attributes for which the Required value is “No”:
"Sort By" attribute. Can have the search attribute names, for example 'ln' etc. as values, except for 'any'.
"Sort Direction" attribute. Can have values - 'up', 'down'.
Search for "First Name"
Search for "Last Name"
Search for "Email Address"
Search for "Business Phone"
Search for "Home Phone"
Search for "Fax Phone"
Search for "Mobile Phone"
Search for "Pager Phone"
Search all fields for any match.
Specifies the type of element (entry) to fetch. May be "contact", "group", or "all". Default is "contact".
The id of a group bean within the entries collection that identifies from which group entries are to be fetched.
Specifies to which collection the results of this fetch operation should be stored. May be "contacts", "groupmembers", "memberchoices", or "entries". Default is "entries". If "contacts" is specified, groups are expanded to their constituent contacts.
A boolean that indicates the following: when false, implicitly append and prepend a "*" to the search patterns. When true, use the pattern explicitly specified. Default is "false".
n/a
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ 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>
The get tag retrieves the specified property. This tag operates exactly like the <util:get> tag and is imported into the ab taglib for convenience. See the util:get tag description for usage details.
util:get
util:get
util:get
util:get
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ 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>
This tag denotes a reference to the current groupmember bean within an enclosing collection tag. For example, <ab:groupmembers>. The body of this tag may contain get/set tags that will generate output derived from the contents of this bean tag.
JSP
<abPrefix:groupmembers>
Only one of the id, name, or the entryid should be used at a time. If no attributes are specified then the current entry in the parent collection is used.
The tag has the following attributes for which the Required value is “No”:
Specifies the bean id of the bean to create.
Specifies the bean id of the bean to use.
Specifies the address book entry id to use.
<abPrefix:entry>
<%-- Example 1 Current groupmember in the groupmembers collection --%> <%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:fetch collection="groupmembers", groupid="$(gid)"> Error in Looking up address book. </ab:fetch> Number of Address Book entries: <ab:context> <ab:get property="numGroupmembers"/> </ab:context> <ab:groupmembers iterate="true"> <ab:groupmember> Entry Id: <ab:get property="entryid"/> First Name: <ab:get property="fn"/> Last Name: <ab:get property="ln"/> Email: <ab:get property="em"/> </ab:groupmember> </ab:groupmembers>
This tag denotes a reference to the groupmembers collection, as constructed by an appropriate fetch tag. This tag will iterate upon its body until the collection is exhausted, or as constrained by the start and count properties. The start and count properties should only be set when the iterate attribute is set to "false".
JSP
n/a
Address Book fetch should have happened prior to the invocation of this tag.
The tag has the following attributes for which the Required value is “No”:
Name of the groupmembers collection to create.
Name of the groupmembers collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
The tag provides the following bean properties for which the Type value is “Integer” and the Access value is “Get/Set”:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero-based index from which to begin iteration.
The zero-based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:fetch collection="groupmembers" elementType="all" groupid="$(gid)"> Error in Looking up address book. </ab:fetch> Number of Address Book entries: <ab:groupmembers iterate="true"> <ab:groupmember> Name: <ab:get property="cn"/> </ab:groupmember> </ab:groupmembers>
This tag denotes a reference to the current memberchoice bean within an enclosing collection tag. For example, <ab:memberchoices>. The body of this tag may contain get/set tags that will generate output derived from the contents of this bean tag.
JSP
<abPrefix:memberchoices>
Only one of id, name, or entryid should be used at a time. If no attributes are specified, the current entry in the parent collection is used.
This tag has the following attributes for which the Required value is “No”:
Specifies the bean id of the bean to create.
Specifies the bean id of the bean to use.
Specifies the address book entry id to use.
<abPrefix:entry>
<%-- Example 1 Current entry in the entries collection --%> <%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:fetch collection="memberchoices"> Error in Looking up address book. </ab:fetch> Number of Address Book entries: <ab:context> <ab:get property="numMemberchoices"/> </ab:context> <ab:memberchoices iterate="true"> <ab:memberchoice> Entry Id: <ab:get property="entryid"/> First Name: <ab:get property="fn"/> Last Name: <ab:get property="ln"/> Email: <ab:get property="em"/> </ab:memberchoice> </ab:memberchoices>
This tag denotes a reference to the memberchoices collection, as constructed by an appropriate fetch tag. This tag will iterate upon its body until the collection is exhausted, or as constrained by the start and count properties. The start and count properties should only be set when the iterate attribute is set to "false".
JSP
n/a
Address Book fetch should have happened prior to the invocation of this tag.
This tag has the following attributes for which the Required value is “No”:
Name of the memberchoices collection to create.
Name of the memberchoices collection to use.
A boolean that selects iteration. Default is "false", the collection will not iterate.
During iteration, specifies a name by which the current bean may be retrieved from the PageContext.
This tag provides the following bean properties for which the Type values are “Integer” and “Boolean”, and the Access values are “Get/Set”:
Index of the current bean in the collection.
The number of iterations the collection should perform.
The zero-based index from which to begin iteration.
The zero-based index that denotes the item upon which iteration will terminate.
One-based start; suitable for presentation.
One-based end; suitable for presentation.
The size of the collection being paged.
Whether or not there are more items in the collection, beyond the current iterations.
Whether there are items in the collection preceding the current iterations.
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:fetch collection="memberchoices" elementType="all" groupid="$(gid)"> Error in Looking up address book. </ab:fetch> Number of Address Book entries: <ab:memberchoices iterate="true"> <ab:memberchoice> Name: <ab:get property="cn"/> </ab:memberchoice> </ab:memberchoices>
Modifies an address book entry. If an error occurs during processing, the tag body will be evaluated and the remainder of the page will be skipped.
JSP
n/a
The use of this tag should precede any use of a "fetch" or "collection" tag.
This tag has the following attributes for which the Required value is “Yes”:
Name of the entry bean, stored on the page context, that contains the modifications.
The id of an entry bean (within the entries collection) identifying which address book entry is to be modified.
n/a
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:entry id="modentry"> <ab:set property="fn" value="$(fn)"/><br> <ab:set property="em" value="$(em)"/><br> <ab:set property="ln" value="$(ln)"/><br> </ab:entry> <ab:modify name="modentry" entryid="$(entryid)"> Problem modifying Entry </ab:modify> Entry modified successfully <ab:fetch> 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>
The set tag updates the specified property. This tag operates exactly like the <util:set> tag and is imported into the ab taglib for convenience. See the util:set tag description for usage details.
util:set
util:set
util:set
util:set
<%@ page errorPage="/jsp/errorpage.jsp" %> <%@ taglib uri="/taglibs/ips_taglib_ab.jar" prefix="ab" %> <ab:context/> <ab:entry id="addentry"> <ab:set property="fn" value="$(fn)"/><br> <ab:set property="ln" value="$(ln)"/><br> <ab:set property="em" value="$(em)"/><br> </ab:entry> <ab:add name="addentry"> Problem saving Entry </ab:add> Entry saved successfully <ab:fetch> 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:entries>
Sets the list of members in a group bean. If the resulting group bean is later used in conjunction with the <ab:modify> tag, the specified group's contents are replaced by those of the group bean.
JSP or Empty
n/a
n/a
This tag has the following attributes for which the Required value is “No”:
The name of the group bean, stored on the page context, in which a list of members is being set.
The name of the edit bean, whose actions will be applied to the value specified in the members attribute.
A comma separated list of entry ids, taken from the memberchoices collection.
n/a
n/a