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 servicea "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 { }
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.