Author: ashish
Date: Mon Nov 30 13:23:08 2009
New Revision: 885414
URL: http://svn.apache.org/viewvc?rev=885414&view=rev
Log:
Applied patch from jira issue OFBIZ-3244 - New feature to upload multiple
Additional View Images at Product Content.
Moving services to correct component | location and renaming services so would
be verbose enough to understand its purpose.
Thanks Mridul for the contribution.
Modified:
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
ofbiz/trunk/applications/content/servicedef/services_content.xml
ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
ofbiz/trunk/applications/product/servicedef/services.xml
ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
Modified:
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml?rev=885414&r1=885413&r2=885414&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
(original)
+++
ofbiz/trunk/applications/content/script/org/ofbiz/content/content/ContentServices.xml
Mon Nov 30 13:23:08 2009
@@ -1220,45 +1220,4 @@
<field-to-result field="subContentList" result-name="subContentList"/>
<field-to-result field="contentViewList"
result-name="subSubContentList"/>
</simple-method>
-
- <simple-method method-name="uploadAdditionalViewImages"
short-description="Method to upload multiple Additional View images">
- <set-service-fields service-name="addAdditionalViewForProduct"
map="parameters" to-map="addAdditionalViewForProductMap"/>
- <if-not-empty field="parameters.additionalImageOne">
- <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
- <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageOne"/>
- <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_1"/>
- <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageOne_fileName"/>
- <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageOne_contentType"/>
- <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
- <clear-field field="addAdditionalViewForProductMap"/>
- </if-not-empty>
- <if-not-empty field="parameters.additionalImageTwo">
- <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
- <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageTwo"/>
- <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_2"/>
- <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageTwo_fileName"/>
- <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageTwo_contentType"/>
- <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
- <clear-field field="addAdditionalViewForProductMap"/>
- </if-not-empty>
- <if-not-empty field="parameters.additionalImageThree">
- <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
- <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageThree"/>
- <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_3"/>
- <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageThree_fileName"/>
- <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageThree_contentType"/>
- <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
- <clear-field field="addAdditionalViewForProductMap"/>
- </if-not-empty>
- <if-not-empty field="parameters.additionalImageFour">
- <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
- <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageFour"/>
- <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_4"/>
- <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageFour_fileName"/>
- <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageFour_contentType"/>
- <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
- <clear-field field="addAdditionalViewForProductMap"/>
- </if-not-empty>
- <field-to-result field="parameters.productId" result-name="productId"/>
- </simple-method>
</simple-methods>
Modified: ofbiz/trunk/applications/content/servicedef/services_content.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/servicedef/services_content.xml?rev=885414&r1=885413&r2=885414&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/servicedef/services_content.xml (original)
+++ ofbiz/trunk/applications/content/servicedef/services_content.xml Mon Nov 30
13:23:08 2009
@@ -323,22 +323,4 @@
<permission-service service-name="genericContentPermission"
main-action="UPDATE"/>
<auto-attributes entity-name="ContentRole" include="pk" mode="IN"
optional="false"/>
</service>
- <service name="uploadAdditionalViewImages" engine="simple"
location="component://content/script/org/ofbiz/content/content/ContentServices.xml"
- auth="true" invoke="uploadAdditionalViewImages">
- <description>Upload Additional View Images</description>
- <permission-service service-name="genericContentPermission"
main-action="UPDATE"/>
- <attribute name="productId" type="String" mode="INOUT"
optional="false"/>
- <attribute name="additionalImageOne" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
- <attribute name="_additionalImageOne_fileName" type="String" mode="IN"
optional="true"/>
- <attribute name="_additionalImageOne_contentType" type="String"
mode="IN" optional="true"/>
- <attribute name="additionalImageTwo" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
- <attribute name="_additionalImageTwo_fileName" type="String" mode="IN"
optional="true"/>
- <attribute name="_additionalImageTwo_contentType" type="String"
mode="IN" optional="true"/>
- <attribute name="additionalImageThree" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
- <attribute name="_additionalImageThree_fileName" type="String"
mode="IN" optional="true"/>
- <attribute name="_additionalImageThree_contentType" type="String"
mode="IN" optional="true"/>
- <attribute name="additionalImageFour" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
- <attribute name="_additionalImageFour_fileName" type="String"
mode="IN" optional="true"/>
- <attribute name="_additionalImageFour_contentType" type="String"
mode="IN" optional="true"/>
- </service>
</services>
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml?rev=885414&r1=885413&r2=885414&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
(original)
+++
ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductContentServices.xml
Mon Nov 30 13:23:08 2009
@@ -126,4 +126,45 @@
<find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
<remove-value value-field="lookedUpValue"/>
</simple-method>
+
+ <simple-method method-name="uploadProductAdditionalViewImages"
short-description="Method to upload multiple Additional View images for
product">
+ <set-service-fields service-name="addAdditionalViewForProduct"
map="parameters" to-map="addAdditionalViewForProductMap"/>
+ <if-not-empty field="parameters.additionalImageOne">
+ <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
+ <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageOne"/>
+ <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_1"/>
+ <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageOne_fileName"/>
+ <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageOne_contentType"/>
+ <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
+ <clear-field field="addAdditionalViewForProductMap"/>
+ </if-not-empty>
+ <if-not-empty field="parameters.additionalImageTwo">
+ <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
+ <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageTwo"/>
+ <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_2"/>
+ <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageTwo_fileName"/>
+ <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageTwo_contentType"/>
+ <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
+ <clear-field field="addAdditionalViewForProductMap"/>
+ </if-not-empty>
+ <if-not-empty field="parameters.additionalImageThree">
+ <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
+ <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageThree"/>
+ <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_3"/>
+ <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageThree_fileName"/>
+ <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageThree_contentType"/>
+ <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
+ <clear-field field="addAdditionalViewForProductMap"/>
+ </if-not-empty>
+ <if-not-empty field="parameters.additionalImageFour">
+ <set field="addAdditionalViewForProductMap.productId"
from-field="parameters.productId"/>
+ <set field="addAdditionalViewForProductMap.uploadedFile"
from-field="parameters.additionalImageFour"/>
+ <set field="addAdditionalViewForProductMap.productContentTypeId"
value="ADDITIONAL_IMAGE_4"/>
+ <set field="addAdditionalViewForProductMap._uploadedFile_fileName"
from-field="parameters._additionalImageFour_fileName"/>
+ <set
field="addAdditionalViewForProductMap._uploadedFile_contentType"
from-field="parameters._additionalImageFour_contentType"/>
+ <call-service service-name="addAdditionalViewForProduct"
in-map-name="addAdditionalViewForProductMap"/>
+ <clear-field field="addAdditionalViewForProductMap"/>
+ </if-not-empty>
+ <field-to-result field="parameters.productId" result-name="productId"/>
+ </simple-method>
</simple-methods>
Modified: ofbiz/trunk/applications/product/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=885414&r1=885413&r2=885414&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services.xml Mon Nov 30
13:23:08 2009
@@ -436,6 +436,25 @@
<override name="productContentTypeId" optional="false"/>
<override name="productId" optional="false"/>
</service>
+
+ <service name="uploadProductAdditionalViewImages" engine="simple"
+
location="component://content/script/org/ofbiz/content/content/ContentServices.xml"
invoke="uploadProductAdditionalViewImages" auth="true">
+ <description>Upload Additional View Images For Product</description>
+ <permission-service service-name="genericContentPermission"
main-action="UPDATE"/>
+ <attribute name="productId" type="String" mode="INOUT"
optional="false"/>
+ <attribute name="additionalImageOne" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageOne_fileName" type="String" mode="IN"
optional="true"/>
+ <attribute name="_additionalImageOne_contentType" type="String"
mode="IN" optional="true"/>
+ <attribute name="additionalImageTwo" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageTwo_fileName" type="String" mode="IN"
optional="true"/>
+ <attribute name="_additionalImageTwo_contentType" type="String"
mode="IN" optional="true"/>
+ <attribute name="additionalImageThree" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageThree_fileName" type="String"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageThree_contentType" type="String"
mode="IN" optional="true"/>
+ <attribute name="additionalImageFour" type="java.nio.ByteBuffer"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageFour_fileName" type="String"
mode="IN" optional="true"/>
+ <attribute name="_additionalImageFour_contentType" type="String"
mode="IN" optional="true"/>
+ </service>
<!-- SupplierProduct Services -->
<service name="createSupplierProduct"
default-entity-name="SupplierProduct" engine="simple"
Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=885414&r1=885413&r2=885414&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
(original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Mon
Nov 30 13:23:08 2009
@@ -631,7 +631,7 @@
</request-map>
<request-map uri="addAdditionalImagesForProduct">
<security https="true" auth="true"/>
- <event type="service" invoke="uploadAdditionalViewImages"/>
+ <event type="service" invoke="uploadProductAdditionalViewImages"/>
<response name="success" type="view" value="EditProductContent"/>
<response name="error" type="view" value="EditProductContent"/>
</request-map>