You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/12/21 05:40:28 UTC

svn commit: r728389 [1/4] - in /ofbiz/trunk: framework/common/data/ framework/common/entitydef/ framework/common/script/org/ofbiz/common/ framework/common/servicedef/ framework/common/webcommon/WEB-INF/ framework/common/webcommon/portal/ framework/comm...

Author: hansbak
Date: Sat Dec 20 20:40:27 2008
New Revision: 728389

URL: http://svn.apache.org/viewvc?rev=728389&view=rev
Log:
First version of the myportal component as a replacement of the MyPage component as announced in issue OFBIZ-2052 now using the new portal functions. Introduced with this version is that the system pages (userLogin=_NA_) are never changed, but automatically a new page is created for the logged in user when he modifies the system page. The deletion function now returns to the system page design

Added:
    ofbiz/trunk/specialpurpose/myportal/
    ofbiz/trunk/specialpurpose/myportal/config/
    ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/data/
    ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/script/
    ofbiz/trunk/specialpurpose/myportal/script/org/
    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/
    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/
    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/MyPortalServices.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/servicedef/
    ofbiz/trunk/specialpurpose/myportal/servicedef/secas.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/servicedef/services.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/templates/
    ofbiz/trunk/specialpurpose/myportal/templates/appheader.ftl   (with props)
    ofbiz/trunk/specialpurpose/myportal/templates/email/
    ofbiz/trunk/specialpurpose/myportal/templates/email/CompletedCustRequestNotification.ftl   (with props)
    ofbiz/trunk/specialpurpose/myportal/templates/email/CreateCustRequestNotification.ftl   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/
    ofbiz/trunk/specialpurpose/myportal/webapp/addAttachFile.ftl   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/attachFileList.ftl   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/index.jsp   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/GetMyCommunicationEventRole.groovy   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/web.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/error/
    ofbiz/trunk/specialpurpose/myportal/webapp/myportal/error/error.jsp   (with props)
    ofbiz/trunk/specialpurpose/myportal/widget/
    ofbiz/trunk/specialpurpose/myportal/widget/CommonScreens.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalForms.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalMenus.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/widget/MyPortalScreens.xml   (with props)
    ofbiz/trunk/specialpurpose/myportal/widget/RequestForms.xml   (with props)
Modified:
    ofbiz/trunk/framework/common/data/PortalDemoData.xml
    ofbiz/trunk/framework/common/entitydef/entitymodel.xml
    ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
    ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml
    ofbiz/trunk/framework/common/servicedef/services.xml
    ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml
    ofbiz/trunk/framework/common/webcommon/portal/appheader.ftl
    ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl
    ofbiz/trunk/framework/common/webcommon/portal/portalPage.ftl
    ofbiz/trunk/framework/common/widget/PortalPageForms.xml
    ofbiz/trunk/framework/common/widget/PortalPageScreens.xml
    ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
    ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml
    ofbiz/trunk/specialpurpose/component-load.xml

Modified: ofbiz/trunk/framework/common/data/PortalDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/data/PortalDemoData.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/data/PortalDemoData.xml (original)
+++ ofbiz/trunk/framework/common/data/PortalDemoData.xml Sat Dec 20 20:40:27 2008
@@ -20,7 +20,7 @@
 
 <entity-engine-xml>
     <!-- PortalPortlet Demo Data -->
-    <PortalPage portalPageId="DEFAULT" portalName="Default home Portal Page" description="The default OFBiz portal page" ownerUserLoginId="admin"/>
+    <PortalPage portalPageId="DEFAULT" portalName="Default home Portal Page" description="The default OFBiz portal page" ownerUserLoginId="admin" originalPortalPageId="EXAMPLE"/>
     <PortalPageColumn portalPageId="DEFAULT" columnSeqId="01" columnWidthPixels="200"/>
     <PortalPageColumn portalPageId="DEFAULT" columnSeqId="02"/><!-- no width in pixels or percent, use the rest of the space available -->
     

Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/entitydef/entitymodel.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/framework/common/entitydef/entitymodel.xml Sat Dec 20 20:40:27 2008
@@ -575,6 +575,7 @@
         <field name="portalName" type="name"></field>
         <field name="description" type="description"></field>
         <field name="ownerUserLoginId" type="id"></field>
+        <field name="originalPortalPageId" type="id"></field>
         <field name="sequenceNum" type="numeric"></field>
         <prim-key field="portalPageId"/>
     </entity>

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=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageMethods.xml Sat Dec 20 20:40:27 2008
@@ -70,4 +70,69 @@
             </iterate-map>
         </if-not-empty>
     </simple-method>
+    
+    <!--Create simple-method of copyOriginalPage-->
+    <simple-method method-name="copyOriginalPage" short-description="">
+        <set field="mainPortalPageId" value="MAINMYPORTAL"/>
+        <entity-and entity-name="PortalPage" list-name="getMainPage">
+            <field-map field-name="originalPortalPageId" env-name="mainPortalPageId"/>
+            <field-map field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
+        </entity-and>
+        <if-empty field="getMainPage">
+        <set field="portalPageId" from-field="parameters.portalPageId"/>
+            <if-compare field="portalPageId" value="MYPORTAL" operator="equals">
+                <entity-and entity-name="PortalPage" use-cache="true" list-name="getNA">
+                    <field-map field-name="ownerUserLoginId" value="_NA_"/>
+                </entity-and>
+                <first-from-list entry-name="getNA" list-name="getNA"/>
+                <make-value entity-name="PortalPage" value-name="getPortalPageAll" map-name="test"/>
+                <set field="test.portalName" from-field="getNA.portalName"/>
+                <set field="test.description" from-field="getNA.description"/>
+                <set field="test.ownerUserLoginId" from-field="userLogin.userLoginId"/>
+                <set field="test.originalPortalPageId" value="MAINMYPORTAL"/>
+                <set-pk-fields map-name="test" value-name="getPortalPageAll"/>
+                <make-next-seq-id value-name="getPortalPageAll" seq-field-name="portalPageId"/>
+                <set-nonpk-fields map-name="test" value-name="getPortalPageAll"/>
+                <create-value value-name="getPortalPageAll"/>
+                <set field="portalPageId" from-field="getPortalPageAll.portalPageId"/>
+                <field-to-request field-name="portalPageId" request-name="portalPageId"/>
+                
+                <entity-and entity-name="PortalPageColumn" use-cache="true"
+                    list-name="portalPageColumnList">
+                    <field-map field-name="portalPageId" env-name="getNA.portalPageId"/>
+                </entity-and>
+                <iterate entry-name="portalPageColumnList" list-name="portalPageColumnList">
+                    <make-value entity-name="PortalPageColumn" value-name="PortalPageColumn"
+                        map-name="column"/>
+                    <set field="column.portalPageId" from-field="getPortalPageAll.portalPageId"/>
+                    <set field="column.columnSeqId" from-field="portalPageColumnList.columnSeqId"/>
+                    <set-pk-fields map-name="column" value-name="PortalPageColumn"/>
+                    <set-nonpk-fields map-name="column" value-name="PortalPageColumn"/>
+                    <create-value value-name="PortalPageColumn"/>
+                    
+                    <entity-and entity-name="PortalPagePortlet" use-cache="true"
+                        list-name="PortalPagePortlet">
+                        <field-map field-name="portalPageId" env-name="getNA.portalPageId"/>
+                        <field-map field-name="columnSeqId" env-name="PortalPageColumn.columnSeqId"
+                        />
+                    </entity-and>
+                    <iterate entry-name="PortalPagePortlet" list-name="PortalPagePortlet">
+                        <make-value entity-name="PortalPagePortlet" value-name="PortletView"
+                            map-name="portlet"/>
+                        <set field="portlet.portalPageId" from-field="PortalPageColumn.portalPageId"/>
+                        <set field="portlet.portalPortletId"
+                            from-field="PortalPagePortlet.portalPortletId"/>
+                        <set field="portlet.columnSeqId" from-field="PortalPageColumn.columnSeqId"/>
+                        <set field="portlet.portletSeqId"
+                            from-field="PortalPagePortlet.portletSeqId"/>
+                        <set field="portlet.sequenceNum" from-field="PortalPagePortlet.sequenceNum"/>
+                        
+                        <set-pk-fields map-name="portlet" value-name="PortletView"/>
+                        <set-nonpk-fields map-name="portlet" value-name="PortletView"/>
+                        <create-value value-name="PortletView"/>
+                    </iterate>
+                </iterate>
+            </if-compare>
+        </if-empty>
+    </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=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml (original)
+++ ofbiz/trunk/framework/common/script/org/ofbiz/common/PortalPageServices.xml Sat Dec 20 20:40:27 2008
@@ -121,20 +121,69 @@
     </simple-method>
     
     <simple-method method-name="deletePortalPage" short-description="Delete a Portal Page">
-        <entity-one entity-name="PortalPage" value-name="portalPage" auto-field-map="true" use-cache="true"/>
+        <if-compare field="parameters.portalPageId" value="MYPORTAL" operator="not-equals">
+            <entity-one entity-name="PortalPage" value-name="portalPage" auto-field-map="true" use-cache="true"/>
         
-        <if-not-empty field="portalPage">
-            <entity-and entity-name="PortalPageColumn" list-name="portalPageColumnList">
-                <field-map field-name="portalPageId" env-name="portalPage.portalPageId"/>
-            </entity-and>
+            <if-not-empty field="portalPage">
+                <entity-and entity-name="PortalPageColumn" list-name="portalPageColumnList">
+                    <field-map field-name="portalPageId" env-name="portalPage.portalPageId"/>
+                </entity-and>
             
-            <iterate list-name="portalPageColumnList" entry-name="portalPageColumn">
-                <set-service-fields service-name="deletePortalPageColumn" to-map-name="deletePortalPageColumnInMap" map-name="portalPageColumn"/>
-                <call-service service-name="deletePortalPageColumn" in-map-name="deletePortalPageColumnInMap"/>
-            </iterate>
+                <iterate list-name="portalPageColumnList" entry-name="portalPageColumn">
+                    <set-service-fields service-name="deletePortalPageColumn" to-map-name="deletePortalPageColumnInMap" map-name="portalPageColumn"/>
+                    <call-service service-name="deletePortalPageColumn" in-map-name="deletePortalPageColumnInMap"/>
+                </iterate>
             
-            <remove-value value-name="portalPage"/>
-        </if-not-empty>
-        
+                <remove-value value-name="portalPage"/>
+            </if-not-empty>
+        </if-compare>
     </simple-method>
+    
+    <!--Create simple-method of getListPreferences-->
+    <simple-method method-name="getListPreferences" short-description="">
+        <if-compare field="parameters.originalPortalPageId" value="EXAMPLE" operator="equals">
+            <entity-and entity-name="PortalPage" list-name="PortalPageList">
+                <field-map field-name="originalPortalPageId" env-name="parameters.originalPortalPageId"/>
+                <field-map field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
+            </entity-and>
+            <else>
+                <set field="mainPortalPageId" value="MAINMYPORTAL"/> 
+                <entity-and entity-name="PortalPage" list-name="getMainPage">
+                    <field-map field-name="originalPortalPageId" env-name="mainPortalPageId"/>
+                    <field-map field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
+                </entity-and>
+                <if-empty field="getMainPage">
+                    <entity-condition entity-name="PortalPage" list-name="PortalPageList">
+                        <condition-list combine="and">
+                            <condition-list combine="or">
+                                <condition-expr field-name="originalPortalPageId" operator="equals" env-name="parameters.originalPortalPageId"/>
+                                <condition-expr field-name="originalPortalPageId" operator="equals" value="_NA_"/>
+                            </condition-list>
+                            <condition-list combine="or">
+                                <condition-expr field-name="ownerUserLoginId" operator="equals" env-name="userLogin.userLoginId"/>
+                                <condition-expr field-name="ownerUserLoginId" operator="equals" value="_NA_"/>
+                            </condition-list>
+                        </condition-list>
+                        <order-by field-name="createdStamp"/>
+                    </entity-condition>
+                </if-empty>
+                <if-not-empty field="getMainPage">
+                    <entity-condition entity-name="PortalPage" list-name="PortalPageList">
+                        <condition-list combine="and">
+                            <condition-list combine="or">
+                                <condition-expr field-name="originalPortalPageId" operator="equals" env-name="parameters.originalPortalPageId"/>
+                                <condition-expr field-name="originalPortalPageId" operator="equals" value="MAINMYPORTAL"/>
+                            </condition-list>
+                            <condition-list combine="or">
+                                <condition-expr field-name="ownerUserLoginId" operator="equals" env-name="userLogin.userLoginId"/>
+                            </condition-list>
+                        </condition-list>
+                        <order-by field-name="createdStamp"/>
+                    </entity-condition>
+                </if-not-empty> 
+            </else>
+        </if-compare>
+        <list-to-list list-name="PortalPageList" to-list-name="result"/>
+        <field-to-result field-name="result" result-name="listIt"/>
+    </simple-method>  
 </simple-methods>

Modified: ofbiz/trunk/framework/common/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services.xml Sat Dec 20 20:40:27 2008
@@ -650,4 +650,12 @@
         <attribute name="portletSeqId" type="String" mode="IN" optional="false"/>
         <attribute name="attributeMap" type="Map" mode="OUT" optional="true"/>
     </service>
+    
+    <!-- GetListPreferences services -->
+    <service name="getListPreferences" engine="simple" auth="true"
+        location="org/ofbiz/common/PortalPageServices.xml" invoke="getListPreferences">
+        <description>GetListPreferences</description>
+        <attribute name="originalPortalPageId" type="String" mode="IN" optional="false"/>
+        <attribute name="listIt" type="List" mode="OUT" optional="true"/>
+    </service>
 </services>

Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml (original)
+++ ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml Sat Dec 20 20:40:27 2008
@@ -26,6 +26,7 @@
     <!-- Portal requests -->
     <request-map uri="dashboard">
         <security https="true" auth="true"/>
+        <event  type="simple" invoke="copyOriginalPage" path="org/ofbiz/common/PortalPageMethods.xml"/>
         <response name="success" type="view" value="dashboard"/>
     </request-map>
     <request-map uri="ManagePortalPages">

Modified: ofbiz/trunk/framework/common/webcommon/portal/appheader.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/appheader.ftl?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/appheader.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/appheader.ftl Sat Dec 20 20:40:27 2008
@@ -31,7 +31,7 @@
         </#list>
         <li class="opposed"><a href="<@o...@ofbizUrl>">${uiLabelMap.CommonLogout}</a></li>
         <#--li class="opposed"><a href="http://docs.ofbiz.org/display/OFBENDUSER/My+Page?decorator=printable" target="_blank">${uiLabelMap.CommonHelp}</a></li>-->
-        <li class="opposed"><a href="<@o...@ofbizUrl>">${uiLabelMap.CommonDashboard}</a></li>
+        <li class="opposed"><a href="<@o...@ofbizUrl>">${uiLabelMap.CommonDashboard}</a></li>
     <#else>
         <li class="opposed"><a href="<@o...@ofbizUrl>">${uiLabelMap.CommonLogin}</a></li>
     </#if>

Modified: ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/listPortalPortlets.ftl Sat Dec 20 20:40:27 2008
@@ -45,7 +45,7 @@
               <tr>
                 <td>
                   <div class="h2">
-                    <a href="<@o...@ofbizUrl>">${portalPortlet.portletName}</a>
+                    <a href="<@o...@ofbizUrl>">${portalPortlet.portletName}</a>
                   </div>
                   <div class="tabletext">
                     ${portalPortlet.description}

Modified: ofbiz/trunk/framework/common/webcommon/portal/portalPage.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/portalPage.ftl?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/portalPage.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/portalPage.ftl Sat Dec 20 20:40:27 2008
@@ -18,36 +18,28 @@
 -->
 
 <#if currentPortalPage?has_content>
-
-<div id="manage-portal-toolbar">
-  <ul>
-    <#if currentPortalPage.portalName?has_content>
-      <li id="portal-page-name">
-        ${currentPortalPage.portalName}
-      </li>
-    </#if>
-
     <#if configurePortalPage?has_content>
-      <li id="add-column">
-        <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonAddColumn}</a>
-      </li>
+		<div id="manage-portal-toolbar">
+  			<ul>
+      			<li id="add-column">
+        		<a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonAddColumn}</a>
+      			</li>
+  			</ul>
+  			<br class="clear"/>
+		</div>
     </#if>
 
-  </ul>
-  <br class="clear"/>
-</div>
-
 <table width="100%">
   <#if configurePortalPage?has_content>
-    <tr>
+    <tr> 
       <#list portalPageColumnList?if_exists as portalPageColumn>
         <td class="manage-portal-column-toolbar">
           <ul>
             <li id="delete-column">
-              <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a>
+              <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a>
             </li>
             <li id="add-portlet">
-              <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonAddAPortlet}</a>
+              <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonAddAPortlet}</a>
             </li>
           </ul>
         </td>
@@ -65,7 +57,7 @@
         <#if (!portlet.columnSeqId?has_content && portalPageColumn_index == 0) || (portlet.columnSeqId?if_exists == portalPageColumn.columnSeqId)>
           <#if portlet.screenName?has_content>
             <#if configurePortalPage?has_content>
-              <#assign portletUrlLink = "portalPageId="+currentPortalPage.portalPageId+"&amp;portalPortletId="+portlet.portalPortletId+"&amp;portletSeqId="+portlet.portletSeqId+"&amp;configurePortalPage=true" />
+              <#assign portletUrlLink = "portalPageId="+currentPortalPage.portalPageId+"&amp;portalPortletId="+portlet.portalPortletId+"&amp;portletSeqId="+portlet.portletSeqId+"&amp;configurePortalPage=true&amp;originalPortalPageId="+parameters.originalPortalPageId/>
       
               <div class="portlet-config">
               <div class="portlet-config-title-bar">

Modified: ofbiz/trunk/framework/common/widget/PortalPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/PortalPageForms.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/PortalPageForms.xml (original)
+++ ofbiz/trunk/framework/common/widget/PortalPageForms.xml Sat Dec 20 20:40:27 2008
@@ -24,15 +24,14 @@
     <form name="ListPortalPages" type="list" list-name="listIt" paginate-target="ManagePortalPages" default-entity-name="PortalPage" separate-columns="true"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>
-            <set field="sortField" from-field="parameters.sortField" default-value="portalPageId"/>
-            <entity-and entity-name="PortalPage" use-cache="true" list-name="listIt">
-                <field-map env-name="userLogin.userLoginId" field-name="ownerUserLoginId" />
-                <order-by field-name="${sortField}"/>
-            </entity-and>
+            <set field="sortField" from-field="parameters.sortField" default-value="createdStamp"/>
+            <service service-name="getListPreferences"  result-map-name="listIt" result-map-list-name="listIt">
+                <field-map field-name="originalPortalPageId" env-name="parameters.originalPortalPageId"/>
+            </service>
         </actions>
         
         <field name="portalPageId" title="${uiLabelMap.CommonId}" sort-field="true">
-            <hyperlink description="${portalPageId}" target="dashboard?portalPageId=${portalPageId}&amp;configurePortalPage=true"/>
+            <hyperlink description="${portalPageId}" target="dashboard?portalPageId=${portalPageId}&amp;configurePortalPage=true&amp;originalPortalPageId=${parameters.originalPortalPageId}"/>
         </field>
         <field name="portalName" title="${uiLabelMap.CommonName}" id-name="portalName" widget-style="tabletext" sort-field="true">
             <display>
@@ -50,14 +49,15 @@
                 </in-place-editor>
             </display>
         </field>
-        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
-            <hyperlink target="deletePortalPage?portalPageId=${portalPageId}&amp;ownerUserLoginId=${userLogin.userLoginId}" description="${uiLabelMap.CommonDelete}"/>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" >
+            <hyperlink target="deletePortalPage?portalPageId=${portalPageId}&amp;originalPortalPageId=${parameters.originalPortalPageId}" description="${uiLabelMap.CommonDelete}"/>
         </field>
     </form>
     
     <form name="NewPortalPage" type="single" target="createPortalPage" title="" default-map-name="PortalPagemap">
         <actions>
             <set from-field="userLogin.userLoginId" field="ownerUserLoginId"/>
+            <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
         </actions>    
         <auto-fields-service service-name="createPortalPage"/>
         <field name="ownerUserLoginId">
@@ -66,7 +66,9 @@
         <field name="sequenceNum">
             <hidden/>
         </field>
-
+        <field name="originalPortalPageId">
+            <hidden/>
+        </field>
         <field name="portalName" title="${uiLabelMap.CommonName}">
             <text/>
         </field>

Modified: ofbiz/trunk/framework/common/widget/PortalPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/PortalPageScreens.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/PortalPageScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/PortalPageScreens.xml Sat Dec 20 20:40:27 2008
@@ -18,30 +18,33 @@
 under the License.
 -->
 
-<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
+<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
 
     <screen name="dashboard">
         <section>
             <actions>
-                <set field="portalPageId" from-field="parameters.portalPageId" default-value="DEFAULT"/>
-                <entity-one entity-name="PortalPage" value-name="currentPortalPage"/>                
-                
-                <entity-condition entity-name="PortalPage" list-name="portalPageList">
-                    <condition-expr field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
-                </entity-condition>
-                <set field="portalPages" from-field="portalPageList"/>
-                
+                <set field="portalPageId" from-field="parameters.portalPageId"/>
+                <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
+                <set field="headerItem" from-field="portalPageId"/>
+                <set field="configurePortalPage" from-field="parameters.configurePortalPage"/>
+                <entity-one entity-name="PortalPage" value-name="currentPortalPage"/>    
+                <set field="portalPages[]" from-field="currentPortalPage"/>                
                 <entity-condition entity-name="PortalPageColumn" list-name="portalPageColumnList">
                     <condition-expr field-name="portalPageId" env-name="portalPageId"/>
                     <order-by field-name="columnSeqId"/>
-                </entity-condition>
+                </entity-condition>               
                 <entity-condition entity-name="PortalPagePortletView" list-name="portalPagePortletViewList">
                     <condition-expr field-name="portalPageId" env-name="portalPageId"/>
                     <order-by field-name="sequenceNum"/>
                 </entity-condition>
-                
-                <set field="configurePortalPage" from-field="parameters.configurePortalPage"/>
+                <!--My Profile From Party-->
+                <set field="titleProperty" value="PageTitleViewPartyProfile"/>
+                <set field="tabButtonItem" value="viewprofile"/>
+                <set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
+                <set field="parameters.partyId" from-field="userLogin.userLoginId"/>
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetUserLoginPrimaryEmail.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -57,6 +60,9 @@
 
     <screen name="ManagePortalPages">
         <section>
+            <actions>
+                <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
+            </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
@@ -71,6 +77,7 @@
     <screen name="AddPortlet">
         <section>
             <actions>
+                <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
                 <entity-condition entity-name="PortalPortlet" list-name="portalPortlets"/>
             </actions>
             <widgets>
@@ -82,10 +89,11 @@
             </widgets>
         </section>
     </screen>
-    
+
     <screen name="EditPortlet">
         <section>
             <actions>
+                <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
                 <entity-one entity-name="PortalPortlet" value-name="portalPortlet"/>
             </actions>
             <widgets>

Modified: ofbiz/trunk/framework/example/widget/example/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/CommonScreens.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/CommonScreens.xml Sat Dec 20 20:40:27 2008
@@ -42,9 +42,12 @@
                 <set field="activeApp" value="example" global="true"/>
                 <!--set field="applicationMenuName" value="ExampleAppBar" global="true"/>
                 <set field="applicationMenuLocation" value="component://example/widget/example/ExampleMenus.xml" global="true"/-->
+                <set field="originalPortalPageId" value="EXAMPLE"/>
                 <set field="appheaderTemplate" value="component://common/webcommon/portal/appheader.ftl"/>                
                 <entity-and entity-name="PortalPage" list-name="pages">
+                    <field-map field-name="originalPortalPageId" env-name="originalPortalPageId"/>
                     <field-map field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
+                    <order-by field-name="createdStamp"/>
                 </entity-and>
             </actions>
             <widgets>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml Sat Dec 20 20:40:27 2008
@@ -152,18 +152,25 @@
     <screen name="DisplayExamplePage">
         <section>
             <actions>
-                <set field="portalPageId" from-field="parameters.portalPageId" default-value="DEFAULT"/>
+                <set field="portalPageId" from-field="parameters.portalPageId"/>
+                <set field="originalPortalPageId" from-field="parameters.originalPortalPageId"/>
                 <set field="headerItem" from-field="portalPageId"/>
                 <entity-one entity-name="PortalPage" value-name="currentPortalPage"/>                
-
                 <entity-condition entity-name="PortalPageColumn" list-name="portalPageColumnList">
                     <condition-expr field-name="portalPageId" env-name="portalPageId"/>
                     <order-by field-name="columnSeqId"/>
-                </entity-condition>
+                </entity-condition>               
                 <entity-condition entity-name="PortalPagePortletView" list-name="portalPagePortletViewList">
                     <condition-expr field-name="portalPageId" env-name="portalPageId"/>
                     <order-by field-name="sequenceNum"/>
                 </entity-condition>
+                <!--My Profile From Party-->
+                <set field="titleProperty" value="PageTitleViewPartyProfile"/>
+                <set field="tabButtonItem" value="viewprofile"/>
+                <set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
+                <set field="parameters.partyId" from-field="userLogin.userLoginId"/>
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetUserLoginPrimaryEmail.groovy"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">

Modified: ofbiz/trunk/specialpurpose/component-load.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/component-load.xml?rev=728389&r1=728388&r2=728389&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/component-load.xml (original)
+++ ofbiz/trunk/specialpurpose/component-load.xml Sat Dec 20 20:40:27 2008
@@ -29,6 +29,7 @@
     <load-component component-location="googlebase"/>
     <load-component component-location="ebay"/>
     <load-component component-location="mypage"/>
+    <load-component component-location="myportal"/>
     <load-component component-location="webpos"/>
     <!-- <load-component component-location="workflow"/> -->
     <!-- <load-component component-location="shark"/> -->

Added: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <property key="MyPersonalPortal">
+        <value xml:lang="en">My Personal Portal.</value>
+    </property>
+</resource>

Propchange: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<entity-engine-xml>
+
+	<!-- allow admin to read company communications -->
+    <PartyRole partyId="admin" roleTypeId="EMAIL_ADMIN"/>
+    <PartyRelationship partyIdFrom="admin" roleTypeIdFrom="EMAIL_ADMIN" partyIdTo="Company" roleTypeIdTo="_NA_" fromDate="2000-01-01 00:00:00"/>
+
+    <!-- incoming customer request examples -->
+    <CustRequest custRequestId="9000" custRequestTypeId="RF_SUPPORT" statusId="CRQ_SUBMITTED" fromPartyId="DemoCustomer" priority="9" custRequestName="Customer Request Usage" description="Could you please advise us how to use the customer request facility within ofbiz?" productStoreId="9000" createdDate="2008-07-28 11:45:31.928" createdByUserLogin="admin" lastModifiedDate="2008-07-28 11:45:31.928" lastModifiedByUserLogin="admin" lastUpdatedStamp="2008-07-28 11:45:31.984" lastUpdatedTxStamp="2008-07-28 11:45:31.83" createdStamp="2008-07-28 11:45:31.984" createdTxStamp="2008-07-28 11:45:31.83"/>
+    <CustRequest custRequestId="9001" custRequestTypeId="RF_SUPPORT" statusId="CRQ_SUBMITTED" fromPartyId="DemoCustAgent" priority="9" custRequestName="Hardware?" description="Please provide us with the hardware requirements of OFBiz" productStoreId="9000" createdDate="2008-07-28 11:45:31.928" createdByUserLogin="admin" lastModifiedDate="2008-07-28 11:45:31.928" lastModifiedByUserLogin="admin" lastUpdatedStamp="2008-07-28 11:45:31.984" lastUpdatedTxStamp="2008-07-28 11:45:31.83" createdStamp="2008-07-28 11:45:31.984" createdTxStamp="2008-07-28 11:45:31.83"/>
+    <!-- responsible employees -->
+    <CustRequestType custRequestTypeId="RF_SUPPORT" partyId="Company"/>
+    <PartyRole partyId="admin" roleTypeId="REQ_TAKER"/> 
+    <PartyRelationship partyIdFrom="Company" roleTypeIdFrom="_NA_" partyIdTo="admin" roleTypeIdTo="REQ_TAKER" fromDate="2000-01-01 00:00:00"/>
+
+    <!-- email from an unknown party -->
+    <CommunicationEvent communicationEventId="9000" communicationEventTypeId="AUTO_EMAIL_COMM" statusId="COM_UNKNOWN_PARTY" contactMechTypeId="EMAIL_ADDRESS" contactMechIdTo="admin" roleTypeIdFrom="_NA_" roleTypeIdTo="_NA_" partyIdTo="admin" entryDate="2008-07-28 13:55:55.827" datetimeStarted="2008-07-28 13:55:19.0" subject="Why i would use the OFBiz system" contentMimeTypeId="text/plain" content="Every time i think of you, only you...you are always on my mind......." note="Sent from: my@email.com; Sent Name from: Jo Easy User; Sent to: ofbiztest@yahoo.com; Delivered-To: ofbiztest@yahoo.com; " fromString="mailinglist@antwebsystems.com" toString="ofbiztest@yahoo.com"/>
+    <PartyRole partyId="admin" roleTypeId="ADDRESSEE"/> 
+    <CommunicationEventRole communicationEventId="9000" partyId="admin" roleTypeId="ADDRESSEE" contactMechId="admin" statusId="COM_ROLE_CREATED"/>
+    
+    <!-- mypage users -->
+    <!-- demo customer read access to his own customer requests and related tasks including planning and actual hours-->
+    <UserLoginSecurityGroup groupId="MYPORTAL_CUSTOMER" userLoginId="DemoCustomer" fromDate="2000-01-01 00:00:00.0"/>
+    <!-- these customers also have access to the project manager (via rules in the project manager comp) -->
+    <UserLoginSecurityGroup groupId="MYPORTAL_CUSTOMER" userLoginId="DemoCustomer1" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginSecurityGroup groupId="MYPORTAL_CUSTOMER" userLoginId="DemoCustomer2" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginSecurityGroup groupId="MYPORTAL_CUSTOMER" userLoginId="DemoCustomer3" fromDate="2000-01-01 00:00:00.0"/>
+    <!-- demo employee has limited projectmanager access including timesheets, can read/write comms internal notes but cannot send external email-->
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPL-NOEML" userLoginId="DemoEmployee1" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPL-NOEML" userLoginId="DemoEmployee2" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPL-NOEML" userLoginId="DemoEmployee3" fromDate="2000-01-01 00:00:00.0"/>
+    <!-- employee have no access to any project -->
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPLOYEE" userLoginId="DemoEmployee" fromDate="2000-01-01 00:00:00.0"/>
+    <!-- admin logins -->
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPLOYEE" userLoginId="admin" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginSecurityGroup groupId="MYPORTAL_EMPLOYEE" userLoginId="demoadmin" fromDate="2000-01-01 00:00:00.0"/>
+    
+    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_CONFIRM" bodyScreenLocation="component://myportal/widget/MyPageScreens.xml#CompletedCustRequestNotification" subject="OFBiz - Your Request Is Complete[${custRequestId}]" fromAddress="ofbiztest@yahoo.com"/>
+    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_CREATED" bodyScreenLocation="component://myportal/widget/MyPageScreens.xml#CreateCustRequestNotification" subject="OFBiz - Your Request Is Created[${custRequestId}]" fromAddress="ofbiztest@yahoo.com"/>
+
+</entity-engine-xml>

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalDemoData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<entity-engine-xml>
+
+    <SecurityPermission permissionId="MYPORTAL_EMPLOYEE" description="Use the employee screens in mypage."/>
+    <SecurityGroup description="Employee user of mypage, Limited access to the projectmgr, comms,custRequests" groupId="MYPORTAL_EMPLOYEE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="MYPORTAL_EMPLOYEE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PROJECTMGR_VIEW"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PROJECTMGR_ROLE_VIEW"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PROJECTMGR_ROLE_TASK_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PROJECTMGR_ROLE_TIMESHEET_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PROJECTMGR_ROLE_TIMESHEET_UPDATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_CME_UPDATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_CME_CREATE"/>
+    <!-- be able to create internal notes and email-->
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_CME-EMAIL_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_CME-EMAIL_UPDATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_CME-NOTE_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="PARTYMGR_VIEW"/>
+    <!-- and can create customer request from emails -->
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="ORDERMGR_CRQ_CREATE"/>
+    <!-- and can upload content for email/task/project -->
+    <SecurityGroupPermission groupId="MYPORTAL_EMPLOYEE" permissionId="CONTENTMGR_ROLE_CREATE"/>
+
+    <SecurityPermission permissionId="MYPORTAL_EMPL-NOEML" description="Usage of the employee screens in MYPORTAL: projectmanager and internal notes."/>
+    <SecurityGroup description="Employee user of MYPORTAL, Limited access to the projectmgr and comms, custReq, no email" groupId="MYPORTAL_EMPL-NOEML"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="MYPORTAL_EMPLOYEE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PROJECTMGR_VIEW"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PROJECTMGR_ROLE_VIEW"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PROJECTMGR_ROLE_TASK_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PROJECTMGR_ROLE_TIMESHEET_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PROJECTMGR_ROLE_TIMESHEET_UPDATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PARTYMGR_CME-NOTE_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PARTYMGR_CME_CREATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="PARTYMGR_CME_UPDATE"/>
+    <!-- and can upload content for task/project -->
+    <SecurityGroupPermission groupId="MYPORTAL_EMPL-NOEML" permissionId="CONTENTMGR_ROLE_CREATE"/>
+    
+    <SecurityPermission permissionId="MYPORTAL_CUSTOMER" description="Use the customer screens in MYPORTAL."/>
+    <SecurityGroup description="Customer user of MYPORTAL, Limited access to own custRequests, and project" groupId="MYPORTAL_CUSTOMER"/>
+    <SecurityGroupPermission groupId="MYPORTAL_CUSTOMER" permissionId="PARTYMGR_CME-NOTE_CREATE"/><!-- allow customer to read/write internal notes -->
+    <SecurityGroupPermission groupId="MYPORTAL_CUSTOMER" permissionId="MYPORTAL_CUSTOMER"/>
+    <SecurityGroupPermission groupId="MYPORTAL_CUSTOMER" permissionId="PARTYMGR_CME_UPDATE"/>
+    <SecurityGroupPermission groupId="MYPORTAL_CUSTOMER" permissionId="PROJECTMGR_ROLE_VIEW"/>
+    <SecurityGroupPermission groupId="MYPORTAL_CUSTOMER" permissionId="CONTENTMGR_ROLE_CREATE"/>
+</entity-engine-xml>

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalSecurityData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<entity-engine-xml>
+    
+    <WorkEffortType description="Company Events" hasTable="N" parentTypeId="EVENT" workEffortTypeId="COMPANY_EVENT"/>
+    
+    <UserPrefGroupType userPrefGroupTypeId="MyPortal" description="User settings of the MyPortal component"/>
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="myTasks" userPrefValue="Y"/> 
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="myTimesheet" userPrefValue="Y"/> 
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="myCommunications" userPrefValue="Y"/> 
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="otherCommunications" userPrefValue="Y"/> 
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="myCompanyComms" userPrefValue="Y"/> 
+    <UserPreference userLoginId="_NA_" userPrefGroupTypeId="MyPortal" userPrefTypeId="sendCustRequestEmail" userPrefValue="Y"/>
+    
+    <RoleType description="Email Administrator" hasTable="N" parentTypeId="PERSON_ROLE" roleTypeId="EMAIL_ADMIN"/>
+    
+    <!-- ProductStoreEmailSetting for send auto email to customer when CustRequest completed -->
+    <Enumeration description="Customer Request Created" enumCode="CUST_CREATED" enumId="PRDS_CUST_CREATED" sequenceId="17" enumTypeId="PRDS_EMAIL"/>
+    <Enumeration description="Customer Request Completed" enumCode="CUST_COMPLETE" enumId="PRDS_CUST_CONFIRM" sequenceId="18" enumTypeId="PRDS_EMAIL"/>
+    
+    <!-- PortalPortlet Demo Data -->
+    <PortalPage portalPageId="MYPORTAL" portalName="Main" description="The default OFBiz portal page" ownerUserLoginId="_NA_" originalPortalPageId="_NA_"/>
+    <PortalPageColumn portalPageId="MYPORTAL" columnSeqId="01" />
+    <PortalPageColumn portalPageId="MYPORTAL" columnSeqId="02" />
+    
+    <PortalPortlet portalPortletId="Attributes" portletName="Attributes" screenName="Attributes" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Attributes in myportal from party" />
+    <PortalPortlet portalPortletId="AvsSettings" portletName="Avs Settings" screenName="AvsSettings" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Avs Settings in myportal from party" />
+    <PortalPortlet portalPortletId="Cart" portletName="Cart" screenName="Cart" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Cart in myportal from party" />
+    <PortalPortlet portalPortletId="Content" portletName="Content" screenName="Content" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Content in myportal from party" />
+    <PortalPortlet portalPortletId="FinAccounts" portletName="Fin Accounts" screenName="FinAccounts" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Fin Accounts in myportal from party" />
+    <PortalPortlet portalPortletId="LoyaltyPoints" portletName="Loyalty Points" screenName="LoyaltyPoints" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Loyalty Points in myportal from party" />
+    <PortalPortlet portalPortletId="MYTASKSPARTY" portletName="My Tasks From Party" screenName="mytasksParty" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="My Tasks in myportal from party" />
+    <PortalPortlet portalPortletId="Notes" portletName="Notes" screenName="Notes" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Notes in myportal from party" />
+    <PortalPortlet portalPortletId="PaymentMethods" portletName="Payment Methods" screenName="PaymentMethods" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="PaymentMethods in myportal from party" />
+    <PortalPortlet portalPortletId="SerializedInventory" portletName="Serialized Inventory" screenName="SerializedInventory" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Serialized Inventory in myportal from party"/>
+    <PortalPortlet portalPortletId="ShipperAccount" portletName="Shipper Account" screenName="ShipperAccount" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Shipper Account in myportal from party" />
+    <PortalPortlet portalPortletId="Subscriptions" portletName="Subscriptions" screenName="Subscriptions" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Subscriptions in myportal from party" />
+    <PortalPortlet portalPortletId="UserLogin" portletName="User Login" screenName="UserLogin" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="User Login in myportal from party"/>
+    <PortalPortlet portalPortletId="ViewInternalOrg" portletName="View Internal Org" screenName="ViewInternalOrg" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="View Internal Org in myportal from party" />
+    <PortalPortlet portalPortletId="Visits" portletName="Visits" screenName="Visits" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Visits in myportal from party" />
+    <PortalPortlet portalPortletId="contact" portletName="Contact" screenName="Contact" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="contact in myportal from party" />
+    <PortalPortlet portalPortletId="contactsAndAccounts" portletName="Contacts and Accounts" screenName="contactsAndAccounts" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Contacts and Accounts in myportal from party" />
+    <PortalPortlet portalPortletId="listrequestlist" portletName="List Request List" screenName="ListRequestList" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="List Request List From My Page" />
+    <PortalPortlet portalPortletId="mycommunications" portletName="My Communications" screenName="MyCommunications" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="My Communications From My Page" />
+    <PortalPortlet portalPortletId="mycompanycomms" portletName="My Company Comms" screenName="MyCompanyComms" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="My Company Comms From My Page" />
+    <PortalPortlet portalPortletId="mytasks" portletName="My Tasks" screenName="MyTasks" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="My Tasks From My Page" />
+    <PortalPortlet portalPortletId="mytimesheet" portletName="My Timesheet" screenName="MyTimesheet" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="My Timesheet From My Page" />
+    <PortalPortlet portalPortletId="otherCommunications" portletName="Other Communications" screenName="OtherCommunications" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="Other Communications From My Page" />
+    <PortalPortlet portalPortletId="party" portletName="Party" screenName="Party" screenLocation="component://myportal/widget/MyPortalScreens.xml" description="profile in myportal from party" />    
+    
+    <PortalPagePortlet portalPageId="MYPORTAL" portalPortletId="listrequestlist" portletSeqId="00001" columnSeqId="01" sequenceNum="-2" />
+    <PortalPagePortlet portalPageId="MYPORTAL" portalPortletId="mycommunications" portletSeqId="00001" columnSeqId="02" sequenceNum="-1" />
+    <PortalPagePortlet portalPageId="MYPORTAL" portalPortletId="mycompanycomms" portletSeqId="00001" columnSeqId="02" sequenceNum="0" />
+    <PortalPagePortlet portalPageId="MYPORTAL" portalPortletId="mytasks" portletSeqId="00001" columnSeqId="01" sequenceNum="0" />
+    <PortalPagePortlet portalPageId="MYPORTAL" portalPortletId="otherCommunications" portletSeqId="00001" columnSeqId="01" />
+</entity-engine-xml>

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<ofbiz-component name="myportal"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <resource-loader name="main" type="component"/>
+    <classpath type="dir" location="config"/>
+    <classpath type="dir" location="script"/>
+    
+    <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPortalTypeData.xml"/>
+    <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPortalSecurityData.xml"/>
+    <entity-resource type="data" reader-name="demo" loader="main" location="data/MyPortalDemoData.xml"/>
+    
+    <service-resource type="model" loader="main" location="servicedef/services.xml"/>
+    <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
+    
+    <webapp name="myportal"
+        title="MyPortal"
+        server="default-server"
+        location="webapp/myportal"
+        mount-point="/myportal"
+        app-bar-display="true"/>
+</ofbiz-component>

Propchange: ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml?rev=728389&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml (added)
+++ ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml Sat Dec 20 20:40:27 2008
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+    <simple-method method-name="updatePreferences" short-description="Update the user preferences">
+        <if-compare operator="equals" value="Y" field="parameters.myCompanyComms">
+            <set field="parameters.userPrefMap.myCompanyComms" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.myCompanyComms" value="N"/>
+            </else>
+        </if-compare>
+        <if-compare operator="equals" value="Y" field="parameters.myTimesheet">
+            <set field="parameters.userPrefMap.myTimesheet" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.myTimesheet" value="N"/>
+            </else>
+        </if-compare>
+        <if-compare operator="equals" value="Y" field="parameters.myTasks">
+            <set field="parameters.userPrefMap.myTasks" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.myTasks" value="N"/>
+            </else>
+        </if-compare>
+        <if-compare operator="equals" value="Y" field="parameters.myCommunications">
+            <set field="parameters.userPrefMap.myCommunications" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.myCommunications" value="N"/>
+            </else>
+        </if-compare>
+        <if-compare operator="equals" value="Y" field="parameters.otherCommunications">
+            <set field="parameters.userPrefMap.otherCommunications" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.otherCommunications" value="N"/>
+            </else>
+        </if-compare>
+        <set-service-fields service-name="setUserPreferenceGroup" map-name="parameters"
+            to-map-name="inMap"/>
+        <call-service service-name="setUserPreferenceGroup" in-map-name="inMap"/>
+    </simple-method>
+
+    <simple-method method-name="updateCustPreferences"
+        short-description="Update the customer preferences">
+        <if-compare operator="equals" value="Y" field="parameters.sendCustRequestEmail">
+            <set field="parameters.userPrefMap.sendCustRequestEmail" value="Y"/>
+            <else>
+                <set field="parameters.userPrefMap.sendCustRequestEmail" value="N"/>
+            </else>
+        </if-compare>
+        <set-service-fields service-name="setUserPreferenceGroup" map-name="parameters"
+            to-map-name="inMap"/>
+        <call-service service-name="setUserPreferenceGroup" in-map-name="inMap"/>
+    </simple-method>
+
+    <simple-method method-name="setCommEventToRead" short-description="">
+        <entity-one entity-name="CommunicationEventRole" value-name="eventRole"/>
+        <if-compare operator="equals" value="COM_ROLE_CREATED" field="eventRole.statusId">
+            <call-simple-method method-name="checkCommEventAccess"/>
+            <if-compare operator="equals" value="true" field="found">
+                <entity-one entity-name="UserLogin" value-name="userLogin">
+                    <field-map field-name="userLoginId" value="system"/>
+                </entity-one>
+                <set-service-fields service-name="setCommunicationEventRoleStatus"
+                    map-name="parameters" to-map-name="updStat"/>
+                <set field="updStat.statusId" value="COM_ROLE_READ"/>
+                <set field="updStat.userLogin" from-field="userLogin"/>
+                <call-service service-name="setCommunicationEventRoleStatus" in-map-name="updStat"
+                    include-user-login="false"/>
+                <else>
+                    <add-error>
+                        <fail-property property="NoAccess" resource="MyPageUiLabels"/>
+                    </add-error>
+                </else>
+            </if-compare>
+        </if-compare>
+    </simple-method>
+
+    <simple-method method-name="checkCommEventAccess"
+        short-description="check if the user has access to the email of this party">
+        <set field="found" value="false"/>
+        <if-compare-field operator="not-equals" field="parameters.partyId"
+            to-field="userLogin.partyId">
+            <entity-and list-name="emailOwners" entity-name="PartyRelationship"
+                filter-by-date="true">
+                <field-map field-name="partyIdFrom" value="${userLogin.partyId}"/>
+                <field-map field-name="roleTypeIdFrom" value="EMAIL_ADMIN"/>
+            </entity-and>
+            <iterate entry-name="emailOwners" list-name="emailOwner">
+                <if-compare operator="equals" value="${userLogin.partyId}"
+                    field="emailOwner.partyIdTo">
+                    <set field="found" value="true"/>
+                </if-compare>
+            </iterate>
+            <else>
+                <set field="found" value="true"/>
+            </else>
+        </if-compare-field>
+    </simple-method>
+    <simple-method method-name="createCommunicationEventRoles" short-description="">
+        <entity-condition list-name="commEvents" entity-name="CommunicationEvent"/>
+        <set field="count" value="0" type="Integer"/>
+        <iterate entry-name="commEvent" list-name="commEvents">
+            <log level="always" message="====processing: ${commEvent.communicationEventId}"/>
+            <get-related value-name="commEvent" relation-name="CommunicationEventRole"
+                list-name="roles"/>
+            <if-empty field="roles">
+                <!--partyId To -->
+                <if-not-empty field="commEvent.partyIdTo">
+                    <entity-one entity-name="PartyRole" value-name="partyRole">
+                        <field-map field-name="partyId" value="${commEvent.partyIdTo}"/>
+                        <field-map field-name="roleTypeId" value="ADDRESSEE"/>
+                    </entity-one>
+                    <if-empty field="partyRole">
+                        <make-value entity-name="PartyRole" value-name="partyRole"/>
+                        <set field="partyRole.partyId" value="${commEvent.partyIdTo}"/>
+                        <set field="partyRole.roleTypeId" value="ADDRESSEE"/>
+                        <create-value value-name="partyRole"/>
+                    </if-empty>
+                    <make-value entity-name="CommunicationEventRole" value-name="commRole"/>
+                    <set field="commRole.communicationEventId"
+                        from-field="commEvent.communicationEventId"/>
+                    <set field="commRole.partyId" from-field="commEvent.partyIdTo"/>
+                    <set field="commRole.roleTypeId" value="ADDRESSEE"/>
+                    <set field="commRole.statusId" value="COM_ROLE_COMPLETED"/>
+                    <create-value value-name="commRole"/>
+                </if-not-empty>
+
+                <!-- partyIdFrom -->
+                <if-not-empty field="commEvent.partyIdFrom">
+                    <entity-one entity-name="PartyRole" value-name="partyRole">
+                        <field-map field-name="partyId" value="${commEvent.partyIdFrom}"/>
+                        <field-map field-name="roleTypeId" value="ORIGINATOR"/>
+                    </entity-one>
+                    <if-empty field="partyRole">
+                        <make-value entity-name="PartyRole" value-name="partyRole"/>
+                        <set field="partyRole.partyId" value="${commEvent.partyIdFrom}"/>
+                        <set field="partyRole.roleTypeId" value="ORIGINATOR"/>
+                        <create-value value-name="partyRole"/>
+                    </if-empty>
+                    <set field="commRole.communicationEventId"
+                        from-field="commEvent.communicationEventId"/>
+                    <set field="commRole.partyId" from-field="commEvent.partyIdFrom"/>
+                    <set field="commRole.roleTypeId" value="ORIGINATOR"/>
+                    <set field="commRole.statusId" value="COM_ROLE_COMPLETED"/>
+                    <create-value value-name="commRole"/>
+                </if-not-empty>
+                <calculate field-name="count">
+                    <number value="1"/>
+                    <calcop operator="add" field-name="count"/>
+                </calculate>
+            </if-empty>
+        </iterate>
+        <log level="always" message="========${count} records updated"/>
+    </simple-method>
+
+    <simple-method method-name="getToNextDonePage"
+        short-description="return the requestValue 'donePage' as a resultcode to the controller">
+        <set field="donePage" from-field="parameters.donePage"
+            default-value="${parameters.DONE_PAGE}"/>
+        <if-not-empty field="donePage">
+            <log level="info" message="Next request: ${donePage}"/>
+            <return response-code="${donePage}"/>
+            <else>
+                <log level="info" message="Next 'donePage' variable not provided, returning 'error'"/>
+                <return response-code="error"/>
+            </else>
+        </if-not-empty>
+    </simple-method>
+
+    <simple-method method-name="createCommunicationContent"
+        short-description="Upload Content and Create Communication Content Association">
+        <!-- Call layout to get field -->
+        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
+            method-name="uploadImageAndParameters" ret-field-name="formInput">
+            <field field-name="request" type="javax.servlet.http.HttpServletRequest"/>
+            <string value="uploadedFile"/>
+        </call-class-method>
+        <set field="parameters.imageFileName" from-field="formInput.imageFileName"/>
+
+        <!-- Call bsh get file type -->
+        <call-bsh><![CDATA[
+            String fileName = parameters.get("imageFileName");
+            String mimeTypeId = fileName.substring(fileName.indexOf(".")+1,fileName.length());
+            parameters.put("mimeType",mimeTypeId);
+            ]]>
+        </call-bsh>
+
+        <!-- Get mime type from FileExtention -->
+        <set field="fileMap.fileExtensionId" value="${parameters.mimeType}"/>
+        <find-by-primary-key map-name="fileMap" value-name="mimeType" entity-name="FileExtension"/>
+
+        <!-- Create Data Resource -->
+        <set-service-fields service-name="createContentFromUploadedFile"
+            map-name="formInput.formInput" to-map-name="data"/>
+        <set field="data.dataResourceTypeId" value="LOCAL_FILE"/>
+        <set field="data.dataTemplateTypeId" value="NONE"/>
+        <set field="data.dataCategoryId" from-field="formInput.formInput.dataCategoryId"/>
+
+        <set field="data.statusId" from-field="formInput.formInput.statusId"/>
+        <set field="data.dataResourceName" from-field="formInput.imageFileName"/>
+        <set field="data.mimeTypeId" from-field="mimeType.mimeTypeId"/>
+        <set field="data.uploadedFile" from-field="formInput.imageData"/>
+        <set field="data._uploadedFile_fileName" from-field="formInput.imageFileName"/>
+        <set field="data._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/>
+        <call-service service-name="createDataResource" in-map-name="data">
+            <result-to-field result-name="dataResourceId" field-name="dataResourceId"
+                map-name="parameters"/>
+        </call-service>
+        <log level="always" message=" DataResource : ${parameters.dataResourceId}"/>
+
+        <!-- Create attach upload to data resource -->
+        <set-service-fields service-name="attachUploadToDataResource" map-name="formInput.formInput"
+            to-map-name="attachMap"/>
+        <set field="attachMap.uploadedFile" from-field="formInput.imageData"/>
+        <set field="attachMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
+        <set field="attachMap._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/>
+        <set field="attachMap.dataResourceId" from-field="parameters.dataResourceId"/>
+        <set field="attachMap.mimeTypeId" from-field="mimeType.mimeTypeId"/>
+        <call-service service-name="attachUploadToDataResource" in-map-name="attachMap"/>
+
+        <!-- Create content from dataResource -->
+        <set-service-fields service-name="createContentFromDataResource"
+            map-name="formInput.formInput" to-map-name="contentMap"/>
+        <set field="contentMap.roleTypeId" from-field="formInput.formInput.roleTypeId"/>
+        <set field="contentMap.partyId" from-field="formInput.formInput.partyId"/>
+        <set field="contentMap.contentTypeId" from-field="formInput.formInput.contentTypeId"/>
+        <set field="contentMap.dataResourceId" from-field="parameters.dataResourceId"/>
+        <call-service service-name="createContentFromDataResource" in-map-name="contentMap">
+            <result-to-field result-name="contentId" field-name="contentId" map-name="parameters"/>
+        </call-service>
+        <log level="always" message=" Content : ${parameters.contentId}"/>
+
+        <!-- Create party content -->
+        <set-service-fields service-name="createPartyContent" map-name="formInput.formInput"
+            to-map-name="partycontent"/>
+        <set field="partycontent.contentId" from-field="parameters.contentId"/>
+        <set field="partycontent.partyContentTypeId"
+            from-field="formInput.formInput.partyContentTypeId"/>
+        <set field="partycontent.partyId" from-field="formInput.formInput.partyId"/>
+        <call-service service-name="createPartyContent" in-map-name="partycontent"/>
+
+        <!-- Create communication event and content association -->
+        <set-service-fields service-name="createCommEventContentAssoc"
+            map-name="formInput.formInput" to-map-name="contentAssoc"/>
+        <set field="contentAssoc.contentId" from-field="parameters.contentId"/>
+        <set field="contentAssoc.communicationEventId"
+            from-field="formInput.formInput.communicationEventId"/>
+        <call-service service-name="createCommEventContentAssoc" in-map-name="contentAssoc">
+            <result-to-field result-name="fromDate" field-name="fromDate"/>
+        </call-service>
+
+        <!-- Return to request -->
+        <set field="communicationEventTypeId"
+            from-field="formInput.formInput.communicationEventTypeId"/>
+        <set field="communicationEventId" from-field="formInput.formInput.communicationEventId"/>
+        <field-to-request field-name="communicationEventId" request-name="communicationEventId"/>
+        <field-to-request field-name="communicationEventTypeId"
+            request-name="communicationEventTypeId"/>
+
+    </simple-method>
+
+    <simple-method method-name="addContentToCommEvent"
+        short-description="Add content to email communication">
+        <!-- Call layout to get field -->
+        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
+            method-name="uploadImageAndParameters" ret-field-name="formInput">
+            <field field-name="request" type="javax.servlet.http.HttpServletRequest"/>
+            <string value="partyId"/>
+        </call-class-method>
+
+        <!-- Create party content -->
+        <set-service-fields service-name="createPartyContent" map-name="formInput.formInput"
+            to-map-name="partycontent"/>
+        <set field="partycontent.contentId" from-field="formInput.formInput.contentId"/>
+        <set field="partycontent.partyContentTypeId"
+            from-field="formInput.formInput.partyContentTypeId"/>
+        <set field="partycontent.partyId" from-field="formInput.formInput.partyId"/>
+        <call-service service-name="createPartyContent" in-map-name="partycontent"/>
+
+        <!-- Create communication event and content association -->
+        <set-service-fields service-name="createCommEventContentAssoc"
+            map-name="formInput.formInput" to-map-name="contentAssoc"/>
+        <set field="contentAssoc.contentId" from-field="formInput.formInput.contentId"/>
+        <set field="contentAssoc.communicationEventId"
+            from-field="formInput.formInput.communicationEventId"/>
+        <call-service service-name="createCommEventContentAssoc" in-map-name="contentAssoc">
+            <result-to-field result-name="fromDate" field-name="fromDate"/>
+        </call-service>
+
+        <!-- Return to request -->
+        <set field="communicationEventTypeId"
+            from-field="formInput.formInput.communicationEventTypeId"/>
+        <set field="communicationEventId" from-field="formInput.formInput.communicationEventId"/>
+        <field-to-request field-name="communicationEventTypeId"
+            request-name="communicationEventTypeId"/>
+        <field-to-request field-name="communicationEventId" request-name="communicationEventId"/>
+    </simple-method>
+    
+    <!--Create simple-method of getPortalPageId-->
+    <simple-method method-name="getPortalPageId" short-description="">
+        <set field="mainPortalPageId" value="MAINMYPORTAL"/>
+        <entity-and entity-name="PortalPage" list-name="getMainPage">
+            <field-map field-name="originalPortalPageId" env-name="mainPortalPageId"/>
+            <field-map field-name="ownerUserLoginId" env-name="userLogin.userLoginId"/>
+        </entity-and>
+        <first-from-list entry-name="getMyportal" list-name="getMainPage"/>
+        <if-empty field="getMainPage">
+            <set field="portalPageId" value="MYPORTAL"/>
+        </if-empty>
+        <if-not-empty field="getMainPage">
+            <set field="portalPageId" from-field="getMyportal.portalPageId"/>
+        </if-not-empty>
+        <field-to-request field-name="portalPageId" request-name="portalPageId"/>
+    </simple-method>
+</simple-methods>

Propchange: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/myportal/script/org/ofbiz/myportal/Events.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml