<<

. 40
( 87 .)



>>

The XML ¬le can also specify exposed ¬lters, custom queries, and recur-
sive queries. Filters are used to limit the results given. For example, the de-
fault XML ¬le includes a ¬lter objectclass=person to ensure that only
person records are retrieved. Custom queries are used to de¬ne queries
that look at more than one attribute, for example searching in several name
¬elds. Recursive queries allow traversing the directory recursively. In the
sample XML ¬le there is a query ReportsTo which recursively searches
for the managers of a speci¬c person.
Once the LDAP connection is con¬gured, it is possible to use the People
Finder portlet, by adding it to any page, as shown in Figure 12-7.
The People Finder portlet is customizable in several ways. To con¬gure it
click the wrench button on the portlet title bar. The con¬guration window
is shown in Figure 12-8.
In Configuration Basics you can connect the People Finder portlet
to connect the portlet to the LDAP directory by selecting one of the loaded
XML con¬guration ¬les, and to invoke the Directory Connector application.
You can also choose what ¬elds to display and for each such ¬eld its display
format (for example, as a mailto link for mail addresses or as a Web page
link for home pages).
In Shared Elements you can customize the business card display used
by the People Finder portlet, as well as de¬ne sections where informa-
tion shall be placed. Sections apply to both the Person Record and Advan-
ced Search. Default sections are Contact Information, Current Job,
and Background, and of course you can add, rename, or remove sec-
tions.
Person Record allows you to customize the Person Record display and
the Organizational View. You can rearrange the ¬elds, and place ¬elds in
the various sections de¬ned.
The Quick Search and Advanced Search entries allow you to cus-
tomize the search options, by choosing the ¬elds available and the output
¬elds.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




232 Chapter 12




Figure 12-8 People Finder portlet con¬guration.


Collaborative Components
In addition to the out-of-the-box collaboration provided by the portlets
described here, WebSphere Portal Server includes the Lotus Collaboration
Components. These components are a set of Java APIs and taglibs for inte-
grating the functionality of Lotus products into portlets. The Lotus products
supported are Lotus Domino, Lotus Sametime, Lotus QuickPlace, and Lo-
tus Discovery Server.
In contrast to the previous sections, the current one requires some basic
understanding of JSP. In addition, to actually make use of the Collaborative
Components, you need to develop and deploy portlets, which you will
learn later in this book.
The Collaborative Components Java APIs are packaged in the ¬le cs.jar,
whereas the taglibs available are people.tld for people awareness and
menu.tld for contextual menus.
The entry point to the Lotus Collaborative Components is the class
CSEnvironment. To start using the Collaborative Components from within
a JSP scriptlet, you need the following two lines of code.

CSEnvironment env = CSEnvironment.getEnvironment(request);
CSCredentials cred = env.getCredentials(request);

The ¬rst line initializes the Collaborative Components and sets the cre-
dentials for the currently logged-in user. The second line retrieves these
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




Adding Collaboration and Search Components to Your Portals 233


credentials. The credentials are used to instantiate service objects. The fol-
lowing are the service objects available:
Domino Service”Provides access to Domino databases
DiscoverServer Service”Retrieves data from the Lotus Discovery
Server
PeopleService”Provides access to information about a person
(aggregates information from Domino Service and DiscoveryServer
service)
Calendar Service
QP Service”Provides access to QuickPlace places
Service objects are instantiated using the object CSFactory. For example,
the following line of code instantiates a Domino Service.
DominoService ds = (DominoService)
CSFactory.getService(cred, CSFactory.DOMINO_SERVICE);

In this case the Domino Directory server is speci¬ed in the CSEnviron-
ment.properties ¬le, located in the Appserver\lib\config directory
under your Application Server installation root. It is also possible (though
not advised) to use the getService method with a hard-coded server
name and protocol.
Given a DominoService instance you can access Domino databases
through views. For example, the following line of code retrieves a full view
of a Lotus Domino address book called names.nsf.
ViewInfo vi = ds.getViewInfo("names.nsf", "($all)");

With the ViewInfo at hand, we can generate a list of names in the view.
A typical use of names would be to provide people awareness. In other
words, allow portal users to see whether other users are online and to
interact with such users. To that end, the Collaborative Components provide
the people.tld taglib. This taglib introduces the peopleservice tag.
When you use this tag, a link menu is generated, allowing users to interact
with the speci¬c user.
The following piece of code combines the information extracted from the
ViewInfo with the peopleservice tag to generate a list of names that
can be clicked to initiate contact with the respective person. For simplicity,
we retrieve only the ¬rst 10 names out of the address book.
<%
RowInfo[] ri = vi.getRowInfo("1", 10);
int i;
String values[];
String name;
for (i = 0; i < ri.length; i++) {
values = ri[i].getValues();
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




234 Chapter 12


name = values[0];
%>
<br><peopleservice:person><%=name%></peopleservice:person>
<%
}
%>

Note that the peopleservice tag can be used directly without any use
of the DominoService. For example, the following JSP shown within a port-
let will provide a list of the authors of this book, with a menu for communi-
cating with them. The actual entries shall be available only if the individuals
can be located through the de¬nitions of the CSEnvironment properties.
<%@ page language="java" import="com.lotus.cs.*"^>
<%@ taglib uri="/WEB-INF/tld/people.tld" prefix="peopleservice" %>
<%@ taglib uri="/WEB-INF/tld/menu.tld" prefix="menu" %>

<TABLE>
<TR><TD><peopleservice:person>Ron Ben-Natan</peopleservice:person>
</TD></TR><TR><TD>
<peopleservice:person>Richard Gornitsky</peopleservice:person>
</TD></TR><TR><TD>
<peopleservice:person>Tim Hanis>/peopleservice:person>
</TD></TR><TR><TD>
<peopleservice:person>Ori Sasson</peopleservice:person></TD></TR>
</TABLE>

If Lotus Sametime is enabled, each of these lines will show a status icon
for the respective person, indicating his online status (for example, Active,
Away, Of¬‚ine). Clicking the person link will show a menu. The menu op-
tions depend on the system con¬guration. With Sametime enabled, it is
possible to initiate instant messaging with the user, or add him to the Same-
time contact list. If Lotus Discovery server is enabled, it is possible to send
e-mail to the speci¬ed user, display the user pro¬le, and ¬nd documents
authored by him. If the People Finder portlet is available within the page,
it is also possible to invoke it to show the person record or his location in
the organizational view.
The menu.tld taglib is used by the people.tld taglib to implement
pop-up menus. You may use it for any purpose other than collaboration, by
using the menu tag and implementing JavaScript callback functions within
your portlet.


Search Capabilities
With the huge amount of information stored both within the corporate
intranet and the Internet, ef¬cient searching is an important ingredient of
the capabilities you expect to have in a portal.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




Adding Collaboration and Search Components to Your Portals 235


IBM offers search capabilities in all versions of the WebSphere Portal
Server. The Portal Server has a built-in search engine that supports full-text
searching. The search engine allows users to specify the + and ’ query
operators to indicate words that must be in the document or words that
must not be in the sought document, respectively.
In order to keep down the search time, some preprocessing is required. To
that end, the search engine building indexed document collections, which
can then be searched.
To enable search in your portal, you need to prepare a document collec-
tion. The document collection is essentially the database of documents to
be searched. The procedure for creating a document collection was covered
in Chapter 10.


Searching a Collection
Once you have prepared a document collection, you are ready to provide
search from within your portal. The Portal Server comes with a preinstalled
search portlet called Document Search. This portlet is con¬gured to use
a speci¬c document collection. Therefore, you need to create a copy of this
portlet for each collection you want to use. You can avoid this only if you
have a single collection, in which case you can con¬gure the preinstalled
instance of the portlet to use that collection.
To con¬gure the portlet, follow these steps:
1. Log in to the portal as Administrator.
2. Enter the portal Administration section.
3. Go to Manage Portlets under Portlets.
4. In the Portlets list select the portlet Document Search.
5. Click Copy (on the right of the list).
6. Click Modify Parameters (on the right of the list).
7. In the IndexName ¬eld, type the path of the document collection, for
example C:\tmpindex.
8. Click Save.
9. Click Activate (right of the portlet list).
Now you have a new instance of the Document Search portlet con¬gured
to use the index created in the previous section. To actually use it, insert
this portlet into any page. Note that typically it would be at the end of the
portlet list, since it was just created.
Once the portlet is placed within a container, it is ready to use. To search it,
users need to specify text in the Search For ¬eld, and click the Search button.
The portlet has an Advanced Search mode where users can limit the search
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




236 Chapter 12




Figure 12-9 Sample Search Results.



to a speci¬c part of the document (for example, Title, Keyword, Subject),
and to limit document types. Figure 12-9 shows the result of searching for
ibm within and index created from the URL http//asia.cnet.com.


Managing Taxonomy and Categorizing
In order to facilitate more ef¬cient searching, the portal search supports
categorization of documents. When documents are collected, they may be
categorized. The basis for categorization is either a prede¬ned static taxon-
omy or a dynamic user-de¬ned taxonomy.
The prede¬ned static taxonomy covers over 2,000 subjects in a variety of
domains. You may customize this static taxonomy based on the needs of
your organization. To that end, a Taxonomy Manager portlet is provided,
which allows you to add synonyms to existing nodes, or to insert new
nodes. New nodes may either be interior nodes, re¬‚ecting concepts and
abstractions, or product nodes (re¬‚ecting speci¬c products or terms relevant
to your organization).
User-de¬ned taxonomies have the advantage of being completely ¬‚exi-
ble, but the obvious downside is that you need to spend signi¬cant effort in
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-12 WY009-BenNatan-v1.cls May 11, 2004 14:49




Adding Collaboration and Search Components to Your Portals 237


de¬ning the various categories. You will also need to de¬ne the associated
rules.
For each document collection, you can de¬ne whether it uses a categorizer

<<

. 40
( 87 .)



>>