Creating a WSRP Portlet Using the .NET Portlet Toolkit
To create a new WSRP portlet, use the Microsoft Visual
Studio 2005 templates provided with the .NET Portlet Toolkit. The
templates are pre-configured to include references to required BEA
assemblies, including the .NET Portlet API.
A new portlet project includes a simple portlet page in the
Default.aspx/Default.aspx.cs files. This page includes the namespaces
necessary for accessing the WSRP Portlet API classes such as
PortletPropertyAttribute and the
WSRPPortletContext.
Follow the steps below to create a new portlet using the WSRPPortletPage template.
- Create a new WSRP portlet project in Microsoft Visual Studio
2005. Note: ALI Portlet and Preference Page templates cannot be used
for WSRP portlets.
- To create a new Web application project, follow the
instructions below:
- Click
- Under Project types, select Visual
C#.
- In the My Templates list, select WSRP Portlet Web Application.
- Enter a name for the project.
- To create a new Web Site project, follow the instructions
below:
- Click .
- Select the language option: C#.
- In the My Templates list, select WSRP Portlet Project. (ALI Portlet and Preference Page templates
cannot be used for WSRP portlets.)
- Enter a name for the project.
- Create a new portlet page:
- In the Solution Explorer, right-click
on the root of the project and select Add New Item….
- In the My Templates list, select WSRP Portlet Page.
- Save the page with an intuitive name (for example, “HelloWorld.aspx”).
- Add the necessary functionality to the portlet page:
If the portlet should support CSS styling applied by the WSRP
Consumer , you must use the CSS class names defined in the WSRP specification.
- Register the portlet with the WSRP Producer. For details,
see Registering a Portlet with the WSRP Producer.
- Deploy the portlet in WLP. For details, seeConsuming a .NET WSRP Portlet in WebLogic Portal.