Tuesday, September 18, 2012

WCM: Scheduled Move Action for Publish is irrelevent at the entry stage of Published workflow stage

Recently I came across a problem with regard to having "Schedule move action on Publish date". The scenario is this. For a Workflow Stage: Published, if "scheduled move action on publish date" is added in entry stage, we observed the content never stays in PUBLISHED status and moves to EXPIRED status.The reason for the behavior is explain in this article.

What is Scheduled move action?

This is the workflow action which pushes the content to next workflow stage upon satisfying some condition. This some condition is on the date field we select while creating the schedule move action. It could be on Live date(Publish date), Expiry date, General date or Selected date.

In our case we opted on Live date(Publish date) and created a workflow action called "To publish". This workflow action has been added in the entry action list for Workflow Stage "PublishedStage".

Now lets observe what happens in the content creation scenario alone. When content is created by default it pics the publish date as "current date". The moment content is created, published date will have value in past for sure. So "To publish" is going to be valid action for sure in this case. It is going to triggered whenever content enters "PublishedStage" Workflow stage. So after content leaves "DraftStage" and enters "PublishedStage", "To publish" is also triggered. The "To publish" going to just trigger "Next Stage" action, so naturally content has to land in "Expired" Stage.

Hope the explanation is logical. Through this exercise I learned precise behavior of "Scheduled Move action" and "Default publish date assignment in content creation process".

Now this pushes me to analyze why WPS is designed to populate "Current date" in the "Publish date" field by default in the content creation process?

Wednesday, May 16, 2012

Creating and running sample application using WebSphere Portal Factory with IBM Websphere Application Server CE

1. Launch Start > All Programs > Webshere Portal Factory > Designer

2. Click New > WebSphere Portlet Factory Project

3) Enter name of the project as "MyFirstProject" and click "Next"

4) In the Feature Set page, select the options under "Tutorials and
Samples" and click "Next"

5) In the Server Configuration, select the WASCE and click "Finish"

6) Please wait for some time till "Publish request" dialog apears

7) In the "Publish request" dialog, click Yes

8) In the "Start WAS CE server" dialog, click Yes

9) It will take some time for server to start

10) After server start, you application will be published to server. (For
the first time it is observed, this process will take endless time, if so
click on the stop button [red in color] and initiate the publish again thro
Project > Publish Application).

11) Double click "OrdersServiceConsumer.model" which is located under
MyFirstProject>models>samples>gettingstarted.

12) To initiate the execution, Click Run>Run As > Run active model

13) After clicking this application will be launched in your default browser

Friday, March 30, 2012

Part2:iWidget - Build and deploy iWidget


Build:

  1.   Export the iwidget by right clicking on "HelloWidget" in RSA
 



  2.   Enter "HelloWidget" under Web project , enter the name of the war
     file in the Destination and click Finish
 



Deploy


  1.   Start Websphere Application Server
  2.   Launch Web console
  3.   Go to Applications > New Application> New Enterprise Application
 



  4.   Select the Local war using the Browse button and click Next
 


  5.   Select Fast Path and click Next
 



  6.   In the first step of installation, don't change anything and simply
     click Next

 



  7.   In the Second step of Installation, don't change anything and simply
     click Next
  (Note: One of the target would be Websphere Portal, this is to access
  the application from WPS)
 



  8.   In the third step, give the context root as "HelloWidget" and click
     next
 


  9.   In the fourth step, click Finish
  10.  Wait for the installation to happen
  11.  After you get message for successful installation, click on
     "Save"
 




  12.  Under Applications>Application Types> Websphere enterprise
     applications select the HelloWidget.war and click "Start"

 



  13.  To test the success of the deployment access the following url
  http://www.extremeportal.com:10000/HelloWidget//HelloWidget.xml

  (Make sure you are using correct hostname and port, for ports refer WAS
  Console> Environment>Virtual hosts>default_host>Host Aliases)

  14.  You should get the following screen

 






Wednesday, March 28, 2012

Part1:iWidget - Developing iWidget for wps7 using RSA

1. Open RSA in Web Perspective
2. Click File>Project



3. Select Web> iwidget (alternatively type the keyword iwidget in the
text box)


4. Choose option 2 "Web and JavaEE technologies(Ajax, HTML, CSS, JSP,
Servlet etc.)" and click Next

Note: iWidget created using the option 1: "Web technologies(Ajax, HTML,
CSS etc.)" cannot be directly exported as WAR, so in order to export it
as war chose option 2 "Web and JavaEE technologies(Ajax, HTML, CSS, JSP,
Servlet etc.)"


5. Type the project name as "HelloWidget" and click Next


6. Select iWidget type as "Simple Widget" and click Finish


7. You will have the project created in bellow folder structure


8. The Sample code HelloWidget.xml created is as bellow

<?xml version="1.0" encoding="UTF-8" ?>
<iw:iwidget id="HelloWidget" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget"
supportedModes="view" lang="en" iScope="HelloWidgetScope">
<iw:content mode="view">
<![CDATA[
<div>Hello World</div>
]]>
</iw:content>

</iw:iwidget>

Thursday, March 22, 2012

How to create custom skin in the wps7


        1.     Setup WEBDAV for skinlist folder and open
           http://localhost:10039/wps/mycontenthandler/dav/skinlist
        2.     Copy folder "csa2.standard"  to you local directory and rename
           to "csa2.standardCustom"
        3.     Inside csa2.standardCustom/metadata edit the
           localized_xx.properties and change the value of the property
           title
 


        4.     Just for verification, lets had little customization to the
           skin by editing csa2.standardCustom/nls/skin_en.html
        5.     Add text "Title:" as shown in the bellow snippet

            <span class="lm-dynamic-title asa.portlet.title
            decoration-title">Title:<a rel="dynamic-content"
            href="lm:title"></a></span>

        6.     Move the "csa2.standardCustom" to the
           http://localhost:10039/wps/mycontenthandler/dav/skinlist
           through WEBDAV
        7.     You could double check the addition of this skin in you portal
           by going to Administration/Portal User Interface/Themes and
           Skins/Skins.



        8.     Now you could add this skin to Page Builder theme by clicking
           on "Edit theme"
        9.     Select "Page Builder – Standard Custom" (this is the tile we
           given in properties file) and click right arrow to add it to
           "Skins for this theme". Finally click OK
       



        10.    Now the skin is ready to apply for a portlet. Go the Edit
           layout for page>Appearance tab>Skin (under a Portlet)



        11.    Bellow is the screen shot of the rendering of the Portlet
           which uses this customized skin. Please note the text "Title:"
           prefixed in the Portlet title bar.

Steps to Setup WEBDAV in Windows for skinlist folder


1. Make sure your portal server is up and running
2. In Windows xp, go to My Network Places
3. Click "Add Network Place"
4. In the Welcome dialog, Click Next
5. Select "Choose another network location" In the list of service
provider and click Next
6. Enter http://localhost:10039/wps/mycontenthandler/dav/skinlist
in the Network address and Click Next
7. You will be prompted for username and password of Portal
server, enter the values and click OK
8. It would take some time to connect and it would ask for label
for this network place. Give it as "skinlist on localhost" and
click Next
9. Click Finish and Open the network place. Now you could see
bellow window

Tuesday, March 20, 2012

Dynamic Portlet Title in JSR286 portlet

Dear All,

I recently came across a need to achieve dynamic portlet title. I came across many articles and methodologies. But bellow one is the simplest and most elegant one that I used.

As per JSR286 portlet specification, we are allowed to override getTitle method of GenericPortlet

Ref: http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/GenericPortlet.html#getTitle%28javax.portlet.RenderRequest%29

so I placed following method in my Porlet Class which extends GenericPortlet


public java.lang.String getTitle(RenderRequest request) {
return "My custom title";
}


The execution of this getTitle is subject to container runtime settings. So dont forget to set javax.portlet.renderHeaders to true under container-runtime-option in portlet.xml


Now you can extend this concept by retrieving a portlet preferences and use it as portlet title.