Expanded entity-auto engine to support auto fromDate; a bunch more changes to example component services to eliminate implementations possible so far; now there are just a few left

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@679288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2008-07-24 07:08:10 +00:00
parent f0637b264b
commit 987d4fc1a0
5 changed files with 48 additions and 111 deletions
@@ -21,16 +21,6 @@ under the License.
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- Example methods -->
<simple-method method-name="createExample" short-description="create a Example">
<make-value entity-name="Example" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="Example" env-name="newEntity.exampleId"/> <!-- get the next sequenced ID -->
<field-to-result field-name="newEntity.exampleId" result-name="exampleId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
<set-service-fields service-name="createExampleStatus" map-name="newEntity" to-map-name="createExampleStatusMap"/>
<call-service service-name="createExampleStatus" in-map-name="createExampleStatusMap"/>
</simple-method>
<simple-method method-name="updateExample" short-description="update a Example">
<entity-one entity-name="Example" value-name="lookedUpValue"/>
@@ -50,19 +40,11 @@ under the License.
<check-errors/>
</if-empty>
</if-not-empty>
<!-- before we set the nonpk fields, if the statusId is different save a status history record -->
<set-service-fields service-name="createExampleStatus" map-name="parameters" to-map-name="createExampleStatusMap"/>
<call-service service-name="createExampleStatus" in-map-name="createExampleStatusMap"/>
</if-compare-field>
<set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteExample" short-description="delete a Example">
<entity-one entity-name="Example" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="createExampleStatus" short-description="create a ExampleItem">
<now-timestamp-to-env env-name="nowTimestamp"/>
@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- ExampleFeature methods -->
<simple-method method-name="createExampleFeature" short-description="create a ExampleFeature">
<set value="_CREATE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<make-value entity-name="ExampleFeature" value-name="newEntity"/>
<sequenced-id-to-env sequence-name="ExampleFeature" env-name="newEntity.exampleFeatureId"/> <!-- get the next sequenced ID -->
<field-to-result field-name="newEntity.exampleFeatureId" result-name="exampleFeatureId"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updateExampleFeature" short-description="update a ExampleFeature">
<set value="_UPDATE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<entity-one entity-name="ExampleFeature" value-name="lookedUpValue"/>
<set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteExampleFeature" short-description="delete a ExampleFeature">
<set value="_DELETE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<entity-one entity-name="ExampleFeature" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
<!-- ExampleFeatureAppl methods -->
<simple-method method-name="createExampleFeatureAppl" short-description="create a ExampleFeatureAppl">
<set value="_CREATE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<make-value entity-name="ExampleFeatureAppl" value-name="newEntity"/>
<set-pk-fields map-name="parameters" value-name="newEntity"/>
<set-nonpk-fields map-name="parameters" value-name="newEntity"/>
<!-- fromDate is part of the PK, but optional in the service def, so make sure something is there -->
<if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
<create-value value-name="newEntity"/>
</simple-method>
<simple-method method-name="updateExampleFeatureAppl" short-description="update a ExampleFeatureAppl">
<set value="_UPDATE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<entity-one entity-name="ExampleFeatureAppl" value-name="lookedUpValue"/>
<set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
<store-value value-name="lookedUpValue"/>
</simple-method>
<simple-method method-name="deleteExampleFeatureAppl" short-description="delete a ExampleFeatureAppl">
<set value="_DELETE" field="securityAction"/>
<check-permission permission="EXAMPLE" action="${securityAction}"><fail-property resource="ExampleUiLabels" property="ExamplePermissionError"/></check-permission>
<check-errors/>
<entity-one entity-name="ExampleFeatureAppl" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
</simple-methods>