An option I've resisted for a while due to limited flexibility when used, but we have a lot of these common cases so this may be worth it; can now define CrUD services and not have to implement them for common cases; the create, update, and delete ExampleItem services now use this entity-auto implementation instead of explicit simple-methods; those are tested and are working, and other variations on create should too but I haven't tested them yet; this also includes various refactorings to expose nderlying tools in simple method code and make it reusable
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@679058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -84,25 +84,6 @@ under the License.
|
||||
<create-value value-name="newEntity"/>
|
||||
</simple-method>
|
||||
|
||||
<!-- ExampleItem methods -->
|
||||
<simple-method method-name="createExampleItem" short-description="create a ExampleItem">
|
||||
<make-value entity-name="ExampleItem" value-name="newEntity"/>
|
||||
<set-pk-fields map-name="parameters" value-name="newEntity"/>
|
||||
<make-next-seq-id value-name="newEntity" seq-field-name="exampleItemSeqId"/> <!-- this finds the next sub-sequence ID -->
|
||||
<field-to-result field-name="newEntity.exampleItemSeqId" result-name="exampleItemSeqId"/>
|
||||
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
|
||||
<create-value value-name="newEntity"/>
|
||||
</simple-method>
|
||||
<simple-method method-name="updateExampleItem" short-description="update a ExampleItem">
|
||||
<entity-one entity-name="ExampleItem" value-name="lookedUpValue"/>
|
||||
<set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
|
||||
<store-value value-name="lookedUpValue"/>
|
||||
</simple-method>
|
||||
<simple-method method-name="deleteExampleItem" short-description="delete a ExampleItem">
|
||||
<entity-one entity-name="ExampleItem" value-name="lookedUpValue"/>
|
||||
<remove-value value-name="lookedUpValue"/>
|
||||
</simple-method>
|
||||
|
||||
<!-- Example ServiceTest Service -->
|
||||
<simple-method method-name="testCreateExampleService" short-description="test the create example service" login-required="false">
|
||||
<set field="createExampleMap.exampleTypeId" value="CONTRIVED"/>
|
||||
|
||||
Reference in New Issue
Block a user