10.6 The Office Supplies application sample code 
|
|
ShowTable of Contents
Previous
This topic contains the Office Supplies sample code and the sample installation instructions. The Office Supplies sample code is written for IBM Web Experience Factory 7.0.1 and is configured to run on either IBM WebSphere Application Server Community Edition (WAS CE) that comes pre-installed with Web Experience Factory or with IBM WebSphere Portal 7.0.
To run the Sample, you have to complete the following tasks:
- Import the Sample application.
- Quick validation check.
- Edit configuration variables.
- Import SSL certificate from the IBM Connections server.
- Run the Sample.
Import the Sample application
- If you are not planning to connect to a Portal server, download OfficeSupplies.zip. Otherwise, download OfficeSuppliesPortlet.zip. Both these zip files are attached to this article.
- Create a WebSphere Portlet Factory project (refer to10.1 Office supplies IBM Web Experience Factory project if you are running it without a portal or 10.5 Deploying to the Portal Server for a portal server configuration).
- Right-click the project and select Import -> WebSphere Portlet Factory Archive from the context menu (see the following figure).

- Click Finish.
The sample is now imported.
Quick validation check
This is a quick check on one part of the sample that does not link to IBM Connections. It proves the IBM Web Experience Factory and WAS CE are working.
- Expand the OfficeSupplies project in the Project Explorer, and navigate to OfficeSuppliesProvider.model.
- Right click OfficeSuppliesProvider.model, and Run As --> Run active model .

- You should see the results shown below. Click the getSupplies link.

If you see these results, Web Experience Factory and WebSphere Community Edition are running correctly.

Edit configuration variables
The sample needs configuring to link to your IBM Connections server and your blog.
- Expand the OfficeSupplies project in the Project Explorer, and navigate to Office Supplies --> Models --> ConnectionConfigData.model --> server_info.properties.

- Right click server_info.properties and Open.
Modify the variables shown to reflect your environment.
Note that the URL must start with https:// .

- Save the properties file.
Import SSL certificate from IBM Connections server
The Blogs API requires that the HTTPS protocol is used to POST data. (The password is transmitted in our example so HTPS is an advantage!)
This example assumes you are running the WAS CE server on Windows.
- Stop the WAS CE server by clicking the Windows Start Menu -> IBM WebSphere -> Application Server Community Edition -> Stop the server.
When prompted, enter the user name and password for the server (the default user name is "system" and password is "manager").
- Extract the SSL certificate from your HTTP server "in front" of your IBM Connections WAS Server.
If you are not using an HTTP server, extract the SSL certificate directly from WAS where IBM Connections is running.
In this example, the extracted file is called social_cert.arm.
- Copy this certificate file to the following directory:
C:\IBM\Portlet Factory\WASCE\jre\lib\security
- Open a command prompt window and change directory to same security folder
cd C:\IBM\Portlet Factory\WASCE\jre\lib\security
- Issue the command to import and trust the certificate:
"C:\IBM\Portlet Factory\WASCE\jre\bin\keytool" -import -trustcacerts -alias social -keystore cacerts -file social_cert.arm
(The default password on the keystore is "changeit").
- Start the WAS CE Server.

Run the sample
This is a quick check on one part of the sample that does not link to IBM Connections. It proves the Web Experience Factor and WebSphere Community Edition are working.
- Start the WAS CE.
- Expand the OfficeSupplies project in the Project Explorer, and navigate to OfficeSupplies.model.
- Right click OfficeSuppliesProvider.model, and Run As --> Run active model.

You should see the results as shown in 10.0 IBM Web Experience Factory.
Parent topic: 10.0 IBM Web Experience Factory
|
|
|
|
| Version 5 |
November 24, 2011 |
11:11:47 AM |
by Robert Thatcher  |
|
|