svn commit: r937230 - in /ofbiz/trunk: framework/common/script/org/ofbiz/common/ framework/common/webcommon/portal/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/myportal/widget/

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

svn commit: r937230 - in /ofbiz/trunk: framework/common/script/org/ofbiz/common/ framework/common/webcommon/portal/ framework/common/widget/ specialpurpose/myportal/config/ specialpurpose/myportal/webapp/myportal/WEB-INF/ specialpurpose/myportal/widget/

erwan
Author: erwan
Date: Fri Apr 23 10:18:41 2010
New Revision: 937230

URL: http://svn.apache.org/viewvc?rev=937230&view=rev
Log:
new improvement for portals : administrative interface, same as ManagePortalPages but for all pages

Modified:
    ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
    ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml
    ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl
    ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl
    ofbiz/trunk/framework/common/widget/PortalPageForms.xml
    ofbiz/trunk/framework/common/widget/PortletEditForms.xml
    ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml

Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml Fri Apr 23 10:18:41 2010
@@ -104,43 +104,73 @@ under the License.
                 </call-service>
                 <field-to-request field="portalPageId" request-name="portalPageId"/>
 
-                <!-- copy portlets -->
-                <entity-and entity-name="PortalPagePortlet" list="portalPagePortlets">
-                    <field-map field-name="portalPageId" from-field="parameters.portalPageId"/>
-                </entity-and>
-                <iterate entry="portalPagePortlet" list="portalPagePortlets">
-                    <set-service-fields service-name="createPortalPagePortlet" map="portalPagePortlet" to-map="createPortLet"/>
-                    <set field="createPortLet.portalPageId" from-field="portalPageId"/>
-                    <call-service service-name="createPortalPagePortlet" in-map-name="createPortLet"/>
-                    <!-- copy the attributes -->
-                    <entity-and entity-name="PortletAttribute" list="portletAttributes">
-                        <field-map field-name="portalPageId" from-field="parameters.portalPageId"/>
-                        <field-map field-name="portalPortletId" from-field="portalPagePortlet.portalPortletId"/>
-                        <field-map field-name="portletSeqId" from-field="portalPagePortlet.portletSeqId"/>
-                    </entity-and>
-                    <iterate entry="portletAttribute" list="portletAttributes">
-                        <set field="portletAttribute.portalPageId" from-field="portalPageId"/>
-                        <create-value value-field="portletAttribute"/>
-                    </iterate>
-                </iterate>
-
-                <!-- delete the columns -->
-                <set field="delMap.portalPageId" from-field="portalPageId"/>
-                <remove-by-and entity-name="PortalPageColumn" map="delMap"/>
-
-                <!-- copy columns -->
-                <entity-and entity-name="PortalPageColumn" use-cache="true" list="portalPageColumns">
-                    <field-map field-name="portalPageId" from-field="parameters.portalPageId"/>
-                </entity-and>
-                <set field="first" value="true" type="Boolean"/>
-                <iterate entry="portalPageColumn" list="portalPageColumns">
-                    <set-service-fields service-name="addPortalPageColumn" map="portalPageColumn" to-map="addColumnMap"/>
-                    <clear-field field="addColumnMap.columnSeqId"/>
-                    <set field="addColumnMap.portalPageId" from-field="portalPageId"/>
-                    <call-service service-name="addPortalPageColumn" in-map-name="addColumnMap"/>
-                </iterate>
+                <call-simple-method method-name="duplicatePortalPageDetails"/>
 
             </if-empty>
         </if-compare>
     </simple-method>
+
+    <!--Duplicate content of portalPage, portalPageColumn, portalPagePortlet, portletAttribute,
+         this method should be call with portalpageId and portalPage in context-->
+    <simple-method method-name="duplicatePortalPageDetails" short-description="Duplicate content of portalPage, portalPageColumn, portalPagePortlet, portletAttribute">
+        <log level="info" message="duplicate portalPage detail from portalPageId  ${parameters.portalPageId} to new protalPageId=${portalPageId}"/>
+
+        <if-not-empty field="portalPageId">
+          <!-- delete the columns -->
+          <set field="delMap.portalPageId" from-field="portalPageId" />
+          <!--        <remove-by-and entity-name="PortalPageColumn" map="delMap"/>-->
+
+          <!-- copy columns -->
+          <entity-and entity-name="PortalPageColumn" use-cache="true" list="portalPageColumns">
+            <field-map field-name="portalPageId" from-field="parameters.portalPageId" />
+          </entity-and>
+          <set field="first" value="true" type="Boolean" />
+          <iterate entry="portalPageColumn" list="portalPageColumns">
+            <set-service-fields service-name="addPortalPageColumn" map="portalPageColumn" to-map="addColumnMap" />
+            <clear-field field="addColumnMap.columnSeqId" />
+            <set field="addColumnMap.portalPageId" from-field="portalPageId" />
+            <call-service service-name="addPortalPageColumn" in-map-name="addColumnMap" />
+          </iterate>
+
+          <!-- copy portlets, and portletAttribute -->
+          <entity-and entity-name="PortalPagePortlet" list="portalPagePortlets">
+            <field-map field-name="portalPageId" from-field="parameters.portalPageId" />
+          </entity-and>
+          <iterate entry="portalPagePortlet" list="portalPagePortlets">
+            <set-service-fields service-name="createPortalPagePortlet" map="portalPagePortlet" to-map="createPortLet" />
+            <set field="createPortLet.portalPageId" from-field="portalPageId" />
+            <call-service service-name="createPortalPagePortlet" in-map-name="createPortLet" />
+            <!-- copy the attributes -->
+            <entity-and entity-name="PortletAttribute" list="portletAttributes">
+              <field-map field-name="portalPageId" from-field="parameters.portalPageId" />
+              <field-map field-name="portalPortletId" from-field="portalPagePortlet.portalPortletId" />
+              <field-map field-name="portletSeqId" from-field="portalPagePortlet.portletSeqId" />
+            </entity-and>
+            <iterate entry="portletAttribute" list="portletAttributes">
+              <set field="portletAttribute.portalPageId" from-field="portalPageId" />
+              <create-value value-field="portletAttribute" />
+            </iterate>
+          </iterate>
+        </if-not-empty>
+    </simple-method>
+
+    <!--Duplicate simple-method of copyOriginalPage-->
+    <simple-method method-name="duplicatePortalPage" short-description="Only duplicate a portal page, user should put correct owner and securityGroup">
+        <entity-one entity-name="PortalPage" value-field="portalPage"/>
+
+        <!-- copy the portal page -->
+        <set-service-fields service-name="createPortalPage" map="portalPage" to-map="createPage"/>
+        <clear-field field="createPage.portalPageId"/>
+        <if-empty field="createPage.originalPortalPageId">
+            <set field="createPage.originalPortalPageId" from-field="parameters.portalPageId"/>
+        </if-empty>
+        <call-service service-name="createPortalPage" in-map-name="createPage">
+            <result-to-field result-name="portalPageId"/>
+        </call-service>
+        <field-to-request field="portalPageId" request-name="portalPageId"/>
+        <log level="info" message="new protalPageId=${portalPageId}"/>
+
+        <call-simple-method method-name="duplicatePortalPageDetails"/>
+
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml Fri Apr 23 10:18:41 2010
@@ -174,11 +174,21 @@ under the License.
                 </add-error>
             </if-empty>
             <check-errors/>
-            <if-compare field="portalPage.ownerUserLoginId" operator="not-equals" value="${parameters.userLogin.userLoginId}">
+            <if> <!-- only page owner or user with MYPORTALBASE_ADMIN can modify the page detail -->
+              <condition>
+                <and>
+                  <if-compare field="portalPage.ownerUserLoginId" operator="not-equals" value="${parameters.userLogin.userLoginId}"/>
+                  <not>
+                       <if-has-permission permission="MYPORTALBASE" action="_ADMIN"/>
+                  </not>
+                </and>
+              </condition>
+              <then>
                 <add-error>
                     <fail-property resource="CommonUiLabels" property="PortalPageNotOwned"/>
                 </add-error>
-            </if-compare>
+              </then>
+            </if>
             <check-errors/>
         </if-not-empty>
     </simple-method>

Modified: ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl Fri Apr 23 10:18:41 2010
@@ -23,13 +23,13 @@ under the License.
       <td class="manage-portal-column-toolbar" style="vertical-align: top; <#if portalPageColumn.columnWidthPercentage?has_content> width:${portalPageColumn.columnWidthPercentage}%;</#if>">
         <hr />
         <ul>
-          <li id="delete-column"><form method="post" action="<@ofbizUrl>deletePortalPageColumn</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="delPortalPageId_${portalPageColumn_index}"><input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/><input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/><input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/></form><a class="buttontext" href="javascript:document.delPortalPageId_${portalPageColumn_index}.submit()">${uiLabelMap.CommonRemove}</a></li>
-          <li id="add-portlet"><form method="post" action="<@ofbizUrl>AddPortlet</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="addPortlet_${portalPageColumn_index}"><input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/><input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/><input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/></form><a class="buttontext" href="javascript:document.addPortlet_${portalPageColumn_index}.submit()">${uiLabelMap.CommonAddAPortlet}</a></li>
+          <li id="delete-column"><form method="post" action="<@ofbizUrl>deletePortalPageColumn${Adm?if_exists}</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="delPortalPageId_${portalPageColumn_index}"><input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/><input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/><input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/></form><a class="buttontext" href="javascript:document.delPortalPageId_${portalPageColumn_index}.submit()">${uiLabelMap.CommonRemove}</a></li>
+          <li id="add-portlet"><form method="post" action="<@ofbizUrl>AddPortlet${Adm?if_exists}</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="addPortlet_${portalPageColumn_index}"><input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/><input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/><input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/></form><a class="buttontext" href="javascript:document.addPortlet_${portalPageColumn_index}.submit()">${uiLabelMap.CommonAddAPortlet}</a></li>
           <li id="column-width">
-           <form method="post" action="<@ofbizUrl>updatePortalPageColumn</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="updatePortalPageColum_${portalPageColumn_index}">
+           <form method="post" action="<@ofbizUrl>updatePortalPageColumn${Adm?if_exists}</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="updatePortalPageColum_${portalPageColumn_index}">
             <input name="portalPageId" value="${portalPage.portalPageId}" type="hidden"/>
             <input name="columnSeqId" value="${portalPageColumn.columnSeqId}" type="hidden"/>
-            <input name="parentPortalPageId" value="${parameters.parentPortalPageId}" type="hidden"/>
+            <input name="parentPortalPageId" value="${parameters.parentPortalPageId?if_exists}" type="hidden"/>
             <select name="columnWidthPercentage" onchange="javascript:document.updatePortalPageColum_${portalPageColumn_index}.submit()">
               <option value="">${uiLabelMap.CommonSetColumnWidth}</option>
               <option <#if portalPageColumn.columnWidthPercentage?default(0) == 10> selected="selected"</#if> value="25">25%</option>
@@ -60,7 +60,7 @@ under the License.
                   <form method="post" action="<@ofbizUrl>updatePortalPagePortletAjax</@ofbizUrl>" name="freeMove_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index].columnSeqId}" type="hidden"/><input name="mode" value="RIGHT" type="hidden"/></form>
                 <#list portalPages as portalPageList>
                   <#if portalPage.portalPageId != portalPageList.portalPageId>
-                    <form method="post" action="<@ofbizUrl>movePortletToPortalPage</@ofbizUrl>" name="movePP_${portlet_index}_${portalPageList_index}">
+                    <form method="post" action="<@ofbizUrl>movePortletToPortalPage${Adm?if_exists}</@ofbizUrl>" name="movePP_${portlet_index}_${portalPageList_index}">
                       ${portletFields}
                       <input name="newPortalPageId" value="${portalPageList.portalPageId}" type="hidden"/>
                     </form>
@@ -68,29 +68,29 @@ under the License.
                 </#list>
                 <ul>
                   <li class="title">Portlet : ${portlet.portletName?if_exists} [${portlet.portalPortletId}]</li>
-                  <li class="remove"><form method="post" action="<@ofbizUrl>deletePortalPagePortlet</@ofbizUrl>" name="removePP_${portlet_index}">${portletFields}</form><a href="javascript:document.removePP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                  <li class="remove"><form method="post" action="<@ofbizUrl>deletePortalPagePortlet${Adm?if_exists}</@ofbizUrl>" name="removePP_${portlet_index}">${portletFields}</form><a href="javascript:document.removePP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
 
                   <#if (portlet.editFormName?has_content && portlet.editFormLocation?has_content)>
-                    <li class="edit"><form method="post" action="<@ofbizUrl>ManagePortalPages</@ofbizUrl>" name="editPP_${portlet_index}">${portletFields}<input name="editAttributes" value="Y" type="hidden"/></form><a href="javascript:document.editPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="edit"><form method="post" action="<@ofbizUrl>ManagePortalPages${Adm?if_exists}</@ofbizUrl>" name="editPP_${portlet_index}">${portletFields}<input name="editAttributes" value="Y" type="hidden"/></form><a href="javascript:document.editPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
 
                   <#if !firstInColumn>
-                    <li class="move-up"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq</@ofbizUrl>" name="moveUpPP_${portlet_index}">${portletFields}<input name="mode" value="UP" type="hidden"/></form><a href="javascript:document.moveUpPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-up"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq${Adm?if_exists}</@ofbizUrl>" name="moveUpPP_${portlet_index}">${portletFields}<input name="mode" value="UP" type="hidden"/></form><a href="javascript:document.moveUpPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if portlet_has_next>
-                    <li class="move-down"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq</@ofbizUrl>" name="moveDownPP_${portlet_index}">${portletFields}<input name="mode" value="DOWN" type="hidden"/></form><a href="javascript:document.moveDownPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-down"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq${Adm?if_exists}</@ofbizUrl>" name="moveDownPP_${portlet_index}">${portletFields}<input name="mode" value="DOWN" type="hidden"/></form><a href="javascript:document.moveDownPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if portalPageColumn_has_next>
-                    <li class="move-right"><form method="post" action="<@ofbizUrl>updatePortalPagePortlet</@ofbizUrl>" name="moveRightPP_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index+1].columnSeqId}" type="hidden"/><input name="mode" value="RIGHT" type="hidden"/></form><a href="javascript:document.moveRightPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-right"><form method="post" action="<@ofbizUrl>updatePortalPagePortlet${Adm?if_exists}</@ofbizUrl>" name="moveRightPP_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index+1].columnSeqId}" type="hidden"/><input name="mode" value="RIGHT" type="hidden"/></form><a href="javascript:document.moveRightPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if (portalPageColumn_index > 0)>
-                    <li class="move-left"><form method="post" action="<@ofbizUrl>updatePortalPagePortlet</@ofbizUrl>" name="moveLeftPP_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index-1].columnSeqId}" type="hidden"/><input name="mode" value="LEFT" type="hidden"/></form><a href="javascript:document.moveLeftPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-left"><form method="post" action="<@ofbizUrl>updatePortalPagePortlet${Adm?if_exists}</@ofbizUrl>" name="moveLeftPP_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index-1].columnSeqId}" type="hidden"/><input name="mode" value="LEFT" type="hidden"/></form><a href="javascript:document.moveLeftPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if !firstInColumn>
-                    <li class="move-top"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq</@ofbizUrl>" name="moveTopPP_${portlet_index}">${portletFields}<input name="mode" value="TOP" type="hidden"/></form><a href="javascript:document.moveTopPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-top"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq${Adm?if_exists}</@ofbizUrl>" name="moveTopPP_${portlet_index}">${portletFields}<input name="mode" value="TOP" type="hidden"/></form><a href="javascript:document.moveTopPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if portlet_has_next>
-                    <li class="move-bottom"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq</@ofbizUrl>" name="moveBottomPP_${portlet_index}">${portletFields}<input name="mode" value="BOTTOM" type="hidden"/></form><a href="javascript:document.moveBottomPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
+                    <li class="move-bottom"><form method="post" action="<@ofbizUrl>updatePortalPagePortletSeq${Adm?if_exists}</@ofbizUrl>" name="moveBottomPP_${portlet_index}">${portletFields}<input name="mode" value="BOTTOM" type="hidden"/></form><a href="javascript:document.moveBottomPP_${portlet_index}.submit()">&nbsp;&nbsp;&nbsp;</a></li>
                   </#if>
                   <#if (portalPages.size() > 1)>
                     <li>

Modified: ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl Fri Apr 23 10:18:41 2010
@@ -40,7 +40,7 @@ under the License.
               <tr>
                 <td>
                   <div class="h2">
-                    <form method="post" action="<@ofbizUrl>createPortalPagePortlet</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="createPortalPortlet_${portalPortlet.portalPortletId}"><input name="portalPortletId" value="${portalPortlet.portalPortletId}" type="hidden"/><input name="portalPageId" value="${parameters.portalPageId}" type="hidden"/><input name="columnSeqId" value="${parameters.columnSeqId}" type="hidden"/></form><a class="buttontext" href="javascript:document.createPortalPortlet_${portalPortlet.portalPortletId}.submit()">${uiLabelMap.CommonAdd}: ${portalPortlet.portletName}</a>
+                    <form method="post" action="<@ofbizUrl>createPortalPagePortlet${Adm?if_exists}</@ofbizUrl>" onsubmit="javascript:submitFormDisableSubmits(this)" name="createPortalPortlet_${portalPortlet.portalPortletId}"><input name="portalPortletId" value="${portalPortlet.portalPortletId}" type="hidden"/><input name="portalPageId" value="${parameters.portalPageId}" type="hidden"/><input name="columnSeqId" value="${parameters.columnSeqId}" type="hidden"/></form><a class="buttontext" href="javascript:document.createPortalPortlet_${portalPortlet.portalPortletId}.submit()">${uiLabelMap.CommonAdd}: ${portalPortlet.portletName}</a>
                   </div>
                   <div class="tabletext">
                     ${portalPortlet.description?if_exists}

Modified: ofbiz/trunk/framework/common/widget/PortalPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/PortalPageForms.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/PortalPageForms.xml (original)
+++ ofbiz/trunk/framework/common/widget/PortalPageForms.xml Fri Apr 23 10:18:41 2010
@@ -102,10 +102,10 @@ under the License.
         <field name="createButton"><submit button-type="button"/></field>
     </form>
 
-    <form name="PortletCategoryAndPortlet" type="list" list-name="portletCat" paginate-target="AddPortlet" separate-columns="true"
+    <form name="PortletCategoryAndPortlet" type="list" list-name="portletCat" paginate-target="AddPortlet${Adm}" separate-columns="true"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <field name="portletCategoryId" title="Category">
-            <hyperlink description="${portletCategoryId}" target="AddPortlet">
+            <hyperlink description="${portletCategoryId}" target="AddPortlet${Adm}">
                 <parameter param-name="portletCategoryId"/>
                 <parameter param-name="portalPortletId"/>
                 <parameter param-name="portalPageId" from-field="parameters.portalPageId"/>

Modified: ofbiz/trunk/framework/common/widget/PortletEditForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/PortletEditForms.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/PortletEditForms.xml (original)
+++ ofbiz/trunk/framework/common/widget/PortletEditForms.xml Fri Apr 23 10:18:41 2010
@@ -21,7 +21,7 @@ under the License.
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
 
-    <form name="CommonPortletEdit" type="single" target="setPortalPortletAttributes" title="" default-map-name="attributeMap">
+    <form name="CommonPortletEdit" type="single" target="setPortalPortletAttributes${Adm}" title="" default-map-name="attributeMap">
         <actions>
             <service service-name="getPortletAttributes">
                 <field-map field-name="portalPageId" from-field="parameters.portalPageId"/>

Modified: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml Fri Apr 23 10:18:41 2010
@@ -19,6 +19,34 @@
     under the License.
 -->
 <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <property key="FormFieldTitle_originalPortalPageId">
+        <value xml:lang="en">original page</value>
+        <value xml:lang="fr">Page d'orig.</value>
+    </property>
+    <property key="FormFieldTitle_ownerUserLoginId">
+        <value xml:lang="en">Owner</value>
+        <value xml:lang="fr">Propri.</value>
+    </property>
+    <property key="FormFieldTitle_parentPortalPageId">
+        <value xml:lang="en">Parent page</value>
+        <value xml:lang="fr">Page père</value>
+    </property>
+    <property key="FormFieldTitle_portalPageName">
+        <value xml:lang="en">Portal page name</value>
+        <value xml:lang="fr">Nom de page</value>
+    </property>
+    <property key="FormFieldTitle_sequenceNum">
+        <value xml:lang="en">Seq.</value>
+        <value xml:lang="fr">Seq.</value>
+    </property>
+    <property key="MyPortalAddPortletToPage">
+        <value xml:lang="en">Add a portlet to portal page</value>
+        <value xml:lang="fr">Ajouter une portlet à la page</value>
+    </property>
+    <property key="MyPropalAdminPortalPage">
+        <value xml:lang="en">Portal page Admin.</value>
+        <value xml:lang="fr">Admin. Page portail</value>
+    </property>
     <property key="MyPortalAppBar">
         <value xml:lang="en">My Page App Bar</value>
         <value xml:lang="fr">Menu des applications</value>
@@ -216,6 +244,10 @@
         <value xml:lang="th">ลงทะเบียนสำหรับลูกค้า</value>
         <value xml:lang="zh">客户注册</value>
     </property>
+    <property key="MyPortalRefresh">
+        <value xml:lang="en">Reload page</value>
+        <value xml:lang="fr">Rafraîchir</value>
+    </property>
     <property key="MyPortalReloadImage">
         <value xml:lang="en">reload image</value>
         <value xml:lang="it">Ricarica immagine</value>
@@ -299,6 +331,10 @@
         <value xml:lang="th">ใส่รหัสตามรูป</value>
         <value xml:lang="zh">验证验证码</value>
     </property>
+    <property key="PageTitleFindPortalPage">
+        <value xml:lang="en">Find Portal page</value>
+        <value xml:lang="fr">Rech. page portail</value>
+    </property>
     <property key="PageTitleMyPortal">
         <value xml:lang="en">My Portal for : </value>
         <value xml:lang="fr">Mon portail pour : </value>

Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml Fri Apr 23 10:18:41 2010
@@ -54,10 +54,118 @@
     <request-map uri="reloadCaptchaCode">
         <security https="true" auth="false"/>
         <response name="success" type="view" value="reloadCaptchaCode"/>
-    </request-map>  
+    </request-map>
+
+    <!-- PortalPage administration  -->
+    <request-map uri="FindPortalPage">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="FindPortalPage"/>
+    </request-map>
+    <request-map uri="EditPortalPage">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="ManagePortalPagesAdm">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="DuplicatePortalPage">
+        <security https="true" auth="true"/>
+        <event  type="simple" invoke="duplicatePortalPage" path="component://common/script/org/ofbiz/common/PortalPageMethods.xml"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="NewPortalPage">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="CreatePortalPage"/>
+    </request-map>
+    <request-map uri="createPortalPageAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPortalPage"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="CreatePortalPage"/>
+    </request-map>
+    <request-map uri="updatePortalPageAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updatePortalPage"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+
+    <!-- PortalPage detail administration, copy from portal-controller with response target change to EditPortalPage-->
+    <request-map uri="addPortalPageColumnAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="addPortalPageColumn"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="deletePortalPageColumnAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deletePortalPageColumn"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="AddPortletAdm">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="AddPortletAdm"/>
+    </request-map>
+    <request-map uri="updatePortalPageColumnAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updatePortalPageColumn"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="movePortletToPortalPageAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="movePortletToPortalPage"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="deletePortalPagePortletAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deletePortalPagePortlet"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="updatePortalPagePortletSeqAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updatePortalPagePortletSeq"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="updatePortalPagePortletAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updatePortalPagePortlet"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="createPortalPagePortletAdm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPortalPagePortlet"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    <request-map uri="setPortalPortletAttributesAdm">
+        <security https="true" auth="true"/>
+        <event type="simple" invoke="setPortalPortletAttributes" path="component://common/script/org/ofbiz/common/PortalPageMethods.xml"/>
+        <response name="success" type="view" value="EditPortalPage"/>
+        <response name="error" type="view" value="EditPortalPage"/>
+    </request-map>
+    
+    <request-map uri="LookupUserLoginAndPartyDetails">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="LookupUserLoginAndPartyDetails"/>
+    </request-map>
+    
     <view-map name="main" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortalPage"/>
     <view-map name="login" type="screen" page="component://myportal/widget/CommonScreens.xml#login"/>
     <view-map name="newRegisterLogin" type="screen" page="component://myportal/widget/CommonScreens.xml#newRegisterLogin"/>  
-    <view-map name="reloadCaptchaImage" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaImage"/>    
-    <view-map name="reloadCaptchaCode" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaCode"/>        
+    <view-map name="reloadCaptchaImage" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaImage"/>
+    <view-map name="reloadCaptchaCode" type="screen" page="component://myportal/widget/CommonScreens.xml#reloadCaptchaCode"/>
+    <view-map name="FindPortalPage" type="screen" page="component://myportal/widget/MyPortalScreens.xml#FindPortalPage"/>
+    <view-map name="CreatePortalPage" type="screen" page="component://myportal/widget/MyPortalScreens.xml#CreatePortalPage"/>
+    <view-map name="EditPortalPage" type="screen" page="component://myportal/widget/MyPortalScreens.xml#EditPortalPage"/>
+    <view-map name="AddPortletAdm" type="screen" page="component://myportal/widget/MyPortalScreens.xml#AddPortletAdm"/>
+
+    <view-map name="LookupUserLoginAndPartyDetails" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupUserLoginAndPartyDetails"/>
+
 </site-conf>

Modified: ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml (original)
+++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml Fri Apr 23 10:18:41 2010
@@ -43,4 +43,63 @@ under the License.
         <field name="captchaCode"><hidden value="${parameters.ID_KEY}"/></field>
     </form>
 
+    <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="portalPageIdSearch" position="1" title="${uiLabelMap.CommonId}"><text-find/></field>
+        <field name="originalPortalPageId" position="2"><text-find/></field>
+        <field name="portalPageName" title="${uiLabelMap.CommonName}"><text-find/></field>
+        <field name="parentPortalPageIdSearch" position="2" title="${uiLabelMap.FormFieldTitle_parentPortalPageId}"><text-find/></field>
+        <field name="description"><text-find/></field>
+        <field name="securityGroupId" position="2" title="${uiLabelMap.PartySecurityGroupId}"><text-find/></field>
+        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+
+    <form name="ListPortalPages" type="list" list-name="pagesList" paginate-target="FindPortalPage" separate-columns="true"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <field name="portalPageId" title="${uiLabelMap.CommonEdit}">
+            <hyperlink description="${portalPageId}" target="EditPortalPage">
+                <parameter param-name="portalPageId"/>
+            </hyperlink>
+        </field>
+        <field name="portalPageName" use-when="ownerUserLoginId.equals(&quot;_NA_&quot;)" title="${uiLabelMap.CommonName}" sort-field="true"><display/></field>
+        <field name="portalPageName" use-when="!ownerUserLoginId.equals(&quot;_NA_&quot;)" title="${uiLabelMap.CommonName}" id-name="portalPageName" widget-style="tabletext" sort-field="true">
+            <display>
+                <in-place-editor url="updatePortalPage" cancel-control="button" saving-text="Updating..." text-between-controls=" ">
+                    <simple-editor/>
+                    <field-map field-name="portalPageId" from-field="portalPageId"/>
+                </in-place-editor>
+            </display>
+        </field>
+        <field name="description" use-when="ownerUserLoginId.equals(&quot;_NA_&quot;)" title="${uiLabelMap.CommonDescription}" widget-style="tabletext" sort-field="true"><display/></field>
+        <field name="description" use-when="!ownerUserLoginId.equals(&quot;_NA_&quot;)" title="${uiLabelMap.CommonDescription}" id-name="portalDescription" widget-style="tabletext" sort-field="true">
+            <display>
+                <in-place-editor url="updatePortalPage" cancel-control="button" saving-text="Updating..." text-between-controls=" ">
+                    <simple-editor/>
+                    <field-map field-name="portalPageId" from-field="portalPageId"/>
+                </in-place-editor>
+            </display>
+        </field>
+        <field name="sequenceNum"><display/></field>
+        <field name="originalPortalPageId"><display/></field>
+        <field name="ownerUserLoginId"><display/></field>
+        <field name="deleteLink" use-when="originalPortalPageId!=null" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" >
+            <hyperlink target="deletePortalPage" description="${uiLabelMap.CommonRevertPortalPage}">
+                <parameter param-name="portalPageId"/>
+                <parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
+            </hyperlink>
+        </field>
+    </form>
+
+    <form name="EditPortalPage" type="single" target="${targetPortalPage}" default-map-name="portalPage">
+        <field name="portalPageId" use-when="!&quot;${portalPage.portalPageId}&quot;.equals(&quot;&quot;)" position="1"><display/></field>
+        <field name="portalPageId" use-when="&quot;${portalPage.portalPageId}&quot;.equals(&quot;&quot;)" position="1"><text/></field>
+        <field name="originalPortalPageId" position="2"><text/></field>
+        <field name="ownerUserLoginId" ><lookup target-form-name="LookupUserLoginAndPartyDetails"/></field>
+        <field name="parentPortalPageId" position="2"><text/></field>
+        <field name="portalPageName"><text/></field>
+        <field name="description" position="2"><text size="60"/></field>
+        <field name="sequenceNum"><text/></field>
+        <field name="saveButton" position="2"><submit button-type="button"/></field>
+    </form>
+
 </forms>

Modified: ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml?rev=937230&r1=937229&r2=937230&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml (original)
+++ ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml Fri Apr 23 10:18:41 2010
@@ -28,6 +28,25 @@ under the License.
                 <parameter param-name="parentPortalPageId" from-field="parameters.parentPortalPageId"/>
             </link>
         </menu-item>
+        <menu-item name="PortalPageAdminItem" title="${uiLabelMap.MyPropalAdminPortalPage}" align-style="opposed">
+            <condition><if-has-permission permission="MYPORTALBASE" action="_ADMIN"/> </condition>
+            <link target="FindPortalPage"/>
+        </menu-item>
     </menu>
 
+    <menu name="CopyNewPortalPage">
+        <menu-item name="duplicate" title="${uiLabelMap.CommonDuplicate}">
+            <link target="DuplicatePortalPage">
+               <parameter param-name="portalPageId" from-field="parameters.portalPageId"/>
+            </link>
+        </menu-item>
+        <menu-item name="new" title="${uiLabelMap.CommonNew}">
+            <link target="NewPortalPage"/>
+        </menu-item>
+        <menu-item name="refresh" title="${uiLabelMap.MyPortalRefresh}">
+            <link target="EditPortalPage">
+               <parameter param-name="portalPageId" from-field="parameters.portalPageId"/>
+            </link>
+        </menu-item>
+    </menu>
 </menus>
\ No newline at end of file