Page tree
Skip to end of metadata
Go to start of metadata

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:

  1. From the Integration Studio menu, select File > New, and click Project.
  2. In the New Project dialog box, expand the Capacity Optimization Portlet node in the tree view, select Capacity Optimization Portlet Project, and click Next.
  3. In the New Portlet project dialog box, enter a name for your new portlet project resource.
  4. Under Contents, select the appropriate option.
  5. 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:

  • The caplan.myapp.myportlets Java portlet class located under the src/main/java folder.
  • All required libraries required to compile the portlet class under /lib, and referenced by the project.
  • The JSP files, view.jsp and edit.jsp, responsible for rendering the portlet, located under src/main/webapp/myportlet.
  • The following XML configuration files, located under /src/main/webapp/WEB-INF, needed to deploy the portlet:
    • liferay-display.xml
    • liferay-portlet.xml
    • portlet.xml
    • web.xml
  • All the tag library (taglib) definition files used in the JSPs, located under /src/main/webapp/WEB-INF/tld.

    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:

  1. Refactorthe portlet class by assigning it a new package and class name. To do this, perform the following steps:
    1. Right-click MyPortlet.java located under caplan.myapp.myportlets, choose Refactor, and click Rename.
    2. In the Rename Compilation Unit dialog, enter a new name for your portlet.
    3. Select the appropriate check boxes.
    4. In the subsequent dialog that is displayed, view and verify the changes to your portlet.
    5. Click Finish to refactor you portlet.
  2. Rename (refactor) the myportlet class located under /src/main/webapp.
  3. Modify liferay-display.xml, liferay-portlet.xml, portlet.xml and web.xml located under the WEB-INFfolder to reflect your changes. To do this:
    1. Double-click the .xml file you want to modify. At this point, the .xml file opens in edit mode in the right pane.
    2. In the tree view, expand the display node down to the last level.
    3. 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.