Monday, September 26, 2011

WebSphere Portal Server: Virtual Portals Concept

Introduction

  • Virtual Portals are logical portals that share the same WebSphere Portal Server hardware and software installation.
  • All the Virtual Portals, including the default portal, run on and share the same JVM (Java Virtual Machine).
  • Each Virtual Portals will have its own unique URI.

Sample Portal Architecture using an Virtual Portal

Advantages of VP feature

  • Using the VP feature we can not only save costs by using the shared resources for multiple portals, but we also can enable a new portal application much faster as you don’t have to spend time installing and configuring new hardware and software for the new portal.

Portal resources that are scoped for virtual portals

  • WebSphere Portal has the following portal resources scoped internally for virtual portals:
    • Portal pages
    • Portlet instances
    • Portal Search Engine search services and search collections. This includes the search content sources.
  • Scoping of these resources is managed by internal portal mechanisms.
  • Scoped resources are only available for the virtual portal for which they are defined. They are well isolated from other virtual portals.
  • Scoped resources cannot be shared with other virtual portals. They are not visible or accessible outside of the virtual portal for which they have been created. This behavior cannot be changed by any portal access control settings.

The rules applied on Virtual Portal

  • Within each virtual portal you or a subadministrator can use Portal Access Control to grant individual users of that virtual portal specific access rights to the scoped portal resources. This works just like under a single portal installation.
  • An administrator can give access rights to users who are members of the user population of a virtual portal only on the scoped resources of that same virtual portal. This implies that, vice versa, you can give access rights on the resources of a virtual portal only to those users who are members of the user population of that virtual portal.
  • Users can only use these access rights when they access the specific virtual portal under which they have the access rights on the scoped resources. The same users cannot access the resources when logging in to a different virtual portal.

Portal resources that you can separate for virtual portals by using Portal Access Control

  • There are some portal resources that are not scoped internally for a particular virtual portal. These resources are shared among all virtual portals of the entire installation. However, as a master administrator you can yourself separate such portal resources for the virtual portals. To do this, use Portal Access Control and the access rights portlets to set up the appropriate access rights for users on the resources of each virtual portal as required.
  • You can separate the following portal resources by using Portal Access Control to give users of an individual virtual portal access right to the resources:
    • Portlets
    • Portlet applications
    • Web modules
    • URL mapping contexts
    • Users and groups.
  • You can separate these resources for individual virtual portals by using Portal Access Control. When you do this, apply special care. It can be of benefit to document the relationships between the users and the virtual portals.

Portal resources that cannot be separated for virtual portals

  • There are some types of portal resources that are not scoped to a particular virtual portal, and you cannot separate them yourself by using Portal Access Control. The following list shows portal resources that you cannot separate for virtual portals:
    • Themes and skins. If you do not want subadministrators to be able to manage themes and skins, restrict their access rights on them.
    • Vault segments and vault slots. To avoid security problems, use private credentials only. They can be used by only one specific user.
    • Supported clients and markups. The settings for these are configured in the corresponding portlets; therefore they apply to the entire portal installation.
    • Composite applications and templates. There is one common application and template catalog per installation. Users see the applications and templates to which they have access, regardless of virtual portal assignments. For more information about applications and templates refer to Composite applications.
    • Policies. Policy resources are not scoped to virtual portals. Users see the policy resources to which they have access, regardless of the virtual portal assignments.
  • Examples:
    • Themes and skins can be accessed by all subadministrators who have the access right to apply themes and skins to the pages that they can administer, regardless of which virtual portal the subadministrators are responsible for.
    • If a subadministrator imports a new template into one virtual portal, this template will appear in the application template library of all virtual portals.

Content of a virtual portal

  • When we create the virtual portal by using the Virtual Portal Manager portlet, the portlet invokes an XML configuration interface script that creates the initial content of the new virtual portal.
  • Content (wps.content.root). This includes the following pages and portlets:
    • Home (ibm.portal.Home). This includes the Welcome page.
  • Welcome (ibm.portal.WebSphere Portal.Welcome). This includes the following portlet:
    • Page Customizer (ibm.portal.Page Customizer)
    • Page Properties (ibm.portal.Page Properties)
  • Welcome (wps.p.Welcome)
    • Organize Favorites (wps.p.Favorites)
  • Login (wps.Login). This contains the following portlet:
    • Login (wps.p.login)
  • Search (wps.p.Search Center)
  • Profile Management (wps.p.Selfcare)
  • Documents (wps.Documents). This contains the following portlet:
    • Document Manager (wps.p.Documents) and Document Picker (wps.p.DocPicker)
  • Administration (ibm.portal.Administration). This includes the following portlets:
    • Manage Pages (wps.p.Manage Pages)
    • Users and Groups (wps.p.Manage Users and Groups)
    • Resource Permissions (wps.p.Resource View)
    • User and Group Permissions (wps.p.User Group Permissions)
    • URL Mapping (wps.p.Url Mapping)
    • Custom Unique names (wps.p.Unique Names)
    • Manage Search (wps.p.Manage Search Admin)
    • Manage Document Libraries (wps.p.MDL)
    • Enable tracing (wps.p.Enable Tracing)
    • Portlet Palette (wps.p.Content Palette)
    • Personalization Picker (ibm.portal.Personalization.Picker.portlet)
    • Applications (wps.p.App Catalog)
    • Edit Layout (wps.p.Content Layout)
    • Members (wps.p.App Membership)
    • Roles (wps.p.App Roles)
    • Properties (wps.p.App Properties)
    • Parameters (wps.p.Template Parameters)
    • Application Layout (wps.p.Application Layout)
    • Application Template Library (wps.p.Template Library)
    • Portlet Wiring Tool (wps.p.Wiring)
    • Appearance portlet (wps.p.Appearance)
    • Page Locks (wps.p.Permissions)
    • Page Properties (wps.p.Properties)
    • Information Portlet (wps.p.Information)
    • Anonymous Information (wps.p.Information.Anonymous). Note: This portlet is hidden.
    • Policy Editor (wps.p.PolicyEditor)
    • Resource Policies (wps.p.PolicyExplorer)

By default the administration portlet Virtual Portal Manager is installed as part of the initial portal installation only. It is not part of the default content of virtual portals that you create. You can only use it in the initial portal installation.

Enjoy :-)

Wednesday, September 7, 2011

Performance guidelines for themes and skins

Use the following guidelines when making decisions that affect the development of your custom themes and skins. These guidelines describe the relative path length involved with the inclusion of various components of themes and skins. A number of the following changes are already implemented in the Portal theme. However, the functionality described is still supported and may have an impact on your design choices for your theme. To further aid in your design decisions, the Portal theme's approach to each guideline is listed in the following table:

Guidelines for a lightweight theme

Guideline

Effect on functionality

Effect on performance

Portal theme approach

Remove Show tools icon from the toolbar

Prevents users from displaying icons on pages and portlets used to arrange or remove content on the page.

High impact on pathlength required to generate the page

Show tools options are included through asynchronous context menus.

Remove enrollment icon from the toolbar

Prevents new visitors to the site from creating a new account for themselves.

High impact on pathlength required to generate the page

Enrollment included through asynchronous context menu.

Remove self care icon from the toolbar

Prevents users from updating account information.

High impact on pathlength required to generate the page

Edit Profile included through asynchronous context menu.

Remove AdminLinkBarInclude.jsp

Removes context-sensitive links that allow authorized users to create a new page, edit the current page, or assign permissions to the current page.

High impact on pathlength required to generate the page

These options are included through asynchronous context menu.

Remove and supporting code

Removes the ability for users to bookmark pages in the portal for quick retrievability

High impact on pathlength required to generate the page

Not included in the theme.

Shrink lines of text to remove white space

With some editors, white space might be used to aid in readability during theme development

Low impact on bandwidth required to transmit the page.

JSPs are left uncompacted for readability.

Change all HTML comments to JSP comments

None

Low impact on bandwidth required to transmit the page.

Mostly JSP comments used.

As noted earlier, not all of the above guidelines for the Portal theme may apply to all the available themes for WebSphere Portal. For example, the following guidelines do not apply to the Tab Menu - Page Builder theme:

  • Remove Show tools icon from the toolbar
  • Remove AdminLinkBarInclude.jsp
  • Remove and supporting code

Guides for a lightweight skin

Guideline

Effect on functionality

Effect on performance

IBM Skin approach

Remove minimize, restore, and maximize buttons

Prevents users from manipulating the size and state of the portlets on the page

High impact on pathlength required to generate the page

These options are included through asynchronous context menu.

Place the JSP tags for the Back, Edit, and Configure icons inside the tag.

No impact to users. Prevents unauthenticated (anonymous) users from attempting to access resources that are protected. For users that are logged in, this adds an extra JSP tag for processing. Processing of the tag has much less impact on performance than the access control checks to determine if a user has access to Edit and Configure portlet modes.

Medium impact on pathlength required to generate the page

None.

Shrink lines of text to remove white space

With some editors, white space might be used to aid in readability during skin development

Low impact on bandwidth required to transmit the page.

JSPs are left uncompacted for readability.

Remove drag and drop tags.

Users will be unable to drag and drop portlets on a page or from the Portlet Palette onto a page.

Medium impact on bandwidth required to transmit the page.

None.

Change all HTML comments to JSP comments

None

Low impact on bandwidth required to transmit the page.

Mostly JSP comments are already used.

As noted earlier, not all of the above guidelines for the IBM skin may apply to all the available skins for WebSphere Portal. For example, the Tab Menu - Page Builder theme does not use drag and drop tags. It uses the Dojo drag and drop framework. Hence, the Remove drag and drop tags guideline does not apply to the Tab Menu - Page Builder and the corresponding skins.

Note: If your starting point is the IBM skin, remember that portlet context menus are loaded asynchronously and the changes to the options available mentioned below (removing window state choices, surrounding in tag) will not affect the initial page size. The changes will affect the size of the page required to generate the contents of the portlet context menu.

Static resources

If possible, any CSS or Javascript that is included either in a theme, skin, portlet application, widget, or by any other extension should be built together either at buildtime or runtime, and then minimized and compressed to remove comments and unnecessary whitespace. This decreases the overall size of these files, reduces the number of HTTP requests the browser must make to aggregate the page, and reduces the load on the Web servers and Portal server. Using CSS sprites in themes, skins, and portlets can improve performance as well for the same reasons.

Wednesday, August 17, 2011

Theme Style and Theme Policy

The theme policy concept has introduced in WebSphere portal server v6.x and above version. Theme Style and Theme Policy are different.

The theme style is used to modify the colors, fonts, and graphics displayed by the theme.

And theme policy is used to turn portions of the page on or off and adjust settings of those areas that are rendered, such as control the menu bread crumbs. These elements are controlled by modifying policy attributes and applying the policy to one or more pages.

The differences between 'Theme Style' and 'Theme Policy' are as following:

Theme Style

· We can create a new Theme Style using the Portal Administration, under Portal User Interface > Theme Customizer.

· We can edit a Theme Style using the Theme Customizer.

· We can remove a Theme Style using the Theme Customizer.

· You can apply a Theme Style to a page using the Theme Customizer or the Manage Pages portlet. The Manage Pages portlet treats a Theme Style as a Theme Policy.

Theme Policy

· We can create a new Theme Policy using the XML Configuration Interface.

· We can not edit a Theme Policy using the Theme Customizer.

· We can update a Theme Policy using the XML Configuration Interface (xmlaccess).

· We can not delete a Theme Policy using the Theme Customizer.

· We can remove a Theme Policy using the XML Configuration Interface (xmlaccess).

· We can apply a Theme Policy to a page using the Manage Pages portlet or the XML Configuration Interface.

Tuesday, November 24, 2009

The caching features in jsr 286 portlets.

The JSR 286 specification added the following two new caching features:
1. Public cache scope: the cache entries are shared across users
2. Validation based caching: expired cache entries can be validated using ETag
But there in JSR 168, only "Expiration" cache was supported. And also the cache is per user client and not shared across users.
Public Cache Scope You can tell the Portlet Container that the cache entry can be shared across users. This can be done by setting the value of element to public.The default value is "private" which behaves like the JSR 168 caching where the cache is per user. The cache scope can also be changed programmatically using a response property(i.e MimeResponse.PUBLIC_SCOPE, MimeResponse.PRIVATE_SCOPE) or the new CacheControl interface(i.e response.getCacheControl().setPublicScope(true).)



Validation based Caching Validation" caching is supported along with "Expiration" caching. After the cache has expired the portlet has the option to check if the cache is still valid and indicate that the cache can be reused. To enable this, ETag has been introduced, which is similar to how the browsers, which conform to HTTP 1.1, perform caching. Once the cache has expired the Portlet Container calls the render/serveResource method with the ETag set in the RenderRequest/ResourceRequest, which the portlet can access and check if the cache is still valid. If the cache is still valid, then the portlet can set CacheControl.setUseCachedContent(true) in the response, and the new expiration time.
protected void doView (RenderRequest request, RenderResponse response)    throws PortletException, IOException {

if ( request.getETag() != null ) { // validation request
if ( markupIsStillValid(request.getETag()) ) {
// markup is still valid
response.getCacheControl().setExpirationTime(30);
response.getCacheControl().setUseCachedContent(true);
return;
}
}
// create new content with new validation tag
response.getCacheControl().setETag(someID);
response.getCacheControl().setExpirationTime(60);
PortletRequestDispatcher rd = getPortletContext().getPortletRequestDispatcher(“view.jsp”); rd.include(request, response);
}

The introduction of ETag ensures that the browser can be leveraged to cache resources and markup. With the new features of public sharing of caches, resource caching, validation caching and leveraging browser caching, the performance of aggregation of portlets by a portal can be seen to increase significantly.

Wednesday, November 18, 2009

How to write the portlet filter ?

You can write a portlet filter in geven two steps:

Step 1 - Write a filter class: A filter class should implement one or more of the above mentioned four interfaces and should provide a no argument public constructor. The filter class should also override the init() and destroy() methods of the javax.portlet.filter.PortletFilter interface.



Step 2 - Filter and filter mapping: Define the filter and filter mapping in the portlet.xml . This is done using the element, where you also need to specify the lifecycle call to which the filter should be applied. In the element you describe to which portlets the filter should be applied. If you want the filter to be applied to all portlets in the application, you need to used an asterisk as a wildcard.

Tuesday, November 17, 2009

What are the Portlet Filters ?

A portlet filter is same as a servlet filter. The only difference is that a servlet has only one request handling method, service() and therefore there is only one type of the servlet filter. A portlet on the other hand has four types of request handling methods and therefore there are four different types of portlet filters.

The portlet API defines the following interfaces for creating portlet filters:
javax.portlet.filter.ActionFilter - For processAction method
javax.portlet.filter.EventFilter - For processEvent method
javax.portlet.filter.RenderFilter - For render method
javax.portlet.filter.ResourceFilter - For serveResource method

Each of the above filter interface contains a single doFilter(Request, Response, FilterChain chain) method which differs in the type of request and response object. For example, the doFilter() method of ActionFilter takes instances of ActionRequest and ActionResponse objects while the doFilter() method of RenderFilter takes instances of the RenderRequest and RenderResponse.

Each filter interface extends a common base interface called javax.portlet.filter.PortletFilter. This common base interface contains two methods:
init(javax.portlet.filter.FilterConfig filterConfig) and destroy(). The init() method makes sure that every filter has access to a FilterConfig object from which it can obtain its initialization parameters, a reference to the PortletContext which it can use, for example, to load resources needed for filtering tasks. The destroy() method signifies the end of service of the filter. The init() and destroy() methods of a portlet filter are called only once during their lifetime.

A single filter class can provide filter functionality for more than one life cycle method. Also, a single filter can provide filter functionality for more than one portlet. Multiple filters can be associated with one life cycle method of a portlet. The doFilter() method of a portlet filter might create customized request and response objects by using the RequestWrapper and ResponseWrapper classes and by passing these wrappers to the doFilter() method of the FilterChain object.

Note: A portlet filter is a Java technology-based component that can be used to modify the content of the portlet request and portlet response before or after any life cycle method of the portlet.


Click here to know How we can write a portlet filter?

Thursday, November 12, 2009

Set cookies for portlet.

There you can set cookies for your portlet on the response of each lifecycle method (processAction, processEvent, render, and serveResource) with the following code:
response.addProperty(javax.servlet.http.Cookie cookie);

The cookie can then be accessed in all lifecycle methods using: request.getCookies(); method.