Quick tutorial: deploying the portlet test suite
Before diving deeper into portlet integration, let’s start with a quick example of portlet deployment and usage. In this tutorial we will deploy the Apache Pluto test suite portlet, which is used for compatibility testing with the specification.
Steps :
-
Download the Apache Pluto portlet testsuite from: http://search.maven.org/remotecontent?filepath=org/apache/portals/pluto/pluto-testsuite/2.0.2/pluto-testsuite-2.0.2.war
-
Launch Jahia
-
Go into the administration screen, select “Server settings” and then “Manage Portlet”.
-
Click on the “Deploy new portlets” button.
![jahia6_6_portletguide_en-1.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-1.png)
-
Click on the “Browse...” button and navigate to the pluto-testsuite-2.0.2.war file and select it.
![jahia6_6_portletguide_en-2.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-2.png)
-
Then click on “Deploy new portlets”. You should now see the portlet application listed as “pluto-testsuite-2.0.2” in the “Manage portlets” screen. By selecting the application, you can view the list of portlets embedded in the application:
![jahia6_6_portletguide_en-3.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-3.png)
-
Go back to the “Server settings” screen and create a web project if you haven’t already done so. An easy way of doing this is to import the “ACME Website Demo 6.5” and click on “Proceed”:
![jahia6_6_portletguide_en-4.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-4.png)
-
Leave the defaults if they are and click “Import”. This step will take time in order to create the site.
![jahia6_6_portletguide_en-5.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-5.png)
-
Once it has completed, it will display the list with an “ACME” site now present. Now go back to the main administration screen, click on “Site settings” and make sure the “ACME site” is selected in the site drop-down list:
![jahia6_6_portletguide_en-6.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-6.png)
-
Then click on “Go to Edit Mode”
-
Open the Portlet Manager from the “Managers” drop down menu in the top Edit Mode tab:
![jahia6_6_portletguide_en-7.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-7.png)
-
The manager will be empty as we haven’t created any portlet instances yet. Right-click on “portlets” under “Current Site Portlets”:
![jahia6_6_portletguide_en-8.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-8.png)
-
Select “New portlet”. This will open up the Portlet Wizard:
![jahia6_6_portletguide_en-9.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-9.png)
-
Select “Test Portlet #1” and click Next on each of the following screens, and to complete this process, press “Finish”. You have now created a portlet instance for the portlet called “Test Portlet #1”. The Portlet Manager will refresh, and you will see this new portlet instance displayed in the right panel:
![jahia6_6_portletguide_en-10.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-10.png)
-
You may now close the Portlet Manager and go back to the main “Edit Mode” screen. In the left side panel, click on the Portlet tab, open up the “ACME” site node and select the “portlets” node. In the lower half of the left side panel you should see the newly created “Test Portlet #1” as illustrated below:
![jahia6_6_portletguide_en-11.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-11.png)
-
You can now simply drag and drop the portlet instance into any page you wish, confirm the portlet reference in the content editing screen and click “Save”:
![jahia6_6_portletguide_en-12.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-12.png)
-
The page will then refresh and should look something like this, depending on where you have positioned the portlet:
![jahia6_6_portletguide_en-13.png [image]](/files/live/sites/jahiacom/files/documentation/6.6/en/images/PortletGuide/jahia6_6_portletguide_en-13.png)
-
You can then switch to the Preview Mode to test your portlet (interacting with the portlet in Edit Mode is not supported nor recommended).
This concludes our quick tutorial on how to deploy, instantiate and position a portlet in a page.

