You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Kalyan Sundhar <Ka...@symphonysv.com> on 2004/02/23 06:09:08 UTC

Customization with JspPortlet

Hi,
 
I am new to jetspeed and I am facing a problem while trying to customize
my portlet. The portlet entry in local-portlet.xreg is as below.
 
    <portlet-entry name="Top5Suppliers" hidden="false" type="ref"
        parent="JSP" application="false">
       <meta-info>
            <title>Top 5 Suppliers</title>
            <description>Top 5 Suppliers</description>
            <image>/images/rptGrid.gif</image>
        </meta-info>
 
<classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
        <parameter name="template" value="/Top5Suppliers.jsp"
            hidden="true" cachedOnName="true" cachedOnValue="true">
            <meta-info/>
        </parameter>
        <parameter name="action" value="portlets.MyPortletAction"
            hidden="true" cachedOnName="true" cachedOnValue="true">
            <meta-info/>
        </parameter>
         .................
         .................

        <media-type ref="html"/>
        <url cachedOnURL="false"/>
        <category group="Jetspeed">SpendApp</category>
    </portlet-entry>
 
My action class MyPortletAction extends GenericMVCAction and I am
overriding the buildNormalContext method to populate the request object
with some attributes that the JSP can retrieve and display. The normal
mode template I am using is Top5Suppliers.jsp. For customization I am
using the default template. As I am using the default template for
customization, when I click on customize button on titlebar, the control
goes to GenericMVCPortlet and CustomizeAction class is called. In the
CustomizeAction class, the action attribute is hard-coded to
portlets.CustomizeAction and set in the context.
 
        context.put("action", "portlets.CustomizeAction");
 
In the customization page, I want to display the parameters in a
specific order. In the buildNormalContext method of CustomizeAction
class, the parameters are iterated using an iterator object and set in
the context. I want to take control of setting the parameters in the
context. How would I do that? 
 
Kindly help me on this.
 
Some more clarification what I want is,
1) How would I use my own customizer instead of default customizer? Is
there any specific parameter name that I can use in local-portlet.xreg
to  specify my own customizer?. Instead of using JspPortlet, Do I need
to extend JspPortlet and take the control to do my stuff ?
2) When I am specifying my own Action class in the xreg file, why the
control is going to CustomizeAction class when I click on customize
button ?
 
Thanks in advance.
 
Kalyan.