Hi Jacques

Le 11/02/2016 23:10, Jacques Le Roux a écrit :
Le 11/02/2016 22:27, Jacques Le Roux a écrit :
Hi Nicolas, All,

I globally like the changes, I just have a question.

With these changes the OrderSecurityError* properties which were used here are now useless, should we not remove them? Despite the lost, I think it's reasonable because these errors have very few chances to appear, and if they appear it's not so hard to find your way through the log.
Yes I planned to remove all unused label before declare the conversion end.

Oops, I did not see the elephant in the room: they are permission issues. So I guess the message to the user will be less clear. Not sure it's a real issue but we might consider it...
By default I return to more generic label (http://ofbiz.135035.n4.nabble.com/entity-auto-improvement-Act-2-td4655973.html) but if you think that it's big lost, I can try to improve the generic order permission service to resolve them

Nicolas

Jacques


Jacques


Le 24/01/2016 20:06, [email protected] a écrit :
Author: nmalin
Date: Sun Jan 24 19:06:32 2016
New Revision: 1726542

URL: http://svn.apache.org/viewvc?rev=1726542&view=rev
Log:


I converted following services from simple to entity-auto :

     createOrderNotificationLog
     createOrderItemBilling
     createOrderAdjustment
     updateOrderAdjustment
     createOrderAdjustmentBilling
     createOrderShipment
     updateOrderShipment
     deleteOrderShipment
     createCommunicationEventOrder
     removeCommunicationEventOrder
     createOrderItemShipGroup
     createOrderContactMech
     removeOrderContactMech
     createOrderTerm
     removeOrderTerm
     createOrderRequirementCommitment

And from java to entity-auto for createOrderPaymentPreference
Related issue OFBIZ-6854.

Removed:
ofbiz/trunk/applications/order/script/org/ofbiz/order/communication/
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml
     ofbiz/trunk/applications/order/servicedef/services.xml
ofbiz/trunk/applications/order/servicedef/services_requirement.xml
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=1726542&r1=1726541&r2=1726542&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Sun Jan 24 19:06:32 2016
@@ -88,56 +88,8 @@ under the License.
<field-to-result field="orderInfo.totalOrders" result-name="totalOrders"/>
          </if-not-empty>
      </simple-method>
- <simple-method method-name="createOrderShipment" short-description="Create OrderShipment">
-        <set value="Create OrderShipment" field="operationName"/>
-        <check-permission permission="ORDERMGR" action="_CREATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderShipment"/>
-        </check-permission>
-        <check-errors/>
-
- <make-value value-field="newEntity" entity-name="OrderShipment"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <create-value value-field="newEntity"/>
-    </simple-method>
- <simple-method method-name="updateOrderShipment" short-description="Update OrderShipment">
-        <set value="Update OrderShipment" field="operationName"/>
-        <check-permission permission="ORDERMGR" action="_UPDATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunDeleteOrderShipment"/>
-        </check-permission>
-        <check-errors/>
-
- <entity-one entity-name="OrderShipment" value-field="lookedUpValue"/> - <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
- <simple-method method-name="deleteOrderShipment" short-description="Delete OrderShipment">
-        <set value="Delete OrderShipment" field="operationName"/>
-        <check-permission permission="ORDERMGR" action="_DELETE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunDeleteOrderShipment"/>
-        </check-permission>
-        <check-errors/>
-
- <entity-one entity-name="OrderShipment" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
        <!-- order requirement methods -->
- <simple-method method-name="createOrderRequirementCommitment" short-description="Create OrderRequirementCommitment"> - <!-- The permission checking is commented out to make this service work also when triggered from ecommerce orders -->
-        <!--
-        <check-permission permission="ORDERMGR" action="_CREATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCheckCreateOrderRequirementCommitment"/>
-        </check-permission>
-        <check-errors/>
-        -->
- <make-value value-field="newEntity" entity-name="OrderRequirementCommitment"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-
<simple-method method-name="createRequirementAndCommitment" short-description="create a requirement and commitment for it"> <set value="PRODUCT_REQUIREMENT" field="inputMap.requirementTypeId"/>
  @@ -759,20 +711,6 @@ under the License.
       </simple-method>
        <!-- OrderItemShipGroup -->
- <simple-method method-name="createOrderItemShipGroup" short-description="Create OrderItemShipGroup">
-        <check-permission permission="ORDERMGR" action="_CREATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderItemShipGroup"/>
-        </check-permission>
-        <check-errors/>
- <make-value value-field="newEntity" entity-name="OrderItemShipGroup"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <if-empty field="newEntity.shipGroupSeqId">
- <make-next-seq-id value-field="newEntity" seq-field-name="shipGroupSeqId"/> <!-- this finds the next sub-sequence ID --> - <field-to-result field="newEntity.shipGroupSeqId" result-name="shipGroupSeqId"/>
-        </if-empty>
-        <create-value value-field="newEntity"/>
-    </simple-method>
<simple-method method-name="updateOrderItemShipGroup" short-description="Update OrderItemShipGroup">
          <check-permission permission="ORDERMGR" action="_UPDATE">
<fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderItemShipGroup"/>
@@ -832,16 +770,6 @@ under the License.
<field-to-result field="orderItemShipGroupInvRes.promisedDatetime" result-name="estimatedShipDate"/>
      </simple-method>
- <simple-method method-name="createOrderContactMech" short-description="Create OrderContactMech">
-        <check-permission permission="ORDERMGR" action="_CREATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderContactMech"/>
-        </check-permission>
-        <check-errors/>
- <make-value value-field="newEntity" entity-name="OrderContactMech"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-
<simple-method method-name="removeOrderContactMech" short-description="Remove OrderContactMech">
          <check-permission permission="ORDERMGR" action="_DELETE">
<fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunRemoveOrderContactMech"/>
@@ -861,39 +789,6 @@ under the License.
          <store-value value-field="orderHeaderNote"/>
      </simple-method>
- <simple-method method-name="createOrderTerm" short-description="Create an OrderTerm">
-        <check-permission permission="ORDERMGR" action="_CREATE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderTerm"/>
-        </check-permission>
-        <check-errors/>
-
-        <make-value value-field="newEntity" entity-name="OrderTerm"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
- <set value="_NA_" set-if-empty="true" field="newEntity.orderItemSeqId"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
-        <create-value value-field="newEntity"/>
-    </simple-method>
- <simple-method method-name="updateOrderTerm" short-description="Update OrderTerm">
-        <check-permission permission="ORDERMGR" action="_DELETE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderTerm"/>
-        </check-permission>
-        <check-errors/>
-
- <entity-one entity-name="OrderTerm" value-field="lookedUpValue"/> - <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
- <simple-method method-name="removeOrderTerm" short-description="Remove OrderTerm">
-        <check-permission permission="ORDERMGR" action="_DELETE">
- <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunRemoveOrderTerm"/>
-        </check-permission>
-        <check-errors/>
-
- <entity-one entity-name="OrderTerm" value-field="lookedUpValue"/>
-        <remove-value value-field="lookedUpValue"/>
-    </simple-method>
-
<simple-method method-name="addPaymentMethodToOrder" short-description="Create an PaymentMethodToOrder">
          <check-permission permission="ORDERMGR" action="_CREATE">
<fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunAddPaymentMethodToOrder"/>
@@ -1373,7 +1268,7 @@ under the License.
              </iterate>
          </iterate>
      </simple-method>
-
+
<simple-method method-name="updateShippingMethodAndCharges" short-description="Updates shipping method and shipping charges from Order View page when Shipment is in picked status and items of Order are packed"> <!-- splitting shipmentMethodAndAmount request parameter value that contains "*" symbol
               into "shipmentMethod" and "newAmount".
@@ -1424,6 +1319,7 @@ under the License.
          </else>
          </if-compare-field>
      </simple-method>
+
<simple-method method-name="productAvailabalityByFacility" short-description="Calculate ATP and Qoh According For each facility"> <set field="facilityMap.ownerPartyId" from-field="parameters.ownerPartyId"/> <find-by-and map="facilityMap" list="facilityList" entity-name="Facility"/>
@@ -1442,7 +1338,7 @@ under the License.
          </iterate>
          <field-to-result field="availabalityList"/>
      </simple-method>
-
+
<simple-method method-name="createOrderPaymentApplication" short-description="Create Order Payment Application">
          <entity-one value-field="paymentMap" entity-name="Payment"/>
<set field="createCtx.amountApplied" from-field="paymentMap.amount" type="BigDecimal"/>
@@ -1459,7 +1355,7 @@ under the License.
<call-service service-name="createPaymentApplication" in-map-name="createCtx"/>
          </if-not-empty>
      </simple-method>
-
+
<simple-method method-name="MoveItemBetweenShipGroups" short-description="Move order items between ship groups"> <entity-one entity-name="OrderItemShipGroupAssoc" value-field="orderItemShipGroupAssoc"> <field-map field-name="orderId" from-field="parameters.orderId"/>
@@ -1483,7 +1379,7 @@ under the License.
<set field="map.shipGroupSeqId" from-field="parameters.toGroupIndex"/> <set field="map.quantity" value="${orderItemShipGroupAssoc.quantity + parameters.quantity}" type="BigDecimal"/> <call-service service-name="updateOrderItemShipGroupAssoc" in-map-name="map"/>
-
+
<entity-one entity-name="OrderItemShipGroupAssoc" value-field="orderItemShipGroupAssoc"> <field-map field-name="orderId" from-field="parameters.orderId"/> <field-map field-name="orderItemSeqId" from-field="parameters.orderItemSeqId"/>
@@ -1495,7 +1391,7 @@ under the License.
              </add-error>
          </if-empty>
          <check-errors/>
-
+
          <clear-field field="map"/>
          <set field="map.orderId" from-field="parameters.orderId"/>
<set field="map.orderItemSeqId" from-field="parameters.orderItemSeqId"/>
@@ -1503,5 +1399,5 @@ under the License.
<set field="map.quantity" value="${orderItemShipGroupAssoc.quantity - parameters.quantity}" type="BigDecimal"/> <call-service service-name="updateOrderItemShipGroupAssoc" in-map-name="map"/>
      </simple-method>
-
+
  </simple-methods>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=1726542&r1=1726541&r2=1726542&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml Sun Jan 24 19:06:32 2016
@@ -44,33 +44,12 @@ under the License.
              </else>
          </if-compare>
      </simple-method>
-
- <simple-method method-name="createOrderAdjustment" short-description="Create an OrderAdjustment">
-
- <make-value entity-name="OrderAdjustment" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-
- <sequenced-id sequence-name="OrderAdjustment" field="newEntity.orderAdjustmentId"/> - <field-to-result field="newEntity.orderAdjustmentId" result-name="orderAdjustmentId"/>
-
-        <now-timestamp field="newEntity.createdDate"/>
- <set from-field="userLogin.userLoginId" field="newEntity.createdByUserLogin"/>
-
-        <create-value value-field="newEntity"/>
-    </simple-method>
- <simple-method method-name="updateOrderAdjustment" short-description="Update an OrderAdjustment"> - <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderAdjustement"/></check-permission>
-        <check-errors/>
- <entity-one entity-name="OrderAdjustment" value-field="lookedUpValue"/> - <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
-        <store-value value-field="lookedUpValue"/>
-    </simple-method>
<simple-method method-name="deleteOrderAdjustment" short-description="Delete an OrderAdjustment"> <check-permission permission="ORDERMGR" action="_DELETE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunDeleteOrderAdjustement"/></check-permission>
          <check-errors/>
<entity-one entity-name="OrderAdjustment" value-field="lookedUpValue"/>
          <remove-value value-field="lookedUpValue"/>
-
+
          <if-not-empty field="parameters.productPromoCodeId">
<entity-one entity-name="OrderProductPromoCode" value-field="lookedUpValue"/>
              <if-not-empty field="lookedUpValue">
@@ -79,30 +58,6 @@ under the License.
          </if-not-empty>
      </simple-method>
- <simple-method method-name="createOrderAdjustmentBilling" short-description="Create an OrderAdjustmentBilling"> - <make-value entity-name="OrderAdjustmentBilling" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-
- <simple-method method-name="createOrderItemBilling" short-description="Create an OrderItemBilling"> - <make-value entity-name="OrderItemBilling" value-field="newEntity"/>
-        <set-nonpk-fields map="parameters" value-field="newEntity"/>
-        <set-pk-fields map="parameters" value-field="newEntity"/>
-        <create-value value-field="newEntity"/>
-    </simple-method>
-
- <simple-method method-name="createNotificationLog" short-description="Log an order notification" login-required="false"> - <make-value entity-name="OrderNotification" value-field="orderNotification"/> - <sequenced-id sequence-name="OrderNotification" field="orderNotification.orderNotificationId"/> - <set from-field="parameters.orderId" field="orderNotification.orderId"/> - <set from-field="parameters.emailType" field="orderNotification.emailType"/> - <set from-field="parameters.comments" field="orderNotification.comments"/>
-        <now-timestamp field="orderNotification.notificationDate"/>
-        <create-value value-field="orderNotification"/>
-    </simple-method>
-
<simple-method method-name="updateOrderStatusFromReceipt" short-description="Update Order Status From ShipmentReceipt"> <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderStatusFromReceipt"/></check-permission>
          <check-errors/>

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1726542&r1=1726541&r2=1726542&view=diff ==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Sun Jan 24 19:06:32 2016
@@ -76,8 +76,7 @@ under the License.
<attribute name="assignedRoleTypeId" type="String" mode="IN" optional="true"/>
      </service>
  -    <service name="createOrderNotificationLog" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createNotificationLog"> + <service name="createOrderNotificationLog" engine="entity-auto" default-entity-name="OrderNotification" invoke="create">
          <description>Logs when a notification was sent</description>
<attribute name="orderId" type="String" mode="IN" optional="false"/> <attribute name="emailType" type="String" mode="IN" optional="false"/>
@@ -164,17 +163,10 @@ under the License.
<attribute name="orderId" type="String" mode="OUT" optional="false"/>
      </service>
  -    <service name="createOrderItemBilling" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderItemBilling"> + <service name="createOrderItemBilling" default-entity-name="OrderItemBilling" engine="entity-auto" invoke="create"> <description>Create a new order item billing record</description> - <attribute name="orderId" type="String" mode="IN" optional="false"/> - <attribute name="orderItemSeqId" type="String" mode="IN" optional="false"/> - <attribute name="invoiceId" type="String" mode="IN" optional="false"/> - <attribute name="invoiceItemSeqId" type="String" mode="IN" optional="false"/> - <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/> - <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/> - <attribute name="itemIssuanceId" type="String" mode="IN" optional="true"/> - <attribute name="shipmentReceiptId" type="String" mode="IN" optional="true"/>
+        <auto-attributes mode="IN" include="pk"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
      </service>
        <service name="orderAdjustmentPermissionCheck" engine="simple"
@@ -183,8 +175,7 @@ under the License.
          <implements service="permissionInterface"/>
      </service>
- <service name="createOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderAdjustment"> + <service name="createOrderAdjustment" default-entity-name="OrderAdjustment" engine="entity-auto" invoke="create"> <description>Creates a new order adjustment record</description> <permission-service service-name="orderAdjustmentPermissionCheck" main-action="CREATE"/>
          <auto-attributes mode="OUT" include="pk" optional="false"/>
@@ -192,9 +183,9 @@ under the License.
          <override name="orderAdjustmentTypeId" optional="false"/>
          <override name="orderId" optional="false"/>
      </service>
- <service name="updateOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="updateOrderAdjustment"> + <service name="updateOrderAdjustment" default-entity-name="OrderAdjustment" engine="entity-auto" invoke="update">
          <description>Update an order adjustment record</description>
+ <permission-service service-name="orderAdjustmentPermissionCheck" main-action="UPDATE"/>
          <auto-attributes mode="IN" include="pk" optional="false"/>
          <auto-attributes mode="IN" include="nonpk" optional="true"/>
          <override name="orderId" optional="false"/>
@@ -207,13 +198,10 @@ under the License.
<attribute name="productPromoCodeId" type="String" mode="IN" optional="true"/>
      </service>
  -    <service name="createOrderAdjustmentBilling" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="createOrderAdjustmentBilling"> + <service name="createOrderAdjustmentBilling" default-entity-name="OrderAdjustmentBilling" engine="entity-auto" invoke="create"> <description>Create a new order adjustment billing record</description> - <attribute name="orderAdjustmentId" type="String" mode="IN" optional="false"/> - <attribute name="invoiceId" type="String" mode="IN" optional="false"/> - <attribute name="invoiceItemSeqId" type="String" mode="IN" optional="false"/> - <attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
+        <auto-attributes mode="IN" include="pk"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
      </service>
        <service name="createPaymentFromPreference" engine="java"
@@ -435,15 +423,10 @@ under the License.
          <attribute name="roleTypeId" type="String" mode="IN"/>
      </service>
  -    <service name="createOrderPaymentPreference" engine="java"
- location="org.ofbiz.order.order.OrderServices" invoke="createPaymentPreference"> + <service name="createOrderPaymentPreference" default-entity-name="OrderPaymentPreference" engine="entity-auto" invoke="create"> <description>Creates an order payment preference</description>
-        <attribute name="orderId" type="String" mode="IN"/>
- <attribute name="paymentMethodTypeId" type="String" mode="IN"/> - <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/> - <attribute name="statusId" type="String" mode="IN" optional="true"/> - <attribute name="maxAmount" type="BigDecimal" mode="IN" optional="true"/> - <attribute name="orderPaymentPreferenceId" type="String" mode="OUT"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes include="pk" mode="OUT"/>
      </service>
        <service name="createOrderNote" engine="java"
@@ -568,20 +551,17 @@ under the License.
      </service>
        <!-- OrderShipment Services -->
- <service name="createOrderShipment" default-entity-name="OrderShipment" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderShipment" auth="true"> + <service name="createOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="create" auth="true">
          <description>Create OrderShipment</description>
          <auto-attributes include="pk" mode="IN" optional="false"/>
          <auto-attributes include="nonpk" mode="IN" optional="true"/>
      </service>
- <service name="updateOrderShipment" default-entity-name="OrderShipment" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderShipment" auth="true"> + <service name="updateOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="update" auth="true">
          <description>Update OrderShipment</description>
          <auto-attributes include="pk" mode="IN" optional="false"/>
          <auto-attributes include="nonpk" mode="IN" optional="true"/>
      </service>
- <service name="deleteOrderShipment" default-entity-name="OrderShipment" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="deleteOrderShipment" auth="true"> + <service name="deleteOrderShipment" engine="entity-auto" default-entity-name="OrderShipment" invoke="delete" auth="true">
          <description>Delete OrderShipment</description>
          <auto-attributes include="pk" mode="IN" optional="false"/>
      </service>
@@ -667,21 +647,27 @@ under the License.
      </service>
        <!-- CommunicationEvents related to orders -->
-    <service name="createCommunicationEventOrder" engine="simple"
- location="component://order/script/org/ofbiz/order/communication/CommunicationEventServices.xml" invoke="createCommunicationEventOrder" auth="true"> + <service name="createCommunicationEventOrder" default-entity-name="CommunicationEventOrder" engine="entity-auto" invoke="create" auth="true">
          <description>Create a Communication Event Order</description>
- <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN" optional="false"/>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="CREATE"/>
+        </required-permissions>
+ <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
      </service>
-    <service name="removeCommunicationEventOrder" engine="simple"
- location="component://order/script/org/ofbiz/order/communication/CommunicationEventServices.xml" invoke="removeCommunicationEventOrder" auth="true"> + <service name="removeCommunicationEventOrder" default-entity-name="CommunicationEventOrder" engine="entity-auto" invoke="delete" auth="true">
          <description>Remove a Communication Event Order</description>
- <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN" optional="false"/>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="DELETE"/>
+        </required-permissions>
+ <auto-attributes entity-name="CommunicationEventOrder" include="pk" mode="IN"/>
      </service>
        <!-- Order Shipping and Contacts -->
- <service name="createOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderItemShipGroup" auth="true"> + <service name="createOrderItemShipGroup" default-entity-name="OrderItemShipGroup" engine="entity-auto" invoke="create" auth="true">
          <description>Creates a new OrderItemShipGroup.</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="CREATE"/>
+        </required-permissions>
          <auto-attributes mode="IN" include="nonpk" optional="true"/>
<attribute name="orderId" type="String" mode="IN" optional="false"/> <attribute name="shipGroupSeqId" type="String" mode="INOUT" optional="true"/>
@@ -696,42 +682,52 @@ under the License.
<attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
      </service>
- <service name="createOrderContactMech" default-entity-name="OrderContactMech" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderContactMech" auth="true"> + <service name="createOrderContactMech" default-entity-name="OrderContactMech" engine="entity-auto" invoke="create" auth="true">
          <description>Create Order Contact Mech</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="CREATE"/>
+        </required-permissions>
          <auto-attributes include="pk" mode="IN" optional="false"/>
      </service>
  -    <service name="updateOrderContactMech" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderContactMech" auth="true" default-entity-name="OrderContactMech"> + <service name="updateOrderContactMech" default-entity-name="OrderContactMech" engine="simple" + location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderContactMech" auth="true">
          <description>Update Order Contact Mech</description>
          <auto-attributes include="pk" mode="IN" optional="false"/>
<attribute name="oldContactMechId" type="String" mode="IN" optional="true"/>
      </service>
- <service name="removeOrderContactMech" default-entity-name="OrderContactMech" engine="simple" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="removeOrderContactMech" auth="true"> + <service name="removeOrderContactMech" default-entity-name="OrderContactMech" engine="entity-auto" invoke="delete" auth="true">
          <description>Remove Order Contact Mech</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="DELETE"/>
+        </required-permissions>
          <auto-attributes include="pk" mode="IN" optional="false"/>
      </service>
        <!-- OrderTerms -->
-    <service name="createOrderTerm" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderTerm" auth="true"> + <service name="createOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="create" auth="true">
          <description>Create an Order Term</description>
- <auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/> - <auto-attributes entity-name="OrderTerm" include="nonpk" mode="IN" optional="true"/>
-        <override name="orderItemSeqId" optional="true"/>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="CREATE"/>
+        </required-permissions>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+ <override name="orderItemSeqId" optional="true" default-value="_NA_"/>
      </service>
-    <service name="updateOrderTerm" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="updateOrderTerm" auth="true"> + <service name="updateOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="update" auth="true">
          <description>Update an Order Term</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="UPDATE"/>
+        </required-permissions>
<auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/> <auto-attributes entity-name="OrderTerm" include="nonpk" mode="IN" optional="true"/>
      </service>
-    <service name="removeOrderTerm" engine="simple"
- location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="removeOrderTerm" auth="true"> + <service name="removeOrderTerm" default-entity-name="OrderTerm" engine="entity-auto" invoke="delete" auth="true">
          <description>Remove an Order Term</description>
+        <required-permissions join-type="AND">
+            <check-permission permission="ORDERMGR" action="DELETE"/>
+        </required-permissions>
<auto-attributes entity-name="OrderTerm" include="pk" mode="IN" optional="false"/>
      </service>

Modified: ofbiz/trunk/applications/order/servicedef/services_requirement.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_requirement.xml?rev=1726542&r1=1726541&r2=1726542&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services_requirement.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services_requirement.xml Sun Jan 24 19:06:32 2016
@@ -105,8 +105,7 @@ under the License.
<attribute mode="OUT" name="quantityTotal" type="BigDecimal" optional="true"/> <attribute mode="OUT" name="amountTotal" type="BigDecimal" optional="true"/>
      </service>
- <service name="createOrderRequirementCommitment" engine="simple" auth="true" - location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="createOrderRequirementCommitment"> + <service name="createOrderRequirementCommitment" engine="entity-auto" auth="true" default-entity-name="OrderRequirementCommitment" invoke="create"> <auto-attributes entity-name="OrderRequirementCommitment" include="pk" mode="IN" optional="false"/> <auto-attributes entity-name="OrderRequirementCommitment" include="nonpk" mode="IN" optional="true"/>
      </service>

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1726542&r1=1726541&r2=1726542&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Sun Jan 24 19:06:32 2016
@@ -2824,52 +2824,6 @@ public class OrderServices {
          return ServiceUtil.returnSuccess();
      }
  -    /** Service to create an order payment preference */
- public static Map<String, Object> createPaymentPreference(DispatchContext ctx, Map<String, ? extends Object> context) {
-        Map<String, Object> result = new HashMap<String, Object>();
-        Delegator delegator = ctx.getDelegator();
-        String orderId = (String) context.get("orderId");
-        String statusId = (String) context.get("statusId");
- String paymentMethodTypeId = (String) context.get("paymentMethodTypeId"); - String paymentMethodId = (String) context.get("paymentMethodId");
-        BigDecimal maxAmount = (BigDecimal) context.get("maxAmount");
- GenericValue userLogin = (GenericValue) context.get("userLogin");
-        Locale locale = (Locale) context.get("locale");
-
-        String prefId = null;
-
-        try {
-            prefId = delegator.getNextSeqId("OrderPaymentPreference");
-        } catch (IllegalArgumentException e) {
- return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, - "OrderErrorCouldNotCreateOrderPaymentPreferenceIdGenerationFailure", locale));
-        }
-
- Map<String, Object> fields = UtilMisc.<String, Object>toMap("orderPaymentPreferenceId", prefId, "orderId", orderId, "paymentMethodTypeId", - paymentMethodTypeId, "paymentMethodId", paymentMethodId, "maxAmount", maxAmount);
-
-        if (statusId != null) {
-            fields.put("statusId", statusId);
-        }
-
-        try {
- GenericValue v = delegator.makeValue("OrderPaymentPreference", fields);
-            v.set("createdDate", UtilDateTime.nowTimestamp());
-            if (userLogin != null) {
- v.set("createdByUserLogin", userLogin.getString("userLoginId"));
-            }
-            delegator.create(v);
-        } catch (GenericEntityException e) {
- result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR); - result.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, - "OrderOrderPaymentPreferencesCannotBeCreated", UtilMisc.toMap("errorString", e.getMessage()), locale));
-            return ServiceUtil.returnFailure();
-        }
-        result.put("orderPaymentPreferenceId", prefId);
- result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
-        return result;
-    }
-
/** Service to get order header information as standard results. */ public static Map<String, Object> getOrderHeaderInformation(DispatchContext dctx, Map<String, ? extends Object> context) {
          Delegator delegator = dctx.getDelegator();










Reply via email to