[OFBiz] SVN: r7727 - in trunk/specialized/opentravelsystem: script/org/ofbiz/opentravelsystem servicedef src/org/ofbiz/opentravelsystem webapp/hotelbackend/WEB-INF webapp/hotelbackend/screens

hansbak@svn.ofbiz.org hansbak at svn.ofbiz.org
Thu Jun 1 02:53:29 CDT 2006


Author: hansbak
Date: 2006-06-01 02:51:34 -0500 (Thu, 01 Jun 2006)
New Revision: 7727

Added:
   trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/ContactMechServices.xml
   trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/PaymentMethodServices.xml
Modified:
   trunk/specialized/opentravelsystem/servicedef/services.xml
   trunk/specialized/opentravelsystem/src/org/ofbiz/opentravelsystem/otsUtils.java
   trunk/specialized/opentravelsystem/webapp/hotelbackend/WEB-INF/controller.xml
   trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/CommonScreens.xml
   trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/Menus.xml
Log:
 download program for all entities for one shop/hotel now working + added webtools upload screen to sysAdmin screen (needs framework change)

Added: trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/ContactMechServices.xml
===================================================================
--- trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/ContactMechServices.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/ContactMechServices.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    $Id: $
+    
+    Copyright 2001-2006 The Apache Software Foundation
+    
+    Licensed 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://www.ofbiz.org/dtds/simple-methods.xsd">
+
+    <!-- ================================================================ -->
+    <!-- Opentravelsystem Contact mech Services -->
+    <!-- ================================================================ -->
+    
+    <simple-method method-name="createContactMech" short-description="--Add a contact mech with the invoice prefix--">
+        <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false" use-cache="true">
+            <field-map field-name="partyId" env-name="parameters.userLogin.partyId"/>
+        </entity-one>
+        <if-not-empty field-name="partyAcctgPreference">
+            <check-permission permission="OPENTRAVELSYSTEM" action="_RW">
+                <alt-permission permission="${parameters.userLogin.partyId}" action="_RW"/>
+                <fail-message message="Security Error: to update you need RW access to &quot;${parameters.partyId}&quot; in the &quot;OPENTRAVELSYSTEM&quot;"/>
+            </check-permission>        
+            <check-errors/>
+            
+            <!-- create id using the invoice prefix -->
+            <sequenced-id-to-env sequence-name="${partyAcctgPreference.invoiceIdPrefix}ContactMech" env-name="nextContactMechId"/>
+            <set field="parameters.contactMechId" value="${partyAcctgPreference.invoiceIdPrefix}${nextContactMechId}"/>
+        </if-not-empty>
+        <!-- call original ofbiz service with preset contactMechId -->
+        <log level="always" message="============${parameters.contactMechId"></log>
+        <set-service-fields service-name="createContactMechOfbiz" map-name="parameters" to-map-name="createContactMech"/>
+        <call-service service-name="createContactMechOfbiz" in-map-name="createContactMech">
+            <result-to-result result-name="contactMechId" service-result-name="contactMechId"/>
+        </call-service>
+        
+    </simple-method>
+
+</simple-methods>
\ No newline at end of file


Property changes on: trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/ContactMechServices.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Added: trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/PaymentMethodServices.xml
===================================================================
--- trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/PaymentMethodServices.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/PaymentMethodServices.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    $Id: $
+    
+    Copyright 2001-2006 The Apache Software Foundation
+    
+    Licensed 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://www.ofbiz.org/dtds/simple-methods.xsd">
+
+    <!-- ================================================================ -->
+    <!-- Opentravelsystem Payment Method Services -->
+    <!-- ================================================================ -->
+    
+    <simple-method method-name="createEftAccount" short-description="--Add a payment nethod with the invoice prefix--">
+        <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false" use-cache="true">
+            <field-map field-name="partyId" env-name="parameters.userLogin.partyId"/>
+        </entity-one>
+        <if-not-empty field-name="partyAcctgPreference">
+            <check-permission permission="OPENTRAVELSYSTEM" action="_RW">
+                <alt-permission permission="${parameters.userLogin.partyId}" action="_RW"/>
+                <fail-message message="Security Error: to update you need RW access to &quot;${parameters.partyId}&quot; in the &quot;OPENTRAVELSYSTEM&quot;"/>
+            </check-permission>        
+            <check-errors/>
+            
+            <!-- create id using the invoice prefix -->
+            <sequenced-id-to-env sequence-name="${partyAcctgPreference.invoiceIdPrefix}PaymentMethod" env-name="nextPaymentMethodId"/>
+            <set field="parameters.paymentMethodId" value="${partyAcctgPreference.invoiceIdPrefix}${nextPaymentMethodId}"/>
+        </if-not-empty>
+        <!-- call original ofbiz service with preset paymentId -->
+        <set-service-fields service-name="createEftAccountOfbiz" map-name="parameters" to-map-name="createPaymentMethod"/>
+        <call-service service-name="createEftAccountOfbiz" in-map-name="createPaymentMethod">
+            <result-to-result result-name="paymentMethodId" service-result-name="paymentMethodId"/>
+        </call-service>
+        
+    </simple-method>
+    
+    <simple-method method-name="createCreditCard" short-description="--Add a creditcard with the invoice prefix--">
+        <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false" use-cache="true">
+            <field-map field-name="partyId" env-name="parameters.userLogin.partyId"/>
+        </entity-one>
+        <if-not-empty field-name="partyAcctgPreference">
+            <check-permission permission="OPENTRAVELSYSTEM" action="_RW">
+                <alt-permission permission="${parameters.userLogin.partyId}" action="_RW"/>
+                <fail-message message="Security Error: to update you need RW access to &quot;${parameters.partyId}&quot; in the &quot;OPENTRAVELSYSTEM&quot;"/>
+            </check-permission>        
+            <check-errors/>
+            
+            <!-- create id using the invoice prefix -->
+            <sequenced-id-to-env sequence-name="${partyAcctgPreference.invoiceIdPrefix}PaymentMethod" env-name="nextPaymentMethodId"/>
+            <set field="parameters.paymentMethodId" value="${partyAcctgPreference.invoiceIdPrefix}${nextPaymentMethodId}"/>
+        </if-not-empty>
+        <!-- call original ofbiz service with preset paymentId -->
+        <set-service-fields service-name="createCreditCardOfbiz" map-name="parameters" to-map-name="createPaymentMethod"/>
+        <call-service service-name="createCreditCardOfbiz" in-map-name="createPaymentMethod">
+            <result-to-result result-name="paymentMethodId" service-result-name="paymentMethodId"/>
+        </call-service>
+        
+    </simple-method>
+    
+    <simple-method method-name="createGiftCard" short-description="--Add a payment nethod with the invoice prefix--">
+        <entity-one entity-name="PartyAcctgPreference" value-name="partyAcctgPreference" auto-field-map="false" use-cache="true">
+            <field-map field-name="partyId" env-name="parameters.userLogin.partyId"/>
+        </entity-one>
+        <if-not-empty field-name="partyAcctgPreference">
+            <check-permission permission="OPENTRAVELSYSTEM" action="_RW">
+                <alt-permission permission="${parameters.userLogin.partyId}" action="_RW"/>
+                <fail-message message="Security Error: to update you need RW access to &quot;${parameters.partyId}&quot; in the &quot;OPENTRAVELSYSTEM&quot;"/>
+            </check-permission>        
+            <check-errors/>
+            
+            <!-- create id using the invoice prefix -->
+            <sequenced-id-to-env sequence-name="${partyAcctgPreference.invoiceIdPrefix}PaymentMethod" env-name="nextPaymentMethodId"/>
+            <set field="parameters.paymentMethodId" value="${partyAcctgPreference.invoiceIdPrefix}${nextPaymentMethodId}"/>
+        </if-not-empty>
+        <!-- call original ofbiz service with preset paymentId -->
+        <set-service-fields service-name="createGiftCardOfbiz" map-name="parameters" to-map-name="createPaymentMethod"/>
+        <call-service service-name="createGiftCardOfbiz" in-map-name="createPaymentMethod">
+            <result-to-result result-name="paymentMethodId" service-result-name="paymentMethodId"/>
+        </call-service>
+        
+    </simple-method>
+    
+</simple-methods>
\ No newline at end of file


Property changes on: trunk/specialized/opentravelsystem/script/org/ofbiz/opentravelsystem/PaymentMethodServices.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Modified: trunk/specialized/opentravelsystem/servicedef/services.xml
===================================================================
--- trunk/specialized/opentravelsystem/servicedef/services.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/servicedef/services.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -487,26 +487,117 @@
         <override name="contactListTypeId" optional="false"/>
         <override name="contactListName" optional="false"/>
     </service>
-    <!--service name="updatePaymentApplication" default-entity-name="PaymentApplication" engine="simple"
-        location="org/ofbiz/opentravelsystem/InvoiceServices.xml" invoke="updatePaymentApplication">
-        <description>
-            Apply a payment to a Invoice, create/update paymentApplication records, modified version, will apply
-            the maximum amount when no amount is supplied.
-        </description>
-        <auto-attributes mode="IN" include="pk" optional="true"/>
-        <auto-attributes mode="IN" include="nonpk" optional="true"/>
-        <attribute name="invoiceProcessing" type="String" mode="IN" optional="true"/>
-        <override name="paymentId" optional="false"/>        
+
+    <service name="createGiftCard" engine="simple"
+        location="org/ofbiz/opentravelsystem/PaymentMethodServices.xml" invoke="createGiftCard" auth="true">
+        <description>Create GiftCard</description>
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="cardNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="pinNumber" type="String" mode="IN" optional="true"/>
+        <attribute name="expireDate" type="String" mode="IN" optional="true"/>
+        <attribute name="expMonth" type="String" mode="IN" optional="true"/>
+        <attribute name="expYear" type="String" mode="IN" optional="true"/>
+        <attribute name="paymentMethodId" type="String" mode="OUT" optional="true"/>
     </service>
-    <service name="updatePaymentApplicationOfbiz" default-entity-name="PaymentApplication" engine="java"
-        location="org.ofbiz.accounting.invoice.InvoiceServices" invoke="updatePaymentApplication">
-        <description>
-            Apply a payment to a Invoice, create/update paymentApplication records
-        </description>
-        <auto-attributes mode="IN" include="pk" optional="true"/>
-        <auto-attributes mode="IN" include="nonpk" optional="true"/>
-        <attribute name="invoiceProcessing" type="String" mode="IN" optional="true"/>
-        <override name="paymentId" optional="false"/>        
-    </service-->
     
+    <service name="createGiftCardOfbiz" engine="java"
+        location="org.ofbiz.accounting.payment.PaymentMethodServices" invoke="createGiftCard" auth="true">
+        <description>Create GiftCard</description>
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="cardNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="pinNumber" type="String" mode="IN" optional="true"/>
+        <attribute name="expireDate" type="String" mode="IN" optional="true"/>
+        <attribute name="expMonth" type="String" mode="IN" optional="true"/>
+        <attribute name="expYear" type="String" mode="IN" optional="true"/>
+        <attribute name="paymentMethodId" type="String" mode="INOUT" optional="true"/>
+    </service>
+    
+    <service name="createEftAccount" engine="simple"
+        location="org/ofbiz/opentravelsystem/PaymentMethodServices.xml" invoke="createEftAccount" auth="true">
+        <description>Create EftAccount</description>
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="bankName" type="String" mode="IN" optional="false"/>
+        <attribute name="routingNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="accountType" type="String" mode="IN" optional="false"/>
+        <attribute name="accountNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="nameOnAccount" type="String" mode="IN" optional="false"/>
+        <attribute name="companyNameOnAccount" type="String" mode="IN" optional="true"/>
+        <attribute name="contactMechId" type="String" mode="IN" optional="true"/>
+        <attribute name="paymentMethodId" type="String" mode="INOUT" optional="true"/>
+    </service>
+    
+    <service name="createEftAccountOfbiz" engine="java"
+        location="org.ofbiz.accounting.payment.PaymentMethodServices" invoke="createEftAccount" auth="true">
+        <description>Create EftAccount</description>
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="bankName" type="String" mode="IN" optional="false"/>
+        <attribute name="routingNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="accountType" type="String" mode="IN" optional="false"/>
+        <attribute name="accountNumber" type="String" mode="IN" optional="false"/>
+        <attribute name="nameOnAccount" type="String" mode="IN" optional="false"/>
+        <attribute name="companyNameOnAccount" type="String" mode="IN" optional="true"/>
+        <attribute name="contactMechId" type="String" mode="IN" optional="true"/>
+        <attribute name="paymentMethodId" type="String" mode="INOUT" optional="true"/>
+    </service>
+    
+    <service name="createCreditCard" default-entity-name="CreditCard" engine="simple"
+        location="org/ofbiz/opentravelsystem/PaymentMethodServices.xml" invoke="createCreditCard" auth="true">
+        <description>Create CreditCard</description>
+        <auto-attributes include="pk" mode="OUT" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <!-- these three fields are for updating on the PaymentMethod -->
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <!-- these two will be assembled into a expireDate by buildCcExpireDate on an ECA if needed -->
+        <attribute name="expMonth" type="String" mode="IN" optional="true"/>
+        <attribute name="expYear" type="String" mode="IN" optional="true"/>
+        <override name="firstNameOnCard" optional="false"/>
+        <override name="lastNameOnCard" optional="false"/>
+        <override name="cardType" optional="false"/>
+        <override name="cardNumber" optional="false"/>
+        <override name="expireDate" optional="false"/>
+    </service>
+    
+    <service name="createCreditCardOfbiz" default-entity-name="CreditCard" engine="java"
+        location="org.ofbiz.accounting.payment.PaymentMethodServices" invoke="createCreditCard" auth="true">
+        <description>Create CreditCard</description>
+        <auto-attributes include="pk" mode="INOUT" optional="true"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <!-- these three fields are for updating on the PaymentMethod -->
+        <attribute name="partyId" type="String" mode="IN" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="thruDate" type="Timestamp" mode="IN" optional="true"/>
+        <!-- these two will be assembled into a expireDate by buildCcExpireDate on an ECA if needed -->
+        <attribute name="expMonth" type="String" mode="IN" optional="true"/>
+        <attribute name="expYear" type="String" mode="IN" optional="true"/>
+        <override name="firstNameOnCard" optional="false"/>
+        <override name="lastNameOnCard" optional="false"/>
+        <override name="cardType" optional="false"/>
+        <override name="cardNumber" optional="false"/>
+        <override name="expireDate" optional="false"/>
+    </service>
+
+    <service name="createContactMech" engine="simple"
+        location="org/ofbiz/opentravelsystem/ContactMechServices.xml" invoke="createContactMech" auth="true">
+        <description>Create a ContactMech</description>
+        <auto-attributes entity-name="ContactMech" include="nonpk" mode="IN" optional="false"/>
+        <auto-attributes entity-name="ContactMech" include="pk" mode="OUT" optional="false"/>
+        <override name="infoString" optional="true"/>
+    </service>
+    <service name="createContactMechOfbiz" engine="simple"
+        location="org/ofbiz/party/contact/ContactMechServices.xml" invoke="createContactMech" auth="true">
+        <description>Create a ContactMech</description>
+        <auto-attributes entity-name="ContactMech" include="nonpk" mode="IN" optional="false"/>
+        <auto-attributes entity-name="ContactMech" include="pk" mode="INOUT" optional="true"/>
+        <override name="infoString" optional="true"/>
+    </service>
 </services>

Modified: trunk/specialized/opentravelsystem/src/org/ofbiz/opentravelsystem/otsUtils.java
===================================================================
--- trunk/specialized/opentravelsystem/src/org/ofbiz/opentravelsystem/otsUtils.java	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/src/org/ofbiz/opentravelsystem/otsUtils.java	2006-06-01 07:51:34 UTC (rev 7727)
@@ -76,25 +76,95 @@
     public static void explode(String topEntityName, String topEntityId,  boolean xmlWrite0, String child1EntityName, boolean xmlWrite1, String child2EntityName, boolean xmlWrite2, String child3EntityName, boolean xmlWrite3, String child4EntityName, boolean xmlWrite4, PrintWriter writer )	{
         explode(  topEntityName,  topEntityId, xmlWrite0, child1EntityName, xmlWrite1, child2EntityName,  xmlWrite2, child3EntityName,  xmlWrite3,child4EntityName,  xmlWrite4, null, true, writer);
     }
-    public static void explode(String topEntityName, String topEntityId, String child1EntityName, String child2EntityName,String child3EntityName,String child4EntityName, String child5EntityName, PrintWriter writer )	{
-        explode(topEntityName,  topEntityId, true,  child1EntityName, true,child2EntityName,  true,child3EntityName, true, child4EntityName, true, child5EntityName, true, writer);
+    // all no entityId and no ignore
+    public static void explode(String topEntityName, String topEntityId, 
+            String child1EntityName,
+            String child2EntityName,
+            String child3EntityName,
+            String child4EntityName, 
+            String child5EntityName, PrintWriter writer )    {
+        explode(topEntityName,  topEntityId, true,  
+                child1EntityName, true,
+                child2EntityName, true,
+                child3EntityName, true, 
+                child4EntityName, true, 
+                child5EntityName, true, writer);
     }
+    // all, no entity id
+    public static void explode(String topEntityName, String topEntityId, boolean xmlWrite0, 
+            String child1EntityName, boolean xmlWrite1, 
+            String child2EntityName, boolean xmlWrite2,
+            String child3EntityName, boolean xmlWrite3,
+            String child4EntityName, boolean xmlWrite4,
+            String child5EntityName, boolean xmlWrite5, PrintWriter writer)    {
+        explode(topEntityName,  topEntityId, xmlWrite0, 
+                child1EntityName, null, xmlWrite1, 
+                child2EntityName, null, xmlWrite2, 
+                child3EntityName, null, xmlWrite3, 
+                child4EntityName, null, xmlWrite4, 
+                child5EntityName, null, xmlWrite5, writer);
+    }
+    // all, no ignore
+    public static void explode(String topEntityName, String topEntityId, 
+            String child1EntityName, String child1EntityId, 
+            String child2EntityName, String child2EntityId,
+            String child3EntityName, String child3EntityId,
+            String child4EntityName, String child4EntityId, 
+            String child5EntityName, String child5EntityId, PrintWriter writer)  {
+        explode(topEntityName,  topEntityId, true, 
+                child1EntityName, null, true, 
+                child2EntityName, null, true, 
+                child3EntityName, null, true, 
+                child4EntityName, null, true, 
+                child5EntityName, null, true, writer);
+    }
+    // 4, no ignore
+    public static void explode(String topEntityName, String topEntityId, 
+            String child1EntityName, String child1EntityId, 
+            String child2EntityName, String child2EntityId,
+            String child3EntityName, String child3EntityId,
+            String child4EntityName, String child4EntityId, 
+            PrintWriter writer)  {
+        explode(topEntityName,  topEntityId, true, 
+                child1EntityName, child1EntityId, true, 
+                child2EntityName, child2EntityId, true, 
+                child3EntityName, child3EntityId, true, 
+                child4EntityName, child4EntityId, true, 
+                null, null, false, writer);
+    }
+    
    /**
     * This routine will export from the data base in xml format if the xmlWrite flag is true.
     * If false then no xml file will be generated but a list will be returned of the lowest level provided
     * Input is a path through the database of related entities.
     * @param topEntityName
     * @param topEntityId
+    * @param xmlWrite0
     * @param child1EntityName
+    * @param child1EntityId
+    * @param xmlWrite1
     * @param child2EntityName
+    * @param child2EntityId
+    * @param xmlWrite2
     * @param child3EntityName
+    * @param child3EntityId
+    * @param xmlWrite3
     * @param child4EntityName
+    * @param child4EntityId
+    * @param xmlWrite4
     * @param child5EntityName
+    * @param child5EntityId
+    * @param xmlWrite5
     * @param writer
     * @param xmlWrite
     * @return
     */
-    private static void explode(String topEntityName, String topEntityId, boolean xmlWrite0, String child1EntityName, boolean xmlWrite1, String child2EntityName, boolean xmlWrite2,String child3EntityName, boolean xmlWrite3,String child4EntityName,  boolean xmlWrite4,String child5EntityName, boolean xmlWrite5, PrintWriter writer)	{
+    private static void explode(String topEntityName, String topEntityId, boolean xmlWrite0, 
+            String child1EntityName, String child1EntityId, boolean xmlWrite1, 
+            String child2EntityName, String child2EntityId, boolean xmlWrite2,
+            String child3EntityName, String child3EntityId, boolean xmlWrite3,
+            String child4EntityName, String child4EntityId, boolean xmlWrite4,
+            String child5EntityName, String child5EntityId, boolean xmlWrite5, PrintWriter writer)	{
     	try {
     		Debug.logInfo("==processing topEntity:" + topEntityName,module);
     		List topEntityList = delegator.findByLike(topEntityName,UtilMisc.toMap(topEntityId,prefix.concat("%")),UtilMisc.toList(topEntityId));
@@ -104,31 +174,51 @@
     				GenericValue topEntityListItem = (GenericValue) t.next();
     				if (xmlWrite0) { topEntityListItem.writeXmlText(writer,""); numberWritten++; }
     				if (child1EntityName != null)	{
-    					List children1 = topEntityListItem.getRelated(child1EntityName);
+                        List children1 = null;
+                        if (child1EntityId != null)
+                            children1 = topEntityListItem.getRelatedByAnd(child1EntityName, UtilMisc.toMap(child1EntityId,prefix.concat("%")));
+                        else
+                            children1 = topEntityListItem.getRelated(child1EntityName);
     					if (children1 != null && children1.size() > 0)	{
     						Iterator psr1 = children1.iterator();
     						while (psr1.hasNext())	{
     							GenericValue child1 = (GenericValue) psr1.next();
     							if (child2EntityName != null)	{
-    								List children2 =  child1.getRelated(child2EntityName);
+                                    List children2 = null;
+                                    if (child2EntityId != null)
+                                        children2 = child1.getRelatedByAnd(child2EntityName, UtilMisc.toMap(child2EntityId,prefix.concat("%")));
+                                    else
+                                        children2 = child1.getRelated(child2EntityName);
     								if (children2 != null && children2.size() > 0)	{
     									Iterator psr2 = children2.iterator();
     									while (psr2.hasNext())	{
     										GenericValue child2 = (GenericValue) psr2.next();
     										if (child3EntityName != null)	{
-    											List children3 = child2.getRelated(child3EntityName);
+                                                List children3 = null;
+                                                if (child3EntityId != null)
+                                                    children3 = child2.getRelatedByAnd(child3EntityName, UtilMisc.toMap(child3EntityId,prefix.concat("%")));
+                                                else
+                                                    children3 = child2.getRelated(child3EntityName);
     											if (children3 != null && children3.size() > 0)	{
     												Iterator psr3 = children3.iterator();
     												while (psr3.hasNext())	{
     													GenericValue child3 = (GenericValue) psr3.next();
     													if (child4EntityName != null)	{
-    														List children4 = child3.getRelated(child4EntityName);
+                                                            List children4 = null;
+                                                            if (child4EntityId != null)
+                                                                children4 = child3.getRelatedByAnd(child4EntityName, UtilMisc.toMap(child4EntityId,prefix.concat("%")));
+                                                            else
+                                                                children4 = child3.getRelated(child4EntityName);
     														if (children4 != null && children4.size() > 0)	{
     															Iterator psr4 = children4.iterator();
     															while (psr4.hasNext())	{
     																GenericValue child4 = (GenericValue) psr4.next();
     																if (child5EntityName != null)	{
-    																	List children5 = child4.getRelated(child5EntityName);
+                                                                        List children5 = null;
+                                                                        if (child5EntityId != null)
+                                                                            children5 = child4.getRelatedByAnd(child5EntityName, UtilMisc.toMap(child5EntityId,prefix.concat("%")));
+                                                                        else
+                                                                            children5 = child4.getRelated(child5EntityName);
     																	if (children5 != null && children5.size() > 0)	{
     																		Iterator psr5 = children5.iterator();
     																		while (psr5.hasNext())	{
@@ -228,6 +318,162 @@
         
         prefix = productStoreId;	// all main entities ID's are prefixed with this prefix
 
+        // create party table first without the created/modified by userlogin fields
+        try {
+            List parties = delegator.findByLike("Party", UtilMisc.toMap("partyId", prefix.concat("%")));
+            Iterator t = parties.iterator();
+            while(t.hasNext()) {
+                GenericValue party = (GenericValue) t.next();
+                party.remove("createdByUserLogin");
+                party.remove("lastModifiedByUserLogin");
+                party.writeXmlText(writer,""); numberWritten++;
+            }
+        } catch (GenericEntityException e) { Debug.logError(e, "Problems parties file", module);}
+        
+        
+        // get all parties
+        explode("Party", "partyId",
+                "UserLogin",null, 
+                "UserLoginSecurityGroup", "groupId", 
+                "SecurityGroupPermission", null, 
+                "SecurityPermission", "permissionId", 
+                writer);
+        explode("Party", "partyId", false, "PartyGroup", true, writer);
+        explode("Party", "partyId", false, "PartyRole",true, writer);
+        
+        // contact mechanisms
+        explode("ContactMech", "contactMechId", "PartyContactMech", writer);
+        explode("PostalAddress", "contactMechId", writer);
+        explode("TelecomNumber", "contactMechId", writer);
+        
+        // payment methods
+        explode("PaymentMethod", "paymentMethodId", writer);
+        explode("EftAccount", "paymentMethodId", writer);
+        explode("CreditCard", "paymentMethodId", writer);
+        explode("GiftCard", "paymentMethodId", writer);
+
+        // specifics for Anet
+        if (prefix.equals("anet")) {
+            
+            try {
+                List cmPartys = delegator.findByLike("PartyContactMech", UtilMisc.toMap("partyId", prefix.concat("%")));
+                if (cmPartys != null && cmPartys.size() > 0) {
+                    Iterator t = cmPartys.iterator();
+                    while(t.hasNext()) {
+                        GenericValue cmParty = (GenericValue) t.next();
+                        GenericValue cm = (GenericValue) delegator.findByPrimaryKey("ContactMech", UtilMisc.toMap("contactMechId", cmParty.getString("contactMechId")));
+                        if (cm != null) { cm.writeXmlText(writer,"");numberWritten++; }
+                        cm = (GenericValue) delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", cmParty.getString("contactMechId")));
+                        if (cm != null) { cm.writeXmlText(writer,"");numberWritten++; }
+                        cm = (GenericValue) delegator.findByPrimaryKey("TelecomNumber", UtilMisc.toMap("contactMechId", cmParty.getString("contactMechId")));
+                        if (cm != null) { cm.writeXmlText(writer,"");numberWritten++; }
+                        cmParty.writeXmlText(writer,"");
+                    }
+                }
+                
+                List pms = delegator.findByLike("PaymentMethod", UtilMisc.toMap("partyId", prefix.concat("%")));
+                if (pms != null && pms.size() > 0) {
+                    Iterator t = pms.iterator();
+                    while(t.hasNext()) {
+                        GenericValue pm = (GenericValue) t.next();
+                        String pmId = pm.getString("paymentMethodId");
+                        pm.writeXmlText(writer,"");numberWritten++;
+                        GenericValue cc = delegator.findByPrimaryKey("EftAccount",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                        cc = delegator.findByPrimaryKey("CreditCard",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                    }
+                }
+                
+                GenericValue party = delegator.findByPrimaryKey("Party",UtilMisc.toMap("partyId","BelastingDienst"));
+                party.writeXmlText(writer,""); numberWritten++;
+                party = delegator.findByPrimaryKey("TaxAuthority",UtilMisc.toMap("taxAuthPartyId","BelastingDienst","taxAuthGeoId", "NLD"));
+                party.writeXmlText(writer,""); numberWritten++;
+                party = delegator.findByPrimaryKey("PartyGroup",UtilMisc.toMap("partyId","BelastingDienst"));
+                party.writeXmlText(writer,""); numberWritten++;
+                List roles = delegator.findByAnd("PartyRole",UtilMisc.toMap("partyId", "BelastingDienst"));
+                if (roles != null && roles.size() > 0) {
+                    Iterator t = roles.iterator();
+                    while(t.hasNext()) {
+                        GenericValue role = (GenericValue) t.next();
+                        role.writeXmlText(writer,""); numberWritten++;
+                    }
+                }
+                party = delegator.findByPrimaryKey("Party",UtilMisc.toMap("partyId","Stulemeijer"));
+                party.writeXmlText(writer,""); numberWritten++;
+                party = delegator.findByPrimaryKey("Person",UtilMisc.toMap("partyId","Stulemeijer"));
+                party.writeXmlText(writer,""); numberWritten++;
+                roles = delegator.findByAnd("PartyRole",UtilMisc.toMap("partyId", "Stulemeijer"));
+                if (roles != null && roles.size() > 0) {
+                    Iterator t = roles.iterator();
+                    while(t.hasNext()) {
+                        GenericValue role = (GenericValue) t.next();
+                        role.writeXmlText(writer,""); numberWritten++;
+                    }
+                }
+                pms = delegator.findByAnd("PaymentMethod", UtilMisc.toMap("partyId","Stulemeijer"));
+                if (pms != null && pms.size() > 0) {
+                    Iterator t = pms.iterator();
+                    while(t.hasNext()) {
+                        GenericValue pm = (GenericValue) t.next();
+                        String pmId = pm.getString("paymentMethodId");
+                        pm.writeXmlText(writer,"");numberWritten++;
+                        GenericValue cc = delegator.findByPrimaryKey("EftAccount",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                        cc = delegator.findByPrimaryKey("CreditCard",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                    }
+                }
+                party = delegator.findByPrimaryKey("Party",UtilMisc.toMap("partyId","Sidin"));
+                party.writeXmlText(writer,""); numberWritten++;
+                party = delegator.findByPrimaryKey("Person",UtilMisc.toMap("partyId","Sidin"));
+                party.writeXmlText(writer,""); numberWritten++;
+                roles = delegator.findByAnd("PartyRole",UtilMisc.toMap("partyId", "Sidin"));
+                if (roles != null && roles.size() > 0) {
+                    Iterator t = roles.iterator();
+                    while(t.hasNext()) {
+                        GenericValue role = (GenericValue) t.next();
+                        role.writeXmlText(writer,""); numberWritten++;
+                    }
+                }
+                pms = delegator.findByAnd("PaymentMethod", UtilMisc.toMap("partyId","Sidin"));
+                if (pms != null && pms.size() > 0) {
+                    Iterator t = pms.iterator();
+                    while(t.hasNext()) {
+                        GenericValue pm = (GenericValue) t.next();
+                        String pmId = pm.getString("paymentMethodId");
+                        pm.writeXmlText(writer,"");numberWritten++;
+                        GenericValue cc = delegator.findByPrimaryKey("EftAccount",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                        cc = delegator.findByPrimaryKey("CreditCard",UtilMisc.toMap("paymentMethodId", pmId));
+                        if (cc != null) {
+                            cc.writeXmlText(writer,"");numberWritten++;
+                        }
+                    }
+                }
+                
+            } catch (GenericEntityException e) { Debug.logError(e, "Problems reading extra parties for A-NeT", module);}
+        }
+
+
+        // tax tables
+        explode("TaxAuthority","taxAuthPartyId",writer);
+        explode("PartyTaxAuthInfo","partyId",writer);
+        
+        // security
+        explode("SecurityGroup", "groupId", "SecurityGroupPermission", writer);
+        explode("Party", "partyId", false, "ToPartyRelationship", true, writer);
+
         // store
         GenericValue productStore = null;
         try{ productStore =delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId",productStoreId));
@@ -262,18 +508,9 @@
         // get all fixed assets and link to product
         explode("FixedAsset","fixedAssetId", "FixedAssetProduct", writer);
 
-        // security
-        explode("SecurityGroup", "groupId", "SecurityGroupPermission", writer);
-        
-        // get all parties
-        explode("Party", "partyId", "PartyGroup", writer);
-        explode("Party", "partyId", false, "PartyRole",true, writer);
-        explode("Party", "partyId", false, "UserLogin", true, "UserLoginSecurityGroup", true, writer);
-        explode("Party", "partyId", false, "ToPartyRelationship", true, writer);
-
         // get all content, resource and electronic text
         explode("Content","contentId",false, "DataResource", true, "ElectronicText", true,  writer);
-        explode("Content","contentId", writer);
+        explode("Content","contentId","FromContentAssoc", writer);
 
         // invoices/payments/applications
         explode("PartyAcctgPreference", "partyId", writer);
@@ -281,7 +518,8 @@
         explode("Invoice", "invoiceId", "InvoiceItem", writer);
         explode("Invoice", "invoiceId",false, "InvoiceStatus", true, writer);
         explode("Invoice", "invoiceId",false, "InvoiceRole", true, writer);
-        explode("Payment", "paymentId", "PaymentApplication", writer);
+        explode("Payment", "paymentId", writer);
+        explode("Payment", "paymentId", false, "PaymentApplication",true, writer);
 
         explode("GlAccountOrganization", "organizationPartyId", writer);
         explode("PaymentMethodTypeGlAccount", "organizationPartyId", writer);
@@ -293,6 +531,9 @@
         explode("OrderHeader","orderId", "OrderItem", "orderItemPriceInfo", writer);
         explode("OrderItemBilling","orderId",  writer);
         
+        // sequence value items: SequenceValueItems
+        explode("SequenceValueItem","seqName",  writer);
+        
         writer.println("</entity-engine-xml>");
         writer.close();
         msgs.append("Unload ended normally, statistics:\n");

Modified: trunk/specialized/opentravelsystem/webapp/hotelbackend/WEB-INF/controller.xml
===================================================================
--- trunk/specialized/opentravelsystem/webapp/hotelbackend/WEB-INF/controller.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/webapp/hotelbackend/WEB-INF/controller.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -2706,6 +2706,14 @@
         <response name="error" type="view" value="SysAdminMain"/>
     </request-map>
     
+    <request-map uri="EntityImport"><security https="true" auth="true"/><response name="success" type="view" value="EntityImport"/><response name="error" type="view" value="EntityImportDir"/></request-map>
+    <request-map uri="entityImport">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="entityImport"/>
+        <response name="success" type="view" value="EntityImport"/>
+        <response name="error" type="view" value="EntityImport"/>
+    </request-map>
+
     <!-- ================ Administratvie Requests ================ -->
     <request-map uri="AdminMain">
         <security https="true" auth="true"/>
@@ -3340,6 +3348,7 @@
     <view-map name="AccountActivitiesDetail" type="screen" page="component://accounting/widget/AccountingScreens.xml#AccountActivitiesDetail"/>
     <!-- System administrative pages -->
     <view-map name="SysAdminMain" type="screen" page="component://opentravelsystem/webapp/hotelbackend/screens/SysAdminScreens.xml#SysAdminMain"/>
+    <view-map name="EntityImport" page="component://webtools/widget/EntityScreens.xml#EntityImport" type="screen"/>
     <!-- Accounting administrative pages -->
     <view-map name="AdminMain" type="screen" page="component://accounting/widget/AdminScreens.xml#AdminMain"/>
     <view-map name="PartyAcctgPreference" type="screen" page="component://accounting/widget/AdminScreens.xml#PartyAcctgPreference"/>

Modified: trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/CommonScreens.xml
===================================================================
--- trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/CommonScreens.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/CommonScreens.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -276,7 +276,19 @@
             </fail-widgets>
         </section>
     </screen>
+    <screen name="CommonWebtoolsDecorator">
+        <section>
+            <widgets>
+                <decorator-screen name="CommonSysAdminDecorator">
+                    <decorator-section name="body">
+                        <decorator-section-include name="body"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     
+    
     <screen name="CommonContactListDecorator">
         <section>
             <condition>

Modified: trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/Menus.xml
===================================================================
--- trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/Menus.xml	2006-06-01 05:46:38 UTC (rev 7726)
+++ trunk/specialized/opentravelsystem/webapp/hotelbackend/screens/Menus.xml	2006-06-01 07:51:34 UTC (rev 7727)
@@ -151,8 +151,8 @@
         default-title-style="appButton" default-tooltip-style="tabletext" default-widget-style="appButton" 
         menu-container-style="appContainer" orientation="horizontal" type="simple">
         <!--menu-item name="intro" title="Intro"><link target="intro"/></menu-item-->
-        <menu-item name="download" title="Download"><link target="download"/></menu-item>
-        <!--menu-item name="upLoad"><link target="upload"/></menu-item-->
+        <menu-item name="download" title="Download"><link target="sysAdminMain"/></menu-item>
+        <menu-item name="upLoad" title="Upload"><link target="entityImport"/></menu-item>
         <!--menu-item name="webtools" title="Webtools"><link target="/webtools"/></menu-item-->
     </menu>
     <menu name="dataExchangeTabBar" default-menu-item-name="ContactList" default-selected-style="tabButtonSelected" 



More information about the Svn mailing list