|
Modified: ofbiz/branches/20111205EmailHandling/applications/product/config/catalog.properties
URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/config/catalog.properties?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/config/catalog.properties (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/config/catalog.properties Mon Mar 26 20:56:02 2012 @@ -39,3 +39,5 @@ reactivate.product.from.receipt=Y image.management.path=${sys:getProperty('ofbiz.home')}/framework/images/webapp/images/products/management image.management.url=/images/products/management image.management.nameofthumbnail=-100 +image.management.autoApproveImage=Y +image.management.multipleApproval=N Modified: ofbiz/branches/20111205EmailHandling/applications/product/data/ProductDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/data/ProductDemoData.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/data/ProductDemoData.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/data/ProductDemoData.xml Mon Mar 26 20:56:02 2012 @@ -42,4 +42,5 @@ under the License. <UserLoginSecurityGroup userLoginId="imageUpload" groupId="CATALOGADMIN" fromDate="2010-01-01 12:00:00.0"/> <UserLoginSecurityGroup userLoginId="imageUpload" groupId="IMAGEUPLOAD" fromDate="2010-01-01 12:00:00.0"/> + <PartyRole partyId="admin" roleTypeId="IMAGEAPPROVER"/> </entity-engine-xml> Modified: ofbiz/branches/20111205EmailHandling/applications/product/data/ProductPortletData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/data/ProductPortletData.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/data/ProductPortletData.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/data/ProductPortletData.xml Mon Mar 26 20:56:02 2012 @@ -19,7 +19,7 @@ --> <entity-engine-xml> - <PortletCategory portletCategoryId="PRODUCTS" description="List of Products"/> + <PortletCategory portletCategoryId="PRODUCTS" description="Product Management Portlets"/> <PortalPortlet portalPortletId="BestSellingProducts" portletName="List of Days Best Selling Products" screenName="BestSellingProducts" Modified: ofbiz/branches/20111205EmailHandling/applications/product/data/ProductTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/data/ProductTypeData.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/data/ProductTypeData.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/data/ProductTypeData.xml Mon Mar 26 20:56:02 2012 @@ -160,6 +160,7 @@ under the License. <GoodIdentificationType description="UPCE" goodIdentificationTypeId="UPCE" hasTable="N" parentTypeId=""/> <GoodIdentificationType description="EAN" goodIdentificationTypeId="EAN" hasTable="N" parentTypeId=""/> <GoodIdentificationType description="Library of Congress" goodIdentificationTypeId="LOC" hasTable="N" parentTypeId=""/> + <GoodIdentificationType description="Harmonized System Codes (HS Code)" goodIdentificationTypeId="HS_CODE" hasTable="N" parentTypeId=""/> <InventoryItemType description="Serialized" hasTable="N" inventoryItemTypeId="SERIALIZED_INV_ITEM" parentTypeId=""/> <InventoryItemType description="Non-Serialized" hasTable="N" inventoryItemTypeId="NON_SERIAL_INV_ITEM" parentTypeId=""/> @@ -499,7 +500,9 @@ under the License. <ProductType description="Work In Process" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="GOOD" productTypeId="WIP"/> <ProductType description="Configurable Good Configuration" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="AGGREGATED" productTypeId="AGGREGATED_CONF"/> <ProductType description="Fixed Asset Usage For Rental of an asset which is shipped from and returned to inventory" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="" productTypeId="ASSET_USAGE_OUT_IN"/> - <ProductType description="Service a product which is received to- and shipped from inventory" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="" productTypeId="SERVICE_PRODUCT"/> + <ProductType description="Service a product using inventory" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="" productTypeId="SERVICE_PRODUCT"/> + <ProductType description="Configurable Service using inventory" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="SERVICE_PRODUCT" productTypeId="AGGREGATED_SERVICE"/> + <ProductType description="Configurable Service Configuration" isPhysical="Y" isDigital="N" hasTable="N" parentTypeId="AGGREGATED" productTypeId="AGGREGATEDSERV_CONF"/> <EnumerationType description="Product Requirement Method" enumTypeId="PROD_REQ_METHOD" hasTable="N" parentTypeId=""/> <!-- NONE: no requirement is created (default) --> @@ -620,14 +623,14 @@ under the License. <ProductFeatureCategory productFeatureCategoryId="IMAGE" description="Image"/> <ProductFeatureCategory productFeatureCategoryId="TEXT" description="Text"/> - <ProductFeature productFeatureId="IMAGE_AVATAR" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="100 X 75 (avatar)" defaultSequenceNum="1"/> - <ProductFeature productFeatureId="IMAGE_THUMBNAIL" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="150 X 112 (thumbnail)" defaultSequenceNum="2"/> - <ProductFeature productFeatureId="IMAGE_WEBSITE" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="320 X 240 (for websites and email)" defaultSequenceNum="3"/> - <ProductFeature productFeatureId="IMAGE_BOARD" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="640 X 480 (for message boards)" defaultSequenceNum="4"/> - <ProductFeature productFeatureId="IMAGE_MONITOR15" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="800 X 600 (15-inch monitor)" defaultSequenceNum="5"/> - <ProductFeature productFeatureId="IMAGE_MONITOR17" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1024 X 768 (17-inch monitor)" defaultSequenceNum="6"/> - <ProductFeature productFeatureId="IMAGE_MONITOR19" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1280 X 1024 (19-inch monitor)" defaultSequenceNum="7"/> - <ProductFeature productFeatureId="IMAGE_MONITOR21" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1600 X 1200 (21-inch monitor)" defaultSequenceNum="8"/> + <ProductFeature productFeatureId="IMAGE_AVATAR" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="100 X 75 (avatar)" abbrev="100x75" defaultSequenceNum="1"/> + <ProductFeature productFeatureId="IMAGE_THUMBNAIL" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="150 X 112 (thumbnail)" abbrev="150x112" defaultSequenceNum="2"/> + <ProductFeature productFeatureId="IMAGE_WEBSITE" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="320 X 240 (for websites and email)" abbrev="320x240" defaultSequenceNum="3"/> + <ProductFeature productFeatureId="IMAGE_BOARD" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="640 X 480 (for message boards)" abbrev="640x480" defaultSequenceNum="4"/> + <ProductFeature productFeatureId="IMAGE_MONITOR15" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="800 X 600 (15-inch monitor)" abbrev="800x600" defaultSequenceNum="5"/> + <ProductFeature productFeatureId="IMAGE_MONITOR17" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1024 X 768 (17-inch monitor)" abbrev="1024x768" defaultSequenceNum="6"/> + <ProductFeature productFeatureId="IMAGE_MONITOR19" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1280 X 1024 (19-inch monitor)" abbrev="1280x1024" defaultSequenceNum="7"/> + <ProductFeature productFeatureId="IMAGE_MONITOR21" productFeatureTypeId="SIZE" productFeatureCategoryId="IMAGE" description="1600 X 1200 (21-inch monitor)" abbrev="1600x1200" defaultSequenceNum="8"/> <ProductFeature productFeatureId="TEXT_SMALL" productFeatureTypeId="SIZE" productFeatureCategoryId="TEXT" description="Small" defaultSequenceNum="1"/> <ProductFeature productFeatureId="TEXT_MIDDLE" productFeatureTypeId="SIZE" productFeatureCategoryId="TEXT" description="Middle" defaultSequenceNum="2"/> Modified: ofbiz/branches/20111205EmailHandling/applications/product/entitydef/eecas.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/entitydef/eecas.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/entitydef/eecas.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/entitydef/eecas.xml Mon Mar 26 20:56:02 2012 @@ -70,6 +70,11 @@ under the License. <condition field-name="availableToPromiseDiff" operator="not-equals" value="0" type="BigDecimal"/> <action service="setLastInventoryCount" mode="sync"/> </eca> + <!-- If the Picklist status is Cancelled then cancel all the PicklistItems --> + <eca entity="Picklist" operation="create-store" event="return"> + <condition field-name="statusId" operator="equals" value="PICKLIST_CANCELLED"/> + <action service="cancelPicklistAndItems" mode="async"/> + </eca> <!-- Product GroupOrder ECAs --> <eca entity="ProductGroupOrder" operation="create" event="return"> Modified: ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel.xml Mon Mar 26 20:56:02 2012 @@ -1045,11 +1045,16 @@ under the License. <view-entity entity-name="FacilityAndContactMech" package-name="org.ofbiz.product.facility" title="Facility and Contact Mech View Entity"> <member-entity entity-alias="FA" entity-name="Facility"/> <member-entity entity-alias="CM" entity-name="FacilityContactMech"/> + <member-entity entity-alias="MC" entity-name="ContactMech"/> <alias-all entity-alias="FA"/> <alias-all entity-alias="CM"/> + <alias-all entity-alias="MC"/> <view-link entity-alias="FA" rel-entity-alias="CM"> <key-map field-name="facilityId"/> </view-link> + <view-link entity-alias="CM" rel-entity-alias="MC"> + <key-map field-name="contactMechId"/> + </view-link> </view-entity> <entity entity-name="FacilityAttribute" package-name="org.ofbiz.product.facility" title="Facility Attribute Entity"> <field name="facilityId" type="id-ne"></field> @@ -1485,6 +1490,7 @@ under the License. <entity entity-name="ProductFeature" package-name="org.ofbiz.product.feature" + default-resource-name="ProductEntityLabels" title="Product Feature Entity"> <field name="productFeatureId" type="id-ne"></field> <field name="productFeatureTypeId" type="id-ne"></field> @@ -3079,39 +3085,28 @@ under the License. <key-map field-name="productId"/> </view-link> </view-entity> - <entity entity-name="ProductKeyword" package-name="org.ofbiz.product.product" title="Product Keyword Entity" never-cache="true"> + <entity entity-name="ProductKeyword" table-name="PRODUCT_KEYWORD_NEW" + package-name="org.ofbiz.product.product" title="Product Keyword Entity" never-cache="true"> <field name="productId" type="id-ne"></field> <field name="keyword" type="short-varchar"></field> + <field name="keywordTypeId" type="id-ne"></field> <field name="relevancyWeight" type="numeric"></field> + <field name="statusId" type="id-ne"></field> <prim-key field="productId"/> <prim-key field="keyword"/> - <relation type="one" fk-name="PROD_KWD_PROD" rel-entity-name="Product"> + <prim-key field="keywordTypeId"/> + <relation type="one" fk-name="PROD_KWD_PROD_NEW" rel-entity-name="Product"> <key-map field-name="productId"/> </relation> - <index name="PROD_KWD_KWD"> - <index-field name="keyword"/> - </index> - </entity> - <entity entity-name="OldProductKeywordResult" table-name="PRODUCT_KEYWORD_RESULT" - package-name="org.ofbiz.product.product" - never-cache="true" - title="Product Keyword Result Entity"> - <field name="productKeywordResultId" type="id-ne"></field> - <field name="visitId" type="id"></field> - <field name="productCategoryId" type="id"></field> - <field name="searchString" type="short-varchar"></field> - <field name="intraKeywordOperator" type="very-short"></field> - <field name="anyPrefix" type="indicator"></field> - <field name="anySuffix" type="indicator"></field> - <field name="removeStems" type="indicator"></field> - <field name="numResults" type="numeric"></field> - <prim-key field="productKeywordResultId"/> - <relation type="one" fk-name="PROD_KWDRES_VST" rel-entity-name="Visit"> - <key-map field-name="visitId"/> + <relation type="one" fk-name="PROD_KWD_TYPE" rel-entity-name="Enumeration"> + <key-map field-name="keywordTypeId" rel-field-name="enumId"/> </relation> - <relation type="one-nofk" rel-entity-name="ProductCategory"> - <key-map field-name="productCategoryId"/> + <relation type="one" fk-name="PROD_KWD_STTS" rel-entity-name="StatusItem"> + <key-map field-name="statusId"/> </relation> + <index name="PROD_KWD_KWD_NEW"> + <index-field name="keyword"/> + </index> </entity> <entity entity-name="ProductMeter" package-name="org.ofbiz.product.product" title="Product Meter Entity"> <field name="productId" type="id-ne"></field> Modified: ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_old.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_old.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_old.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_old.xml Mon Mar 26 20:56:02 2012 @@ -56,5 +56,41 @@ under the License. <key-map field-name="roleTypeId"/> </relation> </entity> + <entity entity-name="OldProductKeyword" table-name="PRODUCT_KEYWORD" + package-name="org.ofbiz.product.facility" + title="Old Product Keyword Entity"> + <field name="productId" type="id-ne"></field> + <field name="keyword" type="short-varchar"></field> + <field name="relevancyWeight" type="numeric"></field> + <prim-key field="productId"/> + <prim-key field="keyword"/> + <relation type="one" fk-name="PROD_KWD_PROD" rel-entity-name="Product"> + <key-map field-name="productId"/> + </relation> + <index name="PROD_KWD_KWD"> + <index-field name="keyword"/> + </index> + </entity> + <entity entity-name="OldProductKeywordResult" table-name="PRODUCT_KEYWORD_RESULT" + package-name="org.ofbiz.product.product" + never-cache="true" + title="Product Keyword Result Entity"> + <field name="productKeywordResultId" type="id-ne"></field> + <field name="visitId" type="id"></field> + <field name="productCategoryId" type="id"></field> + <field name="searchString" type="short-varchar"></field> + <field name="intraKeywordOperator" type="very-short"></field> + <field name="anyPrefix" type="indicator"></field> + <field name="anySuffix" type="indicator"></field> + <field name="removeStems" type="indicator"></field> + <field name="numResults" type="numeric"></field> + <prim-key field="productKeywordResultId"/> + <relation type="one" fk-name="PROD_KWDRES_VST" rel-entity-name="Visit"> + <key-map field-name="visitId"/> + </relation> + <relation type="one-nofk" rel-entity-name="ProductCategory"> + <key-map field-name="productCategoryId"/> + </relation> + </entity> </entitymodel> Modified: ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_shipment.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_shipment.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/entitydef/entitymodel_shipment.xml Mon Mar 26 20:56:02 2012 @@ -1358,6 +1358,7 @@ under the License. <alias entity-alias="SPRS" name="shipmentPackageSeqId"/> <alias entity-alias="SPRS" name="shipmentRouteSegmentId"/> <alias entity-alias="SPRS" name="labelPrinted"/> + <alias entity-alias="SPRS" name="trackingCode"/> <alias entity-alias="SRS" name="carrierPartyId"/> <alias entity-alias="SRS" name="carrierServiceStatusId"/> <alias entity-alias="SRS" name="shipmentMethodTypeId"/> Modified: ofbiz/branches/20111205EmailHandling/applications/product/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/ofbiz-component.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/ofbiz-component.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/ofbiz-component.xml Mon Mar 26 20:56:02 2012 @@ -72,9 +72,20 @@ under the License. <test-suite loader="main" location="testdef/FacilityTest.xml"/> <test-suite loader="main" location="testdef/CostTests.xml"/> <test-suite loader="main" location="testdef/GroupOrderTest.xml"/> + <test-suite loader="main" location="testdef/ProductTagTest.xml"/> - <webapp name="catalog" title="Catalog" server="default-server" location="webapp/catalog" - base-permission="OFBTOOLS,CATALOG" mount-point="/catalog"/> - <webapp name="facility" title="Facility" server="default-server" location="webapp/facility" - base-permission="OFBTOOLS,FACILITY" mount-point="/facility"/> + <webapp name="catalog" + title="Catalog" + description="CatalogComponentDescription" + server="default-server" + location="webapp/catalog" + base-permission="OFBTOOLS,CATALOG" + mount-point="/catalog"/> + <webapp name="facility" + title="Facility" + description="FacilityComponentDescription" + server="default-server" + location="webapp/facility" + base-permission="OFBTOOLS,FACILITY" + mount-point="/facility"/> </ofbiz-component> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/UpgradeServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/UpgradeServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/UpgradeServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/UpgradeServices.xml Mon Mar 26 20:56:02 2012 @@ -80,4 +80,22 @@ under the License. <store-list list="toStore"/> </simple-method> + <simple-method method-name="migrateProductKeyword" short-description="Migrate Data From OldProductKeyword To ProductKeyword"> + <entity-condition entity-name="OldProductKeyword" list="oldProductKeywords"/> + <iterate list="oldProductKeywords" entry="oldProductKeyword"> + <entity-one entity-name="ProductKeyword" value-field="checkProductKeyword"> + <field-map field-name="productId" from-field="oldProductKeyword.productId"/> + <field-map field-name="keyword" from-field="oldProductKeyword.keyword"/> + <field-map field-name="keywordTypeId" value="KWT_KEYWORD"/> + </entity-one> + <if-empty field="checkProductKeyword"> + <make-value entity-name="ProductKeyword" value-field="productKeyword"/> + <set field="productKeyword.productId" from-field="oldProductKeyword.productId"/> + <set field="productKeyword.keyword" from-field="oldProductKeyword.keyword"/> + <set field="productKeyword.keywordTypeId" value="KWT_KEYWORD"/> + <set field="productKeyword.relevancyWeight" from-field="oldProductKeyword.relevancyWeight"/> + <create-value value-field="productKeyword"/> + </if-empty> + </iterate> + </simple-method> </simple-methods> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementEvents.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementEvents.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementEvents.xml Mon Mar 26 20:56:02 2012 @@ -39,7 +39,7 @@ under the License. <create-value value-field="productContent"/> <!-- set thumbnail to product --> - <entity-and list="productContentAndInfos" entity-name="ProductContentAndInfo"> + <!--<entity-and list="productContentAndInfos" entity-name="ProductContentAndInfo"> <field-map field-name="productId" from-field="parameters.productId"/> <field-map field-name="contentId" from-field="parameters.contentId"/> <field-map field-name="productContentTypeId" value="DEFAULT_IMAGE"/> @@ -48,11 +48,11 @@ under the License. <first-from-list entry="productContentAndInfo" list="productContentAndInfos"/> <script location="component://product/webapp/catalog/WEB-INF/actions/imagemanagement/SetDefaultImage.groovy"/> - <!--<entity-one value-field="product" entity-name="Product"> + <entity-one value-field="product" entity-name="Product"> <field-map field-name="productId" from-field="parameters.productId"/> </entity-one> <set field="product.originalImageUrl" from-field="productContentAndInfo.drObjectInfo"/> - <store-value value-field="product"/>--> - </if-not-empty> + <store-value value-field="product"/> + </if-not-empty>--> </simple-method> </simple-methods> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml Mon Mar 26 20:56:02 2012 @@ -23,7 +23,7 @@ under the License. <simple-method method-name="UploadProductImages" short-description="Method to upload multiple images for product"> <set-service-fields service-name="addMultipleuploadForProduct" map="parameters" to-map="addAdditionalViewForProductMap"/> - <if-not-empty field="parameters.additionalImageOne"> + <if-not-empty field="parameters._additionalImageOne_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageOne"/> @@ -33,7 +33,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageTwo"> + <if-not-empty field="parameters._additionalImageTwo_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageTwo"/> @@ -43,7 +43,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageThree"> + <if-not-empty field="parameters._additionalImageThree_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageThree"/> @@ -53,7 +53,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageFour"> + <if-not-empty field="parameters._additionalImageFour_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageFour"/> @@ -63,7 +63,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageFive"> + <if-not-empty field="parameters._additionalImageFive_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageFive"/> @@ -73,7 +73,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageSix"> + <if-not-empty field="parameters._additionalImageSix_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageSix"/> @@ -83,7 +83,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageSeven"> + <if-not-empty field="parameters._additionalImageSeven_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageSeven"/> @@ -93,7 +93,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageEight"> + <if-not-empty field="parameters._additionalImageEight_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageEight"/> @@ -103,7 +103,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageNine"> + <if-not-empty field="parameters._additionalImageNine_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageNine"/> @@ -113,7 +113,7 @@ under the License. <call-service service-name="addMultipleuploadForProduct" in-map-name="addAdditionalViewForProductMap"/> <clear-field field="addAdditionalViewForProductMap"/> </if-not-empty> - <if-not-empty field="parameters.additionalImageTen"> + <if-not-empty field="parameters._additionalImageTen_fileName"> <set field="addAdditionalViewForProductMap.productId" from-field="parameters.productId"/> <set field="addAdditionalViewForProductMap.imageResize" from-field="parameters.imageResize"/> <set field="addAdditionalViewForProductMap.uploadedFile" from-field="parameters.additionalImageTen"/> @@ -245,16 +245,29 @@ under the License. statusId = StringUtil.split(checkStatusVal, "/"); if (statusId) return statusId[0]; }"/> - <entity-and entity-name="ContentApproval" list="contentApprovals"> - <field-map field-name="partyId" from-field="userLogin.partyId"/> - <field-map field-name="contentId" from-field="parameters.contentId"/> - <field-map field-name="roleTypeId" value="IMAGEAPPROVER"/> - </entity-and> - <first-from-list entry="contentApproval" list="contentApprovals"/> - <if-not-empty field="parameters.checkStatusId"> + + <property-to-field resource="catalog.properties" property="image.management.autoApproveImage" field="autoApproveImage"/> + <property-to-field resource="catalog.properties" property="image.management.multipleApproval" field="multipleApproval"/> + <if-compare field="autoApproveImage" operator="equals" value="Y"> + <entity-and entity-name="ContentApproval" list="contentApprovals"> + <field-map field-name="contentId" from-field="parameters.contentId"/> + <field-map field-name="roleTypeId" value="IMAGEAPPROVER"/> + </entity-and> + <iterate entry="contentApproval" list="contentApprovals"> + <set field="contentApproval.approvalStatusId" from-field="parameters.checkStatusId"/> + <store-value value-field="contentApproval"/> + </iterate> + <else> + <entity-and entity-name="ContentApproval" list="contentApprovals"> + <field-map field-name="partyId" from-field="userLogin.partyId"/> + <field-map field-name="contentId" from-field="parameters.contentId"/> + <field-map field-name="roleTypeId" value="IMAGEAPPROVER"/> + </entity-and> + <first-from-list entry="contentApproval" list="contentApprovals"/> <set field="contentApproval.approvalStatusId" from-field="parameters.checkStatusId"/> - </if-not-empty> - <store-value value-field="contentApproval"/> + <store-value value-field="contentApproval"/> + </else> + </if-compare> <if-compare field="parameters.checkStatusId" operator="equals" value="IM_REJECTED"> <entity-condition entity-name="ContentApproval" list="checkRejects"> @@ -271,8 +284,9 @@ under the License. <set field="content.statusId" value="IM_REJECTED"/> <set field="content.createdByUserLogin" from-field="userLogin.userLoginId"/> <store-value value-field="content"/> - <else> - <if-compare field="parameters.checkStatusId" operator="equals" value="IM_APPROVED"> + <else> + <if-compare field="parameters.checkStatusId" operator="equals" value="IM_APPROVED"> + <if-compare field="multipleApproval" operator="equals" value="Y"> <entity-count entity-name="ContentApproval" count-field="countParty"> <condition-list combine="and"> <condition-expr field-name="contentId" operator="equals" from-field="parameters.contentId"/> @@ -291,42 +305,67 @@ under the License. <first-from-list entry="productContent" list="productContents"/> <set field="productContent.purchaseFromDate" from-field="nowTimestamp"/> <store-value value-field="productContent"/> - <else> - <entity-count entity-name="ContentApproval" count-field="countApprove"> - <condition-list combine="and"> + <else> + <entity-count entity-name="ContentApproval" count-field="countApprove"> + <condition-list combine="and"> + <condition-expr field-name="contentId" operator="equals" from-field="parameters.contentId"/> + <condition-expr field-name="roleTypeId" operator="equals" value="IMAGEAPPROVER"/> + <condition-expr field-name="approvalStatusId" operator="equals" value="IM_APPROVED"/> + </condition-list> + </entity-count> + <if-compare field="countApprove" operator="greater-equals" value="2"> + <entity-one entity-name="Content" value-field="content"/> + <set field="content.statusId" value="IM_APPROVED"/> + <store-value value-field="content"/> + + <entity-and entity-name="ProductContent" list="productContents"> + <field-map field-name="contentId" from-field="parameters.contentId"/> + <field-map field-name="productContentTypeId" value="IMAGE"/> + </entity-and> + <first-from-list entry="productContent" list="productContents"/> + <set field="productContent.purchaseFromDate" from-field="nowTimestamp"/> + <store-value value-field="productContent"/> + + <entity-condition entity-name="ContentApproval" list="checkApproveList"> + <condition-list combine="and"> <condition-expr field-name="contentId" operator="equals" from-field="parameters.contentId"/> <condition-expr field-name="roleTypeId" operator="equals" value="IMAGEAPPROVER"/> - <condition-expr field-name="approvalStatusId" operator="equals" value="IM_APPROVED"/> </condition-list> - </entity-count> - <if-compare field="countApprove" operator="greater-equals" value="2"> - <entity-one entity-name="Content" value-field="content"/> - <set field="content.statusId" value="IM_APPROVED"/> - <store-value value-field="content"/> - - <entity-and entity-name="ProductContent" list="productContents"> - <field-map field-name="contentId" from-field="parameters.contentId"/> - <field-map field-name="productContentTypeId" value="IMAGE"/> - </entity-and> - <first-from-list entry="productContent" list="productContents"/> - <set field="productContent.purchaseFromDate" from-field="nowTimestamp"/> - <store-value value-field="productContent"/> - - <entity-condition entity-name="ContentApproval" list="checkApproveList"> - <condition-list combine="and"> - <condition-expr field-name="contentId" operator="equals" from-field="parameters.contentId"/> - <condition-expr field-name="roleTypeId" operator="equals" value="IMAGEAPPROVER"/> - </condition-list> - </entity-condition> - <iterate entry="checkApprove" list="checkApproveList"> - <set field="checkApprove.approvalStatusId" value="IM_APPROVED"/> - <store-value value-field="checkApprove"/> - </iterate> - </if-compare> - </else> + </entity-condition> + <iterate entry="checkApprove" list="checkApproveList"> + <set field="checkApprove.approvalStatusId" value="IM_APPROVED"/> + <store-value value-field="checkApprove"/> + </iterate> + </if-compare> + </else> </if-compare> + <else> + <entity-one entity-name="Content" value-field="content"/> + <set field="content.statusId" value="IM_APPROVED"/> + <store-value value-field="content"/> + + <entity-and entity-name="ProductContent" list="productContents"> + <field-map field-name="contentId" from-field="parameters.contentId"/> + <field-map field-name="productContentTypeId" value="IMAGE"/> + </entity-and> + <first-from-list entry="productContent" list="productContents"/> + <set field="productContent.purchaseFromDate" from-field="nowTimestamp"/> + <store-value value-field="productContent"/> + + <entity-condition entity-name="ContentApproval" list="checkApproveList"> + <condition-list combine="and"> + <condition-expr field-name="contentId" operator="equals" from-field="parameters.contentId"/> + <condition-expr field-name="roleTypeId" operator="equals" value="IMAGEAPPROVER"/> + </condition-list> + </entity-condition> + <iterate entry="checkApprove" list="checkApproveList"> + <set field="checkApprove.approvalStatusId" value="IM_APPROVED"/> + <store-value value-field="checkApprove"/> + </iterate> + </else> </if-compare> - </else> + </if-compare> + </else> </if-compare> </simple-method> @@ -383,24 +422,39 @@ under the License. </iterate> </simple-method> - <simple-method method-name="resizeAllImageOfProduct" short-description="Resize All Image Of Product"> - <set field="removeImageBySizeMap.productId" from-field="parameters.productId"/> - <set field="removeImageBySizeMap.mapKey" from-field="parameters.size"/> - <call-service service-name="removeImageBySize" in-map-name="removeImageBySizeMap"/> - - <entity-and entity-name="ProductContentAndInfo" list="productContentAndInfos"> - <field-map field-name="productId" from-field="parameters.productId"/> - <field-map field-name="productContentTypeId" value="IMAGE"/> - <!--<field-map field-name="statusId" value="IM_APPROVED"/>--> - </entity-and> - <iterate list="productContentAndInfos" entry="productContentAndInfo"> - <set field="resizeImageMap.productId" from-field="productContentAndInfo.productId"/> - <set field="resizeImageMap.contentId" from-field="productContentAndInfo.contentId"/> - <set field="resizeImageMap.dataResourceName" from-field="productContentAndInfo.drDataResourceName"/> - <set field="resizeImageMap.drObjectInfo" from-field="productContentAndInfo.drObjectInfo"/> - <set field="resizeImageMap.resizeWidth" from-field="parameters.size"/> - <call-service service-name="resizeImageOfProduct" in-map-name="resizeImageMap"/> - </iterate> + <simple-method method-name="resizeImages" short-description="Resize Images"> + <if-compare field="parameters.resizeOption" operator="equals" value="resizeAllImages"> + <entity-and entity-name="ProductContentAndInfo" list="productContentAndInfos"> + <field-map field-name="productId" from-field="parameters.productId"/> + <field-map field-name="productContentTypeId" value="IMAGE"/> + <!--<field-map field-name="statusId" value="IM_APPROVED"/>--> + </entity-and> + <iterate list="productContentAndInfos" entry="productContentAndInfo"> + <set field="resizeImageMap.productId" from-field="productContentAndInfo.productId"/> + <set field="resizeImageMap.dataResourceName" from-field="productContentAndInfo.drDataResourceName"/> + <set field="resizeImageMap.resizeWidth" from-field="parameters.size"/> + <call-service service-name="resizeImageOfProduct" in-map-name="resizeImageMap"/> + </iterate> + </if-compare> + <if-compare field="parameters.resizeOption" operator="equals" value="createNewThumbnail"> + <set field="removeImageBySizeMap.productId" from-field="parameters.productId"/> + <set field="removeImageBySizeMap.mapKey" from-field="parameters.size"/> + <call-service service-name="removeImageBySize" in-map-name="removeImageBySizeMap"/> + + <entity-and entity-name="ProductContentAndInfo" list="productContentAndInfos"> + <field-map field-name="productId" from-field="parameters.productId"/> + <field-map field-name="productContentTypeId" value="IMAGE"/> + <!--<field-map field-name="statusId" value="IM_APPROVED"/>--> + </entity-and> + <iterate list="productContentAndInfos" entry="productContentAndInfo"> + <set field="createNewImageThumbnailMap.productId" from-field="productContentAndInfo.productId"/> + <set field="createNewImageThumbnailMap.contentId" from-field="productContentAndInfo.contentId"/> + <set field="createNewImageThumbnailMap.dataResourceName" from-field="productContentAndInfo.drDataResourceName"/> + <set field="createNewImageThumbnailMap.drObjectInfo" from-field="productContentAndInfo.drObjectInfo"/> + <set field="createNewImageThumbnailMap.sizeWidth" from-field="parameters.size"/> + <call-service service-name="createNewImageThumbnail" in-map-name="createNewImageThumbnailMap"/> + </iterate> + </if-compare> </simple-method> <simple-method method-name="removeImageBySize" short-description="Remove Image By Size"> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/product/ProductServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/product/ProductServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/product/ProductServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/product/ProductServices.xml Mon Mar 26 20:56:02 2012 @@ -1072,102 +1072,143 @@ under the License. <set field="jobSandbox.runTime" from-field="parameters.thruDate"/> <store-value value-field="jobSandbox"/> </if-not-empty> - - <entity-one value-field="systemUserLogin" entity-name="UserLogin"> - <field-map field-name="userLoginId" value="system"/> - </entity-one> - <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}"> - <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> - <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/> - <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/> - - <set field="cancelScheduledJobMap.userLogin" from-field="systemUserLogin"/> - <set field="cancelScheduledJobMap.jobId" from-field="productGroupOrder.jobId"/> - <call-service service-name="cancelScheduledJob" in-map-name="cancelScheduledJobMap"/> - </if-compare> </simple-method> <simple-method method-name="deleteProductGroupOrder" short-description="Delete ProductGroupOrder"> <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> <remove-value value-field="productGroupOrder"/> + + <entity-one entity-name="JobSandbox" value-field="jobSandbox"> + <field-map field-name="jobId" from-field="productGroupOrder.jobId"/> + </entity-one> + <remove-value value-field="jobSandbox"/> + + <entity-and entity-name="JobSandbox" list="jobSandboxList"> + <field-map field-name="runtimeDataId" from-field="jobSandbox.runtimeDataId"/> + </entity-and> + <iterate entry="jobSandboxRelatedRuntimeData" list="jobSandboxList"> + <remove-value value-field="jobSandboxRelatedRuntimeData"/> + </iterate> + + <entity-one entity-name="RuntimeData" value-field="runtimeData"> + <field-map field-name="runtimeDataId" from-field="jobSandbox.runtimeDataId"/> + </entity-one> + <remove-value value-field="runtimeData"/> </simple-method> <simple-method method-name="createJobForProductGroupOrder" short-description="Create ProductGroupOrder"> - <!-- Create RuntimeData For ProductGroupOrder --> - <set field="runtimeDataMap.groupOrderId" from-field="parameters.groupOrderId"/> - <call-class-method class-name="org.ofbiz.entity.serialize.XmlSerializer" method-name="serialize" ret-field="runtimeInfo"> - <field field="runtimeDataMap" type="Object"/> - </call-class-method> - <make-value entity-name="RuntimeData" value-field="runtimeData"/> - <sequenced-id sequence-name="RuntimeData" field="runtimeData.runtimeDataId"/> - <set field="runtimeDataId" from-field="runtimeData.runtimeDataId"/> - <set field="runtimeData.runtimeInfo" from-field="runtimeInfo"/> - <create-value value-field="runtimeData"/> - - <!-- Create Job For ProductGroupOrder --> - <make-value entity-name="JobSandbox" value-field="jobSandbox"/> - <sequenced-id sequence-name="JobSandbox" field="jobSandbox.jobId"/> - <set field="jobId" from-field="jobSandbox.jobId"/> - <set field="jobSandbox.jobName" value="Check Product GroupOrder Expired"/> - <set field="jobSandbox.runTime" from-field="parameters.thruDate"/> - <set field="jobSandbox.poolId" value="pool"/> - <set field="jobSandbox.statusId" value="SERVICE_PENDING"/> - <set field="jobSandbox.serviceName" value="checkProductGroupOrderExpired"/> - <set field="jobSandbox.runAsUser" value="system"/> - <set field="jobSandbox.runtimeDataId" from-field="runtimeDataId"/> - <set field="jobSandbox.maxRecurrenceCount" value="1" type="Long"/> - <create-value value-field="jobSandbox"/> - <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> - <set field="productGroupOrder.jobId" from-field="jobId"/> - <store-value value-field="productGroupOrder"/> + <if-empty field="productGroupOrder.jobId"> + <!-- Create RuntimeData For ProductGroupOrder --> + <set field="runtimeDataMap.groupOrderId" from-field="parameters.groupOrderId"/> + <call-class-method class-name="org.ofbiz.entity.serialize.XmlSerializer" method-name="serialize" ret-field="runtimeInfo"> + <field field="runtimeDataMap" type="Object"/> + </call-class-method> + <make-value entity-name="RuntimeData" value-field="runtimeData"/> + <sequenced-id sequence-name="RuntimeData" field="runtimeData.runtimeDataId"/> + <set field="runtimeDataId" from-field="runtimeData.runtimeDataId"/> + <set field="runtimeData.runtimeInfo" from-field="runtimeInfo"/> + <create-value value-field="runtimeData"/> + + <!-- Create Job For ProductGroupOrder --> + <make-value entity-name="JobSandbox" value-field="jobSandbox"/> + <sequenced-id sequence-name="JobSandbox" field="jobSandbox.jobId"/> + <set field="jobId" from-field="jobSandbox.jobId"/> + <set field="jobSandbox.jobName" value="Check Product GroupOrder Expired"/> + <set field="jobSandbox.runTime" from-field="parameters.thruDate"/> + <set field="jobSandbox.poolId" value="pool"/> + <set field="jobSandbox.statusId" value="SERVICE_PENDING"/> + <set field="jobSandbox.serviceName" value="checkProductGroupOrderExpired"/> + <set field="jobSandbox.runAsUser" value="system"/> + <set field="jobSandbox.runtimeDataId" from-field="runtimeDataId"/> + <set field="jobSandbox.maxRecurrenceCount" value="1" type="Long"/> + <create-value value-field="jobSandbox"/> + + <set field="productGroupOrder.jobId" from-field="jobId"/> + <store-value value-field="productGroupOrder"/> + </if-empty> </simple-method> - <simple-method method-name="checkOrderItemForProductGroupOrder" short-description="Check Order Item For ProductGroupOrder"> - <entity-one value-field="systemUserLogin" entity-name="UserLogin"> - <field-map field-name="userLoginId" value="system"/> - </entity-one> + <simple-method method-name="checkOrderItemForProductGroupOrder" short-description="Check OrderItem For ProductGroupOrder"> + <entity-one entity-name="OrderHeader" value-field="orderHeader"/> <entity-and entity-name="OrderItem" list="orderItems"> <field-map field-name="orderId" from-field="parameters.orderId"/> </entity-and> <iterate entry="orderItem" list="orderItems"> - <entity-and entity-name="ProductGroupOrder" list="productGroupOrders" filter-by-date="true"> + <set field="productId" from-field="orderItem.productId"/> + <entity-one entity-name="Product" value-field="product"> <field-map field-name="productId" from-field="orderItem.productId"/> + </entity-one> + <if-compare field="product.isVariant" operator="equals" value="Y"> + <entity-and entity-name="ProductAssoc" list="variantProductAssocs" filter-by-date="true"> + <field-map field-name="productIdTo" from-field="orderItem.productId"/> + <field-map field-name="productAssocTypeId" value="PRODUCT_VARIANT"/> + </entity-and> + <first-from-list entry="variantProductAssoc" list="variantProductAssocs"/> + <set field="productId" from-field="variantProductAssoc.productId"/> + </if-compare> + + <entity-and entity-name="ProductGroupOrder" list="productGroupOrders" filter-by-date="true"> + <field-map field-name="productId" from-field="productId"/> </entity-and> <iterate entry="productGroupOrder" list="productGroupOrders"> - <if-compare field="productGroupOrder.soldOrderQty" operator="less" value="${productGroupOrder.reqOrderQty}"> + <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_CREATED"> <calculate field="productGroupOrder.soldOrderQty"> <calcop field="productGroupOrder.soldOrderQty" operator="add"> <calcop field="orderItem.quantity" operator="get"/> </calcop> </calculate> - <store-value value-field="productGroupOrder"/> - - <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}"> - <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> - <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/> - <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/> - - <set field="cancelScheduledJobMap.userLogin" from-field="systemUserLogin"/> - <set field="cancelScheduledJobMap.jobId" from-field="productGroupOrder.jobId"/> - <call-service service-name="cancelScheduledJob" in-map-name="cancelScheduledJobMap"/> - </if-compare> </if-compare> + <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_CANCELLED"> + <calculate field="productGroupOrder.soldOrderQty"> + <calcop field="productGroupOrder.soldOrderQty" operator="subtract"> + <calcop field="orderItem.quantity" operator="get"/> + </calcop> + </calculate> + </if-compare> + <store-value value-field="productGroupOrder"/> </iterate> </iterate> </simple-method> <simple-method method-name="checkProductGroupOrderExpired" short-description="Check ProductGroupOrder Expired"> <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> - <if-compare field="productGroupOrder.soldOrderQty" operator="equals" value="${productGroupOrder.reqOrderQty}"> + <if-compare field="productGroupOrder.soldOrderQty" operator="greater-equals" value="${productGroupOrder.reqOrderQty}"> <set field="newItemStatusId" value="ITEM_APPROVED"/> <else> <set field="newItemStatusId" value="ITEM_CANCELLED"/> </else> </if-compare> + + <entity-one entity-name="Product" value-field="product"> + <field-map field-name="productId" from-field="productGroupOrder.productId"/> + </entity-one> + <if-compare field="product.isVirtual" operator="equals" value="Y"> + <entity-and entity-name="ProductAssoc" list="variantProductAssocs" filter-by-date="true"> + <field-map field-name="productId" from-field="productGroupOrder.productId"/> + <field-map field-name="productAssocTypeId" value="PRODUCT_VARIANT"/> + </entity-and> + <iterate entry="variantProductAssoc" list="variantProductAssocs"> + <set field="findOrderItemMap.productId" from-field="variantProductAssoc.productIdTo"/> + <set field="findOrderItemMap.newItemStatusId" from-field="newItemStatusId"/> + <set field="findOrderItemMap.fromDate" from-field="productGroupOrder.fromDate"/> + <set field="findOrderItemMap.thruDate" from-field="productGroupOrder.thruDate"/> + <call-service service-name="findOrderItemForProductGroupOrder" in-map-name="findOrderItemMap"/> + </iterate> + <else> + <set field="findOrderItemMap.productId" from-field="productGroupOrder.productId"/> + <set field="findOrderItemMap.newItemStatusId" from-field="newItemStatusId"/> + <set field="findOrderItemMap.fromDate" from-field="productGroupOrder.fromDate"/> + <set field="findOrderItemMap.thruDate" from-field="productGroupOrder.thruDate"/> + <call-service service-name="findOrderItemForProductGroupOrder" in-map-name="findOrderItemMap"/> + </else> + </if-compare> + </simple-method> + + <simple-method method-name="findOrderItemForProductGroupOrder" short-description="Find OrderItem For ProductGroupOrder"> <entity-condition entity-name="OrderItem" list="orderItems"> <condition-list combine="and"> - <condition-expr field-name="productId" operator="equals" from-field="productGroupOrder.productId"/> + <condition-expr field-name="productId" operator="equals" from-field="parameters.productId"/> <condition-list combine="or"> <condition-expr field-name="statusId" operator="equals" value="ITEM_CREATED"/> <condition-expr field-name="statusId" operator="equals" value="ITEM_APPROVED"/> @@ -1182,14 +1223,14 @@ under the License. <condition> <and> <if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/> - <if-compare field="orderHeader.orderDate" operator="greater-equals" value="${productGroupOrder.fromDate}"/> - <if-compare field="orderHeader.orderDate" operator="less" value="${productGroupOrder.thruDate}"/> + <if-compare field="orderHeader.orderDate" operator="greater-equals" value="${parameters.fromDate}"/> + <if-compare field="orderHeader.orderDate" operator="less" value="${parameters.thruDate}"/> </and> </condition> <then> <set field="changeOrderItemStatusMap.orderId" from-field="orderItem.orderId"/> <set field="changeOrderItemStatusMap.orderItemSeqId" from-field="orderItem.orderItemSeqId"/> - <set field="changeOrderItemStatusMap.statusId" from-field="newItemStatusId"/> + <set field="changeOrderItemStatusMap.statusId" from-field="parameters.newItemStatusId"/> <call-service service-name="changeOrderItemStatus" in-map-name="changeOrderItemStatusMap"/> </then> </if> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml Mon Mar 26 20:56:02 2012 @@ -24,9 +24,10 @@ under the License. <simple-method method-name="testGroupOrderLimitReached" short-description="Test GroupOrder the limit is reached" login-required="false"> <!-- Test GroupOrder the limit is reached Step 1) Create ProductGroupOrder . - Step 2) Create order. + Step 2) Create an order. Step 3) Check soldOrderQty is added. - Step 4) Check Order Item should approved. + Step 4) Check ProductGroupOrder expired. + Step 5) Check Order Item should approved. --> <!-- Step 1 --> <now-timestamp field="nowTimestamp"/> @@ -123,6 +124,10 @@ under the License. <if-compare field="productGroupOrder.soldOrderQty" operator="not-equals" value="0"/> </assert> <!-- Step 4 --> + <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> + <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/> + <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/> + <!-- Step 5 --> <entity-condition entity-name="OrderHeader" list="orderHeaders"> <condition-expr field-name="orderTypeId" value="SALES_ORDER"/> <order-by field-name="-orderDate"/> @@ -143,9 +148,10 @@ under the License. <simple-method method-name="testGroupOrderLimitNotReached" short-description="Test GroupOrder the limit is not reached" login-required="false"> <!-- Test GroupOrder the limit is not reached Step 1) Create ProductGroupOrder. - Step 2) Create order. - Step 2) Check ProductGroupOrder expired. - Step 3) Check Order Item should cancelled. + Step 2) Create an order. + Step 3) Check soldOrderQty is added. + Step 4) Check ProductGroupOrder expired. + Step 5) Check Order Item should cancelled. --> <!-- Step 1 --> <now-timestamp field="nowTimestamp"/> @@ -238,10 +244,14 @@ under the License. <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"> <field-map field-name="groupOrderId" from-field="groupOrderId"/> </entity-one> + <assert> + <if-compare field="productGroupOrder.soldOrderQty" operator="not-equals" value="0"/> + </assert> + <!-- Step 4 --> <set field="checkProductGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> <set field="checkProductGroupOrderExpiredMap.groupOrderId" from-field="productGroupOrder.groupOrderId"/> <call-service service-name="checkProductGroupOrderExpired" in-map-name="checkProductGroupOrderExpiredMap"/> - <!-- Step 4 --> + <!-- Step 5 --> <entity-condition entity-name="OrderHeader" list="orderHeaders"> <condition-expr field-name="orderTypeId" value="SALES_ORDER"/> <order-by field-name="-orderDate"/> Propchange: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/product/test/InventoryTests.xml ------------------------------------------------------------------------------ Merged /ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:r1210494-1305499 Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Mon Mar 26 20:56:02 2012 @@ -53,6 +53,7 @@ under the License. <or> <if-compare field="product.productTypeId" operator="equals" value="SERVICE_PRODUCT"/> <if-compare field="product.productTypeId" operator="equals" value="ASSET_USAGE_OUT_IN"/> + <if-compare field="product.productTypeId" operator="equals" value="AGGREGATEDSERV_CONF"/> </or> </condition> <then> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Mon Mar 26 20:56:02 2012 @@ -804,6 +804,7 @@ under the License. <if-empty field="checkStatusValidChange"> <set value="ERROR: Changing the status from ${lookedUpValue.statusId} to ${parameters.statusId} is not allowed." field="error_list[]"/> </if-empty> + <check-errors/> <make-value entity-name="PicklistStatusHistory" value-field="newStatusValue"/> <set from-field="parameters.picklistId" field="newStatusValue.picklistId"/> @@ -1672,4 +1673,23 @@ under the License. </else> </if-compare> </simple-method> + + <simple-method method-name="cancelPicklistAndItems" short-description="If Picklist is Cancelled then cancel all the PicklistItem"> + <entity-and entity-name="PicklistBin" list="picklistBinList"> + <field-map field-name="picklistId" from-field="parameters.picklistId"/> + </entity-and> + <if-not-empty field="picklistBinList"> + <iterate entry="picklistBin" list="picklistBinList"> + <entity-and entity-name="PicklistItem" list="itemList"> + <field-map field-name="picklistBinId" from-field="picklistBin.picklistBinId"/> + </entity-and> + <if-not-empty field="itemList"> + <iterate entry="item" list="itemList"> + <set field="item.itemStatusId" value="PICKITEM_CANCELLED"/> + <store-value value-field="item"/> + </iterate> + </if-not-empty> + </iterate> + </if-not-empty> + </simple-method> </simple-methods> Modified: ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml Mon Mar 26 20:56:02 2012 @@ -53,6 +53,7 @@ under the License. <or> <if-compare field="product.productTypeId" operator="equals" value="SERVICE_PRODUCT"/> <if-compare field="product.productTypeId" operator="equals" value="ASSET_USAGE_OUT_IN"/> + <if-compare field="product.productTypeId" operator="equals" value="AGGREGATEDSERV_CONF"/> </or> </condition> <then> Modified: ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services.xml Mon Mar 26 20:56:02 2012 @@ -1544,9 +1544,10 @@ under the License. <attribute name="partyId" mode="IN" type="String" optional="false"/> </service> - <service name="resizeAllImageOfProduct" engine="simple" - location="component://product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml" invoke="resizeAllImageOfProduct" auth="true"> - <description>Resize All Image Of Product.</description> + <service name="resizeImages" engine="simple" + location="component://product/script/org/ofbiz/product/imagemanagement/ImageManagementServices.xml" invoke="resizeImages" auth="true"> + <description>Resize Images.</description> + <attribute name="resizeOption" mode="IN" type="String" optional="false"/> <attribute name="productId" mode="IN" type="String" optional="false"/> <attribute name="size" mode="IN" type="String" optional="false"/> </service> @@ -1555,10 +1556,18 @@ under the License. location="org.ofbiz.product.imagemanagement.ImageManagementServices" invoke="resizeImageOfProduct" auth="true"> <description>Resize Image Of Product.</description> <attribute name="productId" mode="IN" type="String" optional="false"/> + <attribute name="dataResourceName" mode="IN" type="String" optional="false"/> + <attribute name="resizeWidth" mode="IN" type="String" optional="false"/> + </service> + + <service name="createNewImageThumbnail" engine="java" + location="org.ofbiz.product.imagemanagement.ImageManagementServices" invoke="createNewImageThumbnail" auth="true"> + <description>Create New Image Thumbnail.</description> + <attribute name="productId" mode="IN" type="String" optional="false"/> <attribute name="contentId" mode="IN" type="String" optional="false"/> <attribute name="dataResourceName" mode="IN" type="String" optional="false"/> <attribute name="drObjectInfo" mode="IN" type="String" optional="false"/> - <attribute name="resizeWidth" mode="IN" type="String" optional="false"/> + <attribute name="sizeWidth" mode="IN" type="String" optional="false"/> </service> <service name="removeImageBySize" engine="simple" @@ -1698,7 +1707,7 @@ under the License. <service name="checkOrderItemForProductGroupOrder" engine="simple" location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="checkOrderItemForProductGroupOrder" auth="true"> - <description>Check Order Item For ProductGroupOrder</description> + <description>Check OrderItem For ProductGroupOrder</description> <attribute name="orderId" mode="IN" type="String" optional="false"/> </service> @@ -1708,4 +1717,13 @@ under the License. <attribute name="groupOrderId" mode="IN" type="String" optional="false"/> </service> + <service name="findOrderItemForProductGroupOrder" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="findOrderItemForProductGroupOrder" auth="true"> + <description>Find OrderItem For ProductGroupOrder</description> + <attribute name="productId" mode="IN" type="String" optional="false"/> + <attribute name="newItemStatusId" mode="IN" type="String" optional="false"/> + <attribute name="fromDate" mode="IN" type="Timestamp" optional="false"/> + <attribute name="thruDate" mode="IN" type="Timestamp" optional="false"/> + </service> + </services> Modified: ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_maint.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_maint.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_maint.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_maint.xml Mon Mar 26 20:56:02 2012 @@ -114,6 +114,20 @@ under the License. <attribute name="parentProductCategoryId" type="String" mode="IN" optional="false"/> <attribute name="categories" type="java.util.List" mode="INOUT" optional="true"/> </service> + + <service name="getCategoryTrail" engine="java" + location="org.ofbiz.product.category.CategoryWorker" invoke="getCategoryTrail"> + <description> Returns a complete category trail - can be used for exporting proper category trees. + This is mostly useful when used in combination with breadcrumbs, for building a facetted index tree, + or to export a category tree for migration to another system. + Will create the tree from root point to categoryId. + + This service is not meant to be run on every request. + Its best use is to generate the trail every so often and store somewhere (a lucene/solr tree, entities, cache or so). + </description> + <attribute name="productCategoryId" type="String" mode="IN" optional="false"/> + <attribute name="trail" type="java.util.List" mode="OUT" optional="true"/> + </service> <service name="checkImageUrlForCategoryAndProduct" engine="simple" location="component://product/script/org/ofbiz/product/catalog/CatalogServices.xml" invoke="checkImageUrlForCategoryAndProduct"> Modified: ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_picklist.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_picklist.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_picklist.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_picklist.xml Mon Mar 26 20:56:02 2012 @@ -179,6 +179,11 @@ under the License. <auto-attributes include="pk" mode="IN" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="false"/> </service> + <service name="cancelPicklistAndItems" engine="simple" + location="component://product/script/org/ofbiz/shipment/picklist/PicklistServices.xml" invoke="cancelPicklistAndItems" auth="true"> + <description>If Picklist is Cancelled then cancel all the PicklistItems.</description> + <attribute name="picklistId" type="String" mode="IN"/> + </service> <!-- PicklistRole --> <service name="createPicklistRole" default-entity-name="PicklistRole" engine="simple" Modified: ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_shipment.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_shipment.xml Mon Mar 26 20:56:02 2012 @@ -676,7 +676,7 @@ under the License. </service> <service name="completePack" engine="java" - location="org.ofbiz.shipment.packing.PackingServices" invoke="completePack" auth="true"> + location="org.ofbiz.shipment.packing.PackingServices" invoke="completePack" auth="true" transaction-timeout="7200"> <description>Complete the packaging set the shipment to PACKED</description> <attribute name="packingSession" type="org.ofbiz.shipment.packing.PackingSession" mode="IN" optional="false"/> <attribute name="orderId" type="String" mode="IN" optional="false"/> Modified: ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_upgrade.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_upgrade.xml?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_upgrade.xml (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/servicedef/services_upgrade.xml Mon Mar 26 20:56:02 2012 @@ -48,5 +48,15 @@ under the License. The entity ProductStoreEmailSetting has been deprecated since revision XXX (2011-XX-XX) (FIXME) </description> </service> - + <service name="migrateProductKeyword" engine="simple" + location="component://product/script/org/ofbiz/product/UpgradeServices.xml" invoke="migrateProductKeyword"> + <description> + Migrate data from oldProductKeyword to ProductKeyword. + The entity oldProductKeyword has been deprecated. + This service can be used to upgrade existing data from the oldProductKeyword entity to the new + ProductKeyword entity. + Before running this service, load the seed data for the KeywordType entity from the file: + common/data/CommonTypeData.xml + </description> + </service> </services> Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/catalog/CatalogWorker.java Mon Mar 26 20:56:02 2012 @@ -48,6 +48,8 @@ public class CatalogWorker { public static final String module = CatalogWorker.class.getName(); + private CatalogWorker () {} + public static String getWebSiteId(ServletRequest request) { return WebSiteWorker.getWebSiteId(request); } Modified: ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java?rev=1305581&r1=1305580&r2=1305581&view=diff ============================================================================== --- ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java (original) +++ ofbiz/branches/20111205EmailHandling/applications/product/src/org/ofbiz/product/category/CatalogUrlServlet.java Mon Mar 26 20:56:02 2012 @@ -189,7 +189,7 @@ public class CatalogUrlServlet extends H urlBuilder.append(CATALOG_URL_MOUNT_POINT); if (UtilValidate.isNotEmpty(currentCategoryId)) { - crumb = CategoryWorker.adjustTrail(crumb, currentCategoryId, previousCategoryId); + crumb = CategoryWorker.adjustTrail(crumb, currentCategoryId, previousCategoryId); for (String trailCategoryId: crumb) { if ("TOP".equals(trailCategoryId)) continue; urlBuilder.append("/"); |
| Free forum by Nabble | Edit this page |
