Mainsoft for Java EE, Portal Edition
Within Mainsoft for Java EE, Portal Edition (www.mainsoft.com), the JSR 168 API is reproduced in the .NET namespace javax.portlet, mirroring the Java portlet-api.jar. .NET developers have full access to the entire API. The vmw.PortletUtils class lets you access the request and response objects; see Listing Three.
From these objects, you can access the entire functionality of the JSR 168 spec. Listing Four shows how portlet preferences can be stored, while Listing Five shows how the portlet can be read backa useful technique for preserving data across user sessions.
Mainsoft for Java EE, Portal Edition provides a set of ASP.NET controls that automatically apply the WebSphere Portal styles to the controls. However, ASP.NET developers can use any of the standard controls (if desired). These pick up the WebSphere theme and skin if you use the correct portal styles.
ActionRequest ar = vmw.portlet.PortletUtils.getPortletRequest() as ActionRequest; RenderResponse rs = vmw.portlet.PortletUtils.getPortletResponse() as RenderResponse;
ActionRequest ar = vmw.portlet.PortletUtils.getPortletRequest() as ActionRequest; PortletPreferences prefs = ar.getPreferences(); prefs.setValue("userData", someData); prefs.store();
RenderRequest rr = vmw.portlet.PortletUtils.getPortletRequest() as RenderRequest; PortletPreferences prefs = rr.getPreferences(); string userData = prefs.getValue("lastsearch", string.Empty);
Once the code is ready for compilation, the tool automatically converts the MSIL to Java bytecode, creates a standard WAR file, and deploys it to the WebSphere Portal. You can debug code directly in Visual Studio as long as the Portal debugging service is turned on.