Thursday, March 13, 2014

JSR 286 InterPortlet communication





Interportlet communication(IPC) allows sharing of data between portlets.
In JSR 168, we use portlet session with Application Scope to share data between portles and this is possible within a portlet application, because session can't be shared across two different context (web/portlet application).


JSR 286 has introduced two ways to achieve IPC.

1) Public Render Parameter
2) Eventing

Let's dicsuss one by one with their Concept, Implementation and Usage Scenario

1) Public Render Parameter

Concept:-
Public Render parameters allows you to share data using render parameters.
Source portlet will set data using actionResponse.setrenderPrameter in processAction phase and target portlet will receive data using renderRequest.getPramete("param name").

Note:- In JSR168 render parameter was also there but not public.
Public means, render prameter set in processAction of one portlet can be retrieved in render method of any other portlets in the same/different war.

Implementation:-
a) You will require to set public render parameter at portlet application level.
List all the render prameter you like to publish/share.

<public-render-parameter>
<identifier>id1</identifier>
<qname xmlns:x="http://sun.com/params">x:param1</qname>
</public-render-parameter>
<public-render-parameter>
<identifier>id2</identifier>
<qname xmlns:x="http://sun.com/params">x:param2</qname>
</public-render-parameter>

b) Need to specify render prameters you would need a portlet to share
Specify prameter within portelts that would like access those prameters

<portlet>
<portlet-name>PortletA</portlet-name>
<supported-public-render-parameter>id1</supported-public-render-parameter>
<supported-public-render-parameter>id2</supported-public-render-parameter>
<portlet>
<portlet>
<portlet-name>PortletB</portlet-name>
<supported-public-render-parameter>id1</supported-public-render-parameter>
</portlet>
<portlet>
<portlet-name>PortletC</portlet-name>
<supported-public-render-parameter>id2</supported-public-render-parameter>
<portlet>

Usage scenario:-
a)
Since the public render parameters are encoded in the URL, so you will have option only to share data between portlets of type String and String arrays.
b) Since public render prameter are only available in render methods, so you will not be using it where processing is required in data.
c) Best to use in situations where, you have target portlet changing it's rendering view based on parameter retrieved without any processing on prameter value.

2) Eventing

Concept:-
Portlet event model is a loosely coupled, that allows creating portlets as stand-alone portlets that can be wired together with other portlets at runtime.
Source portlet publish an event and all other portlets ( within same war or different war), can register for that event.
Once target portlet receives an event, it can peform processing on data and then display results based on business need.

Implementation:-

a) Portlet which want to publish events should have follwoing entry at application level in portlet.xml.
If IPC is beween two different war, then this event definition should present in portlet.xml of both war.
Setting event definition.

<portlet-app ...>
<portlet>
. . .
. . .
</portlet>

<event-definition>
<qname xmlns:x="http://ExtremePortal.blogspot.com/Employee">x:Employee</qname>
<value-type>com.wps.Employee</value-type>
</event-definition>
</portlet-app>

b) Event publishing Portlet should specify events that they want to publish.

<portlet>
<description>SourcePortlet</description>
<portlet-name>SourcePortlet</portlet-name>
.................
<supported-publishing-event>
<qname xmlns:x="http://ExtremePortal.blogspot.com/Employee">x:Employee</qname>
</supported-publishing-event>
</portlet>

Setting an event into processAction of publishing portlet

public class SourcePortlet extends GenericPortlet {
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException,IOException {
QName qname = new QName(""http://ExtremePortal.blogspot.com/Employee" , "Employee");
Employee emp = new Employee();
//set values in Employee
response.setEvent(qname, emp);
}
}


c) Event processing portlets should specify events that they want to process

<portlet>
<description>TargetPortlet1</description>
<portlet-name>TargetPortlet1</portlet-name>
<supported-processing-event>
<qname xmlns:x="http://ExtremePortal.blogspot.com/Employee">x:Employee</qname>
</supported-processing-event>
</portlet>

<portlet>
<description>TargetPortlet2</description>
<portlet-name>TargetPortlet2</portlet-name>
<supported-processing-event>
<qname xmlns:x="http://ExtremePortal.blogspot.com/Employee">x:Employee</qname>
</supported-processing-event>
</portlet>

Event process portlet needs to override processEvent method

public class TargetPortlet extends GenericPortlet {
public void processEvent(EventRequest request, EventResponse response) {
Event event = request.getEvent();
if(event.getName().equals("Employee")){
Employee emp = (Employee )event.getValue();
//process emp here
}
}
}

Usage scenario:-
a) Event technique should be used in situation where data shared needs to be processed in receiver portlet.
b) it is advisable to use public render parameters as they avoid the overhead for portlets event creation and wiring the portlets together. Wiring portlets together is portal container specific and is an additional overhead.

Monday, March 10, 2014

Customization VS Personalization

Customization vs Personalization


When developing a portal application, there is lot of confusion wrt Customization vs Personalization. What the client might be calling Personalization might in fact be Customization or vice versa. So, it is very important to understand the difference between the two.

The term "customization" is used to mean the rendering of portlet content based on users preferences or manipulating the portal layout based on the users security attributes.

The term "personalization" is used to mean delivering portlet content based on a business rule or collaborative filtering.

Customization centers around what resources (portlets and pages) you show the users based on their role. This is a core capability of Portal. There are tools provided that help administrators provision these resources. Typically, portlets allow users to specify what kind of information should display. For example, a weather portlet might be customized to show
weather in the users home town.

Personalization can deliver content to a user based on a profile and/or business rule, or determine characteristics of a user based on previous purchases, or pages viewed. Personalization then selects content that is appropriate for that profile. For example, if a person has a high salary range, personalization can be configured to retrieve information about premium products, the page is assembled with the proper information and the user sees his personalized page.

Personalization includes a rules engine, a recommendation engine and a resource engine. Although a full install of Portal installs and configures personalization functions by default, there are additional databases to consider. For example, personalization uses the DB2 Content Manager Runtime Edition for storage of rules, campaigns and other objects. There is a logging framework used to record information about web site usage to a feedback database. The LikeMinds recommendation engine also requires a database to store information gathered through the logging APIs.

To use personalization, you need content to display to your users. Therefore, personalization and content management go hand in hand. You will also need to understand where content is stored and how it is managed to optimize performance.

URL Mapping:

URL Mapping:
URL mapping allows portal administrator to create constant user friendly URLs and map them to portal page. While creating URL administrator can assign human friendly names to them. When user clicks on this friendly URL, portal takes him straight to the portal page.

Important Note: Clicking on a mapped URL from outside the portal takes the user straight to the desired page in the case of pages which are accessible without login to the portal. In the case of pages which require login the user is prompted for user ID and password. After successful login the portal takes user to the desired page. However this works only if the security is enabled. Otherwise the portal redirects the user to the portal welcome page.

Lets create a sample URL mapping that will map http://localhost:10040/wps/myportal/manageportlet to the Portlets page in the admin console. Please follow these steps to do that

  • Log in into the WebSphere Portal Adminstration console

  • Go to Portlet Settings -> URL Mapping page. On this page click on New Context Button


  • On the next page assign lable to the url. In our case we want assign manageportlet as label to the URL so enter manageportlet and click ok


  • It will take you back to the URL mapping list. Click on Edit Mapping button next to the managepages URL



  • On the next screen you will have to actually choose the page that you want to map this URL to, so search Portlets here and once the page is found select it.




Once URL mapping is done you can go to http://localhost:10040/wps/myportal/manageportlet URL and it will directly take you to the Portlets page, if your not already logged in it will take you to the login page first.

Important Note: A User can map context to all portal pages for which they have User role. After Mapping the URL to particular page, administer can give Editor role to that mapping to users, Users with Editor role can change the URL mapping to point to some other page.

Mapping URL task: Required role
Creating a context: Editor role for the parent context
Deleting a context: Manager role for the context
Adding, removing, or changing a label: Editor role for the context
Changing a mapping/* Removing a mapping: Editor role for the context + User role on the portal page.

Friendly URL

Friendly URL

WebSphere Portal 6.1 introduced concept of friendly URL, what that does is, let you set a friendly URL at the time of creating page. Friendly URL is different than the url mapping in following aspects

1.     By default the friendly URLs are disabled and you need to enable it

2.     The actual URL that you use for accessing page using friendly URL, is made of all the URL's starting from root. Ex. If you create a page under Home page and assign friendly URL testurl to it then you will have to first assign a friendly url to to Home page say home. Then final url for your page will be /home/testurl. In URL mapping you can directly assign a URL to any child page




These are the steps that i used to create Friendly URL mapping on my portal, First set value of
friendly.enabled property to true in ConfigService like this



After enabling this property now when you either create new page or when you go to Manage Properties button of the existing page you will get "Friendly URL name" input like this



Use the manage properties, portlet to assign URL labels to every page from Home to your destination page. In my case page hierarchy is like this Root -> Home -> fun -> Test URL. I did assign name home to Home page and fun to fun page and testurl to Test URL page. Now i can access Test URL page using /home/fun/testurl


Implementation
If you create a URL mapping using URL mapping portlet then it gets stored like this in xmlaccess


 <url-mapping-context action="update" domain="rel" label="flashquery" objectid="C_VVILMKG1089N00I2U8SB9F00G2">

  <access-control externalized="false" owner="uid=wasadmin,o=defaultwimfilebasedrealm" private="false"/>

  <portal-url resourceref="6_VVILMKG10G04D0I2C4HO3V0007" update="set"/>

</url-mapping-context>


If you assign friendly URL to a page then it gets stored as value of
com.ibm.portal.friendly.name parameter in the page level metadata



<content-node action="update" active="true" allportletsallowed="true" content-parentref="6_CGAH47L008IC40I4BOR2EO00I3" 

create-type="explicit" domain="rel" objectid="6_VVILMKG100GBC0I2F1UTLJ0001" ordinal="1300" type="page">

  <supported-markup markup="html" update="set"/>

  <localedata locale="en">

    <title>Test Page</title>

  </localedata>

  <parameter name="com.ibm.portal.IgnoreAccessControlInCaches" type="string" update="set"><![CDATA[false]]></parameter>

  <parameter name="com.ibm.portal.bookmarkable" type="string" update="set"><![CDATA[Yes]]></parameter>

  <parameter name="com.ibm.portal.friendly.name" type="string" update="set"><![CDATA[testurl]]></parameter>

  <parameter name="com.ibm.portal.remote-cache-expiry" type="string" update="set"><![CDATA[0]]></parameter>

  <parameter name="com.ibm.portal.remote-cache-scope" type="string" update="set"><![CDATA[NON-SHARED]]></parameter>

How to show or hide a portal or portlet page in WebSphere Portal


One of the common requirements in WebSphere Portal Server is how do i show/hide particular portlet or portal page. You might want to show particular page say every Monday or only to those users for whom value of particular email attribute say city is San Francisco. Or you might want to implement some custom logic ex. you might have a table in database which has information such as role and you might want to say if role is say Manager in database then only show a portlet or page.

WebSphere Portal has concept of Visibility rule, so you can create a visibility rule and assign it to particular portlet on a page and when portal is displaying that page to user it will execute the visibility rule to decide if a portlet should be displayed to the user or not. While creating the visibility rule you can use one of the built in criteria for portal or you can create your own Java class that will get executed as a part of visibility rule and your Java class will decide if the particular portlet will be displayed to the user or not. I wanted to try this feature so i followed these steps

1.     First create a SampleApplicationObject java project and then create a SampleApplicationObject.java first which looks like this in it.


package com.webspherenotes.pzn;

import com.ibm.websphere.personalization.RequestContext;

import com.ibm.websphere.personalization.applicationObjects.SelfInitializingApplicationObject;

public class SampleApplicationObject implements SelfInitializingApplicationObject{


  private RequestContext requestContext;

  @Override

  public void init(RequestContext requestContext) {

    this.requestContext = requestContext;

    requestContext.setSessionAttribute("sampleobject", this);

  }



  public String getUserName() {

    System.out.println("Value returned from User Name " + requestContext.getRemoteUser());

    return requestContext.getRemoteUser();

  }



}


The SampleApplicationObject is extended from the SelfInitializationApplicationObject and it has init() method which gets called to give this object a chance to initialize itself. In the init() method it will get access to object of RequestContext class which has some methods that you can use to get access to the environment.

I also have a getUserName() method in this class which returns name of the user for whom this rule is getting executed. Similarly you can add more methods to this class that follow JavaBean specification to return more values.

2.    
Add pznresources.jar and pznruntime.jar which are located in WebSphere\PortalServer\pzn\prereq.pzn\lib as part of your project build path

3.     Export this java class and content of the project as .jar file and copy the exported jar in \WebSphere\PortalServer\pzn\prereq.pzn\collections directory

4.     Restart the Portal Server

5.     Once the portal server is started login and go to the portal page which has Personalization Navigator and Personalization Editor portlet on it. In the Personalization Navigator portlet click on New -< Application Object and it will open a New Application Object screen like this.


Enter fully qualified class name as well as session key name that you used for storing the object in session here.

6.     Once the Sample Application Object is created go the Editor screen of the page and you should see the userName property that your java class is exposing like this


7.     Once the Sample Application Object is ready you can use it for creating sample visibility rule. For that go to the Personalization Navigator Portlet click on New -< Rule. It will open a Rules Editor page like this. In that change type of the rule to Visibility rule


8.     The Rules editor is active editor in that if you click on the Attributes link it will open all the different attributes that are available for creating rules. We can also see our custom Select Application Object, If you select that it will show userName property so select that and set "wasadmin" as value. I am setting wasadmin as user because thats the userName that i want to use for testing, you can set some other value here





With this your visibility rule is in place now the next step would be to assign it to either page or portlet depending on what you want to show or hide. 

IBM Websphere Portal Interview Questions and Answers for Developers



Below is the list of IBM Websphere Portal basic interview questions and answers. These IBM Websphere Portal interview questions and answers are meant for freshers as well as for experienced developers. So, If you going for an interview on IBM Websphere Portal,  I suggest you to must give a look at following IBM Websphere Portal interview questions. These IBM Websphere Portal interview questions are based on basic introduction to IBM Websphere Portal,  why we need IBM Websphere Portal, Dynacache, Websphere Portal Life Cycle, PortletContext, PortletSession, Websphere Portal Architecture, Trace and logging for WebSphere Portal, LDAP, ReleaseBuilder tool in WebSphere Portal, Authoring and Presentation Templates  etc. So lets have a look on following basic IBM Websphere Portal interview questions and answers.

1.What is Portal?

Portal is nothing but a web/J2EE application installed on an application server. Portal provides content aggregation, personalization, authorization and authentication.

2.What are Portlets?

Portlets are applications managed by portal container which generate fragment of portal page rather than complete page as generated by servlet.

3. Differences between a Portlet and servlet?

Portlets generate only fragment of the portal page rather than entire page
Portlets have more refined request cycle than servlet
Portlets have predefined modes and window states
Portlets are can be only invoked using portlet URLs

4.What are different phases of portlet life cycle?

Portlet life cycle has following phases

Initialization(init method)
Process action
Process event
Resource serving
Render
Destroy

5. What are the different types of Portlet URLs and their use?

There are three types of portlet URLs

Action URL- used for submitting forms
Render  URL- used for links
Resource URL – used for ajax calls and serving documents (pdf files).

6. Difference between JSR 168 and JSR 286 specifications?

The major changes in JSR 286 are events, public render parameters, resource serving and portlet filter.

7. How is the inter portlet communication carried out in JSR 168 portlet?

The inter portlet communication for JSR 168 in websphere portal can be done using dyna cache or shared library. We can create a hash map or any data structure, where we can store an object that need to be transported with unique key and retrieve it from the receiving portlet

8. Can you create a DB connection in render phase? Explain reason?

Yes we can create DB connection in render phase of portlet. But it is not suggested to create one in render phase because it will called every time any other portlet on the page is changed and may result in stale DB connections.

9. What are different modes supported by JSR 286?

Different modes supported by JSR 286 are view, edit and help. A portlet should define its supported mode is portlet.xml file.

10. What are different States supported by JSR 286?

Different  portlet states supported are normal, maximized and minimized.

11. What is Dynacache?

Dynacache is disturbed map used to store and retrieve objects from memory. IBM provides API to create, store retrieve the objects.

12. What is CSA?

Client-side aggregation (CSA) is a new method of rendering a WebSphere Portal page that moves the rendering workload from the server to the client. It is made possible by the Representational State Transfer (REST) services introduced in WebSphere Portal 6.1.

In the traditional server-side aggregation (SSA) rendering, the page and each of the portlets is completely rendered on the server, using JSPs, and returned to the client in one big response. 

In contrast, in CSA, we request only the pieces of information from the server that are required to update the page as a result of the user’s interactions with the page.

For example, if a page contains four portlets and the user clicks a link in one of the portlets, only that portlet is updated. This means the server must render only one portlet, instead of four portlets plus the theme for an interaction with a single portlet.

The REST services also take greater advantage of caching. Since each individual artifact can be independently cache-able, the client ends up retrieving a greater number of responses directly out of cache, further reducing the server workload.

13. What are different modes available in Websphere Portal?

A part for standard modes ( view, edit, help) it provides edit_ defaults and configure mode.

14. What can you do with XML access scripts?

Xml access is command line utility used for exporting and importing portal configurations. It can be used for backing up the configuration of certain environments, for loading new configurations (for new portlets or pages, for example), or for updating existing portlets when a new WAR file is provided by development. There are few samples C:\IBM\WebSphere\PortalServer\doc\xml-sample

15. What is model spi and what is it used for?

Web sphere uses different model for providing content aggregation and navigation The available models are Content model, navigation model , navigation selection model and layout model. These models are provided using model spi.

16. What is Navigation model? 

Navigation model is used to get topology of the navigation available to a user.

17. How do you solve problems related to themes and skins?

We can debug theme and skin problems by client side logging and using firebug for javascript problems

18. What is Web Content Management System (WCMS)?

Web Content management system is a software system that helps build and manage a Web entities (html pages, documents etc.) Once setup is complete it provides templates for authoring, workflow management to the content.  It is easy to use for non technical user.

19. What is syndication?

Syndication, (Web syndication in particular) is a ability to provide users updates of the content from the site. The most popular formats of web syndication are RSS and ATOM feeds.

20. What is local rendering and remote rendering?

The web content management portlets can be rendered local or remotely. A local rendering portlet displays content on the same portal as the instance where the web content manager is installed. A remote rendering portlet displays Web content on a different portal server than the instance where Web Content Manager is installed.

21. What are different steps in creating content for WebSphere portal WCM?

The following are different steps involved in creating the content for the WebSphere portal WCM

Create Library
Create Workflow
Create Site area (Sites are removed in WebSphere Portal 7.0)
Create Authoring templates
Create Presentation templates
Map authoring and presentation templates

22. What are workflows?

A workflow is a sequence of steps that are followed in creating approved content. In WebSphere portal, A workflow contains one or more stages. Every stage contains one or more actions, the following are different Workflow actions available in WebSphere Publish, Expire, Email, Scheduled Move, Custom Actions.

23. What are Authoring and Presentation Templates?

Authoring Template- This template is defined using authoring portlet, where we define the access information,  form properties and default content. It does not contain any information for presentation and The elements in this form are linked to presentation template.

Presentation Template- This allow to change the look of a page without having to update what is being displayed on a page. It will allow to define Page style, Page layout and map element to the authoring templates.

24. What is the difference between personalization and customization?

Personalization-   It means to serve the user or consumer with user specific data depending on his interests collected over a time. A real world example would be google serving ads basing on the recent search you made.

Customization-  It is ability provided to the user to change the layout, styling of the page and save it.

25. What is the difference between Application Server and Portal Server?

Application servers extend the ability of a Web server to handle Web application requests, and enables a server to generate a dynamic, customized response to a client request. A portal server extends the application server by providing a portlet container that can run portlets and to create portal a website that provides users with a single point of access to Web-based resources by aggregating those resources in one place.

26. What are the steps involved in deploying themes and skins in a clustered production websphere portal environment ?

Export the WebSphere wps.ear (Portal EAR) using wsadmin.
Use EarExpander tool to expand the exported wps.ear file.
Copy the updated themes and skins into ../themes/html, ../skins/html folder.
Use EarExpander tool to collapse the EAR directory into an EAR file.
Use wsadmin to update the wps.ear to complete the deployment of updated themes and skins.

27. What changes needs to be done to view changes to your theme and skins JSPs without restarting the portal server?

You need to enable automatic JSP loading by setting reloadingEnable property to true in ibm-web-ext.xmi file of the wps.ear.

28. What are the 3 different ways of installing a portlet application in WebSphere Portal?

Install a portlet using the portal administration page using Web Modules portlet.
Install a portlet using xmlaccess tool.
Pre-deploy a portlet as a standard EAR by installing the portlet WAR file in WAS console and then registering the portlet using xmlaccess.

29. What is the purpose of XMLAccess configuration file Export.xml & ExportRelease.xml? What is the difference & When will you use one over the other?

Export.xml exports the complete portal configuration and useful when transferring configurations between development installations.

ExportRelease.xml exports the complete portal configuration from the release domain as required by the portal ReleaseBuilder tool and useful when tranaferring different release configurations between staging and production environments.

30. List me the steps involved in building a release in WebSphere Portal?

If you have a completely new installation of the staging server and the production server:

Install the staging server, then install the production server.
Develop a release on the staging server.
Build the release on the staging server.
Empty portal contents on the production server by running the WPSconfig.sh|bat action-empty-portal task.
Import that release onto the production server. Refer to Transferring a complete configuration for information.

If you already have a production server without a staging system:

Export the release of your production server.
Install an empty staging server using one of the following two methods:
Install the staging server with the flag -W emptyPortal.active=True.
After installing and configuring the staging server, run the WPSconfig.sh|bat action-empty-portal task.
Import the production release onto the staging server. Refer to Transferring a complete configuration for information.
Develop and build a new release on the staging server.
Export that new release from the staging server.
Use ReleaseBuilder to generate the differential between the two releases.
Import the differential onto the production server.

31. What is the purpose of ReleaseBuilder tool in WebSphere Portal?

ReleaseBuilder enables management of release configurations independent of user configurations and used during staging of follow-on releases of WebSphere portals, configurations, and artifacts need to be moved between systems.

32. What are the steps involved in editing WebSPhere Member Manager (wmm.xml) files on a federated node?

On the primary node of the WebSphere Portal cluster, check out the files using ./WPSconfig.sh check-out-wmm-cfg-files-from-dmgr task.
Make any changes to the Member Manager files. The files can be edited in the portal_server_root/wmm directory on the WebSphere Portal node.
When you have completed your changes, check the files back in using ./WPSconfig.sh check-in-wmm-cfg-files-to-dmgr.

33. List different types of user registry supported by WebSphere Portal?

LDAP (includes LDAP with an optional database user registry).
Database user registry.
Custom User registry, (non-LDAP, non-database).

34. What is LDAP realm support and why would I want to use it?

A Realm allows you to group users from one or more LDAP trees of one user registry and expose them as a coherent user population to WebSphere Portal; this is also referred to as horizontal partitioning. Realms allow a flexible user management with various configuration options; for example, you can combine principals from one or more corporate LDAP tree. A realm must be mapped to a Virtual Portal to allow the realm's defined user population to login to the Virtual Portal.

35. What is an Application group and why would I want to use it?

Application groups is a concept that allows you to define user groups within the database user registry with members (users or groups) contained in the LDAP user registry you configured. 

The benefit of application groups is that you can create Groups that are only used in WebSphere Portal particularly in scenarios where there is Read-only LDAP or special group setup specific to the portal.

36. What are the two methods to install the empty staging WebSphere portal server?

Empty portal contents on the staging server by running the ./WPSconfig.sh action-empty-portal.
Install portal with the ./install.sh -W emptyPortal.active="True" option.

37. How do you stop portal traffic to the node being upgraded in 24x7 cluster upgrade process ?

Locate the cluster member being upgraded, and change the value in the Configured weight column from a value to zero and make sure the plugin config information is propagated to webserver to stop traffic.

38. How to set limits on searches for users and groups?

Setting a maximum number of search results maximumSearchResults="200" in wmm.xml

39. What portal resources are scoped for virtual portal?

Portal pages.
Portlet instances.
Portal Search Engine search services and search collections. This includes the search content sources.

40. What portal resources can't be seperated for virual portal?

Themes and skins.
Vault segments and vault slots.
Supported clients and markups.
Composite applications and templates.
Policies.

41. How do you enable temporary and extended trace logging for WebSphere Portal?

Temporary traces can be set for a temporary period by using the administration portlet Enable Tracing or the IBM WebSphere Application Server administrative console and also using the Enable Tracing portlet in the portal administration page.

To enable extended trace settings for a longer period of time, that is, for more than one session, switch them on in the WebSphere Application Server configuration, save the updates and restart the portal server.

42. What are the different states of the syndication process?

Idle: No syndication is occurring.
Pending: A request has been made to the syndicator, but it has yet to initiate a request to the syndication application.
Queued: The syndicator has sent a request to the syndication application, but syndication is not yet active.
Active: Syndication is occurring between the syndicator and subscriber.
Disabled: Syndication is currently disabled.

43. What are the two types of rendering portlets?

Local rendering portlet and Remote rendering portlet

44. Explain Portal architecture.

The core implementation of the portal is UI, hosted by a Portal server. The HTTP requests, HTML responses, and returning appropriate portal pages are handled by the Portal UI. Enterprise Web application also can be handled by the Portal Server.

The portal architecture has the following:

Automaton Server: This server performs the management of job scheduling and implementation of a portal. It accesses all remote crawlers and profile services retrieved and stored from a remote database.

Image Server: This server hosts images and other web page content used by web services and a portal. With this configuration, large static files are to be sent directly to the browser without portal server impacts.

Search Server: This server indexes and searches all the information, applications, communities, documents, web sites through portal.

Collaboration Server: Web content publication and management for portals and web applications are supported by this server. Its functionality can be accessed by a remote web services through Enterprise Web Development kit.

Content Server: Publication and management of web content for portals and web applications along with form based publishing, branding, templates, content expiration is allowed by this server.

Authentication Server: This server handles the portal authentication for users and remote services can be accessed through EDK.

Remote Servers: Web services written using the EDK are hosted by remote servers. The servers can be in different countries, on different platforms and domains. 

45. What is PortletSession interface?

User identification across many requests and transient information storage about the user is processed by PortletSession interace. One PortletSession is created per portlet application per client.

The PortletSession interface provides a way to identify a user across more than one request and to store transient information about that user.

The storing of information is defined in two scopes- APPLICATION_SCOPE and PORTLET_SCOPE.

APPLICATION_SCOPE: All the objects in the session are available to all portlets,servlets, JSPs of the same portlet application, by using APPLICATION_SCOPE.

PORTLET_SCOPE: All the objects in the session are available to the portlet during the requests for the same portlet window. The attributes persisted in the PORTLET_SCOPE are not protected from other web components. 

46. What is PortletContext interface?

The portlet view of the portlet container is defined by PortletContext. It allows the availability of resources to the portlet. Using this context, the portlet log can be accessed and URL references to resources can be obtained. There is always only one context per portlet application per JVM. 

47. How to change the default portal URI /wps/portal after installation?

Set the property WpsContextRoot to the new URI and run ./WPSConfig.sh modify-servlet-path task.
What is a portlet filter?
A filter is a reusable piece of code that can transform the content of portlet requests and
portlet responses. Filters do not generally create a response or respond to a request as

portlets do, rather they modify or adapt the requests, and modify or adapt the response.

Among the types of functionality available to the developer needing to use filters are the
following:
The modification of request data by wrapping the request in customized versions
of the request object.
The modification of response data by providing customized versions of the
response object.
The interception of an invocation of a portlet after its call.
Portlet filters are modeled after the servlet filters in order to make them easy to
understand for people already familiar with the servlet model and to have one consistent
filter concept in JavaEE.

PortletPreferences Interface:

Portlets are commonly configured to provide a customized view or behavior for different
users. This configuration is represented as a persistent set of name-value pairs and it is referred to as portlet preferences. The portlet container is responsible for the details of
retrieving and storing these preferences.
Portlets have access to the associated PortletPreferences object while they
are processing requests. Portlets may only modify preferences attributes during a
processAction, processEvent, or serveResource invocation.

PortletPreferences prefs = req.getPreferences();
String[] symbols = prefs.getValues(”preferredStockSymbols”,new String[]{”ACME”,”FOO”});
String url = prefs.getValue(”quotesFeedURL”,null);
int refreshInterval =
Integer.parseInt(prefs.getValue(”refresh”,”10”));

<portlet>
...
<!—- Portlet Preferences -->
<portlet-preferences>
<preference>
<name>PreferredStockSymbols</name>
<value>FOO</value>
<value>XYZ</value>
<read-only>true</read-only>
</preference>
<preference>
<name>quotesFeedURL</name> <value>http://www.foomarket.com/quotes</value>
</preference>
</portlet-preferences>

</portlet>