svn commit: r566700 - in /ofbiz/trunk/applications/product: ofbiz-component.xml script/org/ofbiz/product/rental/ script/org/ofbiz/product/rental/RentalServices.xml servicedef/services_rental.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r566700 - in /ofbiz/trunk/applications/product: ofbiz-component.xml script/org/ofbiz/product/rental/ script/org/ofbiz/product/rental/RentalServices.xml servicedef/services_rental.xml

hansbak-2
Author: hansbak
Date: Thu Aug 16 06:12:27 2007
New Revision: 566700

URL: http://svn.apache.org/viewvc?view=rev&rev=566700
Log:
start a separated file for rentalservices, will expect more additions in the next few months. move one service (createFixedAssetAndLinkToProduct) from the accounting component to be deleted in the next revision

Added:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/
    ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml   (with props)
    ofbiz/trunk/applications/product/servicedef/services_rental.xml   (with props)
Modified:
    ofbiz/trunk/applications/product/ofbiz-component.xml

Modified: ofbiz/trunk/applications/product/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/ofbiz-component.xml?view=diff&rev=566700&r1=566699&r2=566700
==============================================================================
--- ofbiz/trunk/applications/product/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/product/ofbiz-component.xml Thu Aug 16 06:12:27 2007
@@ -50,6 +50,7 @@
     <service-resource type="model" loader="main" location="servicedef/services_shipment.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_store.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_subscription.xml"/>
+    <service-resource type="model" loader="main" location="servicedef/services_rental.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_view.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_cost.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_uom.xml"/>

Added: ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml?view=auto&rev=566700
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml (added)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml Thu Aug 16 06:12:27 2007
@@ -0,0 +1,62 @@
+<?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">
+
+    <simple-method method-name="createFixedAssetAndLinkToProduct" short-description="Create an FixedAsset and link the asset to the product, used when a asset usage product is created">
+        <check-permission permission="CATALOG" action="_UPDATE">
+            <fail-message message="Security Error: to run createFixedAssetAndLinkToProduct you must have the CATALOG_UPDATE or CATALOG_ADMIN permission"/>
+        </check-permission>        
+        <check-errors/>
+
+        <set field="createFixedAsset.fixedAssetTypeId" value="PROPERTY"/>
+        <if-not-empty field-name="parameters.productName">
+            <set field="createFixedAsset.fixedAssetName" from-field="parameters.productName"/>
+        </if-not-empty>
+        <if-not-empty field-name="parameters.internalName">
+            <set field="createFixedAsset.fixedAssetName" from-field="parameters.internalName"/>
+        </if-not-empty>
+        <call-service service-name="createFixedAsset" in-map-name="createFixedAsset">
+            <result-to-field result-name="fixedAssetId" field-name="newLink.fixedAssetId"/>
+        </call-service>
+
+        <set field="newLink.fixedAssetProductTypeId" value="FAPT_USE"/>
+        <set field="newLink.productId" from-field="parameters.productId"/>
+        <call-service service-name="addFixedAssetProduct" in-map-name="newLink"/>
+        
+    </simple-method>
+
+    <simple-method method-name="getProductFirstRelatedFixedAsset"
+     short-description="Most rental products are associated with one fixed asset only,
+     this service will return the first genericValue fixedAsset">
+        <check-permission permission="CATALOG" action="_VIEW"><fail-message message="Security Error: to run getProductFirstRelatedFixedAsset you must have the CATALOG_VIEW or CATALOG_ADMIN permission"/></check-permission>
+        <check-errors/>
+
+ <entity-one entity-name="Product" value-name="product"/>
+ <get-related relation-name="FixedAssetProduct" value-name="product" list-name="productFixedAssets"/>
+ <if-not-empty field-name="productFixedAssets">
+    <first-from-list list-name="productFixedAssets" entry-name="productFixedAsset"/>
+      <field-to-result field-name="productFixedAsset.fixedAssetId" result-name="fixedAssetId"/>
+ </if-not-empty>
+ <field-to-result field-name="parameters.productId" result-name="productId"/>
+    </simple-method>
+
+</simple-methods>

Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/product/rental/RentalServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/applications/product/servicedef/services_rental.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_rental.xml?view=auto&rev=566700
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_rental.xml (added)
+++ ofbiz/trunk/applications/product/servicedef/services_rental.xml Thu Aug 16 06:12:27 2007
@@ -0,0 +1,39 @@
+<?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.
+-->
+
+<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
+    <description>Product Component Services</description>
+
+    <service name="createFixedAssetAndLinkToProduct" default-entity-name="FixedAsset" engine="simple"
+                location="org/ofbiz/product/rental/RentalServices.xml" invoke="createFixedAssetAndLinkToProduct" auth="true">
+        <description>Create an FixedAsset and link to an existing product to ease rental products creation</description>
+        <attribute name="productId" mode="IN" type="String"/>
+        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+
+    <service name="getProductFirstRelatedFixedAsset" engine="simple"
+                location="org/ofbiz/product/rental/RentalServices.xml" invoke="getProductFirstRelatedFixedAsset" auth="true">
+        <description>Most rental products are associated with one fixed asset only, this service will return the first genericValue fixedAsset</description>
+        <attribute name="productId" mode="INOUT" type="String"/>
+        <attribute name="fixedAssetId" mode="OUT" type="String" optional="true"/>
+    </service>
+</services>

Propchange: ofbiz/trunk/applications/product/servicedef/services_rental.xml
------------------------------------------------------------------------------
    svn:eol-style = native