<<

. 76
( 87 .)



>>

in administrator-managed CV segments




Figure 23-9 Creating a CV segment.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




Integrating ExternalApplications withWebSphere Portal 457


Shared credentials. Shared among all portlets of a single user; also
created in the administrator-managed CV segments
Private credentials. Private to a combination of user and portlet
Slots are accessed through the CV service as instances of the Creden-
tialSlotConfig class. This class stores the metadata associated with the
slot as well as a link to the actual resource. Slots can be created programmat-
ically in user-managed segments or using the CV portlet for administrator-
managed segments. To create CV slot in an administrator-managed seg-
ment, log in as an administrator and follow these steps:
1. Click Administration ➪ Access ➪ Credential Vault.
2. Select Add a Vault Slot.
3. Select the vault and the CV segment in which this slot will be created.
4. Enter a unique name for the slot and select a resource to be created
(or link the slot to an existing resource).
5. If you are creating a shared slot for all resources, check the Vault slot
is shared check box and enter the user ID and password to be used; if
there will be a distinct value for each user in WP leave this check box
empty.
6. Finally, enter a description and click OK, as shown in Figure 23-10.




Figure 23-10 Adding a CV slot.
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




458 Chapter 23


Using the Credential Vault Service API
The CV service provides an API for portlets to access the CV. The API is avai-
lable from the com.ibm.wps.portletservice.credentialvault.
credentials package and allows you to programmatically create slots,
create or modify credentials, and access credentials stored in a slot.
In order to use the CV service, you will ¬rst need to initialize the Cre-
dentialVaultService object:
try {
vaultService =
(CredentialVaultService)getPortletConfig().getContext().
getService(CredentialVaultService.class);
} catch(Exception e){
e.printStackTrace(System.out);
}

Once you have the vault service object, you can create a new private slot
and store a value in it as follows:
try {
PortletData data = portletRequest.getData();
String slotId = "PeopleTools id";
String resourceName = "PeopleToolsID";
ObjectID segmentID = vaultService.getDefaultUserVaultSegmentId();
Map description = new Hashtable();
Map keywords = new Hashtable();
int secretType =
vaultService.SECRET_TYPE_USERID_STRING_PASSWORD_STRING;
boolean active = true;
boolean portletPrivate = false;

CredentialSlotConfig slot =
vaultService.createSlot(
resourceName, segmentID, description,
keywords, secretType, active, portletPrivate,
portletRequest);

vaultService.setCredentialSecretUserPassword(
slotId, userID,
password.toCharArray(),portletRequest);
} catch(Exception e){
e.printStackTrace(System.out);
}

To access credentials from a private slot (using portlet data):
Map toReturn = new Hashtable();
try {
String slotId = (String) portletRequest.getData().
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




Integrating ExternalApplications withWebSphere Portal 459


getAttribute("PeopleToos id");
if(slotId == null) return ;

UserPasswordPassiveCredential credential =
(UserPasswordPassiveCredential)vaultService.getCredential
(slotId, "UserPasswordPassive", new HashMap(),
portletRequest);
toReturn.put("userid", credential.getUserId());
toReturn.put("password", String.valueOf(credential.getPassword()));
} catch(Exception e){
e.printStackTrace(System.out);

}



Using the WebSphere Portlet Catalog
The next category of integration is the portlet catalog, allowing you to make
use of ready-made packages that provide both the portlet and the back-
end integration component. This means that you have no development
activities, and very little setup is required”making this pattern the easiest
to use. The limitation of this pattern is that it can only provide you with the
functionality that was implemented and packaged by the provider and this
may not be precisely the functionality you need nor will the user interface
always be consistent with your look and feel.
Business application portlets are available from the WebSphere Portlet
Catalog at www-3.ibm.com/services/cwi/portal/_pagr/105/”
this site is maintained by IBM. The catalog lists and describes offerings
available from IBM and IBM Business Partners. The catalog enables you to
search for information that meets speci¬c criteria such as:
Portlets and portlet builders
Tools and other applications, which integrate with WP
Solutions, such as services and value-added offerings
The catalog is organized based on a set of categories and each catalog
entry contains information on the function as well as pointers to additional
information about the offering. You can either browse the catalog using
content lists such as the one shown in Figure 23-11 or search by category.
The following are the available categories listed on the catalog (excluding
categories that are based on the company creating the portal, language,
markup, or market category):
Collaboration
Calendar
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




460 Chapter 23




Figure 23-11 Browsing for portlets.


Contacts
E-mail
Messaging
Tasks
Work areas
Personal tools
Personal bookmarks
Personal calculators
Personal calendars
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




Integrating ExternalApplications withWebSphere Portal 461


Personal clocks
Personal contacts
Personal search
Personal tasks
Content
Business
News
Syndicated
Travel
Miscellaneous
Samples
Free preview
Unknown classi¬cation
Tools”Portlet generators
Software application
Business Intelligence
App Collaboration
Lotus iNotes
Lotus Notes
Microsoft Exchange
Communications
Content Management
Customer Relationship Management
Siebel
Data Management
DB2
Oracle
Desktop Applications
Development Tools
Document Management
Enterprise Resource Planning
PeopleSoft
SAP
Knowledge Management
Multimedia
Supply Chain Management
Web-based Applications
The importance of the portlet catalog should not be underestimated. The
more comprehensive the catalog is, the easier it will be for you to set up
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




462 Chapter 23


meaningful content within your portal. The goal is therefore to have the
catalog constantly evolving and have more and more prepackaged portlets
offered through the catalog. Because it is supply and demand that drive
companies to develop and offer applications, you should make it a point to
always look for portlets using the catalog before you opt to develop your
own.
While many of the portlets on the catalog are offered by IBM, some of
them package integration with business applications. As an example, one of
the most popular portlets offered on the catalog is the SAP Enterprise Inte-
gration portlets. These portlets were built by IBM using WPAI and support
functions in SAP HR, Finance, Material Management, and more. Because
the portlets are built using WPAI, they take a very object-centric (rather than
process-centric or function-centric) view and support the following views
(by category):
Finance
List customer balances
List vendor balances
Show credit information of customer
List open items of debtor
List statements of vendor
List payment requests
Human Resource
List employee by cost center
List and create appraisals
Show detail and rate appraisals
List quali¬cations for person
List requirements for position
Sales Orders:
Show details of customer
List sales orders
Check sales order status
Material Management
Material data
Material detail
Availability of material
Cost Center
List cost center by controlling area
P1: FCH/SPH P2: FCH/SPH QC: FCH/SPH T1: FCH
WY009-23 WY009-BenNatan-v1.cls May 11, 2004 14:53




Integrating ExternalApplications withWebSphere Portal 463

<<

. 76
( 87 .)



>>