Wednesday, 21 September 2011

JSR-286 Key features?

1. Resource serving:
Invoking a Portlet directly  ( but still through the Portal ) API: MimeResponse.createResourceURL (  ) ResourceServingPortlet.serveResource ( ResourceRequest, ResourceResponse ) Extends the render phase, NOT a new life-cycle phase POST, PUT, DELETE supported Should not change shared portlet state Additional URL parameters are specific for the request Full control over request and response headers Can be used for binary data or “readonly” AJAX  ( cannot change navigational state )

2.Extended Cache
Allow public cached content for multiple users
<portlet> ... <expirationcache> <expirationtime>300</expirationtime> <scope>public</scope> </expirationcache> </portlet>
Support validation based caching using ETag API:         response.getCacheControl (  )                .getExpirationTime (  ) , .setExpirationTime (  ) .isPublicScope (  ) , .setPublicScope ( boolean )                .getETag (  ) , .setETag ( String ) .useCachedContent (  ) , .setUseCachedContent ( boolean )
Better Web Platform support Allow servlet dispatching, including using forwards, from: processAction processEvent render serveResource Optionally providing a PORTLET_SCOPEd session to Servlets Extended JSP tag library using new taglib uri "http://java.sun.com/portlet_2_0" Bridging and native integration underway for JSF  ( JSR-301 ) and Apache Wicket  ( 1.3+ )


3.Portlet Coordination – Portlet Events
Events must be defined in portlet.xml After event definition, each portlet must declare what events it will publish or receive Portal-defined events do not have to be defined in portlet.xml Event naming: Must use the W3C QName standard Receiving events can end with a * wildcard Can declare default-event-namespace in portlet.xml and just use local names A portlet declares the events it wants to receive or send in portlet.xml using Qnames or by using a default namespace: <defaultnamespace> http://acme.com/events</defaultnamespace> <eventdefinition> <name>foo</name> <javaclass> java.lang.String</javaclass> </eventdefinition> <portlet> <portletname> PortletA</ portletname> ... <supportedprocessingevent> <qname xmlns:x=”http://acme.com/events”>x:foo</qname> </supportedprocessingevent> <supportedpublishingevent> <name>foo</name> </supportedpublishingevent>

</portlet>
Sending non-declared events at runtime is allowed too Allows wiring of portlets at runtime The portal / portlet container will act as broker The portal or portlet container can also send events Formally not 100% reliable, i.e. no guarantee of delivery  ( mainly for WSRP, “local” portals are less limited ) New 3rd life cycle phase: before rendering API: EventPortlet.processEvent ( EventRequest req, EventResponse res ) StateAwareResponse.setEvent ( QName name, Serializable value ) StateAwareResponse.setEvent ( String name, Serializable value )

4.Portlet Filters -
Modeled after Servlet Filters Modify request data by wrapping request Modify response data by wrapping response Intercept invocation of a portlet before and after it is called Filters may be chained Defined in portlet.xml  <filter> <filter-name>Event Filter</filter-name> <filter-class>com.acme.EventFilter</filter-class> </filter> <filter-mapping> <filter-name>Event Filter</filter-name> <portlet-name>SamplePortlet</portlet-name> <lifecycle>EVENT</lifecycle> </filter-mapping> Must implement javax.portlet.Filter interface Must provide a public no-arg constructor init (  ) method will be called on all Filters before being called on any Portlets destroy (  ) will be called if Filter is removed from service doFilter (  ) method called if processAction (  ) , processEvent (  ) , render (  ) , or serveResource (  ) would be called on Filtered Portlet
Redirect to login page after session timeout?


Installing the Remote Rendering Portlet (Remote Web Content Viewer)

The Remote Rendering Portlet (Remote Web Content Viewer) can be used to display Web Content Management content within a portlet located on a different WebSphere Portal server than the instance of WebSphere Portal that Web Content Management is installed with.

The Remote Rendering Portlet is installed just like any other portlet:
Login to WebSphere Portal as an administrator.
Go to the Administration view and then Portlet Management.
Select Web Modules.
Click Install
Click Browse.
Select the file called ilwwcm-remoterendering-portlet.war from the
\PortalServer\installableApps folder
of your Web Content Management server.
Click Open.
Click Next.
Click Finish.
You will then need to add the Remote Rendering Portlet (Remote Web Content Viewer) to a WebSphere Portal page

Portlet Life Cycle

The Life Cycle Methods Called by the container are:

1) init(PortletConfig config)
2) processAction(ActionRequest request,ActionResponse response)
3) render(RenderRequest request,RenderResponse response)
4) destroy()

Init(PortletConfig config):
Called when the portlet is instantiated by the container. This method is called only once, immediately after the portlet instance is created.

PortletConfig represents the read-only configuration data , specified in protlet’s configuration file (portlet.xml).
This init method behaves similar to the servlet’s init method.

processAction(ActionRequest request,ActionResponse):
Called after user submitted changes to the portlet. Intended to process input from a user action.
ProcessAction method is called in response to a user action such as clicking a hyperlink or submitting a form.
ProcessAction notifies the portlet about the user’s request for an action.

render(RenderRequest request ,RenderResponse response):
render notifies the portlet to generate the markup fragment.
Render follows the ProcessAction in the chain of lifecycle methods.

destroy:
destroy will be called just before the portlet is garbage collected and provides last chance to freeup portlet resources.

Sunday, 18 September 2011

Change URI of Websphere Portal server


Change URI
1. open the wkplc.properties(6.1)--C:\IBM\WebSphere\wp_profile\ConfigEngine\properties.
2. change the value of WpsContextRoot as you display in URI
WpsContextRoot=web  //wps
      Note: file name in websphere portal 6.0 :wpconfig.properties.
3. Open a command prompt and change to the C:\IBM\WebSphere\wp_profile\ConfigEngine directory
WPSconfig.bat modify-servlet-path -DPortalAdminPwd=wpsadmin -DWasPassword=wpsadmin
WPSconfig.bat action-update-portlets -DPortalAdminPwd=wpsadmin -DWasPassword=wpsadmin