Author: jleroux
Date: Thu Jan 24 10:02:40 2008 New Revision: 614946 URL: http://svn.apache.org/viewvc?rev=614946&view=rev Log: Applied fix from trunk for revision: 614945 Modified: ofbiz/branches/release4.0/applications/party/script/org/ofbiz/party/party/PartyServices.xml Modified: ofbiz/branches/release4.0/applications/party/script/org/ofbiz/party/party/PartyServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=614946&r1=614945&r2=614946&view=diff ============================================================================== --- ofbiz/branches/release4.0/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original) +++ ofbiz/branches/release4.0/applications/party/script/org/ofbiz/party/party/PartyServices.xml Thu Jan 24 10:02:40 2008 @@ -389,15 +389,16 @@ <!-- 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> + </call-service> + + <set-service-fields service-name="updateDataResource" map-name="dataResource" to-map-name="dataResource"/> + <set from-field="dataResourceId" field="dataResource.dataResourceId"/> + <call-service service-name="updateDataResource" in-map-name="dataResource" break-on-error="false" /> + <set from-field="dataResource.dataResourceId" field="lookup.dataResourceId"/> + <find-by-primary-key use-cache="true" entity-name="DataResource" value-name="dataResourceMap" map-name="lookup"/> </if-not-empty> <set-service-fields service-name="createContent" map-name="parameters" to-map-name="createContentMap"/> @@ -476,17 +477,22 @@ <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> + <!-- 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="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"/> + </call-service> + <set value="${uploadPath}/${dataResourceId}" field="dataResource.objectInfo"/> + <if-not-empty field-name="extension"> + <set value="${uploadPath}/${dataResourceId}.${extension.fileExtensionId}" field="dataResource.objectInfo"/> + </if-not-empty> + <set-service-fields service-name="updateDataResource" map-name="dataResource" to-map-name="dataResource"/> + <set from-field="dataResourceId" field="dataResource.dataResourceId"/> + <call-service service-name="updateDataResource" in-map-name="dataResource" break-on-error="false" /> + <set from-field="dataResource.dataResourceId" field="lookup.dataResourceId"/> + <find-by-primary-key use-cache="true" entity-name="DataResource" value-name="dataResourceMap" map-name="lookup"/> </else> </if-not-empty> </if-not-empty> |
Free forum by Nabble | Edit this page |