svn commit: r492494 - in /ofbiz/trunk/applications/party: config/ script/org/ofbiz/party/party/ servicedef/ webapp/partymgr/WEB-INF/ webapp/partymgr/party/ widget/partymgr/

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

svn commit: r492494 - in /ofbiz/trunk/applications/party: config/ script/org/ofbiz/party/party/ servicedef/ webapp/partymgr/WEB-INF/ webapp/partymgr/party/ widget/partymgr/

jaz-3
Author: jaz
Date: Thu Jan  4 02:06:14 2007
New Revision: 492494

URL: http://svn.apache.org/viewvc?view=rev&rev=492494
Log:
applied patch from JIRA issue OFBIZ-589 from Anil Patel & Co.

Modified:
    ofbiz/trunk/applications/party/config/PartyUiLabels.properties
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
    ofbiz/trunk/applications/party/servicedef/services.xml
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
    ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml
    ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
    ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml

Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.properties?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyUiLabels.properties (original)
+++ ofbiz/trunk/applications/party/config/PartyUiLabels.properties Thu Jan  4 02:06:14 2007
@@ -69,6 +69,7 @@
 
 OrderNewOrder=New Order
 OrderOrders=Orders
+PageTitleAddPartyContent=Add Party Content
 PageTitleAddressMatchMap=Address Match Map
 PageTitleAddressMatches=Address Matches
 PageTitleCommEvents=Communication Events
@@ -205,6 +206,7 @@
 PartyContactTelephoneMissing=Contact telephone is missing
 PartyContactType=Contact Type
 PartyContactWorkPhoneNumber=Work Phone Number
+PartyContent=Party Content
 PartyContentId=Content ID
 PartyCookie=Cookie
 PartyCountryCode=Country Code

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Thu Jan  4 02:06:14 2007
@@ -326,7 +326,7 @@
     
     <!-- create party content -->
     <simple-method method-name="createPartyContent" short-description="Creates Party Associated Content" login-required="false">
-        <!-- make sure we are logged in when passing a partyId -->
+           <!-- make sure we are logged in when passing a partyId -->
         <if-not-empty field-name="partyId" map-name="parameters">
             <if-empty field-name="userLogin" map-name="parameters">
                 <add-error><fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/></add-error>
@@ -345,73 +345,131 @@
                 </if-compare-field>
             </if-not-empty>
         </if-empty>
-
-        <!-- find the sub directory file location -->
-        <call-class-method class-name="org.ofbiz.content.data.DataResourceWorker" method-name="getDataResourceContentUploadPath" ret-field-name="uploadPath"/>
-        <log level="always" message="[createPartyContent] - Found Subdir : ${uploadPath}"/>
-
-        <!-- locate the file extension to use based on mime-type -->
-        <set from-field="parameters._uploadedFile_contentType" field="extenLookup.mimeTypeId"/>
-        <find-by-and entity-name="FileExtension" map-name="extenLookup" list-name="extensions"/>
-        <first-from-list entry-name="extension" list-name="extensions"/>
-
-        <!-- create the data resource object -->
-        <sequenced-id-to-env sequence-name="DataResource" env-name="dataResourceId"/>
-        <make-value value-name="dataResource" entity-name="DataResource"/>
-        <set from-field="dataResourceId" field="dataResource.dataResourceId"/>
-        <set from-field="parameters._uploadedFile_fileName" field="dataResource.dataResourceName"/>
-        <set from-field="parameters._uploadedFile_contentType" field="dataResource.mimeTypeId"/>
-        <set from-field="parameters.dataCategoryId" field="dataResource.dataCategoryId"/>
-        <set from-field="parameters.statusId" field="dataResource.statusId"/>
-
-        <set value="${uploadPath}/${dataResource.dataResourceId}" field="dataResource.objectInfo"/>
-        <if-not-empty field-name="extension">
-            <set value="${uploadPath}/${dataResource.dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/>
-        </if-not-empty>
-
-        <set value="LOCAL_FILE" field="dataResource.dataResourceTypeId"/>
-        <create-value value-name="dataResource"/>
-
-        <!-- create content record -->
-        <sequenced-id-to-env sequence-name="Content" env-name="contentId"/>
-        <make-value value-name="content" entity-name="Content"/>
-        <set from-field="contentId" field="content.contentId"/>
-        <set from-field="parameters._uploadedFile_fileName" field="content.contentName"/>
-        <set from-field="parameters._uploadedFile_contentType" field="content.mimeTypeId"/>
-        <set from-field="dataResource.dataResourceId" field="content.dataResourceId"/>
-        <set from-field="parameters.contentTypeId" field="content.contentTypeId"/>
-        <set from-field="parameters.statusId" field="content.statusId"/>
-        <set value="${parameters.locale}" field="content.localeString"/>
-        <create-value value-name="content"/>
-
-        <!-- create the content role -->
-        <if-not-empty field-name="partyId" map-name="parameters">
+       <if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">                    
+           <call-class-method class-name="org.ofbiz.content.data.DataResourceWorker" method-name="getDataResourceContentUploadPath" ret-field-name="uploadPath"/>
+           <log level="always" message="[createPartyContent] - Found Subdir : ${uploadPath}"/>
+           <!-- locate the file extension to use based on mime-type -->
+           <set from-field="parameters._uploadedFile_contentType" field="extenLookup.mimeTypeId"/>
+           <find-by-and entity-name="FileExtension" map-name="extenLookup" list-name="extensions"/>
+           <first-from-list entry-name="extension" list-name="extensions"/>
+           <set-service-fields service-name="createDataResource" map-name="parameters" to-map-name="dataResource"/>
+           <!-- create the data resource object -->
+           <set from-field="parameters._uploadedFile_fileName" field="dataResource.dataResourceName"/>
+           <set from-field="parameters._uploadedFile_contentType" field="dataResource.mimeTypeId"/>
+           <set value="${uploadPath}/${dataResource.dataResourceId}" field="dataResource.objectInfo"/>
+           <if-not-empty field-name="extension">
+              <set value="${uploadPath}/${dataResource.dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/>
+           </if-not-empty>
+           <set value="LOCAL_FILE" field="dataResource.dataResourceTypeId"/>
+           <call-service service-name="createDataResource" in-map-name="dataResource" break-on-error="false">
+               <result-to-field result-name="dataResourceId" field-name="dataResourceId"/>
+               <result-to-field result-name="dataResource" field-name="dataResourceMap"/>
+           </call-service>          
+       </if-not-empty>
+        
+       <set-service-fields service-name="createContent" map-name="parameters" to-map-name="createContentMap"/>
+       <if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
+            <set from-field="dataResourceId" field="createContentMap.dataResourceId"/>
+       </if-not-empty>
+       <call-service service-name="createContent" in-map-name="createContentMap" break-on-error="false">
+            <result-to-field result-name="contentId" field-name="contentId"/>
+       </call-service>        
+       <!-- create the content role -->
+       <if-not-empty field-name="partyId" map-name="parameters">
             <now-timestamp-to-env env-name="nowTimestamp"/>
-            <make-value value-name="contentRole" entity-name="ContentRole"/>
-            <set from-field="content.contentId" field="contentRole.contentId"/>
+            <set-service-fields service-name="createContentRole" map-name="parameters" to-map-name="contentRole"/>
+            <set from-field="contentId" field="contentRole.contentId"/>
             <set from-field="parameters.partyId" field="contentRole.partyId"/>
             <set from-field="nowTimestamp" field="contentRole.fromDate"/>
             <set value="OWNER" field="contentRole.roleTypeId"/>
-
+            <call-service service-name="createContentRole" in-map-name="contentRole" break-on-error="false" />
             <!-- check party role -->
             <make-value value-name="partyRole" entity-name="PartyRole"/>
             <set-pk-fields value-name="partyRole" map-name="contentRole"/>
             <find-by-and entity-name="PartyRole" map-name="partyRole" list-name="pRoles"/>
             <if-empty field-name="pRoles">
-                <create-value value-name="partyRole"/>
+                <set-service-fields service-name="createPartyRole" map-name="contentRole" to-map-name="partyRole"/>
+                <call-service service-name="createPartyRole" in-map-name="partyRole" break-on-error="false" />    
             </if-empty>
-            <create-value value-name="contentRole"/>
+       </if-not-empty>      
+       <if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
+            <!-- store the file -->
+            <set-service-fields service-name="createAnonFile" map-name="dataResourceMap" to-map-name="fileCtx"/>
+            <set from-field="parameters.uploadedFile" field="fileCtx.binData"/>
+            <set from-field="dataResourceMap" field="fileCtx.dataResource"/>
+            <call-service service-name="createAnonFile" in-map-name="fileCtx" include-user-login="true"/>
         </if-not-empty>
-        
-        <!-- store the file -->
-        <set-service-fields service-name="createAnonFile" map-name="dataResource" to-map-name="fileCtx"/>
-        <set from-field="parameters.uploadedFile" field="fileCtx.binData"/>
-        <set from-field="dataResource" field="fileCtx.dataResource"/>
-        <call-service service-name="createAnonFile" in-map-name="fileCtx" include-user-login="true"/>
-
-        <field-to-result field-name="contentId" map-name="content"/>
+       <field-to-result field-name="contentId" />                
     </simple-method>
 
+        <!-- Update party content -->
+    <simple-method method-name="updatePartyContent" short-description="Creates Party Associated Content" login-required="false">
+           <!-- make sure we are logged in when passing a partyId -->
+        <if-not-empty field-name="partyId" map-name="parameters">
+            <if-empty field-name="userLogin" map-name="parameters">
+                <add-error><fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/></add-error>
+                <check-errors/>
+            </if-empty>
+        </if-not-empty>
+
+        <!-- check permission when creating content on behalf of another party -->
+        <if-empty field-name="partyId" map-name="parameters">
+            <if-not-empty field-name="userLogin" map-name="parameters">
+                <set from-field="userLogin.partyId" field="parameters.partyId"/>
+                <if-compare-field field-name="partyId" map-name="parameters" to-map-name="userLogin" operator="not-equals">
+                    <check-permission permission="PARTYMGR" action="_UPDATE">
+                        <fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/>
+                    </check-permission>
+                </if-compare-field>
+            </if-not-empty>
+        </if-empty>
+                
+        <if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">                    
+           <set from-field="parameters.contentId" field="lookupParam.contentId"/>
+           <find-by-primary-key use-cache="true" entity-name="Content" value-name="content" map-name="lookupParam"/>
+           <if-not-empty field-name="dataResourceId" map-name="content">
+               <set-service-fields service-name="updateDataResource" map-name="parameters" to-map-name="dataResource"/>          
+               <set from-field="content.dataResourceId" field="dataResource.dataResourceId"/>
+               <call-service service-name="updateDataResource" in-map-name="dataResource" break-on-error="false" />
+               <set from-field="content.dataResourceId" field="lookup.dataResourceId"/>
+               <find-by-primary-key use-cache="true" entity-name="DataResource" value-name="dataResourceMap" map-name="lookup"/>
+            <else>
+               <call-class-method class-name="org.ofbiz.content.data.DataResourceWorker" method-name="getDataResourceContentUploadPath" ret-field-name="uploadPath"/>
+               <log level="always" message="[createPartyContent] - Found Subdir : ${uploadPath}"/>
+               <!-- locate the file extension to use based on mime-type -->
+               <set from-field="parameters._uploadedFile_contentType" field="extenLookup.mimeTypeId"/>
+               <find-by-and entity-name="FileExtension" map-name="extenLookup" list-name="extensions"/>
+               <first-from-list entry-name="extension" list-name="extensions"/>
+               <set-service-fields service-name="createDataResource" map-name="parameters" to-map-name="dataResource"/>
+               <!-- create the data resource object -->
+               <set from-field="parameters._uploadedFile_fileName" field="dataResource.dataResourceName"/>
+               <set from-field="parameters._uploadedFile_contentType" field="dataResource.mimeTypeId"/>
+               <set value="${uploadPath}/${dataResource.dataResourceId}" field="dataResource.objectInfo"/>
+               <if-not-empty field-name="extension">
+                   <set value="${uploadPath}/${dataResource.dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/>
+               </if-not-empty>
+               <set value="LOCAL_FILE" field="dataResource.dataResourceTypeId"/>
+               <call-service service-name="createDataResource" in-map-name="dataResource" break-on-error="false">
+                   <result-to-field result-name="dataResourceId" field-name="dataResourceId"/>
+                   <result-to-field result-name="dataResource" field-name="dataResourceMap"/>
+               </call-service>              
+            </else>  
+           </if-not-empty>          
+       </if-not-empty>        
+       <set-service-fields service-name="updateContent" map-name="parameters" to-map-name="updateContentMap"/>
+       <if-not-empty field-name="dataResourceId">
+           <set from-field="dataResourceId" field="updateContentMap.dataResourceId" />
+       </if-not-empty>
+       <call-service service-name="updateContent" in-map-name="updateContentMap" break-on-error="false" />
+       <if-not-empty field-name="_uploadedFile_fileName" map-name="parameters">
+          <set-service-fields service-name="createAnonFile" map-name="dataResourceMap" to-map-name="fileCtx"/>
+          <set from-field="parameters.uploadedFile" field="fileCtx.binData"/>
+          <set from-field="dataResourceMap" field="fileCtx.dataResource"/>
+          <call-service service-name="createAnonFile" in-map-name="fileCtx" include-user-login="true"/>
+      </if-not-empty>
+      <field-to-result map-name="parameters" field-name="contentId" result-name="contentId" />  
+    </simple-method>      
+    
     <!-- get parties based on PartyRelationship -->
     <simple-method method-name="getPartiesByRelationship"
             short-description="Gets all parties related to partyIdFrom using the PartyRelationship entity" login-required="false">

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartySimpleEvents.xml Thu Jan  4 02:06:14 2007
@@ -70,4 +70,60 @@
             <default-message resource="PartyUiLabels" property="PartyPartyGroupSuccessfullyUpdated"/>
         </call-service>
     </simple-method>
+    
+    <!--Party Content Events -->    
+    <!-- create party content -->
+    <simple-method method-name="createPartyContent" short-description="Creates Party Associated Content" login-required="false">
+        <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="dataResourceName"/>
+        </call-class-method>
+        
+        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
+              method-name="returnByteWrapper"
+              ret-field-name="byteWrap"
+           >
+             <field field-name="formInput" type="java.util.Map"/>
+         </call-class-method >
+        
+         <set-service-fields service-name="createPartyContent" map-name="formInput.formInput" to-map-name="partyContentMap"/>
+         <set field="partyContentMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
+         <set field="partyContentMap.uploadedFile" from-field="byteWrap"/>
+         <set field="partyContentMap._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/>
+         <call-service service-name="createPartyContent" in-map-name="partyContentMap" break-on-error="false">        
+             <result-to-field result-name="contentId" field-name="contentId"/>    
+         </call-service>  
+        <!-- set the partyId in the request -->
+        <field-to-request field-name="partyId" map-name="formInput.formInput" request-name="partyId"/>
+        <field-to-request field-name="contentId" request-name="contentId"/>
+    </simple-method>
+    <!-- Update party content -->
+    <simple-method method-name="updatePartyContent" short-description="Update Party Associated Content" login-required="false">
+        <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="dataResourceName"/>
+        </call-class-method>
+        
+        <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker"
+              method-name="returnByteWrapper"
+              ret-field-name="byteWrap"
+           >
+             <field field-name="formInput" type="java.util.Map"/>
+         </call-class-method >
+         <set-service-fields service-name="updatePartyContent" map-name="formInput.formInput" to-map-name="partyContentMap"/>
+         <set field="partyContentMap._uploadedFile_fileName" from-field="formInput.imageFileName"/>
+         <set field="partyContentMap.uploadedFile" from-field="byteWrap"/>
+         <set field="partyContentMap._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/>
+         <call-service service-name="updatePartyContent" in-map-name="partyContentMap" break-on-error="false" >        
+            <result-to-field result-name="contentId" field-name="contentId"/>    
+         </call-service>  
+        <!-- set the partyId in the request -->
+        <field-to-request field-name="partyId" map-name="formInput.formInput" request-name="partyId"/>
+        <field-to-request field-name="contentId" request-name="contentId"/>
+    </simple-method>
+    
 </simple-methods>

Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Thu Jan  4 02:06:14 2007
@@ -665,17 +665,29 @@
         <attribute name="communicationEventId" type="String" mode="IN" optional="false"/>
     </service>
 
-    <service name="createPartyContent" engine="simple"
+    <service name="createPartyContent" engine="simple" default-entity-name="Content"
         location="org/ofbiz/party/party/PartyServices.xml" invoke="createPartyContent" auth="false">
         <description>Create Party Associated Content</description>
-        <attribute name="uploadedFile" type="org.ofbiz.entity.util.ByteWrapper" mode="IN" optional="false"/>
-        <attribute name="_uploadedFile_fileName" type="String" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="uploadedFile" type="org.ofbiz.entity.util.ByteWrapper" mode="IN" optional="true"/>
+        <attribute name="_uploadedFile_fileName" type="String" mode="IN" optional="true"/>
         <attribute name="_uploadedFile_contentType" type="String" mode="IN" optional="false"/>
-        <attribute name="contentTypeId" type="String" mode="IN" optional="false"/>
         <attribute name="dataCategoryId" type="String" mode="IN" optional="true"/>
         <attribute name="statusId" type="String" mode="IN" optional="false"/>
         <attribute name="partyId" type="String" mode="IN" optional="true"/>
         <attribute name="contentId" type="String" mode="OUT" optional="false"/>
+        <override name="contentTypeId" optional="false"/>        
+    </service>
+    <service name="updatePartyContent" engine="simple" default-entity-name="Content"
+        location="org/ofbiz/party/party/PartyServices.xml" invoke="updatePartyContent" auth="false">
+        <description>Update a Party Content</description>
+        <auto-attributes include="pk" mode="INOUT" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="uploadedFile" type="org.ofbiz.entity.util.ByteWrapper" mode="IN" optional="true"/>
+        <attribute name="_uploadedFile_fileName" type="String" mode="IN" optional="true"/>
+        <attribute name="_uploadedFile_contentType" type="String" mode="IN" optional="false"/>
+        <attribute mode="IN" name="partyId" optional="true" type="String"/>        
+        <attribute mode="IN" name="dataCategoryId" optional="true" type="String"/>
     </service>
     <service name="getPartyEmail" engine="simple"
         location="org/ofbiz/party/party/PartyServices.xml" invoke="getPartyEmail" auth="false">

Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Thu Jan  4 02:06:14 2007
@@ -829,6 +829,24 @@
         <security auth="false" https="false"/>
         <response name="success" type="view" value="ViewSimpleContent"/>
     </request-map>
+
+    <!-- Create and Upload Party Content -->
+    <request-map uri="EditPartyContents">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="EditPartyContents"/>
+    </request-map>    
+    
+    <request-map uri="createPartyContent">
+        <security auth="true" https="true"/>
+        <event type="simple" path="org/ofbiz/party/party/PartySimpleEvents.xml" invoke="createPartyContent"/>
+        <response name="success" type="view" value="EditPartyContents"/>
+    </request-map>
+    
+    <request-map uri="updatePartyContent">
+        <security auth="true" https="true"/>
+        <event type="simple" path="org/ofbiz/party/party/PartySimpleEvents.xml" invoke="updatePartyContent"/>
+        <response name="success" type="view" value="EditPartyContents"/>
+    </request-map>
     
     <!-- Lookup request mappings -->
     <request-map uri="LookupPartyName"><security https="true" auth="true"/><response name="success" type="view" value="LookupPartyName"/></request-map>
@@ -841,6 +859,9 @@
     <request-map uri="LookupSegmentGroup"><security https="true" auth="true"/><response name="success" type="view" value="LookupSegmentGroup"/></request-map>
     <request-map uri="LookupContactList"><security https="true" auth="true"/><response name="success" type="view" value="LookupContactList"/></request-map>
     <request-map uri="LookupWorkEffort"><security https="true" auth="true"/><response name="success" type="view" value="LookupWorkEffort"/></request-map>
+    <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map>
+    <request-map uri="LookupDataResource"><security auth="true" https="true"/><response name="success" type="view" value="LookupDataResource"/></request-map>
+    
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -921,6 +942,8 @@
     <view-map name="LookupCustRequest" type="screen" page="component://order/widget/ordermgr/LookupScreens.xml#LookupCustRequest"/>
 
     <view-map name="LookupContactList" type="screen" page="component://party/widget/partymgr/PartyContactListScreens.xml#ListLookupContactList"/>
+    <view-map name="LookupContent" page="component://content/widget/content/ContentScreens.xml#LookupContent" type="screen"/>
+    <view-map name="LookupDataResource" page="component://content/widget/content/DataResourceScreens.xml#LookupDataResource" type="screen"/>
 
     <view-map name="LookupSegmentGroup" type="screen" page="component://marketing/widget/LookupScreens.xml#LookupSegmentGroup"/>
 
@@ -928,5 +951,6 @@
 
     <view-map name="AddressMatchMap" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#AddressMatchMap"/>
     <view-map name="FindAddressMatch" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#FindAddressMatch"/>
+    <view-map name="EditPartyContents" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#EditPartyContents"/>
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Thu Jan  4 02:06:14 2007
@@ -375,4 +375,100 @@
         <field name="partyId"><hidden value="${partyId}"/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
+    
+    <!-- Party Content Form -->
+    
+    <form name="AddPartyContent" target="updatePartyContent" title="" type="upload" default-map-name="content"
+        default-title-style="tableheadtext" default-tooltip-style="tabletext" default-widget-style="inputBox">
+        <actions>
+            <entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false">
+                <field-map field-name="statusId" env-name="content.statusId"/>
+            </entity-one>
+            <entity-one entity-name="DataResource" value-name="dataResource" auto-field-map="false">
+                <field-map field-name="dataResourceId" env-name="content.dataResourceId"/>
+            </entity-one>
+        </actions>
+        <alt-target use-when="content==null" target="createPartyContent"/>
+        <auto-fields-entity entity-name="Content" />
+        <field name="partyId" map-name="parameters"><hidden/></field>
+        <field use-when="content!=null" name="contentId" tooltip="${uiLabelMap.CommonNotModifRecreat}" widget-style="tabletext"><display/></field>
+        <field use-when="content==null&amp;&amp;contentId==null" name="contentId"><ignored/></field>
+        <field use-when="content==null&amp;&amp;contentId!=null" name="contentId" widget-style="tabletext"><display description="${uiLabelMap.CommonCannotBeFound}: [${contentId}]" also-hidden="false"/></field>
+        <field name="ownerContentId"><lookup target-form-name="LookupContent"/></field>        
+        <field name="dataResourceId">
+            <lookup target-form-name="LookupDataResource"/>
+        </field>
+        <field name="contentTypeId">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="ContentType" key-field-name="contentTypeId"/>
+            </drop-down>
+        </field>
+        <field name="statusId" use-when="content==null" widget-style="selectBox">
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" value="CONTENT_STATUS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="statusId" use-when="content!=null" widget-style="selectBox">
+                <drop-down allow-empty="false" current-description="${currentStatus.description}">
+                <entity-options entity-name="StatusValidChangeToDetail" key-field-name="statusIdTo" description="${transitionName} (${description})">
+                    <entity-constraint name="statusId" value="${content.statusId}"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="mimeTypeId" >
+            <drop-down allow-empty="false">
+                <entity-options description="${description}" entity-name="MimeType" key-field-name="mimeTypeId"/>
+            </drop-down>
+        </field>
+        <field name="dataResourceName" title="${uiLabelMap.CommonUpload}"><file/></field>
+        <field name="dataCategoryId" use-when="dataResource==null">
+            <drop-down allow-empty="false">
+                <entity-options description="${categoryName}" entity-name="DataCategory" key-field-name="dataCategoryId"/>
+            </drop-down>
+        </field>
+        <field name="dataCategoryId" use-when="dataResource!=null">
+            <drop-down allow-empty="false">
+                <entity-options description="${categoryName}" entity-name="DataCategory">
+                    <entity-constraint name="dataCategoryId" value="${dataResource.dataCategoryId}"/>
+                    <entity-order-by field-name="categoryName"/>
+                </entity-options>
+               <entity-options description="${categoryName}" entity-name="DataCategory" key-field-name="dataCategoryId"/>
+            </drop-down>
+        </field>
+
+        <field name="createButton" use-when="content==null" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="updateButton" use-when="content!=null" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="ListPartyContents" target="" separate-columns="false"
+        default-title-style="tableheadtext" default-tooltip-style="tabletext" default-widget-style="tabletext"
+        title="" type="list">
+        <actions>
+            <entity-and entity-name="ContentAndRole">
+                <field-map field-name="partyId"/>
+            </entity-and>
+        </actions>
+        <field name="partyId"><hidden/></field>
+        <field name="contentId"><hidden/></field>
+        <field name="contentName" widget-style="tabletext">
+            <display-entity entity-name="Content" description="${contentName}" key-field-name="contentId">
+                <sub-hyperlink target="EditPartyContents?contentId=${contentId}&amp;amp;partyId=${partyId}" description="${contentId}" link-style="buttontext"/>
+            </display-entity>
+        </field>
+        <field name="description"><display/></field>
+        <field name="statusId"><display-entity entity-name="StatusItem"></display-entity></field>
+        <field name="localeString"><display-entity entity-name="CountryCode" key-field-name="countryCode" description="${countryName}${countryCode}"></display-entity></field>
+        <field name="contentTypeId"><display-entity entity-name="ContentType"></display-entity></field>
+        <field name="mimeTypeId"><display-entity entity-name="MimeType"></display-entity></field>
+        <field name="dataResourceId" title="${uiLabelMap.FormFieldTitle_dataResourceName}" use-when="dataResourceId==null"><display/> </field>
+        <field name="dataResourceId" title="${uiLabelMap.FormFieldTitle_dataResourceName}" use-when="dataResourceId!=null">
+            <display-entity entity-name="DataResource" description="${dataResourceName}"/>
+        </field>
+        <field name="editLink" title="" widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.CommonEdit}" target="EditPartyContents?contentId=${contentId}&amp;partyId=${partyId}&amp;dataResourceId=${dataResourceId}"/>
+        </field>
+    </form>    
 </forms>

Modified: ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml Thu Jan  4 02:06:14 2007
@@ -25,6 +25,7 @@
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
 
                 <set field="layoutSettings.companyName" from-field="uiLabelMap.PartyCompanyName" global="true"/>
@@ -269,4 +270,5 @@
         </section>
     </screen>
 </screens>
+
 

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml Thu Jan  4 02:06:14 2007
@@ -56,5 +56,8 @@
         <menu-item name="ContactList" title="${uiLabelMap.PartyContactList}">
             <link target="ListPartyContactLists?partyId=${partyId}"/>
         </menu-item>
+        <menu-item name="PartyContents" title="${uiLabelMap.PartyContent}">
+            <link target="EditPartyContents?partyId=${partyId}"/>
+        </menu-item>
     </menu>
 </menus>

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?view=diff&rev=492494&r1=492493&r2=492494
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Thu Jan  4 02:06:14 2007
@@ -687,4 +687,30 @@
             </widgets>
         </section>
     </screen>
+    
+<!-- Party Content Screen -->
+    <screen name="EditPartyContents">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListContent"/>
+                <set field="headerItem" value="find"/>
+                <set field="tabButtonItem" value="PartyContents"/>
+                <set field="partyId" from-field="parameters.partyId" />              
+                <set field="contentId" from-field="parameters.contentId"/>
+                <entity-one entity-name="Content" value-name="content"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonPartyDecorator"  location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container><link target="EditPartyContents?partyId=${partyId}" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/></container>                    
+                        <container><label style="head1" text="${uiLabelMap.PageTitleListContent}"/></container>                        
+                        <include-form name="ListPartyContents" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+                        <label style="head1">${uiLabelMap.PageTitleAddPartyContent}</label>                        
+                        <include-form name="AddPartyContent" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>            
+        </section>
+    </screen>    
+        
 </screens>