Hi devs,
I need your help.

I am trying to complete the Portal/Portlet stuff adding the possibility to
set some attributes specific to a Portlet instance.

The idea is that when a portlet is defined, a form is defined also and
linked in the PortalPortlet entity with something similar to this:
    <PortalPortlet portalPortletId="LOGIN" portletName="Login"
description="Login form"
                   screenName="loginPortlet"
screenLocation="component://common/widget/PortletScreens.xml"
                   editFormName="LoginPortletEdit"
editFormLocation="component://common/widget/PortletEditForms.xml" />

The form is needed to edit a particular Portlet instance attributes. This
extends from a common frame defined in the framework like this:
    <form name="CommonPortletEdit" type="single"
target="setPortalPortletAttributes" title=""
default-map-name="PortalPortletAttributeMap">
        <field name="portalPageId"><hidden/></field>
        <field name="portalPortletId"><hidden/></field>
        <field name="portletSeqId"><hidden/></field>
        <field name="submitButton" title="${uiLabelMap.CommonEdit}"><submit
button-type="button"/></field>
    </form>

Using this method an example of a specific portlet attribute editing form
could be:
    <form name="LoginPortletEdit" extends="CommonPortletEdit"
extends-resource="component://common/widget/CommonForms.xml">
        <field name="ItemsToShow">
            <drop-down allow-empty="false">
                <option key="5"/>
                <option key="15"/>
                <option key="20"/>
                <option key="25"/>
                <option key="30"/>
                <option key="35"/>
            </drop-down>
        </field>
    </form>

In this example I supposed that the portlet has an attribute "ItemsToShow"
that tells the portlet how many items to show.

When the user submits one of the portlet attributes editing forms, the
setPortalPortletAttributes service is triggered.

My problem is now how to make this service able to retrieve from the
submitted form the list of fields so that the Attribute entities can be
created/updated.

Is there an example of this in OFBiz?
How can the service receive a map of fields that is not constant to iterate
on?

Many thanks for your help!
-Bruno

Reply via email to