Search This Blog

Wednesday, November 10, 2010

Steps required to export WCM Library

IBM Workplace Web Content Management (WCM) 6 provides a way that you can export and import data from libraries. This can be useful as a way to backup data for safety - especially in the early days of development.
For example, before more robust data backup and restore procedures can be trusted, you might leverage this mechanism. It is also a way that you can get data from one server to another such as from a team DEV server to your local DEV server.

(Note that Syndication, not data export/import is the proper way to keep WCM content synchronized between servers on a regular basis. This describes a backup or data move procedure, not syndication for data synchronization.)

This procedure assumes that you have already configured the data export options in the WCM data export configuration file. This is intended to simply document a quick checklist style procedure for executing new data exports on a regular basis.
  • Use PuTTY to login to the server (on SSH connection if necessary)
  • Change directory: cd /usr/IBM/WebSphere/wp_profile/PortalServer/wcm/config
    • If you list the contents of this directory (ls -la), you should see a file called wcm60_conf.xml. This is the file where the WCM data export options are configured. We will need to modify this file, so let's make a backup for safety first.
  • Backup the config file by making a dated copy. For example:
    • cp wcm60_conf.xml wcm60_conf_2009_09_24.xml
  • Use VI to open the file:
    • vi wcm60_conf.xml
  • The first thing we want to do is change the date in the name of the export directory (first config line in the file). We will change the following line, for example from:
    • <property name="ExportDir" value="/usr/IBM/WebSphere/wp_profile/PortalServer/wcm/config/22Sept2009export"/>
    • to...
    • <property name="ExportDir" value="/usr/IBM/WebSphere/wp_profile/PortalServer/wcm/config/24Sept2009export"/>
  • Note that there is also a line in the file that defines the libary to export. It looks like this:
    • <property name="WebLib" value="Content"/>
  • We can leave that alone for now and export the Content library first. But to export other libraries, we will need to change the library name and run the export command again.
  • In VI, use [ESCAPE] to exit edit mode, then :wq (write, quit). If necessary, you can skip making changes to the file with :q! (quit, but ignore changes).
  • Now that we've saved the file, we can execute the export command.
  • cd /usr/IBM/WebSphere/wp_profile/ConfigEngine
  • ./ConfigEngine.sh export-wcm-data
  • The data will begin to export and you will get a lot of information on the console. Hopefully, the console messages will end with a BUILD SUCCESSFUL message. You will then have all the data exported from the library in the directory you specified and you can later import that data if necessary.
  • Now you can cd back to the directory containing the config file, use VI to change the library name to export, and repeat the process for each library you wish to export.

Some Quick Tips for using the VI editor:
k = up
j = down
w = right or forward one word
b = left or back one word
l = right 1 char
h = left 1 char
x = delete 1 char
u = undo
i = insert
[ESCAPE] = get out of edit mode
:wq = write and quit
:q! = quite ignoring changes (do not write).

Hope this article will be useful...

List of Useful Blogs on WCM and Portal

IBM Forums
1. IBM WCM Forum
2. IBM Portal Forum


External Forum
1. WCM Blog
2. Extreme Portal
3. Sunil Patil Blog
4. http://vivekagarwal.wordpress.com/

Monday, November 8, 2010

Extending Portal Personlaization to external data source

This article to explain how to create a simple Plain Old Java Object (POJO) to use external data source in implementing your custom pzn rule in WebSphere Portal 6.x/7.x.

Steps to be followed.
1. Create simple Java project in RAD 7.x

2. Configure the build path to include the following jar file which are required to buld.
- pznauthor.jar
- pzncommon.jar
- pznquery.jar
- pznresources.jar
- pznruntime.jar

Note: the jar files can be found in in the location
v6.x - [portal-root-dir]/pzn/v6.0/lib and
v7.x - [portal-root-dir]/pzn/prereq.pzn/lib

3. Your POJO class should implement the following interface
- com.ibm.websphere.personalization.applicationObjects. SelfInitializingApplicationObject
& Serializable.

Example :

package com.ibm.websphere.personalization.examples;

import java.util.Date;

import com.ibm.websphere.personalization.RequestContext;
import com.ibm.websphere.personalization.applicationObjects.SelfInitializingApplicationObject;
import java.io.Serializable;

public class MySampleObject implements SelfInitializingApplicationObject,
Serializable {

private String userName;
public void init(RequestContext context) {
userName = context.getRequestUsername();
context.setSessionAttribute("mysampleobject", this);
}

public String getMySampleString() {
return "Hello " + userName;
}

public int getMySampleInt() {
return 1;
}

public Date getMySampleDate() {
return new Date();
}
}

4. Export this java project as jar file and copy into the following locations

v6.x - [portal-root-dir]/pzn/v6.0/collections
v7.x - [portal-root-dir]/pzn/prereq.pzn/collections

5. Please don't forget to restart your portal server to take effect.

Configure the application object in Portal Personalization

1. Login to the portal server.

2. Navigate to the Personalization Business Rules page. With the default theme, this page is accessible by clicking Launch => Personalization => Business Rules.

3. Create a folder to contain your work by choosing New => Folder from the menu; name the folder Application Objects and click Save. Using a folder here is optional. Because export, import, access control, and versioning operate on folders, it is a good idea to give some thought to the folder structure you use. Moving some objects in Personalization after their creation will break references to those objects.

4. With the Application Object folder open in the Personalization Navigator, choose New => Application Object from the menu.

5. Enter My First Application Object in the name field. This name will display in the rule editor; it can be anything you choose.

6. Enter mysampleobject for the Session Key. This name should match the key you used in the code in step 5c. Keeping these values the same insures that the rules engine will pick up the object from the session.

7. Complete the Class Name field with the name of our Application Object Java class, com.ibm.websphere.personalization.examples.MySampleObject.

If you have not put the MySampleObject class in the classpath by copying the JAR into the collections folder, or if you have not restarted the server, you might see a message: The application object class 'com.ibm.websphere.personalization.examples.MySampleObject' could not be located. Specify a valid class for this application object.

If you see this message, check the location of the JAR, and restart the portal server.

8. Click Save to store the definition of the application object in Personalization.

Finally you can add this rule to any portlet/page/label to suit your own needs with business logic implemented in POJO class.

Please do remember you can use DB layer approach fetch any data from the external data source to wrap your business rule.

Hope this tutorial will be useful to everyone.

Detailed Information on modifying Config parameters for WebSphere Portal Sevrer 7

All Techies,

The following link will be useful when you are configuring WebSphere Portal 7 and it explains you that various config. parameters which are required during running configuration task.

Hope you will find it very useful :-)

http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Configuration_properties_reference_wp7

Thursday, November 4, 2010

Clustering WebSphere Portal 7 with Process Server 7

All techies,

I came across one of the good article about clustering of WebSphere Portal 7 with Process Server 7 at IBM developerworks site.

Please take a look at this at http://www.ibm.com/developerworks/websphere/zones/portal/proddoc/dw-w-integratewps/index.html

Parsing & using XML in AJAX method by XML DOM Parser

Agenda:

How to parse and use XML data using XML DOM parser using AJAX in your enterprise application.

XML :

AJAX Code snippet (which will be inside the onreadystatechange block):

var xmlDoc;
if (window.DOMParser) { //for Firefox
parser=new DOMParser();
xmlDoc=parser.parseFromString(xmlHttp.responseXML,"text/xml");
} else { //for IE 6+
xmlDoc = xmlHttp.responseXML;
}

var tagValue = xmlDoc.getElementsByTagName("[XML-TAG-NAME]")[(POSITION)];
var attrValue = xmlDoc.getElementsByTagName("[XML-TAG-NAME]")[(POSITION)].getAttribute("[ATTRIBUTE-NAME]");

Thursday, October 28, 2010

Useful IBM WebSphere Portal related IBM Links

General Documents

1. Product Documentation (latest) -
http://www-10.lotus.com/ldd/portalwiki.nsf/xpViewCategories.xsp?lookupName=Product Documentation

2. Details System Requirements for all version 6.x/7.x
http://www-01.ibm.com/support/docview.wss?uid=swg27007791

3. WebSphere Portal Product CD Number versus Folder Reference information for all OS platforms (viz., CZZLL3ML - W-Setup)

http://www-01.ibm.com/support/docview.wss?uid=swg24026533

4. WebSphere Portal - IBM Discussion Forum

https://www.ibm.com/developerworks/forums/forum.jspa?forumID=168

5. My DW Link - https://www.ibm.com/developerworks/mydeveloperworks/profiles/user/Lessly

6. Lotus Portal Blog - https://www.ibm.com/developerworks/mydeveloperworks/blogs/lotusportal/entry/websphere_portal_and_ibm_web_content_management_7_0104?lang=en


7. Steps By Steps Cluster Guide
http://129.33.205.81/jct01003c/support/docview.wss?ca=wpwcmfaq&rs=688&context=SSHRKX&uid=swg27019688&loc=en_US&cs=utf-8&lang=en

8. WCM Wiki - IBM
http://www-10.lotus.com/ldd/wcmforum.nsf


9. WCM Troubleshooting Wiki
http://www-10.lotus.com/ldd/portalwiki.nsf/xpViewCategories.xsp?lookupName=WCM%20Troubleshooting

------------------------------------------------------------------------------------------------


WebSphere Portlet Factory Links

1. IBM Technote on Application imporving performance

http://www-01.ibm.com/support/docview.wss?rs=3044&ca=wpwcmfeatured&uid=swg21268497