svn commit: r1307601 [1/3] - in /ofbiz/branches/20120329_portletWidget/framework: base/src/org/ofbiz/base/util/ common/config/ common/data/ common/entitydef/ common/webcommon/WEB-INF/ common/widget/ images/webapp/images/ webtools/config/ webtools/webap...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1307601 [1/3] - in /ofbiz/branches/20120329_portletWidget/framework: base/src/org/ofbiz/base/util/ common/config/ common/data/ common/entitydef/ common/webcommon/WEB-INF/ common/widget/ images/webapp/images/ webtools/config/ webtools/webap...

erwan
Author: erwan
Date: Fri Mar 30 20:44:26 2012
New Revision: 1307601

URL: http://svn.apache.org/viewvc?rev=1307601&view=rev
Log:
First patch from OFBIZ-4742

Modified:
    ofbiz/branches/20120329_portletWidget/framework/base/src/org/ofbiz/base/util/UtilURL.java
    ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml
    ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml
    ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml
    ofbiz/branches/20120329_portletWidget/framework/common/entitydef/entitymodel.xml
    ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/portal-controller.xml
    ofbiz/branches/20120329_portletWidget/framework/common/widget/CommonScreens.xml
    ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageScreens.xml
    ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/selectall.js
    ofbiz/branches/20120329_portletWidget/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/main.ftl
    ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml
    ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml
    ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd
    ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd
    ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/html/HtmlMenuRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/menu/MenuStringRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/menu/ModelMenuItem.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/MacroScreenRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/text/TextFormRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/xml/XmlFormRenderer.java
    ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlFormMacroLibrary.ftl
    ofbiz/branches/20120329_portletWidget/framework/widget/templates/htmlScreenMacroLibrary.ftl

Modified: ofbiz/branches/20120329_portletWidget/framework/base/src/org/ofbiz/base/util/UtilURL.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/base/src/org/ofbiz/base/util/UtilURL.java?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/base/src/org/ofbiz/base/util/UtilURL.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/base/src/org/ofbiz/base/util/UtilURL.java Fri Mar 30 20:44:26 2012
@@ -160,4 +160,18 @@ public class UtilURL {
 
         return buf.toString();
     }
+
+    //#Bam# portletWidget, used by addToParamsIfInContext for idDescription which is "user text"
+    /**This method can be used to remove all characters that may break a URL in the application
+     * @param in
+     * @return string after removing ', ", / and \ characters
+     */
+    public static String removeBadCharForUrl(String in){
+        if(UtilValidate.isNotEmpty(in))
+            return in.replace("<", "").replace(">", "").replace("'", "").replace("/", "").replace("\\", "").replace("\"", "").replace("&", "");
+        else
+            return "";
+    }
+    //#Eam# portletWidget
+
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml Fri Mar 30 20:44:26 2012
@@ -19,6 +19,121 @@
     under the License.
 -->
 <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    
+    <!--#Bam# portletWidget -->
+    <property key="FieldDescription.component">
+        <value xml:lang="en">Portlet component, used for search and classification and generate default value for other Portlet field (most of them, not mandatory but strongly recommended if portletType is used) </value>
+        <value xml:lang="fr">Le composant de référence pour cette portlet, utilisé pour rechercher et classifier les portlet et générer des valeur par défaut pour les autres champs (beaucoup, pas obligatoire mais fortement recommandé si un type de portlet est utilisé)</value>
+    </property>
+    <property key="FieldDescription.editAreaDivId">
+        <value xml:lang="en">Used by some portlet template, to define an area where show via ajax, in addition to content already present, a portlet (for edition most of time); default value is {portletLongId}_EditArea</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir une zone où pouvoir afficher via ajax, en plus du contenu déja présent, une portlet (d'édition le plus souvent); la valeur par défaut est {portletLongId}_EditArea</value>
+    </property>
+    <property key="FieldDescription.editFormLocation">
+        <value xml:lang="en">look at editFormName; default value is component://{component}/widget/({webapp}/ if webapp not empty){subComponent}Forms.xml</value>
+        <value xml:lang="fr">voir form d'édition; la valeur par défaut est component://{component}/widget/({webapp}/ si webapp non vide){subComponent}Forms.xml</value>
+    </property>
+    <property key="FieldDescription.editFormName">
+        <value xml:lang="en">If portlet is customizable, form name to edit portlet parameters; default value is EditParam_{portletLongId}</value>
+        <value xml:lang="fr">Si la portlet est paramétrable, nom de la form pour éditer les paramètres; la valeur par défaut est EditParam_{portletLongId}</value>
+    </property>
+    <property key="FieldDescription.formLocation">
+        <value xml:lang="en">look at formName; default value is component://{component}/widget/({webapp}/ if webapp not empty){subComponent}Forms.xml</value>
+        <value xml:lang="fr">voir nom de la form; la valeur par défaut est component://{component}/widget/({webapp}/ si webapp non vide){subComponent}Forms.xml</value>
+    </property>
+    <property key="FieldDescription.formName">
+        <value xml:lang="en">Used by some portlet template, to define the form used (ex: SimpleScreenlet ); default value is {portletLongId}</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir la nom de la form utilisé (par ex: dans SimpleScreenlet); la valeur par défaut est le {portletLongId}</value>
+    </property>
+    <property key="FieldDescription.helpContentId">
+        <value xml:lang="en">Used to give contentId which will be shown, on top before links to each portlet Help, when help on this page will be call</value>
+        <value xml:lang="fr">permet de préciser l'identifant d'un élément de contenu qui sera affiché dans l'écran de d'aide de cette page portail au-dessus des liens vers l'aide de chacune des portlets.</value>
+    </property>
+    <property key="FieldDescription.helpName">
+        <value xml:lang="en">Id used to show help text about this portlet; default value is HELP_{portalPortletId}; if helpName is not empty and start with DETAIL_ the end is a user context field which contain last selected portletId to show in this place, so it's its helpName which will be used</value>
+        <value xml:lang="fr">identifiant utilisé afficher le help de cette portlet; la valeur par défaut est HELP_{portalPortletId}; si ce champ est non vide et commence par DETAIL_ alors la fin de ce champ représente le nom d'une variable du contexte utilisateur qui contient l'identifiant de la portlet dernièrement affiché à cet emplacement, c'est donc l'aide de celle-ci qui affiché.</value>
+    </property>
+    <property key="FieldDescription.menuLocation">
+        <value xml:lang="en">look at menuName; default value is component://{component}/widget/({webapp}/ if webapp not empty){subComponent}Menus.xml</value>
+        <value xml:lang="fr">voir nom menu; la valeur par défaut est component://{component}/widget/({webapp}/ si webapp non vide){subComponent}Menus.xml</value>
+    </property>
+    <property key="FieldDescription.menuName">
+        <value xml:lang="en">Used by some portlet template, to define menuName used (ex: in screenlet top); default value is {portletLongId}</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir la nom du menu utilisé (par ex: dans la barre du screenlet); la valeur par défaut est {portletLongId}</value>
+    </property>
+    <property key="FieldDescription.pkIdName">
+        <value xml:lang="en">Used by some portlet template, to define field name to test in condition to show or not portlet; no default value </value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir la nom du champ à tester pour savoir si on affiche ou non la portlet; il n'y a pas de valeur par défaut</value>
+    </property>
+    <property key="FieldDescription.portletLongId">
+        <value xml:lang="en">Sometime portletId is too short to be readable, so a id more long, for generate default value for other field this field will be used; default value {portletLongId}</value>
+        <value xml:lang="fr">L'id de la portlet est quelque fois trop court pour être lisible, celui-ci est plus long, il sera utilisé pour la génération des valeur par défaut pour les autres champs; la valeur par défaut est {portletLongId}</value>
+    </property>
+    <property key="FieldDescription.portletName">
+        <value xml:lang="en">Short description</value>
+        <value xml:lang="fr">Description courte</value>
+    </property>
+    <property key="FieldDescription.portletTypeId">
+        <value xml:lang="en">Can be empty, define a portlet template name (enumCode): a screen in PortletTypeScreens.xml in common</value>
+        <value xml:lang="fr">Peux être vide, défini le modèle de portlet, le nom (enumCode) correspond à un screen dans PortletTypeScreens.xml dans common</value>
+    </property>
+    <property key="FieldDescription.screenLocation">
+        <value xml:lang="en">look at screenName; default value is component://{component}/widget/({webapp}/ if webapp not empty){subComponent}Screens.xml</value>
+        <value xml:lang="fr">voir nom de screen; la valeur par défaut est component://{component}/widget/({webapp}/ si webapp non vide){subComponent}Screens.xml</value>
+    </property>
+    <property key="FieldDescription.screenName">
+        <value xml:lang="en">if portletType is empty, it's the screen which will be used, otherwise it will include in template (if template need a screen); default value is {portletLongId}</value>
+        <value xml:lang="fr">Si portletTypeId est vide c'est le screen qui sera utilisé, sinon c'est celui qui sera inclus dans le modèle (si le modèle en a besoin); la valeur par défaut est le {portletLongId}</value>
+    </property>
+    <property key="FieldDescription.scriptName">
+        <value xml:lang="en">Used by some portlet template (portletType not empty), to define the script to used (ex: SFScreenlet ); default value is {portletLongId} in file component://{component}/script/org/ofbiz/{component}/({webapp}/ if webapp not empty){subComponent}Wscripts.xml</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet (portletType non vide), pour définir la nom du script à utiliser (par ex: dans SimpleScreenlet); la valeur par défaut est le {portletLongId} dans le  fichier component://{component}/script/org/ofbiz/{component}/({webapp}/ if webapp not empty){subComponent}Wscripts.xml</value>
+    </property>
+    <property key="FieldDescription.securityMainAction">
+        <value xml:lang="en">Can be empty, the main action which can be done with this portlet, possible values: CREATE UPDATE VIEW DELETE</value>
+        <value xml:lang="fr">Peux être vide, l'action principale réalisé par cette portlet, les valeurs possible sont CREATE UPDATE VIEW DELETE</value>
+    </property>
+    <property key="FieldDescription.securityPermission">
+        <value xml:lang="en">Can be empty, if not, Permission needed to see Portlet (permission_mainAction)</value>
+        <value xml:lang="fr">Peux être vide, sinon, Permission que l'utilisateur doit avoir (avec l'action) pour pouvoir accéder à cette portlet</value>
+    </property>
+    <property key="FieldDescription.securityServiceName">
+        <value xml:lang="en">Can be empty, the service named here is used to see if current user can see the portlet on the list of available portlets; the screen that the portlet calls should also call this service to check permission and not render; the service named here must implement the "permissionInterface" service just like services used for service permissions</value>
+        <value xml:lang="fr">Peux être vide, ce nom du service est utilisé pour valider si l'utilisateur actuel peut voir la portlet dans la liste des portlets disponibles; le screen que cette portlet appelle peut aussi appeler ce service pour verifier la permission et donc s'afficher ou non; Le service nomé ici doit implémenter l'interface du service "permissionInterface" comme tous les services de validation des permissions</value>
+    </property>
+    <property key="FieldDescription.subAreaDivId">
+        <value xml:lang="en">Used by some portlet template, to define an area where show via ajax, a portlet (ex: for multiple tab); default value is {portletLongId}_SubArea</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir une zone où pouvoir afficher via ajax, une portlet (par ex: pour différent onglet); la valeur par défaut est {portletLongId}_SubArea</value>
+    </property>
+    <property key="FieldDescription.subComponent">
+        <value xml:lang="en">same as component but to give main Entity (ex: Party, Communication, Classification, ...) (strongly recommended if portletType is used)</value>
+        <value xml:lang="fr">idem composant mais pour préciser l'entité majeur concerné (ex: Party, Communication, Classification, ...) (fortement recommandé si un type de portlet est utilisé)</value>
+    </property>
+    <property key="FieldDescription.titleLabel">
+        <value xml:lang="en">Used by some portlet template, to define title used (ex: in screenlet top); default value is PageTitle{portletLongId}</value>
+        <value xml:lang="fr">Utilisé par certain modèle de portlet, pour définir le titre utilisé (par ex: dans la barre du screenlet); la valeur par défaut est PageTitle{portletLongId}</value>
+    </property>
+    <property key="FieldDescription.useMenu">
+        <value xml:lang="en">Default value is N so portlet template will not use menuName, if Y it use menuName which is locate in MenuLocation. Not used if portletType is empty.</value>
+        <value xml:lang="fr">Par défaut est égale à N donc le modéle de portlet n'utilisera pas le menu, si =Y alors il utilisera menuName qui se trouve à menuLocation. Non utilisé si portletType est vide</value>
+    </property>
+    <property key="FieldDescription.useScreen">
+        <value xml:lang="en">Default value is N so portlet template will use formName, if Y portlet will use screenName (which is in screenLocation). Not used if portletType is empty.</value>
+        <value xml:lang="fr">Par défaut est égale à N donc le modéle de portlet utilisera directement la form, si =Y alors c'est le screenName qui se trouve à screenLocation qui est utilisé. Non utilisé si portletType est vide</value>
+    </property>
+    <property key="FieldDescription.useScript">
+        <value xml:lang="en">Default value is N so portlet template will not use scriptName in portlet template, if Y portlet will use scriptName. Not used if portletType is empty.</value>
+        <value xml:lang="fr">Par défaut est égale à N donc le modéle de portlet n'utilisera pas le scriptName, si =Y alors le scrpitName sera appelé. Non utilisé si portletType est vide</value>
+    </property>
+    <property key="FieldDescription.uiLabelLocation">
+        <value xml:lang="en">Used by most of portlet template, to define portletUiLabelDecorator decorator location; default value is component://{component}/widget/({webapp}/ if webapp not empty)CommonScreens.xml</value>
+        <value xml:lang="fr">Utilisé par la plupart des modèles, pour définir le champ location du decorator portletUiLabelDecorator; la valeur par défaut est component://{component}/widget/({webapp}/ si webapp non vide)CommonScreens.xml</value>
+    </property>
+    <property key="FieldDescription.webapp">
+        <value xml:lang="en">same as component, to group subComponent (ex : all file in a sub directory) (optional)</value>
+        <value xml:lang="fr">idem component, il représente un groupe de subComponent (par ex : pour regrouper les fichiers dans un sous répertoire) (optionnel)</value>
+    </property>
+    <!--#Eam# portletWidget -->
     <property key="PortalPage.portalPageName.MYPORTAL_EMPLOYEE">
         <value xml:lang="en">Main</value>
         <value xml:lang="es">Principal</value>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml Fri Mar 30 20:44:26 2012
@@ -11996,6 +11996,37 @@
         <value xml:lang="zh">你不拥有页面'${portalPage.portalPageName}' [${portalPage.portalPageId}],所以你不能修改它!</value>
         <value xml:lang="zh_TW">你不擁有頁面'${portalPage.portalPageName}' [${portalPage.portalPageId}],所以你不能修改它!</value>
     </property>
+    <!--#Bam# portletWidget -->
+    <property key="PortalPortletFieldActionsBefore">
+        <value xml:lang="en">Actions, before showing </value>
+        <value xml:lang="fr">Actions, avant l'affichage</value>
+    </property>
+    <property key="PortalPortletFieldAjaxEditArea">
+        <value xml:lang="en">Ajax update area (cf portletType) </value>
+        <value xml:lang="fr">Zones de mise à jours de contenu en ajax (cf types de portlets)</value>
+    </property>
+    <property key="PortalPortletFieldAttributeMgmt">
+        <value xml:lang="en">To manage attributes (edit it, if there are some) </value>
+        <value xml:lang="fr">Pour gérer les attribues (les éditer, s'il y en a)</value>
+    </property>
+    <property key="PortalPortletFieldContent">
+        <value xml:lang="en">portlet technical content (default value, look to portletType) </value>
+        <value xml:lang="fr">Contenu technique de la portlet (valeurs par défaut, voir les types de portlets)</value>
+    </property>
+    <property key="PortalPortletFieldFunctions">
+        <value xml:lang="en">Portlet field showing its function</value>
+        <value xml:lang="fr">Champs liés à la fonction de la portlet</value>
+    </property>
+    <property key="PortalPortletFieldHelp">
+        <value xml:lang="en">Associated Help (not mandatory)</value>
+        <value xml:lang="fr">Gestion de l'aide (non obligatoire)</value>
+    </property>
+    <property key="PortalPortletFieldSecurity">
+        <value xml:lang="en">Security (not mandatory, no default value)</value>
+        <value xml:lang="fr">Sécurité (non obligatoire, pas de valeurs par défaut)</value>
+    </property>
+    <!--#Eam# portletWidget -->
+
     <property key="Project">
         <value xml:lang="de">Projekt</value>
         <value xml:lang="en">Project</value>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/data/CommonPortletData.xml Fri Mar 30 20:44:26 2012
@@ -30,4 +30,10 @@
     <PortalPortlet portalPortletId="GricScltAjaxWithMenu" portletName="Screenlet with one screen, and one menu called by ajax" screenName="GenericScreenletAjaxWithMenu" screenLocation="component://common/widget/PortalPageScreens.xml" editFormName="GenericScreenletAjaxWithMenuParam" editFormLocation="component://common/widget/PortletEditForms.xml" description="Simple portlet using screenlet with a menu, with one screen which was update by ajax process, so with a div. This portlet has 6 mandatory parameters." securityServiceName="" securityMainAction="VIEW"/>
     <PortletPortletCategory portalPortletId="GricScltAjaxWithMenu" portletCategoryId="GENERIC_PORTLET"/>
     <PortalPage portalPageId="_NA_" sequenceNum="000" portalPageName="For using genericPortletScreen" description="To be able to have parameters at the portlet level, not PortletPage level" ownerUserLoginId="_NA_"/>
+  <!--#Bam# portletWidget -->
+  <PortletType portletTypeId="Decorator" screenName="portletUiLabelDecorator" description="use screen and screen location in the portletDecorator" screenLocation="component://common/widget/PortletTypeScreens.xml"/>
+  <PortletType portletTypeId="Screenlet" screenName="Screenlet" description="depending of scriptName, menuName and screenName exist a screen with call (or not) scriptName in action and include a screenlet with include formName (or screenName) and include (or not) menuName" screenLocation="component://common/widget/PortletTypeScreens.xml"/>
+  <PortletType portletTypeId="ScreenletList" screenName="ScreenletList" description="include a list type form (do not use screenName) and an editing area, depending of scriptName and menuName exist a screen with call (or not) scriptName in action and include a screenlet with include formName and include (or not) menuName" screenLocation="component://common/widget/PortletTypeScreens.xml"/>
+  <PortletType portletTypeId="Empty" screenName="Empty" description="a empty screen, used to define a areaId" screenLocation="component://common/widget/PortletTypeScreens.xml"/>
+  <!--#Eam# portletWidget -->
 </entity-engine-xml>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/entitydef/entitymodel.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/entitydef/entitymodel.xml Fri Mar 30 20:44:26 2012
@@ -701,18 +701,51 @@ under the License.
     <!-- org.ofbiz.common.portal -->
     <!-- ============================ -->
 
-    <entity entity-name="PortalPortlet" package-name="org.ofbiz.common.portal" title="Defines a Portlet to be used in Portals">
+    <entity entity-name="PortalPortlet" package-name="org.ofbiz.common.portal" title="Defines a Portlet to be used in Portals" default-resource-name="CommonPortalEntityLabels">
+        <!--#Eam# PortletWidget : default-resource-name is used to contain description field, currentlty all FieldDescription are done.
+               If you want have information to each field go to portlet editPortlet and read hint about each field label -->
         <field name="portalPortletId" type="id-ne"></field>
+        <field name="portletLongId" type="id-long"></field>
         <field name="portletName" type="name"></field>
+        <field name="portletTypeId" type="id"></field>
+        <field name="component" type="id"></field>
+        <field name="subComponent" type="id"></field>
+        <field name="webapp" type="id"></field>
+        <field name="useScreen" type="indicator"></field>
         <field name="screenName" type="long-varchar"></field>
         <field name="screenLocation" type="long-varchar"></field>
+        <field name="useScript" type="indicator"></field>
+        <field name="scriptName" type="long-varchar"></field>
+        <field name="uiLabelLocation" type="long-varchar"></field>
+        <field name="formName" type="long-varchar"></field>
+        <field name="formLocation" type="long-varchar"></field>
+        <field name="pkIdName" type="short-varchar"></field>
+<!--        <field name="areaDivId" type="short-varchar"></field>  with id build with portalPageId portalPortletId portletSeqId, it seem, it's no more necessary because alway unique -->
+        <field name="editAreaDivId" type="short-varchar"></field>
+        <field name="subAreaDivId" type="short-varchar"></field>
+        <field name="titleLabel" type="short-varchar"></field>
+        <field name="useMenu" type="indicator"></field>
+        <field name="menuName" type="short-varchar"></field>
+        <field name="menuLocation" type="long-varchar"></field>
+        <field name="helpName" type="short-varchar"></field>
         <field name="editFormName" type="long-varchar"></field>
         <field name="editFormLocation" type="long-varchar"></field>
         <field name="description" type="description"></field>
         <field name="screenshot" type="url"></field>
         <field name="securityServiceName" type="long-varchar"><description>The service named here is used to see if current user can see the portlet on the list of available portlets; the screen that the portlet calls should also call this service to check permission and not render; the service named here must implement the "permissionInterface" service just like services used for service permissions</description></field>
+        <field name="securityPermission" type="short-varchar"></field>
         <field name="securityMainAction" type="short-varchar"><description>The main action which can be done with this portlet, possible values: CREATE UPDATE VIEW DELETE</description></field>
         <prim-key field="portalPortletId"/>
+        <relation rel-entity-name="PortletType" type="one" fk-name="PPORTLET_TYPE">
+          <key-map field-name="portletTypeId"/>
+        </relation>
+    </entity>
+    <entity entity-name="PortletType" package-name="org.ofbiz.common.portal" title="Portlet Type Entity">
+      <field name="portletTypeId" type="id-ne"/>
+      <field name="description" type="description"/>
+      <field name="screenName" type="long-varchar"></field>
+      <field name="screenLocation" type="long-varchar"></field>
+      <prim-key field="portletTypeId"/>
     </entity>
     <entity entity-name="PortletCategory" package-name="org.ofbiz.common.portal" title="Portlet Category Entity">
       <field name="portletCategoryId" type="id-ne"/>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/portal-controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/portal-controller.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/portal-controller.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/portal-controller.xml Fri Mar 30 20:44:26 2012
@@ -29,7 +29,7 @@ under the License.
     </request-map>
     <request-map uri="refreshPortlet">
         <security https="true" auth="true"/>
-        <response name="success" type="view" value="showPortletUiLabelDecorator"/>
+        <response name="success" type="view" value="showPortlet"/>
     </request-map>
     <request-map uri="showPortletMainDecorator">
         <security https="true" auth="true"/>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/widget/CommonScreens.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/widget/CommonScreens.xml Fri Mar 30 20:44:26 2012
@@ -124,6 +124,7 @@ under the License.
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/validate/jquery.validate.min.js" global="true" />
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/fjTimer/jquerytimer-min.js" global="true" />
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true" />
+                <set field="layoutSettings.javaScripts[+0]" value="/images/portlet.js" global="true"/><!--#Eam# portletWidget -->
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.7.min.js" global="true" />
                 <!-- jQuery CSSs -->
                 <set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css" global="true" />
@@ -443,6 +444,7 @@ under the License.
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/fjTimer/jquerytimer-min.js" global="true"/>
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/plugins/validate/jquery.validate.min.js" global="true"/>
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js" global="true"/>
+                <set field="layoutSettings.javaScripts[+0]" value="/images/portlet.js" global="true"/><!--#Eam# portletWidget -->
                 <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.7.min.js" global="true"/>
                     <!-- jQuery CSSs -->
                 <set field="layoutSettings.styleSheets[+0]" value="/images/jquery/plugins/asmselect/jquery.asmselect-1.0.4a-beta.css" global="true"/>

Modified: ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageScreens.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageScreens.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/common/widget/PortalPageScreens.xml Fri Mar 30 20:44:26 2012
@@ -21,28 +21,24 @@ under the License.
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
 
+    
+    
+    <!--#Bam# portletWidget  replace call showPortlet.ftl -->
     <screen name="showPortlet">
         <section>
             <widgets>
                 <section>
                     <actions>
-                        <entity-one entity-name="PortalPortlet" value-field="portlet" />
+                        <set field="portalPortletId" from-field="portalPortletId" default-value="${parameters.portalPortletId}"/>
                     </actions>
                     <widgets>
-                        <!--
-                            label text=" id: ${parameters.portalPortletId} location:
-                            ${portlet.screenLocation} screen: ${portlet.screenName}"></label
-                        -->
-                        <platform-specific>
-                            <html>
-                                <html-template location="component://common/webcommon/portal/showPortlet.ftl" />
-                            </html>
-                        </platform-specific>
+                        <include-portal-page id="${parameters.portalPageId}" portalPortletId="${portalPortletId}" portletSeqId="${parameters.portletSeqId}"/>
                     </widgets>
                 </section>
             </widgets>
         </section>
     </screen>
+    <!--#Eam# portletWidget  -->
     <screen name="showPortletMainDecorator">
         <section>
             <widgets>

Modified: ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/selectall.js?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/selectall.js Fri Mar 30 20:44:26 2012
@@ -263,6 +263,27 @@ function ajaxUpdateAreas(areaCsvString)
         // not nice but works
         targetParams = targetParams.replace('#','');
         targetParams = targetParams.replace('?','');
+        /*Begin addon modification portletWidget wait-spinner working*/
+        var UPDATE_OP = {};
+        UPDATE_OP.areaId = areaId;
+        UPDATE_OP.target = target;
+        UPDATE_OP.targetParams = targetParams;
+        UPDATE_OP.update = function(){
+            var _op = this;
+            jQuery.ajax({
+                url: _op.target,
+                type: "POST",
+                data: _op.targetParams,
+                success: function(data) {
+                    jQuery("#" + _op.areaId).html(data);
+                    evalScripts(jQuery("#" + _op.areaId));
+                    waitSpinnerHide();
+                },
+                error: function(data) {waitSpinnerHide()}
+            });
+        }
+        UPDATE_OP.update();
+        /*
         jQuery.ajax({
             url: target,
             async: false,
@@ -274,6 +295,8 @@ function ajaxUpdateAreas(areaCsvString)
             },
             error: function(data) {waitSpinnerHide()}
         });
+        */
+        /*Begin addon modification portletWidget wait-spinner working*/
     }
 }
 
@@ -346,10 +369,14 @@ function submitFormInBackground(form, ar
 function ajaxSubmitFormUpdateAreas(form, areaCsvString) {
    waitSpinnerShow();
    hideErrorContainer = function() {
-       jQuery('#content-messages').removeClass('errorMessage').fadeIn('fast');
+       jQuery('#content-messages').remove();
    }
    updateFunction = function(data) {
-       if (data._ERROR_MESSAGE_LIST_ != undefined || data._ERROR_MESSAGE_ != undefined) {
+       /*Begin addon modification genericPortlet*/
+       if ((data._ERROR_MESSAGE_LIST_ != undefined || data._ERROR_MESSAGE_ != undefined)
+               && (data.responseMessage == undefined || data.responseMessage != "fail")) {
+          showMessages('errorMessage',data._ERROR_MESSAGE_,data._ERROR_MESSAGE_LIST_);
+          /*
            if(!jQuery('#content-messages')) {
               //add this div just after app-navigation
               if(jQuery('#content-main-section')){
@@ -365,9 +392,18 @@ function ajaxSubmitFormUpdateAreas(form,
               jQuery('#content-messages' ).html(data._ERROR_MESSAGE_);
           }
           jQuery('#content-messages').fadeIn('fast');
+          */
        }else {
-           if(jQuery('#content-messages')) {
-               jQuery('#content-messages').removeClass('errorMessage').fadeIn("fast");
+           // now show message if needed
+           if (data.responseMessage != undefined && data.responseMessage == "fail") {
+               showMessages('failMessage',data._ERROR_MESSAGE_,data._ERROR_MESSAGE_LIST_);
+           }
+           else if (data._EVENT_MESSAGE_LIST_ != undefined || data._EVENT_MESSAGE_ != undefined){
+               showMessages('eventMessage',data._EVENT_MESSAGE_,data._EVENT_MESSAGE_LIST_);
+           }
+           else if(jQuery('#content-messages').text()) {
+               jQuery('#content-messages').remove();
+           /*End addon modification genericPortlet*/
            }
            ajaxUpdateAreas(areaCsvString);
        }

Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/config/WebtoolsUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/config/WebtoolsUiLabels.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/webtools/config/WebtoolsUiLabels.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/webtools/config/WebtoolsUiLabels.xml Fri Mar 30 20:44:26 2012
@@ -3888,6 +3888,12 @@
         <value xml:lang="it">Set</value>
         <value xml:lang="pt">Definir</value>
     </property>
+    <!--#Bam# portletWidget -->
+    <property key="WebtoolsShowPortalPortlet">
+        <value xml:lang="en">Show Portlet field</value>
+        <value xml:lang="fr">Montrer les champs d'une portlet</value>
+    </property>
+    <!--#Eam# portletWidget -->
     <property key="WebtoolsShowShowWSDL">
         <value xml:lang="de">WSDL zeigen</value>
         <value xml:lang="en">Show wsdl</value>

Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/WEB-INF/controller.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/WEB-INF/controller.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/WEB-INF/controller.xml Fri Mar 30 20:44:26 2012
@@ -527,6 +527,8 @@ under the License.
         <security https="true" auth="true"/>
         <response name="success" type="view" value="FindPortalPage"/>
     </request-map>
+    <request-map uri="ShowPortalPortlet"><security https="true" auth="true"/><response name="success" type="view" value="ShowPortalPortlet"/></request-map>
+    <request-map uri="ShowPortalPortletHelp"><security https="true" auth="true"/><response name="success" type="view" value="ShowPortalPortletHelp"/></request-map>
     <request-map uri="EditPortalPage">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditPortalPage"/>
@@ -683,6 +685,8 @@ under the License.
 
     <!-- PortalPage administration  -->
     <view-map name="FindPortalPage" type="screen" page="component://webtools/widget/PortalAdmScreens.xml#FindPortalPage"/>
+    <view-map name="ShowPortalPortlet" type="screen" page="component://webtools/widget/PortalAdmScreens.xml#ShowPortalPortlet"/>
+    <view-map name="ShowPortalPortletHelp" type="screen" page="component://webtools/widget/PortalAdmScreens.xml#ShowPortalPortletHelp"/>
     <view-map name="CreatePortalPage" type="screen" page="component://webtools/widget/PortalAdmScreens.xml#CreatePortalPage"/>
     <view-map name="EditPortalPage" type="screen" page="component://webtools/widget/PortalAdmScreens.xml#EditPortalPage"/>
 

Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/main.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/main.ftl?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/main.ftl (original)
+++ ofbiz/branches/20120329_portletWidget/framework/webtools/webapp/webtools/main.ftl Fri Mar 30 20:44:26 2012
@@ -96,6 +96,7 @@ under the License.
         </#if>
         <li><h3>${uiLabelMap.WebtoolsMiscSetupTools}</h3></li>
         <#if security.hasPermission("PORTALPAGE_ADMIN", session)>
+          <li><a href="<@ofbizUrl>ShowPortalPortlet</@ofbizUrl>">${uiLabelMap.WebtoolsShowPortalPortlet}</a></li>
           <li><a href="<@ofbizUrl>FindPortalPage</@ofbizUrl>">${uiLabelMap.WebtoolsAdminPortalPage}</a></li>
           <li><a href="<@ofbizUrl>FindGeo</@ofbizUrl>">${uiLabelMap.WebtoolsGeoManagement}</a></li>
           <li><a href="<@ofbizUrl>WebtoolsLayoutDemo</@ofbizUrl>">${uiLabelMap.WebtoolsLayoutDemo}</a></li>

Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmForms.xml Fri Mar 30 20:44:26 2012
@@ -21,6 +21,136 @@ under the License.
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
 
+    
+    <!--#Bam# portletWidget -->
+    <form name="ShowPortalPortlet" type="single" default-map-name="portalPortlet" default-entity-name="PortalPortlet">
+        <actions>
+          <entity-one entity-name="PortletType" value-field="portletType">
+            <field-map field-name="portletTypeId" from-field="portalPortlet.portletTypeId"/>
+          </entity-one>
+        </actions>
+<!--      <auto-fields-entity entity-name="PortalPortlet" default-field-type="display"/>-->
+        <field name="portalPortletId"><display/></field>
+        <field name="portletLongId" tooltip="${context.portletLongId}"><display/></field>
+        <field name="portletName"><display/></field>
+        <field name="portletTypeId" tooltip="${portletType.screenLocation}#${portletType.screenName}">
+          <drop-down allow-empty="true">
+            <entity-options description="[${portletTypeId}] ${description}" entity-name="PortletType">
+              <entity-order-by field-name="portletTypeId"/>
+            </entity-options>
+          </drop-down>
+        </field>
+        <field name="component"><display/></field>
+        <field name="subComponent"><display/></field>
+        <field name="webapp"><display/></field>
+        <field name="useScreen"><display description="${uiLabelMap.Common${useScreen}}"/></field>
+        <field name="screenName" tooltip="${context.screenName}"><display/></field>
+        <field name="screenLocation" tooltip="${context.screenLocation}"><display/></field>
+        <field name="useScript"><display description="${uiLabelMap.Common${useScript}}"/></field>
+        <field name="scriptName" tooltip="${context.scriptName}"><display/></field>
+        <field name="uiLabelLocation" tooltip="${context.uiLabelLocation}"><display/></field>
+        <field name="formName" tooltip="${context.formName}"><display/></field>
+        <field name="formLocation" tooltip="${context.formLocation}"><display/></field>
+        <field name="pkIdName" tooltip="${context.pkIdName}"><display/></field>
+<!--        <field name="areaDivId" tooltip="${context.areaDivId}"><display/></field> with id build with portalPageId portalPortletId portletSeqId, it seem, it's no more necessary because always unique -->
+        <field name="editAreaDivId" tooltip="${context.editAreaDivId}"><display/></field>
+        <field name="subAreaDivId" tooltip="${context.subAreaDivId}"><display/></field>
+        <field name="titleLabel" tooltip="${context.titleLabel}"><display/></field>
+        <field name="useMenu"><display description="${uiLabelMap.Common${useMenu}}"/></field>
+        <field name="menuName" tooltip="${context.menuName}"><display/></field>
+        <field name="menuLocation" tooltip="${context.menuLocation}"><display/></field>
+        <field name="helpName" tooltip="${context.helpName}"><display/></field>
+        <field name="editFormName" tooltip="${context.editFormName}"><display/></field>
+        <field name="editFormLocation" tooltip="${context.editFormLocation}"><display/></field>
+        <field name="description" tooltip="${context.description}"><display/></field>
+        <field name="screenshot" tooltip="${context.screenshot}"><display/></field>
+        <field name="description" tooltip="${context.description}"><display/></field>
+        <field name="securityServiceName" tooltip="${context.securityServiceName}"><display/></field>
+        <field name="securityPermission" tooltip="${context.securityPermission}"><display/></field>
+        <field name="securityMainAction" tooltip="${context.securityMainAction}"><display/></field>
+<!--        <field name="back" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">-->
+<!--            <hyperlink target="ShowPortalPortlet" description="${uiLabelMap.CommonBack}"/>-->
+<!--        </field>-->
+        <sort-order>
+            <field-group title="${uiLabelMap.PortalPortletFieldFunctions}" collapsible="true">
+                <sort-field name="portalPortletId"/>
+                <sort-field name="portletLongId"/>
+                <sort-field name="portletTypeId"/>
+                <sort-field name="portletName"/>
+                <sort-field name="description"/>
+                <sort-field name="component"/>
+                <sort-field name="subComponent"/>
+                <sort-field name="webapp"/>
+                <sort-field name="uiLabelLocation"/>
+                <sort-field name="screenshot"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldActionsBefore}" collapsible="true">
+                <sort-field name="useScript"/>
+                <sort-field name="scriptName"/>
+                <sort-field name="pkIdName"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldContent}" collapsible="true">
+                <sort-field name="titleLabel"/>
+                <sort-field name="useScreen"/>
+                <sort-field name="screenName"/>
+                <sort-field name="screenLocation"/>
+                <sort-field name="formName"/>
+                <sort-field name="formLocation"/>
+                <sort-field name="useMenu"/>
+                <sort-field name="menuName"/>
+                <sort-field name="menuLocation"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldAjaxEditArea}" collapsible="true">
+                <sort-field name="editAreaDivId"/>
+                <sort-field name="subAreaDivId"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldAttributeMgmt}" collapsible="true">
+                <sort-field name="editFormName"/>
+                <sort-field name="editFormLocation"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldHelp}" collapsible="true">
+                <sort-field name="helpName"/>
+            </field-group>
+            <field-group title="${uiLabelMap.PortalPortletFieldSecurity}" collapsible="true">
+                <sort-field name="securityServiceName"/>
+                <sort-field name="securityPermission"/>
+                <sort-field name="securityMainAction"/>
+            </field-group>
+        </sort-order>
+    </form>
+    <form name="SelectPortalPortlet" type="single" target="ShowPortalPortlet">
+        <field name="portalPageId"><text/></field>
+        <field name="portalPortletId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
+        <field name="portletSeqId"><text/></field>
+        <field name="submit" title="${uiLabelMap.CommonValidate}"><submit/></field>
+    </form>
+    <form name="listPortletAttribute" type="list" list-name="portletAttributeList">
+      <actions>
+        <entity-and entity-name="PortletAttribute" list="portletAttributeList">
+          <field-map field-name="portalPageId" from-field="parameters.portalPageId"/>
+          <field-map field-name="portalPortletId" from-field="parameters.portalPortletId"/>
+          <field-map field-name="portletSeqId" from-field="parameters.portletSeqId"/>
+          <order-by field-name="attrName"/>
+        </entity-and>
+      </actions>
+      <field name="attrName"><display/></field>
+      <field name="attrValue"><display/></field>
+      <field name="attrType"><display/></field>
+    </form>
+    <form name="listPortletAttributeNA" type="list" list-name="portletAttributeList">
+      <actions>
+        <entity-and entity-name="PortletAttribute" list="portletAttributeList">
+          <field-map field-name="portalPageId" value="_NA_"/>
+          <field-map field-name="portalPortletId" from-field="parameters.portalPortletId"/>
+          <field-map field-name="portletSeqId" value="00000"/>
+          <order-by field-name="attrName"/>
+        </entity-and>
+      </actions>
+      <field name="attrName"><display/></field>
+      <field name="attrValue"><display/></field>
+      <field name="attrType"><display/></field>
+    </form>
+    <!--#Eam# portletWidget -->
     <form name="FindPortalPages" type="single" target="FindPortalPage" default-entity-name="PortalPage">
         <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
         <field name="portalPageId" position="1" title="${uiLabelMap.CommonId}"><text-find/></field>

Modified: ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml (original)
+++ ofbiz/branches/20120329_portletWidget/framework/webtools/widget/PortalAdmScreens.xml Fri Mar 30 20:44:26 2012
@@ -22,6 +22,56 @@ under the License.
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
 
 
+    
+
+    <!--#Bam# portletWidget currently only To be able to have help for each portalPortlet field -->
+    <screen name="ShowPortalPortlet">
+        <section>
+            <actions>
+                <set field="headerItem" value="portalAdmin"/>
+                <set field="titleProperty" value="WebtoolsShowPortalPortlet"/>
+                <entity-one value-field="portalPortlet" entity-name="PortalPortlet"/>
+                <script location="component://webtools/webapp/webtools/WEB-INF/actions/portlet/RetrievePortletAttributes.groovy" />
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <include-form name="SelectPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/>
+                                <include-form name="ShowPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/>
+                                <include-form name="listPortletAttribute" location="component://webtools/widget/PortalAdmForms.xml"/>
+                                <label text="Generic Portlet attribute for _NA_ and 00000"/>
+                                <include-form name="listPortletAttributeNA" location="component://webtools/widget/PortalAdmForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="ShowPortalPortletHelp">
+        <section>
+            <actions>
+                <set field="headerItem" value="portalAdmin"/>
+                <set field="titleProperty" value="WebtoolsShowPortalPortlet"/>
+                <entity-one value-field="portalPortlet" entity-name="PortalPortlet"/>
+                <script location="component://webtools/webapp/webtools/WEB-INF/actions/portlet/RetrievePortletAttributes.groovy" />
+            </actions>
+            <widgets>
+                <decorator-screen name="uiLabelDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <include-form name="ShowPortalPortlet" location="component://webtools/widget/PortalAdmForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <!--#Eam# portletWidget -->
     <!-- list all PortalPage in a tabular format -->
     <screen name="FindPortalPage">
         <section>

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-form.xsd Fri Mar 30 20:44:26 2012
@@ -374,6 +374,24 @@ under the License.
         </xs:attribute>
         <xs:attribute name="area-id" type="xs:string" use="required"/>
         <xs:attribute name="area-target" type="xs:string" use="required"/>
+        <!--
+        <xs:attribute name="use-when" type="xs:string">
+            <xs:annotation><xs:documentation>
+                Used to specify a condition that must be true to use this field; the condition should be written using the
+                Java syntax and can operate on values in the form context; conditional fields are evaluated in reverse
+                order so the last field defined that evaluates to true is the one that is rendered.
+            </xs:documentation></xs:annotation>
+        </xs:attribute>
+        -->
+        <xs:attribute name="redirect-all-parameter" default="false">
+            <xs:annotation><xs:documentation>Usable only for type="submit", use all parameters returned by the submit as parameter for area-target.</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
     </xs:attributeGroup>
     <xs:element name="on-event-update-area">
         <xs:annotation>
@@ -382,6 +400,10 @@ under the License.
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="redirect-parameter">
+                  <xs:annotation><xs:documentation>
+                      Usable only for type="submit", give parameter name returned by the submit to put as parameter for area-target.</xs:documentation></xs:annotation>
+                </xs:element>
             </xs:sequence>
             <xs:attributeGroup ref="attlist.on-form-event-update-area"/>
         </xs:complexType>
@@ -393,6 +415,9 @@ under the License.
         <xs:complexType>
             <xs:sequence>
                 <xs:element minOccurs="0" ref="AllFields"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="show-portlet">
+                  <xs:annotation><xs:documentation>it's possible to generate multiple show-portlet with one click.</xs:documentation></xs:annotation>
+                </xs:element>
                 <xs:element minOccurs="0" maxOccurs="unbounded" ref="on-field-event-update-area"/>
             </xs:sequence>
             <xs:attributeGroup ref="attlist.field"/>
@@ -920,7 +945,113 @@ under the License.
         <xs:attribute type="xs:string" name="param-name" use="required"/>
         <xs:attribute type="xs:string" name="from-field"/>
         <xs:attribute type="xs:string" name="value"/>
+        <xs:attribute name="send-if-empty" default="false">
+            <xs:annotation><xs:documentation>if true param-name will be included in parameters list even if value is empty or from-field is null </xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
     </xs:attributeGroup>
+    <xs:element name="show-portlet">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameters-form">
+                  <xs:annotation><xs:documentation>used to give a form name which will used to send all field content as parameters, form-name attribute is optional, if not present current form name is used</xs:documentation></xs:annotation>
+                </xs:element>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
+            </xs:sequence>
+            <xs:attributeGroup ref="attlist.showPortlet"/>
+        </xs:complexType>
+    </xs:element>
+    <xs:attributeGroup name="attlist.showPortlet">
+        <xs:attribute name="also-hidden" default="true">
+            <xs:annotation><xs:documentation>If set to true, an hidden form field is also rendered, with the name of the field and its content.</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portlet-id" use="required">
+            <xs:annotation><xs:documentation>The portalPortletId which want to show, will pass as parameter to target; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portal-page-id">
+            <xs:annotation><xs:documentation>if a field named portalPageId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portlet-seq-id">
+            <xs:annotation><xs:documentation>if a field named portletSeqId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="target">
+            <xs:annotation><xs:documentation>The target uri, default value is refreshPortlet; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="description">
+            <xs:annotation><xs:documentation>Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="area-id">
+            <xs:annotation><xs:documentation>Area where to show the portlet, default value is "PP_${targetPageId}${targetPortletId}${targetSeqId}", will be pass as parameter to target if has content otherwise generate a warning message;can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="alternate">
+            <xs:annotation><xs:documentation>Alternate text if the image is not found at image-location</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="image-title">
+            <xs:annotation><xs:documentation>Use as a title for the HTML img tag</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="image-location"/>
+        <xs:attribute name="request-confirmation" default="false">
+            <xs:annotation><xs:documentation>If true then the user is presented with a dialog box, if confirmation-message is empty, use default</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="confirmation-message" type="xs:string"><xs:annotation><xs:documentation>The message displayed in confirmation box</xs:documentation></xs:annotation></xs:attribute>
+        <xs:attribute name="parameters-map" type="xs:string">
+            <xs:annotation><xs:documentation>A Map in the context that will be used as additional name/value pairs.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:integer" name="size">
+            <xs:annotation><xs:documentation>Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="collapse-screenlet">
+            <xs:annotation><xs:documentation>Specifies the name of screenlet to collapse, can use the ${} syntax to insert context values, if value is empty nothing will be done</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="mark-selected" default="false">
+            <xs:annotation><xs:documentation>If true, when user click a selected css is apply to the line to show the  selected line; only one line can be selected, a click on a second line unselected the first before select the new one.</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="parameters-form">
+            <xs:annotation><xs:documentation>Specifies the name of a form, all field of it will be put as parameters, can use the ${} syntax to insert context values, if value is empty nothing will be done</xs:documentation></xs:annotation>
+        </xs:attribute>
+    </xs:attributeGroup>
+    <xs:element name="redirect-parameter">
+        <xs:complexType>
+            <xs:attribute type="xs:string" name="param-name" use="required"/>
+            <xs:attribute name="send-if-empty" default="false">
+                <xs:annotation><xs:documentation>if true param-name will be included in parameters list even if value is empty or from-field is null </xs:documentation></xs:annotation>
+                <xs:simpleType>
+                    <xs:restriction base="xs:token">
+                        <xs:enumeration value="true"/>
+                       <xs:enumeration value="false"/>
+                    </xs:restriction>
+                </xs:simpleType>
+            </xs:attribute>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="parameters-form">
+        <xs:complexType>
+            <xs:attribute type="xs:string" name="form-name"/>
+        </xs:complexType>
+    </xs:element>
     <xs:element name="ignored" substitutionGroup="AllFields">
         <xs:complexType/>
     </xs:element>

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-menu.xsd Fri Mar 30 20:44:26 2012
@@ -96,6 +96,7 @@ under the License.
                 <xs:element minOccurs="0" ref="condition"/>
                 <xs:element minOccurs="0" ref="actions"/>
                 <xs:element minOccurs="0" ref="link"/>
+                <xs:element minOccurs="0" ref="show-portlet"/>
                 <xs:element minOccurs="0" maxOccurs="unbounded" ref="menu-item"/>
             </xs:sequence>
             <xs:attributeGroup ref="attlist.menu-item"/>
@@ -135,6 +136,7 @@ under the License.
     </xs:element>
     <xs:attributeGroup name="attlist.image">
         <xs:attribute type="xs:string" name="src"/>
+        <xs:attribute type="xs:string" name="title"/>
         <xs:attribute type="xs:string" name="id"/>
         <xs:attribute type="xs:string" name="style"/>
         <xs:attribute type="xs:string" name="width"/>
@@ -605,4 +607,69 @@ under the License.
     <xs:attributeGroup name="attlist.if-empty">
         <xs:attribute name="field" use="required"/>
     </xs:attributeGroup>
+    <xs:element name="show-portlet">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="parameter"/>
+            </xs:sequence>
+            <xs:attributeGroup ref="attlist.showPortlet"/>
+        </xs:complexType>
+    </xs:element>
+    <xs:attributeGroup name="attlist.showPortlet">
+        <xs:attribute name="also-hidden" default="true">
+            <xs:annotation><xs:documentation>If set to true, an hidden form field is also rendered, with the name of the field and its content.</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portlet-id" use="required">
+            <xs:annotation><xs:documentation>The portalPortletId which want to show, will pass as parameter to target; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portal-page-id">
+            <xs:annotation><xs:documentation>if a field named portalPageId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portlet-seq-id">
+            <xs:annotation><xs:documentation>if a field named portletSeqId is present in context it will be used, will be pass as parameter to target if has content otherwise generate a warning message; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="target">
+            <xs:annotation><xs:documentation>The target uri, default value is refreshPortlet; can use the ${} syntax to substitute values from the context.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="description">
+            <xs:annotation><xs:documentation>Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="area-id">
+            <xs:annotation><xs:documentation>Area where to show the portlet, default value is "PP_${targetPageId}${targetPortletId}${targetSeqId}", will be pass as parameter to target if has content otherwise generate a warning message;can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="alternate">
+            <xs:annotation><xs:documentation>Alternate text if the image is not found at image-location</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="image-title">
+            <xs:annotation><xs:documentation>Use as a title for the HTML img tag</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="image-location"/>
+        <xs:attribute name="request-confirmation" default="false">
+            <xs:annotation><xs:documentation>If true then the user is presented with a dialog box, if confirmation-message is empty, use default</xs:documentation></xs:annotation>
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
+        <xs:attribute name="confirmation-message" type="xs:string"><xs:annotation><xs:documentation>The message displayed in confirmation box</xs:documentation></xs:annotation></xs:attribute>
+        <xs:attribute name="parameters-map" type="xs:string">
+            <xs:annotation><xs:documentation>A Map in the context that will be used as additional name/value pairs.</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:integer" name="size">
+            <xs:annotation><xs:documentation>Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint</xs:documentation></xs:annotation>
+        </xs:attribute>
+    </xs:attributeGroup>
+    <xs:element name="parameters-form">
+        <xs:complexType>
+            <xs:attribute type="xs:string" name="form-name"/>
+        </xs:complexType>
+    </xs:element>
 </xs:schema>

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/dtd/widget-screen.xsd Fri Mar 30 20:44:26 2012
@@ -1124,6 +1124,14 @@ under the License.
                 </xs:restriction>
             </xs:simpleType>
         </xs:attribute>
+        <!-- Begin addon modification : genericPortlet -->
+        <xs:attribute type="xs:string" name="portalPortletId">
+            <xs:annotation><xs:documentation>Retrieve only the attributes for this portalPortlet</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <xs:attribute type="xs:string" name="portletSeqId">
+            <xs:annotation><xs:documentation>Specify the portletSeqId of the portalPortlet to look for when retrieving the attributes</xs:documentation></xs:annotation>
+        </xs:attribute>
+        <!-- End addon modification : genericPortlet -->
     </xs:attributeGroup>
 
     <xs:element name="sub-content" substitutionGroup="AllWidgets">

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/ModelWidget.java Fri Mar 30 20:44:26 2012
@@ -32,6 +32,35 @@ import org.w3c.dom.Element;
 @SuppressWarnings("serial")
 public class ModelWidget implements Serializable {
 
+    public interface ShowPortletLink {
+        public String getImage(Map<String, Object> context);
+        public String getImageTitle(Map<String, Object> context);
+        public String getAlternate(Map<String, Object> context);
+        public String getDescription(Map<String, Object> context);
+    }
+    public static class ShowPortletLinkData {
+        public String imgSrc;
+        public String imgTitle;
+        public String alt;
+        public String description;
+    }
+    public interface ShowPortletItem {
+        public String getPortalPageId(Map<String, Object> context);
+        public String getPortletId(Map<String, Object> context);
+        public String getPortletSeqId(Map<String, Object> context);
+        public String getAreaId(Map<String, Object> context);
+        public String getTarget(Map<String, Object> context);
+        public Map<String, String> getParameterMap(Map<String, Object> context);
+    }
+    public static class ShowPortletItemData {
+        public String portalPageId;
+        public String portletId;
+        public String portletSeqId;
+        public String areaId;
+        public String target;
+        public Map<String, String> parameterMap;
+        public StringBuilder params;
+    }
     /**
      * The parameter name used to control widget boundary comments. Currently
      * set to "widgetVerbose".

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Fri Mar 30 20:44:26 2012
@@ -37,6 +37,7 @@ import org.ofbiz.base.util.StringUtil;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilHttp;
+import org.ofbiz.base.util.UtilURL;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.collections.FlexibleMapAccessor;
 import org.ofbiz.base.util.string.FlexibleStringExpander;
@@ -45,6 +46,8 @@ import org.ofbiz.service.LocalDispatcher
 import org.ofbiz.webapp.control.ConfigXMLReader;
 import org.ofbiz.webapp.control.RequestHandler;
 import org.ofbiz.webapp.taglib.ContentUrlTag;
+import org.ofbiz.widget.ModelWidget.ShowPortletItemData;
+import org.ofbiz.widget.ModelWidget.ShowPortletLinkData;
 import org.ofbiz.widget.form.ModelForm;
 import org.ofbiz.widget.form.ModelFormField;
 import org.w3c.dom.Element;
@@ -141,6 +144,12 @@ public class WidgetWorker {
         }
     }
 
+    //#Bam# portletWidget
+    public static void buildShowPortletUrl(Appendable externalWriter, String target, Map<String, String> parameterMap,
+            String prefix, boolean fullPath, boolean secure, boolean encode, HttpServletRequest request, HttpServletResponse response, Map<String, Object> context) throws IOException {
+    }
+    //#Eam# portletWidget
+
     public static void appendContentUrl(Appendable writer, String location, HttpServletRequest request) throws IOException {
         StringBuilder buffer = new StringBuilder();
         ContentUrlTag.appendContentPrefix(request, buffer);
@@ -319,12 +328,14 @@ public class WidgetWorker {
     public static class Parameter {
         protected String name;
         protected FlexibleStringExpander value;
+        protected FlexibleStringExpander sendIfEmpty; //#Eam# portletWidget
         protected FlexibleMapAccessor<Object> fromField;
 
         public Parameter(Element element) {
             this.name = element.getAttribute("param-name");
             this.value = UtilValidate.isNotEmpty(element.getAttribute("value")) ? FlexibleStringExpander.getInstance(element.getAttribute("value")) : null;
             this.fromField = UtilValidate.isNotEmpty(element.getAttribute("from-field")) ? FlexibleMapAccessor.getInstance(element.getAttribute("from-field")) : null;
+            this.sendIfEmpty = UtilValidate.isNotEmpty(element.getAttribute("send-if-empty")) ? FlexibleStringExpander.getInstance(element.getAttribute("send-if-empty")) : null; //#Eam# portletWidget
         }
 
         public Parameter(String paramName, String paramValue, boolean isField) {
@@ -389,6 +400,13 @@ public class WidgetWorker {
                 return null;
             }
         }
+        //#Bam# portletWidget
+        public boolean sendIfEmpty(Map<String, Object> context) {
+            if (this.sendIfEmpty != null)
+              return "true".equals(this.sendIfEmpty.expandString(context));
+            else return false;
+        }
+        //#Eam# portletWidget
     }
 
     public static String determineAutoLinkType(String linkType, String target, String targetType, HttpServletRequest request) {
@@ -476,4 +494,115 @@ public class WidgetWorker {
         Delegator delegator = (Delegator) context.get("delegator");
         return delegator;
     }
+    //#Bam# portletWidget
+    /**
+     * Prepare data for Form and Menu show-portlet
+     */
+    public static ShowPortletLinkData prepareShowPortletLinkData(ModelWidget.ShowPortletLink showPortletLink, Map<String, Object> context) {
+        ShowPortletLinkData splData = new ShowPortletLinkData();
+        splData.imgSrc = showPortletLink.getImage(context);
+        if (UtilValidate.isEmpty(splData.imgSrc)) {
+            splData.imgSrc  = "";
+        }
+        splData.imgTitle = showPortletLink.getImageTitle(context);
+        if (UtilValidate.isEmpty(splData.imgTitle)) {
+            splData.imgTitle = "";
+        }
+        splData.alt = showPortletLink.getAlternate(context);
+        if (UtilValidate.isEmpty(splData.alt)) {
+            splData.alt = "";
+        }
+        splData.description = showPortletLink.getDescription(context);
+        if(UtilValidate.isEmpty(splData.description)) {
+            splData.description = "";
+        }
+        return splData;
+    }
+    public static ShowPortletItemData prepareShowPortletItemsData(ModelWidget.ShowPortletItem showPortletItem, Map<String, Object> context) {
+        ShowPortletItemData spiData = new ShowPortletItemData();
+        spiData.portalPageId = showPortletItem.getPortalPageId(context);
+        spiData.portletId = showPortletItem.getPortletId(context);
+        spiData.portletSeqId = showPortletItem.getPortletSeqId(context);
+        if (UtilValidate.isEmpty(spiData.portalPageId) && context.containsKey("portalPageId")) {
+            spiData.portalPageId = (String) context.get("portalPageId");
+        }
+        // portletID is mandatory in show-portlet so, if value is null it's a choice
+        //if (UtilValidate.isEmpty(portletId) && context.containsKey("portalPortletId"))
+        //    portletId = (String) context.get("portalPortletId");
+        if (UtilValidate.isEmpty(spiData.portletSeqId) && context.containsKey("portletSeqId")) {
+            spiData.portletSeqId = (String) context.get("portletSeqId");
+        }
+        spiData.areaId = showPortletItem.getAreaId(context);
+        if (UtilValidate.isEmpty(spiData.areaId)) {
+            if (UtilValidate.isNotEmpty(spiData.portalPageId) && UtilValidate.isNotEmpty(spiData.portletId) && UtilValidate.isNotEmpty(spiData.portletSeqId)) {
+                spiData.areaId = "PP_" + spiData.portalPageId + spiData.portletId + spiData.portletSeqId;
+            }
+            else {
+                //Debug.logWarning("The form [" + modelFormField.getModelForm().getFormLocation() + "#" + modelFormField.getModelForm().getName() +"] has a show-portlet field that should define a target-area  or must have target-page-id, target-portlet-id and target-seq_id attributes", module);
+            }
+        }
+        spiData.target = "showPortlet";
+        if (UtilValidate.isNotEmpty(showPortletItem.getTarget(context))) {
+            spiData.target = showPortletItem.getTarget(context);
+        }
+
+        StringBuilder params = new StringBuilder();
+        Map<String, String> parameters = showPortletItem.getParameterMap(context);
+        for (String key : parameters.keySet()) {
+            WidgetWorker.addToParams(params, key, parameters.get(key));
+        }
+
+        if (UtilValidate.isNotEmpty(spiData.portalPageId)) {
+            WidgetWorker.addToParams(params, "portalPageId", spiData.portalPageId);
+        } else {
+            WidgetWorker.addToParamsIfInContext(params, context, "portalPageId", parameters);
+        }
+
+        if (UtilValidate.isNotEmpty(spiData.portletId)) {
+            WidgetWorker.addToParams(params, "portalPortletId", spiData.portletId);
+        }
+
+        if (UtilValidate.isNotEmpty(spiData.portletSeqId)) {
+            WidgetWorker.addToParams(params, "portletSeqId", spiData.portletSeqId);
+        } else {
+            WidgetWorker.addToParamsIfInContext(params, context, "portletSeqId", parameters);
+        }
+
+        WidgetWorker.addToParamsIfInContext(params, context, "areaId", parameters);
+        WidgetWorker.addToParamsIfInContext(params, context, "idDescription", parameters);
+        spiData.params = params;
+        return spiData;
+    }
+
+    /**
+     * if context.get(key) not empty or context.get(parameters.key) not empty and not already in parameters add key=keyValue in params
+     * @param params
+     * @param context
+     * @param key
+     * @param parameters
+     */
+    public static void addToParamsIfInContext(StringBuilder params, Map<String, Object> context, String key, Map<String, String> parameters) {
+        if (parameters.containsKey(key)) return;
+
+        String paramValue = (String) context.get(key);
+        if (UtilValidate.isEmpty(paramValue)) {
+            Map<String, Object> contextParameters = UtilGenerics.checkMap(context.get("parameters"));
+            paramValue = (String) contextParameters.get(key);
+        }
+        if (UtilValidate.isNotEmpty(paramValue)) {
+            if ("idDescription".equals(key)) {
+                addToParams(params, key, UtilURL.removeBadCharForUrl(paramValue));
+            }
+            else {
+                addToParams(params, key, paramValue);
+            }
+        }
+    }
+    public static void addToParams(StringBuilder params, String key, String oneParam) {
+        if (UtilValidate.isNotEmpty(params)) {
+            params.append("&");
+        }
+        params.append(key).append("=").append(oneParam);
+    }
+    //#Eam# portletWidget
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/fo/FoFormRenderer.java Fri Mar 30 20:44:26 2012
@@ -48,6 +48,7 @@ import org.ofbiz.widget.form.ModelFormFi
 import org.ofbiz.widget.form.ModelFormField.RadioField;
 import org.ofbiz.widget.form.ModelFormField.RangeFindField;
 import org.ofbiz.widget.form.ModelFormField.ResetField;
+import org.ofbiz.widget.form.ModelFormField.ShowPortletLink;
 import org.ofbiz.widget.form.ModelFormField.SubmitField;
 import org.ofbiz.widget.form.ModelFormField.TextField;
 import org.ofbiz.widget.form.ModelFormField.TextFindField;
@@ -422,4 +423,7 @@ public class FoFormRenderer extends Html
 
     public void renderContainerFindField(Appendable writer, Map<String, Object> context, ContainerField containerField) throws IOException {
     }
+
+    public void renderShowPortletLink(Appendable writer, Map<String, Object> context, ShowPortletLink showPortletLink) {
+    }
 }

Modified: ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java?rev=1307601&r1=1307600&r2=1307601&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java (original)
+++ ofbiz/branches/20120329_portletWidget/framework/widget/src/org/ofbiz/widget/form/FormStringRenderer.java Fri Mar 30 20:44:26 2012
@@ -93,4 +93,6 @@ public interface FormStringRenderer {
     public void renderContainerFindField(Appendable writer, Map<String, Object> context, ModelFormField.ContainerField containerField) throws IOException;
     public void renderFieldGroupOpen(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) throws IOException;
     public void renderFieldGroupClose(Appendable writer, Map<String, Object> context, ModelForm.FieldGroup fieldGroup) throws IOException;
+//    public void renderShowPortletField(Appendable writer,Map<String, Object> context, ModelFormField.ShowPortletField showPortletField) throws IOException;
+    public void renderShowPortletLink(Appendable writer,Map<String, Object> context, ModelFormField.ShowPortletLink showPortletLink) throws IOException;
 }