Author: hansbak
Date: Tue Nov 22 10:09:31 2011 New Revision: 1204894 URL: http://svn.apache.org/viewvc?rev=1204894&view=rev Log: update groupbying feature Modified: ofbiz/trunk/applications/order/servicedef/secas.xml ofbiz/trunk/applications/product/entitydef/eecas.xml ofbiz/trunk/applications/product/entitydef/entitymodel.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductServices.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml ofbiz/trunk/applications/product/servicedef/services.xml ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Modified: ofbiz/trunk/applications/order/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/secas.xml (original) +++ ofbiz/trunk/applications/order/servicedef/secas.xml Tue Nov 22 10:09:31 2011 @@ -434,6 +434,6 @@ under the License. <!-- Group Buying --> <eca service="storeOrder" event="commit"> <condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/> - <action service="checkOrderItemForGroupOrder" mode="sync"/> + <action service="checkOrderItemForProductGroupOrder" mode="sync"/> </eca> </service-eca> Modified: ofbiz/trunk/applications/product/entitydef/eecas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/eecas.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/eecas.xml (original) +++ ofbiz/trunk/applications/product/entitydef/eecas.xml Tue Nov 22 10:09:31 2011 @@ -70,4 +70,9 @@ under the License. <condition field-name="availableToPromiseDiff" operator="not-equals" value="0" type="BigDecimal"/> <action service="setLastInventoryCount" mode="sync"/> </eca> + + <!-- Product GroupOrder ECAs --> + <eca entity="ProductGroupOrder" operation="create" event="return"> + <action service="createJobForProductGroupOrder" mode="sync"/> + </eca> </entity-eca> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Tue Nov 22 10:09:31 2011 @@ -4810,9 +4810,9 @@ under the License. </relation> </entity> - <entity entity-name="GroupOrder" + <entity entity-name="ProductGroupOrder" package-name="org.ofbiz.product.product" - title="Group Order Entity"> + title="Product Group Order Entity"> <field name="groupOrderId" type="id-ne"></field> <field name="productId" type="id-ne"></field> <field name="fromDate" type="date-time"></field> @@ -4821,10 +4821,10 @@ under the License. <field name="soldOrderQty" type="fixed-point"></field> <field name="jobId" type="id-ne"></field> <prim-key field="groupOrderId"/> - <relation type="one" fk-name="GROUP_ORDER" rel-entity-name="Product"> + <relation type="one" fk-name="PROD_GROUP_ORDER" rel-entity-name="Product"> <key-map field-name="productId"/> </relation> - <relation type="one" fk-name="GROUP_ORDER_JOB" rel-entity-name="JobSandbox"> + <relation type="one" fk-name="PROD_GROUP_ORDER_JOB" rel-entity-name="JobSandbox"> <key-map field-name="jobId"/> </relation> </entity> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductServices.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/product/ProductServices.xml Tue Nov 22 10:09:31 2011 @@ -1047,54 +1047,21 @@ under the License. </simple-method> <!-- Product GroupOrder Services --> - <simple-method method-name="createGroupOrder" short-description="Create GroupOrder"> - <!-- Create Job For GroupOrder --> - <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 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="checkGroupOrderExpired"/> - <set field="jobSandbox.runAsUser" value="system"/> - <set field="jobSandbox.runtimeDataId" from-field="runtimeData.runtimeDataId"/> - <set field="jobSandbox.maxRecurrenceCount" value="1" type="Long"/> - <create-value value-field="jobSandbox"/> - - <!-- Create GroupOrder --> - <make-value entity-name="GroupOrder" value-field="groupOrder"/> - <make-next-seq-id value-field="groupOrder" seq-field-name="groupOrderId"/> - <set field="groupOrderId" from-field="groupOrder.groupOrderId"/> - <set-nonpk-fields value-field="groupOrder" map="parameters"/> - <set field="groupOrder.jobId" from-field="jobId"/> - <create-value value-field="groupOrder"/> - - <!-- Create RuntimeData For GroupOrder --> - <set field="runtimeDataMap.groupOrderId" from-field="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"/> - - <entity-one entity-name="JobSandbox" value-field="updateJobSandbox"> - <field-map field-name="jobId" from-field="jobId"/> - </entity-one> - <set field="updateJobSandbox.runtimeDataId" from-field="runtimeDataId"/> - <store-value value-field="updateJobSandbox"/> + <simple-method method-name="createProductGroupOrder" short-description="Create ProductGroupOrder"> + <make-value entity-name="ProductGroupOrder" value-field="newEntity"/> + <make-next-seq-id value-field="newEntity" seq-field-name="groupOrderId"/> + <field-to-result field="newEntity.groupOrderId" result-name="groupOrderId"/> + <set-nonpk-fields value-field="newEntity" map="parameters"/> + <create-value value-field="newEntity"/> </simple-method> - <simple-method method-name="updateGroupOrder" short-description="Update GroupOrder"> - <entity-one entity-name="GroupOrder" value-field="groupOrder"/> - <set-nonpk-fields value-field="groupOrder" map="parameters"/> - <store-value value-field="groupOrder"/> + <simple-method method-name="updateProductGroupOrder" short-description="Update ProductGroupOrder"> + <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> + <set-nonpk-fields value-field="productGroupOrder" map="parameters"/> + <store-value value-field="productGroupOrder"/> <entity-one entity-name="JobSandbox" value-field="jobSandbox"> - <field-map field-name="jobId" from-field="groupOrder.jobId"/> + <field-map field-name="jobId" from-field="productGroupOrder.jobId"/> </entity-one> <if-not-empty field="jobSandbox"> <set field="jobSandbox.runTime" from-field="parameters.thruDate"/> @@ -1104,23 +1071,54 @@ under the License. <entity-one value-field="systemUserLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="system"/> </entity-one> - <if-compare field="groupOrder.soldOrderQty" operator="equals" value="${groupOrder.reqOrderQty}"> - <set field="checkGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> - <set field="checkGroupOrderExpiredMap.groupOrderId" from-field="groupOrder.groupOrderId"/> - <call-service service-name="checkGroupOrderExpired" in-map-name="checkGroupOrderExpiredMap"/> + <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="groupOrder.jobId"/> + <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="deleteGroupOrder" short-description="Delete GroupOrder"> - <entity-one entity-name="GroupOrder" value-field="groupOrder"/> - <remove-value value-field="groupOrder"/> + <simple-method method-name="deleteProductGroupOrder" short-description="Delete ProductGroupOrder"> + <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> + <remove-value value-field="productGroupOrder"/> + </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"/> </simple-method> - <simple-method method-name="checkOrderItemForGroupOrder" short-description="Check Order Item For GroupOrder"> + <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> @@ -1128,25 +1126,25 @@ under the License. <field-map field-name="orderId" from-field="parameters.orderId"/> </entity-and> <iterate entry="orderItem" list="orderItems"> - <entity-and entity-name="GroupOrder" list="groupOrders" filter-by-date="true"> + <entity-and entity-name="ProductGroupOrder" list="productGroupOrders" filter-by-date="true"> <field-map field-name="productId" from-field="orderItem.productId"/> </entity-and> - <iterate entry="groupOrder" list="groupOrders"> - <if-compare field="groupOrder.soldOrderQty" operator="less" value="${groupOrder.reqOrderQty}"> - <calculate field="groupOrder.soldOrderQty"> - <calcop field="groupOrder.soldOrderQty" operator="add"> + <iterate entry="productGroupOrder" list="productGroupOrders"> + <if-compare field="productGroupOrder.soldOrderQty" operator="less" value="${productGroupOrder.reqOrderQty}"> + <calculate field="productGroupOrder.soldOrderQty"> + <calcop field="productGroupOrder.soldOrderQty" operator="add"> <calcop field="orderItem.quantity" operator="get"/> </calcop> </calculate> - <store-value value-field="groupOrder"/> + <store-value value-field="productGroupOrder"/> - <if-compare field="groupOrder.soldOrderQty" operator="equals" value="${groupOrder.reqOrderQty}"> - <set field="checkGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> - <set field="checkGroupOrderExpiredMap.groupOrderId" from-field="groupOrder.groupOrderId"/> - <call-service service-name="checkGroupOrderExpired" in-map-name="checkGroupOrderExpiredMap"/> + <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="groupOrder.jobId"/> + <set field="cancelScheduledJobMap.jobId" from-field="productGroupOrder.jobId"/> <call-service service-name="cancelScheduledJob" in-map-name="cancelScheduledJobMap"/> </if-compare> </if-compare> @@ -1154,9 +1152,9 @@ under the License. </iterate> </simple-method> - <simple-method method-name="checkGroupOrderExpired" short-description="Check GroupOrder Expired"> - <entity-one entity-name="GroupOrder" value-field="groupOrder"/> - <if-compare field="groupOrder.soldOrderQty" operator="equals" value="${groupOrder.reqOrderQty}"> + <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}"> <set field="newItemStatusId" value="ITEM_APPROVED"/> <else> <set field="newItemStatusId" value="ITEM_CANCELLED"/> @@ -1164,7 +1162,7 @@ under the License. </if-compare> <entity-condition entity-name="OrderItem" list="orderItems"> <condition-list combine="and"> - <condition-expr field-name="productId" operator="equals" from-field="groupOrder.productId"/> + <condition-expr field-name="productId" operator="equals" from-field="productGroupOrder.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"/> @@ -1179,8 +1177,8 @@ under the License. <condition> <and> <if-compare field="orderHeader.orderTypeId" operator="equals" value="SALES_ORDER"/> - <if-compare field="orderHeader.orderDate" operator="greater-equals" value="${groupOrder.fromDate}"/> - <if-compare field="orderHeader.orderDate" operator="less" value="${groupOrder.thruDate}"/> + <if-compare field="orderHeader.orderDate" operator="greater-equals" value="${productGroupOrder.fromDate}"/> + <if-compare field="orderHeader.orderDate" operator="less" value="${productGroupOrder.thruDate}"/> </and> </condition> <then> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/test/GroupOrderTest.xml Tue Nov 22 10:09:31 2011 @@ -23,7 +23,7 @@ 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 GroupOrder . + Step 1) Create ProductGroupOrder . Step 2) Create order. Step 3) Check soldOrderQty is added. Step 4) Check Order Item should approved. @@ -38,13 +38,15 @@ under the License. <entity-one value-field="systemUserLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="system"/> </entity-one> - <set field="createGroupOrderMap.userLogin" from-field="systemUserLogin"/> - <set field="createGroupOrderMap.productId" value="GZ-1000"/> - <set field="createGroupOrderMap.fromDate" from-field="nowTimestamp"/> - <set field="createGroupOrderMap.thruDate" from-field="thruDate"/> - <set field="createGroupOrderMap.reqOrderQty" value="1" type="BigDecimal"/> - <set field="createGroupOrderMap.soldOrderQty" value="0" type="BigDecimal"/> - <call-service service-name="createGroupOrder" in-map-name="createGroupOrderMap"/> + <set field="createProductGroupOrderMap.userLogin" from-field="systemUserLogin"/> + <set field="createProductGroupOrderMap.productId" value="GZ-1000"/> + <set field="createProductGroupOrderMap.fromDate" from-field="nowTimestamp"/> + <set field="createProductGroupOrderMap.thruDate" from-field="thruDate"/> + <set field="createProductGroupOrderMap.reqOrderQty" value="1" type="BigDecimal"/> + <set field="createProductGroupOrderMap.soldOrderQty" value="0" type="BigDecimal"/> + <call-service service-name="createProductGroupOrder" in-map-name="createProductGroupOrderMap"> + <result-to-field result-name="groupOrderId" field="groupOrderId"/> + </call-service> <!-- Step 2 --> <field-to-session field="nullField" session-name="orderMode"/> <set field="request" from-field="parameters.request"/> @@ -114,13 +116,11 @@ under the License. </call-class-method> <log level="info" message="===== >>> Event : destroyCart, Response = ${result}"/> <!-- Step 3 --> - <entity-condition entity-name="GroupOrder" list="groupOrders"> - <condition-expr field-name="productId" value="GZ-1000"/> - <order-by field-name="-groupOrderId"/> - </entity-condition> - <first-from-list entry="groupOrder" list="groupOrders"/> + <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"> + <field-map field-name="groupOrderId" from-field="groupOrderId"/> + </entity-one> <assert> - <if-compare field="groupOrder.soldOrderQty" operator="not-equals" value="0"/> + <if-compare field="productGroupOrder.soldOrderQty" operator="not-equals" value="0"/> </assert> <!-- Step 4 --> <entity-condition entity-name="OrderHeader" list="orderHeaders"> @@ -142,9 +142,9 @@ 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 GroupOrder. + Step 1) Create ProductGroupOrder. Step 2) Create order. - Step 2) Check GroupOrder expired. + Step 2) Check ProductGroupOrder expired. Step 3) Check Order Item should cancelled. --> <!-- Step 1 --> @@ -157,13 +157,15 @@ under the License. <entity-one value-field="systemUserLogin" entity-name="UserLogin"> <field-map field-name="userLoginId" value="system"/> </entity-one> - <set field="createGroupOrderMap.userLogin" from-field="systemUserLogin"/> - <set field="createGroupOrderMap.productId" value="GZ-1000"/> - <set field="createGroupOrderMap.fromDate" from-field="nowTimestamp"/> - <set field="createGroupOrderMap.thruDate" from-field="thruDate"/> - <set field="createGroupOrderMap.reqOrderQty" value="2" type="BigDecimal"/> - <set field="createGroupOrderMap.soldOrderQty" value="0" type="BigDecimal"/> - <call-service service-name="createGroupOrder" in-map-name="createGroupOrderMap"/> + <set field="createProductGroupOrderMap.userLogin" from-field="systemUserLogin"/> + <set field="createProductGroupOrderMap.productId" value="GZ-1000"/> + <set field="createProductGroupOrderMap.fromDate" from-field="nowTimestamp"/> + <set field="createProductGroupOrderMap.thruDate" from-field="thruDate"/> + <set field="createProductGroupOrderMap.reqOrderQty" value="2" type="BigDecimal"/> + <set field="createProductGroupOrderMap.soldOrderQty" value="0" type="BigDecimal"/> + <call-service service-name="createProductGroupOrder" in-map-name="createProductGroupOrderMap"> + <result-to-field result-name="groupOrderId" field="groupOrderId"/> + </call-service> <!-- Step 2 --> <field-to-session field="nullField" session-name="orderMode"/> <set field="request" from-field="parameters.request"/> @@ -233,14 +235,12 @@ under the License. </call-class-method> <log level="info" message="===== >>> Event : destroyCart, Response = ${result}"/> <!-- Step 3 --> - <entity-condition entity-name="GroupOrder" list="groupOrders"> - <condition-expr field-name="productId" value="GZ-1000"/> - <order-by field-name="-groupOrderId"/> - </entity-condition> - <first-from-list entry="groupOrder" list="groupOrders"/> - <set field="checkGroupOrderExpiredMap.userLogin" from-field="systemUserLogin"/> - <set field="checkGroupOrderExpiredMap.groupOrderId" from-field="groupOrder.groupOrderId"/> - <call-service service-name="checkGroupOrderExpired" in-map-name="checkGroupOrderExpiredMap"/> + <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"> + <field-map field-name="groupOrderId" from-field="groupOrderId"/> + </entity-one> + <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 --> <entity-condition entity-name="OrderHeader" list="orderHeaders"> <condition-expr field-name="orderTypeId" value="SALES_ORDER"/> Modified: ofbiz/trunk/applications/product/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services.xml Tue Nov 22 10:09:31 2011 @@ -1662,17 +1662,10 @@ under the License. <auto-attributes include="pk" mode="IN" optional="false"/> </service> - <service name="updateGroupOrder" default-entity-name="GroupOrder" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="updateGroupOrder" auth="true"> - <description>Update a Group Order</description> - <auto-attributes include="pk" mode="IN" optional="false"/> - <auto-attributes include="nonpk" mode="IN" optional="true"/> - </service> - <!-- Product GroupOrder Services --> - <service name="createGroupOrder" default-entity-name="GroupOrder" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="createGroupOrder" auth="true"> - <description>Create GroupOrder</description> + <service name="createProductGroupOrder" default-entity-name="ProductGroupOrder" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="createProductGroupOrder" auth="true"> + <description>Create ProductGroupOrder</description> <attribute name="productId" mode="IN" type="String" optional="false"/> <attribute name="soldOrderQty" mode="IN" type="BigDecimal" optional="false"/> <attribute name="reqOrderQty" mode="IN" type="BigDecimal" optional="false"/> @@ -1681,30 +1674,37 @@ under the License. <attribute name="groupOrderId" mode="OUT" type="String" optional="true"/> </service> - <service name="updateGroupOrder" default-entity-name="GroupOrder" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="updateGroupOrder" auth="true"> - <description>Update GroupOrder</description> + <service name="updateProductGroupOrder" default-entity-name="ProductGroupOrder" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="updateProductGroupOrder" auth="true"> + <description>Update ProductGroupOrder</description> <attribute name="groupOrderId" mode="IN" type="String" optional="false"/> <attribute name="reqOrderQty" mode="IN" type="BigDecimal" optional="false"/> <attribute name="fromDate" mode="IN" type="Timestamp" optional="false"/> <attribute name="thruDate" mode="IN" type="Timestamp" optional="false"/> </service> - <service name="deleteGroupOrder" default-entity-name="GroupOrder" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="deleteGroupOrder" auth="true"> - <description>Delete GroupOrder</description> + <service name="deleteProductGroupOrder" default-entity-name="ProductGroupOrder" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="deleteProductGroupOrder" auth="true"> + <description>Delete ProductGroupOrder</description> <auto-attributes include="pk" mode="IN" optional="false"/> </service> - <service name="checkOrderItemForGroupOrder" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="checkOrderItemForGroupOrder" auth="true"> - <description>Check Order Item For GroupOrder</description> + <service name="createJobForProductGroupOrder" default-entity-name="ProductGroupOrder" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="createJobForProductGroupOrder" auth="true"> + <description>Create Job For ProductGroupOrder</description> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + + <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> <attribute name="orderId" mode="IN" type="String" optional="false"/> </service> - <service name="checkGroupOrderExpired" engine="simple" - location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="checkGroupOrderExpired" auth="true"> - <description>Check GroupOrder Expired</description> + <service name="checkProductGroupOrderExpired" engine="simple" + location="component://product/script/org/ofbiz/product/product/ProductServices.xml" invoke="checkProductGroupOrderExpired" auth="true"> + <description>Check ProductGroupOrder Expired</description> <attribute name="groupOrderId" mode="IN" type="String" optional="false"/> </service> 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=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Tue Nov 22 10:09:31 2011 @@ -2990,7 +2990,7 @@ under the License. <response name="success" type="view" value="listMiniproduct"/> </request-map> - <!-- ================ Product GroupOrder Requests ================= --> + <!-- ================ Product GroupOrder Requests ================= --> <request-map uri="ViewProductGroupOrder"> <security https="true" auth="true"/> <response name="success" type="view" value="ViewProductGroupOrder"/> @@ -3001,23 +3001,23 @@ under the License. <response name="success" type="view" value="EditProductGroupOrder"/> </request-map> - <request-map uri="createGroupOrder"> + <request-map uri="createProductGroupOrder"> <security https="true" auth="true"/> - <event type="service" invoke="createGroupOrder"/> + <event type="service" invoke="createProductGroupOrder"/> <response name="success" type="view" value="ViewProductGroupOrder"/> <response name="error" type="view" value="ViewProductGroupOrder"/> </request-map> - <request-map uri="updateGroupOrder"> + <request-map uri="updateProductGroupOrder"> <security https="true" auth="true"/> - <event type="service" invoke="updateGroupOrder"/> + <event type="service" invoke="updateProductGroupOrder"/> <response name="success" type="view" value="ViewProductGroupOrder"/> <response name="error" type="view" value="EditProductGroupOrder"/> </request-map> - <request-map uri="deleteGroupOrder"> + <request-map uri="deleteProductGroupOrder"> <security https="true" auth="true"/> - <event type="service" invoke="deleteGroupOrder"/> + <event type="service" invoke="deleteProductGroupOrder"/> <response name="success" type="view" value="ViewProductGroupOrder"/> <response name="error" type="view" value="ViewProductGroupOrder"/> </request-map> Modified: ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml Tue Nov 22 10:09:31 2011 @@ -2111,7 +2111,7 @@ under the License. <field name="changedDate"><display/></field> </form> - <form name="ListProductGroupOrder" type="list" target="" title="" list-name="groupOrders" + <form name="ListProductGroupOrder" type="list" target="" title="" list-name="productGroupOrders" odd-row-style="alternate-row" default-table-style="basic-table"> <field name="productId"><hidden/></field> <field name="groupOrderId"><display/></field> @@ -2119,21 +2119,21 @@ under the License. <field name="soldOrderQty" title="${uiLabelMap.ProductSoldQuantity}"><display/></field> <field name="fromDate" title="${uiLabelMap.ProductDealStartDate}"><display/></field> <field name="thruDate" title="${uiLabelMap.ProductDealEndDate}"><display/></field> - <field name="editLink" use-when="${groovy: return reqOrderQty.compareTo(soldOrderQty)!= 0;}" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> + <field name="editLink" use-when="${groovy: return reqOrderQty.compareTo(soldOrderQty)!= 0;}&&${groovy: return thruDate.compareTo(org.ofbiz.base.util.UtilDateTime.nowTimestamp()) == 1}" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> <hyperlink target="EditProductGroupOrder" description="${uiLabelMap.CommonEdit}" also-hidden="false"> <parameter param-name="productId"/> <parameter param-name="groupOrderId"/> </hyperlink> </field> <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> - <hyperlink target="deleteGroupOrder" description="${uiLabelMap.CommonDelete}" also-hidden="false"> + <hyperlink target="deleteProductGroupOrder" description="${uiLabelMap.CommonDelete}" also-hidden="false"> <parameter param-name="productId"/> <parameter param-name="groupOrderId"/> </hyperlink> </field> </form> - <form name="CreateProductGroupOrder" type="single" target="createGroupOrder" title="" + <form name="CreateProductGroupOrder" type="single" target="createProductGroupOrder" title="" header-row-style="header-row" default-table-style="basic-table"> <field name="productId"><hidden/></field> <field name="soldOrderQty"><hidden value="0"/></field> @@ -2143,7 +2143,7 @@ under the License. <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> - <form name="EditProductGroupOrder" type="single" target="updateGroupOrder" title="" default-map-name="groupOrder" + <form name="EditProductGroupOrder" type="single" target="updateProductGroupOrder" title="" default-map-name="productGroupOrder" header-row-style="header-row" default-table-style="basic-table"> <field name="groupOrderId"><hidden/></field> <field name="productId"><hidden/></field> @@ -2153,4 +2153,3 @@ under the License. <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> </forms> - Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=1204894&r1=1204893&r2=1204894&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue Nov 22 10:09:31 2011 @@ -1392,7 +1392,7 @@ under the License. <set field="tabButtonItem" value="ViewProductGroupOrder"/> <set field="labelTitleProperty" value="ProductGroupOrder"/> <set field="productId" from-field="parameters.productId"/> - <entity-and entity-name="GroupOrder" list="groupOrders"> + <entity-and entity-name="ProductGroupOrder" list="productGroupOrders"> <field-map field-name="productId" from-field="productId"/> </entity-and> </actions> @@ -1418,7 +1418,7 @@ under the License. <set field="tabButtonItem" value="EditProductGroupOrder"/> <set field="labelTitleProperty" value="ProductGroupOrder"/> <set field="productId" from-field="parameters.productId"/> - <entity-one entity-name="GroupOrder" value-field="groupOrder"/> + <entity-one entity-name="ProductGroupOrder" value-field="productGroupOrder"/> </actions> <widgets> <decorator-screen name="CommonProductDecorator" location="${parameters.productDecoratorLocation}"> |
Free forum by Nabble | Edit this page |