Little Pink WebSphere World

Friday, January 25, 2008

Working with JSP elements on WCM 6

The JSP file must be stored under
<was_profile>/<cellName>/installedApps/wcm.ear/ilwwcm.war/

If your JSP contains references to other files like Javascripts, images, style sheets, etc, do the following:

1- Store those files under the same folder as the JSP.
2- Refer them as /wps/wcm/<file_name>

For example, if you have an image called dot.gif, your code within the jsp should look like:
<img src="/wps/wcm/dot.gif"/>

In order to check if the files are in the correct place, you should be able to access the follow URL:

http://<yourPortalserver>:<portNumber>/wps/wcm/dot.gif

PS: You must copy your jsp to PortalServer/installedApps/WCM_Local_xxx.ear/xxx.war/jsp if your JSP component will be rendered in a Local Web Content Viewer portlet.

IWKPL1515X: Value must be between 2/7/08 11:43 AM and 2/8/08 11:43 AM. (Expiry Date)

This is a WCM 6 exception. It happens when the author tries to save new content after the "Expiry date and Time field properties" were changed in the "Default Content Settings" in the Authoring Template.

Solution:IBM suggested the installation of 6.0.1.1-WCM-PK57002.zip

For more details, see: http://www-1.ibm.com/support/docview.wss?uid=swg1PK57002

IBM recommends 17 additional fixes that need to be applied before the expiry date issues is corrected:

PK54658, PK53869, PK53463, PK53575, PK53183, PK52815, PK52906, PK52802, PK53868, PK55366, PK55082, PK52688, PK51512, PK53899, PK52903, PK51892, PK55773, WCM 6.0.1.2, PK57002

How to setup automatic content expiration on WCM 6

In order to setup automatic content expiration you need to do the following:

1- Set the content expiry date.
2- Create "Scheduled Move" workflow action based on the "Expiry Date" to move content from Published to Expired stage. Add this action to your Published stage.
3- To guarantee the author will set the exp date, make it a required field in the Authoring Template. Also, set a default Workflow and a range of dates to be selected from. Click the icon besides "Expiry Date" under the AT "Default Content Settings" for options.

How to load a Javascript on a page without using the body or img tag.

If you need to execute some Javascript function before loading the page but you can't use or don't want to use the tags <body> nor <img> for that do the following:

<script type="text/javascript">
function ShowFirst(){ //do something }
</script>

<script language="javascript" type="text/javascript" for="window" event="onload">
if (document.all) {
//For IE
ShowFirst();
}else{
//For Firefox
window.document.addEventListener("DOMContentLoaded", ShowFirst, true);
}
</script>