Before you start developing a new Dashboard portlet, you first need to create it. Use the following task to create a new Dashboard portlet using Integration Studio:
- From the Integration Studio menu, select File > New, and click Project.
- In the New Project dialog box, expand the Capacity Optimization Portlet node in the tree view, select Capacity Optimization Portlet Project, and click Next.
- In the New Portlet project dialog box, enter a name for your new portlet project resource.
- Under Contents, select the appropriate option.
- Click Finish to create your portlet project.
Creating a new portlet project
At this point, your IDE switches to a Java perspective, and your new portlet project is displayed under Package Explorer.
Your new portlet project
Your new portlet project already contains an example portlet template that you can edit to obtain your custom component. In particular, this template contains:
caplan.myapp.myportlets Java portlet class located under the
- All required libraries required to compile the portlet class under
/lib, and referenced by the project.
- The JSP files,
edit.jsp, responsible for rendering the portlet, located under
- The following XML configuration files, located under
/src/main/webapp/WEB-INF, needed to deploy the portlet:
- All the tag library (taglib) definition files used in the JSPs, located under
An example of a portlet template
BMC recommends you to rename your portlet template soon after you create it. The following task describes how this is done:
- Refactorthe portlet class by assigning it a new package and class name. To do this, perform the following steps:
- Right-click MyPortlet.java located under
caplan.myapp.myportlets, choose Refactor, and click Rename.
- In the Rename Compilation Unit dialog, enter a new name for your portlet.
- Select the appropriate check boxes.
- In the subsequent dialog that is displayed, view and verify the changes to your portlet.
- Click Finish to refactor you portlet.
- Rename (refactor) the
myportlet class located under
web.xml located under the
WEB-INFfolder to reflect your changes. To do this:
- Double-click the .xml file you want to modify. At this point, the .xml file opens in edit mode in the right pane.
- In the tree view, expand the display node down to the last level.
- Next to id, click on MyPortlet, enter the new name, and press Enter.
You are now ready to start developing your first portlet. If you would like to view a full code example of a simple portlet, see An example of a simple portlet.