[FrontPage] [TitleIndex] [WordIndex

Happily hacking the hell out of igeoportalet

UT: here my log book, typed in as I went by the bits and bytes.

1. Intro

We're creating a portlet named "EnterBBOXPortlet". Because it's a iGeoPortal Portlet, we'll given it a better name: "iGeoPortal:EnterBBOXPortlet". That's a convention we follow, but of course, you're free to disagree ;-)

Make sure you have stopped Tomcat, otherwise the bad cat might undo your changes.

The basic deployment mechanism has four steps: defining the portlet metadata and jsp, copying those files into the proper directories, adding the portlet (sing JetSpeed admin interface) and, finally, writing the Java code. We take it easy and shw all intermediate steps too.

2. Create an xreg file for your portlet

<?xml version="1.0" encoding="UTF-8"?>
<registry>
    <portlet-entry name="iGeoPortal:EnterBBOXPortlet" hidden="false" type="ref" parent="JSP" application="false">
        <meta-info>
            <title>iGeoPortal:EnterBBOXPortlet</title>
            <description>Portlet for entering a new map bbox</description>
        </meta-info>
        <classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
        <parameter name="template" value="enterbbox.jsp" hidden="true" cachedOnName="true" cachedOnValue="true"/>
        <parameter name="action" value="portlets.EnterBBOXPortletAction" hidden="true" cachedOnName="true" cachedOnValue="true"/>
        <parameter name="mapPortletID" value="P-105ab3f206c-10000" hidden="false" cachedOnName="true" cachedOnValue="true"/>
        <media-type ref="html"/>
        <url cachedOnURL="true"/>
    </portlet-entry>
</registry>

Note the pitfall here, the Java class behind this portlet is available at:

org.deegree.portal.portlet.modules.map.actions.portlets.EnterBBOXPortletAction

but we only give a relative Java class name:

"portlets.EnterBBOXPortletAction" as in

<parameter name="action" value="portlets.EnterBBOXPortletAction" hidden="true" cachedOnName="true" cachedOnValue="true"/>

3. Copying file

Copy this file into the igeoportalet\WEB-INF\conf folder

4. Defining the jsp

You must also copy the enterbbox.jsp into the igeoportal\WEB-INF\igeotemplates\jsp\portlets\html\ directory

5. Adding the portlet

You are now ready to start programing. The basic info is already available. We'll now make the portlet available, even though there'S no code to run

6. Adding the portlet with JetSpeed GUI

You are now ready to start programing. The basic info is already available. We'll now make the portlet available, even though there'S no code to run

We now want to add this new portlet. We'll add it to anon (that's the user) default PSML. Restart the web app, log in (SEC_ADMIN/jetspeed) and browse to

Admin/PSML Browse

Choose to modify anon's defaut.psml (click on it!).

Click on Mapwindow, we want to put the portlet in this tab.

BUG ALERT: JetSpeed doesn't show add new portlet. Hack around by choosing a 25/75 layout! See the button going active?

Click on add portlet and browse till you find iGeoPortal:EnterBBOXPortlet. Check it and go back. Save chanegs by clicking on apply. Logout, point your browser to http://localhost:8080/igeoportalet/

See your portlet? If now, open a window and through your computer out. Before doing that, make sure you got a new job, an insurance, and a good friend at the next police dept.

If you see your portlet, it's time to start writing some code.

7. Write some Java code

Currently, you need to implement two classes, a portlets.EnterBBOXPortletAction and portlets.EnterBBOXPortletPerform. Confunsigly enough, the actions happens in Perform. Action just delegates to it.


CategoryDeegree2 CategoryHowTo


2018-04-20 12:04