Author: hansbak
Date: Wed Jan 7 04:27:15 2009 New Revision: 732318 URL: http://svn.apache.org/viewvc?rev=732318&view=rev Log: implemented the portal portlet move function Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl ofbiz/trunk/framework/common/widget/PortalPageScreens.xml ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml 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=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml (original) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml Wed Jan 7 04:27:15 2009 @@ -22,8 +22,16 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="movePortletToPortalPage" short-description="Moves a PortalPortlet from the actual portalPage to a different one"> - <entity-one entity-name="PortalPagePortlet" value-field="oldEntity" auto-field-map="true"/> + <entity-one entity-name="PortalPagePortlet" value-field="oldEntity" auto-field-map="true"/> + <entity-one entity-name="PortalPage" value-field="getOwnerUserLoginId" auto-field-map="true"> + <field-map field-name="portalPageId" from-field="parameters.newPortalPageId"/> + </entity-one> <check-errors/> + <if-compare field="getOwnerUserLoginId.ownerUserLoginId" value="_NA_" operator="equals"> + <set field="parameters.portalPageId" from-field="parameters.newPortalPageId"/> + <call-simple-method method-name="copyIfRequiredSystemPage" xml-resource="component://common/script/org/ofbiz/common/PortalPageMethods.xml"/> + <set field="parameters.newPortalPageId" from-field="portalPageId"/> + </if-compare> <make-value value-field="newEntity" entity-name="PortalPagePortlet"/> <set field="newEntity.portalPortletId" from-field="parameters.portalPortletId"/> Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy Wed Jan 7 04:27:15 2009 @@ -21,10 +21,15 @@ import org.ofbiz.base.util.*; import org.ofbiz.entity.condition.*; -portalPage = delegator.findByPrimaryKey("PortalPage", [portalPageId : parameters.portalPageId]); +portalPageId = parameters.portalPageId; +if(!portalPageId){ + portalPageId = parameters.parentPortalPageId; +} + +portalPage = delegator.findByPrimaryKey("PortalPage", [portalPageId : portalPageId]); // check if the user created a private page for a system page if (portalPage.ownerUserLoginId.equals("_NA_")) { - portalPages = delegator.findByAnd("PortalPage", [originalPortalPageId : parameters.portalPageId, ownerUserLoginId : parameters.userLogin.userLoginId]); + portalPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : parameters.userLogin.userLoginId]); if (UtilValidate.isNotEmpty(portalPages)) { portalPage = portalPages.get(0); } Modified: ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl Wed Jan 7 04:27:15 2009 @@ -104,10 +104,10 @@ <select name="moveToPortal" onchange="window.location=this[this.selectedIndex].value;"> <option value="">${uiLabelMap.CommonMoveToPortalPage}</option> - <#list portalPages as portalPage> - <#if (portalPage.portalPageName != portalPage.portalPageName)> - <option value="<@ofbizUrl>movePortletToPortalPage?${portletUrlLink}&newPortalPageId=${portalPage.portalPageId}</@ofbizUrl>">${portalPage.portalPageName}</option> - </#if> + <#list portalPages as portalPageList> + <#if portalPage.portalPageId != portalPageList.portalPageId> + <option value="<@ofbizUrl>movePortletToPortalPage?${portletUrlLink}&newPortalPageId=${portalPageList.portalPageId}</@ofbizUrl>">${portalPageList.portalPageName}</option> + </#if> </#list> </select> </li> Modified: ofbiz/trunk/framework/common/widget/PortalPageScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/PortalPageScreens.xml?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/framework/common/widget/PortalPageScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/PortalPageScreens.xml Wed Jan 7 04:27:15 2009 @@ -42,9 +42,10 @@ <actions> <set field="headerItem" from-field="parameters.portalPageId"/> <entity-one entity-name="PortalPage" value-name="portalPage"/> + <set field="portalPages[]" from-field="portalPage"/> <set field="portalPageId" from-field="portalPage.portalPageId"/> - <set field="parentPortalPageId" from-field="parameters.parentPortalPageId"/> - <set field="portalPages[]" from-field="portalPage"/> + <set field="parentPortalPageId" from-field="parameters.parentPortalPageId"/> + <script location="component://common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy"/> <entity-condition entity-name="PortalPageColumn" list-name="portalPageColumnList"> <condition-expr field-name="portalPageId" env-name="portalPageId"/> <order-by field-name="columnSeqId"/> Modified: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml Wed Jan 7 04:27:15 2009 @@ -122,21 +122,4 @@ </then> </if> </simple-method> - - <!--Create simple-method of getPortalPageId--> - <simple-method method-name="getMainPortalPageId" short-description=""> - <entity-and entity-name="PortalPage" list="getPrivatePage"> - <field-map field-name="parentPortalPageId" from-field="nullField"/> - <field-map field-name="originalPortalPageId" value="MYPORTAL"/> - <field-map field-name="ownerUserLoginId" from-field="userLogin.userLoginId"/> - </entity-and> - <first-from-list entry="getPrivatePageId" list="getPrivatePage"/> - <if-empty field="getPrivatePageId"> - <set field="portalPageId" value="MYPORTAL"/> - </if-empty> - <if-not-empty field="getPrivatePageId"> - <set field="portalPageId" from-field="getPrivatePageId.portalPageId"/> - </if-not-empty> - <field-to-result field="portalPageId" result-name="portalPageId"/> - </simple-method> </simple-methods> Modified: ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml Wed Jan 7 04:27:15 2009 @@ -28,12 +28,5 @@ <attribute name="custRequestId" type="String" mode="IN"/> <auto-attributes mode="IN" include="pk" optional="false"/> <auto-attributes include="nonpk" mode="OUT" optional="true"/> - </service> - - <service name="getMainPortalPageId" engine="simple" auth="true" default-entity-name="PortalPage" - location="org/ofbiz/myportal/MyPortalServices.xml" invoke="getMainPortalPageId"> - <description>Send email to customer when customer request is Completed or Created. </description> - <attribute name="portalPageId" type="String" mode="OUT"/> - </service> - + </service> </services> Modified: ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml?rev=732318&r1=732317&r2=732318&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml Wed Jan 7 04:27:15 2009 @@ -47,7 +47,7 @@ <!--set field="applicationMenuName" value="ExampleAppBar" global="true"/> <set field="applicationMenuLocation" value="component://example/widget/example/ExampleMenus.xml" global="true"/--> <set field="appheaderTemplate" value="component://myportal/templates/appheader.ftl"/> - <set field="parameters.parentPortalPageId" value="MYPORTAL"/> + <set field="parameters.parentPortalPageId" value="MYPORTAL" global="true"/> <set field="parameters.userLogin.userLoginId" from-field="userLogin.userLoginId"/> <script location="component://common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy"/> <entity-one entity-name="PartyNameView" value-name="partyNameView"> @@ -142,8 +142,7 @@ <screen name="main"> <section> <actions> - <service service-name="getMainPortalPageId" result-map-name="getMainPortalPageId"/> - <set field="parameters.portalPageId" from-field="getMainPortalPageId.portalPageId"/> + <set field="parameters.portalPageId" value="MYPORTAL"/> <script location="component://common/webcommon/WEB-INF/actions/includes/ShowPortalPage.groovy"/> <set field="headerItem" from-field="parameters.portalPageId"/> <!--My Profile From Party--> |
Free forum by Nabble | Edit this page |