Channels ▼
RSS

.NET

.NET Development & the IBM WebSphere Portal Server

Source Code Accompanies This Article. Download It Now.


WSRP

An emerging standard for portlet development is Web Services for Remote Portlets (WSRP; www.oasis-open.org). WSRP defines a set of SOAP messages that contain portlet mark-up fragments. This means that the portlets themselves can be hosted on a remote machine to the portal server. The technology used to develop the portlets is immaterial so long as the HTML is exposed by a WSRP-compliant web service—a "WSRP Producer." The portal acts as a WSRP Consumer. WSRP 1.0 supports content navigation and interactions between the user and the portlet, managed by the portal. Future versions of WSRP will also support inter-portlet communication between remote portlets, mediated by the portal.

NetUnity (www.netunitysoftware.com) offers a tool that exposes ASP.NET pages as WSRP portlets via a simple mechanism. The tool adds a new PortletLibrary template to the Visual Studio IDE that offers two new types of file: a Portlet and a WSRP Portlet Page. The Portlet is a simple file that defines the ASP.NET pages that provide the entry points for the portlet in its standard modes: View, Edit, and Help (Listing Ten). The Portlet file has parallels with the portlet.xml file of JSR 168.

using System;
using System.Web.UI;
using NetUnity.WSRP;
using NetUnity.WSRP.ASP;

[OfferedHandle("800b284e-dc02-4c29-961a-a289149a979e")]
[Title("My ASP.NET Portlet")]
[DisplayName("My ASP.NET Portlet")]
[Modes(PortletMode.View, PortletMode.Edit, PortletMode.Help)]
[WindowStates(WindowState.Maximized, WindowState.Minimized, WindowState.Normal, WindowState.Solo)]
[PortletPage(PortletMode.View, "ViewPage.aspx")]
[PortletPage(PortletMode.Edit, "EditPage.aspx")]
[PortletPage(PortletMode.Help, "HelpPage.aspx")]
public class MyPortlet : NetUnity.WSRP.ASP.AspPortlet
{
}
Listing Ten

WSRP Portlet Page is an ASP.NET page that inherits from NetUnity.WSRP.ASP .WsrpPage rather than the standard System.Web.UI.Page class. Other than that, the ASP.NET developer is free to develop as usual, subject to a few restrictions: Ajax currently is not well supported and Session must be managed through the use of the NetUnity.WSRP.StateBag rather than the standard ASP.NET Session. URLs (for redirection and downloading of embedded resources) must be managed using a set of special methods provided by the NetUnity assemblies. Once compiled, the portlet is deployed as a set of ASPX pages and their code behind, and an asmx file that is automatically created by the NetUnity toolkit. This provides the WSDL that is required by a WSRP consumer.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video