You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ri...@apache.org on 2006/05/23 20:41:56 UTC

svn commit: r408980 - in /incubator/tuscany/java/sampleapps/bigbank: account/src/main/java/bigbank/account/services/account/ account/src/main/java/bigbank/account/services/accountdata/ account/src/main/java/bigbank/account/services/accountdb/ account/s...

Author: rineholt
Date: Tue May 23 11:41:55 2006
New Revision: 408980

URL: http://svn.apache.org/viewvc?rev=408980&view=rev
Log:
TUSCANY-270
http://issues.apache.org/jira/browse/TUSCANY-270

Added:
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/accountLog.jsp
Modified:
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/DasAccountConfiguration.xml
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/sca.module
    incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/wsdl/AccountService.wsdl
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld
    incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/account/AccountServiceImpl.java Tue May 23 11:41:55 2006
@@ -34,6 +34,7 @@
 import bigbank.account.services.stockquote.StockQuote;
 import bigbank.account.services.stockquote.StockQuoteService;
 
+import com.bigbank.account.AccountLog;
 import com.bigbank.account.AccountReport;
 import com.bigbank.account.AccountService;
 import com.bigbank.account.AccountSummary;
@@ -263,4 +264,9 @@
             throw new RemoteException(e.getClass() + " " + e.getMessage(), e);
         }
     }
+    
+    public AccountLog getAccountLog(final int customerID) throws RemoteException {
+        return accountDataService.getAccountLog(customerID);
+    }
+    
 }

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataService.java Tue May 23 11:41:55 2006
@@ -73,5 +73,11 @@
      public com.bigbank.account.AccountReport getAccountReport(
      int param19) throws java.rmi.RemoteException;
     
+     /**
+      * Auto generated method signatures
+      * @param param0
+      */
+      public com.bigbank.account.AccountLog getAccountLog(
+      int param0) throws java.rmi.RemoteException;
 
    }

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceDASImpl.java Tue May 23 11:41:55 2006
@@ -20,7 +20,9 @@
 import java.rmi.RemoteException;
 import java.sql.Connection;
 import java.sql.DriverManager;
+import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.sql.Statement;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -46,8 +48,8 @@
 import commonj.sdo.DataObject;
 import commonj.sdo.helper.TypeHelper;
 
-@Service(AccountDataService.class)
-public class AccountDataServiceDASImpl implements AccountDataService {
+@Service(CustomerIdService.class)
+public class AccountDataServiceDASImpl implements CustomerIdService {  // TODO fix this!
 
     static public String dbDirectory = null;
 
@@ -290,7 +292,7 @@
 
                     stock.setQuantity(newQuatity);
                 }
-
+                return stock;
             }
 
             return null;
@@ -393,5 +395,42 @@
 
         }
 
+    }
+
+    public int getCustomerIdByPurchaseLotNumber(int purchaseLotNumber) throws RemoteException {
+        
+        return queryCustomerId("select id from stocks where purchaseLotNumber = " + purchaseLotNumber);
+    }
+    
+    public int getCustomerIdByAccount(String account) throws RemoteException {
+        
+        return queryCustomerId("select id from accounts where accountNumber = '" + account + "'");
+    }
+    
+    private int queryCustomerId(String query) throws RemoteException {
+        
+        try {
+            Connection conn = getConnection();
+
+            Statement s = conn.createStatement();
+            
+            ResultSet rs = s.executeQuery(query);
+            int id = -1;
+            if (rs.next()) {
+                id = rs.getInt("id");
+            }
+
+            conn.commit();
+
+            rs.close();
+            s.close();
+            conn.close();
+
+            return id;
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RemoteException(e.getClass().getName() ,e);
+        }        
     }
 }

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/AccountDataServiceImpl.java Tue May 23 11:41:55 2006
@@ -22,6 +22,7 @@
 import org.osoa.sca.annotations.Service;
 
 import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountLog;
 import com.bigbank.account.AccountReport;
 import com.bigbank.account.AccountSummary;
 import com.bigbank.account.CustomerProfileData;
@@ -95,5 +96,9 @@
     public float withdraw(String param16, float param17) throws RemoteException {
         // TODO Auto-generated method stub
         return 0;
+    }
+    
+    public AccountLog getAccountLog(final int customerID) throws RemoteException {
+        throw new RemoteException("This method should not be called");
     }
 }

Added: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdata/CustomerIdService.java Tue May 23 11:41:55 2006
@@ -0,0 +1,94 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.account.services.accountdata;
+
+import java.rmi.RemoteException;
+
+/**
+ * This interface allows access to a customer's id from the data service.
+ */
+public interface CustomerIdService {
+    
+    /*
+     * Return -1 if purchaseLotNumber not found
+     */
+    public int getCustomerIdByPurchaseLotNumber(int purchaseLotNumber) throws RemoteException;
+    
+    /*
+     * Return -1 if account not found
+     */
+    public int getCustomerIdByAccount(String account) throws RemoteException;
+
+    // TODO (isilval) Fix this !!!
+    // Apparently, configuration can't deal with extends so I am adding the contents of AccountDataService here
+    
+    /**
+     * Auto generated method signatures
+     * @param param0* @param param1* @param param2
+     */
+     public com.bigbank.account.StockSummary purchaseStock(
+     int param0,com.bigbank.account.StockSummary parm1) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param4
+     */
+     public com.bigbank.account.CustomerProfileData getCustomerProfile(
+     java.lang.String param4) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param6* @param param7
+     */
+     public float deposit(
+     java.lang.String param6,float param7) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param9* @param param10* @param param11
+     */
+     public com.bigbank.account.CustomerProfileData createAccount(
+     com.bigbank.account.CustomerProfileData param9,boolean param10,boolean param11) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param13* @param param14
+     */
+     public com.bigbank.account.StockSummary sellStock(
+     int param13,int param14) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param16* @param param17
+     */
+     public float withdraw(
+     java.lang.String param16,float param17) throws java.rmi.RemoteException;
+    
+    
+    /**
+     * Auto generated method signatures
+     * @param param19
+     */
+     public com.bigbank.account.AccountReport getAccountReport(
+     int param19) throws java.rmi.RemoteException;
+    
+}

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountdb/AccountDBInit.java Tue May 23 11:41:55 2006
@@ -44,6 +44,7 @@
 
 import bigbank.account.services.account.AccountServiceImpl;
 import bigbank.account.services.accountdata.AccountDataServiceDASImpl;
+import bigbank.account.services.accountlogger.AccountLoggerServiceImpl;
 
 import com.bigbank.account.AccountFactory;
 import com.bigbank.account.AccountSummary;
@@ -103,6 +104,7 @@
     public static void  createDB(final String location) throws Exception {
         Connection conn = null;
         AccountDataServiceDASImpl.dbDirectory = location;
+        AccountLoggerServiceImpl.dbDirectory = location;   // TODO get rid of this (isilval)
         Exception processessingException = null;
         try {
             conn = createConnection(location);
@@ -177,13 +179,15 @@
         
         
         Statement s = conn.createStatement();
-        s
-                .execute("create table customers(firstName varchar(80) NOT NULL, lastName varchar(80), address varchar(180),email varchar(40),loginID varchar(80) NOT NULL UNIQUE, password varchar(80), id int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY)");
+        s.execute("create table customers(firstName varchar(80) NOT NULL, lastName varchar(80), address varchar(180),email varchar(40),loginID varchar(80) NOT NULL UNIQUE, password varchar(80), id int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY)");
 
         s.execute("create table accounts(id int NOT NULL, accountNumber varchar(80) NOT NULL UNIQUE, accountType varchar(80), balance real )");
 
-        s
-                .execute("create table stocks(id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, purchasePrice real NOT NULL, purchaseDate TIMESTAMP, purchaseLotNumber int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY  )");
+        s.execute("create table stocks(id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, purchasePrice real NOT NULL, purchaseDate TIMESTAMP, purchaseLotNumber int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY  )");
+        
+        s.execute("create table acctLog (logSeqNo int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id int NOT NULL, accountNumber varchar(80) NOT NULL, actionType varchar(32) NOT NULL, amount real )");
+
+        s.execute("create table stockLog (logSeqNo int NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY, id int NOT NULL, Symbol varchar(8) NOT NULL, quantity int NOT NULL, actionType varchar(32) NOT NULL, purchaseLotNumber int NOT NULL )");
 
         s.close();
     }

Added: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerDataServiceImpl.java Tue May 23 11:41:55 2006
@@ -0,0 +1,125 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.account.services.accountlogger;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.CustomerProfileData;
+import com.bigbank.account.StockSummary;
+
+import bigbank.account.services.accountdata.AccountDataService;
+import bigbank.account.services.accountdata.CustomerIdService;
+
+/**
+ * This class implements the Account Data Logger service component.
+ */
+@Service(AccountDataService.class)
+public class AccountLoggerDataServiceImpl implements AccountDataService {
+    
+    private CustomerIdService accountDataService;  // TODO fix this!
+    @Reference
+    public void setAccountDataService(CustomerIdService accountDataService) {
+        this.accountDataService = accountDataService;
+    }
+
+    private AccountLoggerService accountLoggerService;
+    @Reference
+    public void setAccountLoggerService(AccountLoggerService accountLoggerService) {
+        this.accountLoggerService = accountLoggerService;
+    }
+
+    public StockSummary purchaseStock(int id, StockSummary stock) throws RemoteException {
+        accountLoggerService.logPurchaseStock(id, stock);
+
+        return accountDataService.purchaseStock(id, stock);
+    }
+
+    public CustomerProfileData getCustomerProfile(String logonID) throws RemoteException {
+        
+        return accountDataService.getCustomerProfile(logonID);
+    }
+
+    public float deposit(String account, float amount) throws RemoteException {
+        try{
+            if (!(accountDataService instanceof CustomerIdService)) {
+                throw new RemoteException("Can't use data service as customer id service");
+            }
+            int id = ((CustomerIdService)accountDataService).getCustomerIdByAccount(account);
+            // int id = accountDataService.getCustomerIdByAccount(account);
+            accountLoggerService.logDeposit(id, account, amount);
+
+            return accountDataService.deposit(account, amount);
+        } catch (RemoteException  e){
+            e.printStackTrace();
+            throw e;
+        } catch (Exception e) {
+            e.printStackTrace();
+             throw new RemoteException(e.getClass() + " " +e.getMessage(),e); 
+        }        
+    }
+
+    public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createChecking)
+        throws RemoteException {
+        
+        return accountDataService.createAccount(customerProfile, createSavings, createChecking);
+    }
+
+    public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException {
+        try{
+            int id = ((CustomerIdService)accountDataService).getCustomerIdByPurchaseLotNumber(purchaseLotNumber);
+            StockSummary ss = accountDataService.sellStock(purchaseLotNumber, quantity);
+            if (ss != null) {
+                if (!(accountDataService instanceof CustomerIdService)) {
+                    throw new RemoteException("Can't use data service as customer id service");
+                }
+                accountLoggerService.logSellStock(id, ss, quantity);
+            }
+            return ss;
+        } catch (RemoteException  e){
+            e.printStackTrace();
+            throw e;
+        } catch (Exception e) {
+            e.printStackTrace();
+             throw new RemoteException(e.getClass() + " " +e.getMessage(),e); 
+        }        
+    }
+
+    public float withdraw(String account, float amount) throws RemoteException {
+        if (!(accountDataService instanceof CustomerIdService)) {
+            throw new RemoteException("Can't use data service as customer id service");
+        }
+        int id = ((CustomerIdService)accountDataService).getCustomerIdByAccount(account);
+        // int id = accountDataService.getCustomerIdByAccount(account);
+        accountLoggerService.logWithdrawal(id, account, amount);
+
+        return accountDataService.withdraw(account, amount);
+    }
+
+    public AccountReport getAccountReport(final int customerID) throws RemoteException {
+
+        return accountDataService.getAccountReport(customerID);
+    }
+    
+    public AccountLog getAccountLog(final int customerID) throws RemoteException {
+        return accountLoggerService.getAccountLog(customerID);
+    }
+}

Added: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerService.java Tue May 23 11:41:55 2006
@@ -0,0 +1,45 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.account.services.accountlogger;
+
+import java.rmi.RemoteException;
+
+import org.osoa.sca.annotations.OneWay;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.StockSummary;
+
+/**
+ * This is the business interface of the Account Logger service component.
+ */
+public interface AccountLoggerService {
+    
+    @OneWay
+    public void logDeposit(int id, String account, float amount) throws RemoteException;
+    
+    @OneWay
+    public void logWithdrawal(int id, String account, float amount) throws RemoteException;
+    
+    @OneWay
+    public void logPurchaseStock(int id, StockSummary stock) throws RemoteException;
+    
+    @OneWay
+    public void logSellStock(int id, StockSummary stock, int quantity) throws RemoteException;
+    
+    public AccountLog getAccountLog(int id) throws RemoteException;
+
+}

Added: incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/java/bigbank/account/services/accountlogger/AccountLoggerServiceImpl.java Tue May 23 11:41:55 2006
@@ -0,0 +1,216 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.account.services.accountlogger;
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.osoa.sca.annotations.Service;
+
+import com.bigbank.account.AccountFactory;
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.DataGraphRoot;
+import com.bigbank.account.StockSummary;
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * This class implements the Account Logger service component.
+ */
+@Service(AccountLoggerService.class)
+public class AccountLoggerServiceImpl implements AccountLoggerService {
+    
+    public static final String ACCT_ACTION_TYPE_DEPOSIT = "deposit";
+    public static final String ACCT_ACTION_TYPE_WITHDRAW = "withdraw";
+    public static final String STOCK_ACTION_TYPE_PURCHASE = "purchase";
+    public static final String STOCK_ACTION_TYPE_SELL = "sell";
+
+    static public String dbDirectory = null;
+
+    protected static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+    protected static final String protocol = "jdbc:derby:";
+
+    public void logDeposit(int id, String account, float amount) throws RemoteException {
+        
+        Command insert = Command.FACTORY.createCommand("insert into acctLog (id, accountNumber, actionType, amount) values (?,?,?,?)");
+        insert.setParameterValue(1, new Integer(id));
+        insert.setParameterValue(2, account);
+        insert.setParameterValue(3, ACCT_ACTION_TYPE_DEPOSIT);
+        insert.setParameterValue(4, new Float(amount));
+
+        insert.setConnection(getConnection());
+        insert.execute();
+/*
+        performLog("insert into acctLog (id, accountNumber, actionType, amount) values (" +
+                id + ", '" + account + "', '" + ACCT_ACTION_TYPE_DEPOSIT + "', " + amount + ")"); */
+    }
+    
+    public void logWithdrawal(int id, String account, float amount) throws RemoteException {
+        
+        Command insert = Command.FACTORY.createCommand("insert into acctLog (id, accountNumber, actionType, amount) values (?,?,?,?)");
+        insert.setParameterValue(1, new Integer(id));
+        insert.setParameterValue(2, account);
+        insert.setParameterValue(3, ACCT_ACTION_TYPE_WITHDRAW);
+        insert.setParameterValue(4, new Float(amount));
+
+        insert.setConnection(getConnection());
+        insert.execute();
+        /*
+        performLog("insert into acctLog (id ,accountNumber, actionType, amount) values (" +
+                id + ", '" + account + "', '" + ACCT_ACTION_TYPE_WITHDRAW + "', " + amount + ")"); */
+    }
+    
+    public void logPurchaseStock(int id, StockSummary stock) throws RemoteException {
+        
+        Command insert = Command.FACTORY.createCommand("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (?,?,?,?,?)");
+        insert.setParameterValue(1, new Integer(id));
+        insert.setParameterValue(2, stock.getSymbol());
+        insert.setParameterValue(3, new Integer(stock.getQuantity()));
+        insert.setParameterValue(4, STOCK_ACTION_TYPE_PURCHASE);
+        insert.setParameterValue(5, new Integer(stock.getPurchaseLotNumber()));
+
+        insert.setConnection(getConnection());
+        insert.execute();
+        /*
+        performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" +
+                id + ", '" + stock.getSymbol() + "', " + stock.getQuantity() +
+                ", '" + STOCK_ACTION_TYPE_PURCHASE + ", " + stock.getPurchaseLotNumber() + ")"); */
+    }
+    
+    public void logSellStock(int id, StockSummary stock, int quantity) throws RemoteException {
+        
+        String symbol = ((stock.getSymbol()!=null)?stock.getSymbol():"null");
+        Command insert = Command.FACTORY.createCommand("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (?,?,?,?,?)");
+        insert.setParameterValue(1, new Integer(id));
+        insert.setParameterValue(2, symbol);
+        insert.setParameterValue(3, new Integer(quantity));
+        insert.setParameterValue(4, STOCK_ACTION_TYPE_SELL);
+        insert.setParameterValue(5, new Integer(stock.getPurchaseLotNumber()));
+
+        insert.setConnection(getConnection());
+        insert.execute();
+        /*
+        performLog("insert into stockLog (id, Symbol, quantity, actionType, purchaseLotNumber) values (" +
+                id + ", '" + stock.getSymbol() + "', " + quantity +
+                ", '" + STOCK_ACTION_TYPE_SELL + ", " + stock.getPurchaseLotNumber() + ")"); */
+    }
+    
+    private void performLog(String toLog) throws RemoteException {
+        
+        try {
+            Connection conn = getConnection();
+
+            Statement s = conn.createStatement();
+
+            s.execute(toLog);
+            
+            conn.commit();
+            
+            System.out.println("SN id acctNo action amount");
+            ResultSet rs = s.executeQuery("select * from acctLog");
+            while(rs.next()) {
+                System.out.println(rs.getInt("logSeqNo") + " " + rs.getInt("id") + " " + rs.getString("accountNumber") +
+                        " " + rs.getString("actionType") + " " + rs.getFloat("amount"));
+            }
+            
+            conn.commit();
+
+            System.out.println("SN Symbol qty action plot#");
+            rs = s.executeQuery("select * from stockLog");
+            while(rs.next()) {
+                System.out.println(rs.getInt("logSeqNo") + " " + rs.getString("Symbol") + " " + rs.getInt("quantity") +
+                        " " + rs.getString("actionType") + " " + rs.getInt("purchaseLotNumber"));
+            }
+            
+            conn.commit();
+
+            s.close();
+
+            conn.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RemoteException(e.getClass().getName() ,e);
+        }        
+
+        System.out.println("Logged " + toLog);
+    }
+
+    protected Connection getConnection() throws RemoteException {
+        try {
+            Connection conn;
+            Class.forName(driver).newInstance();
+            Properties props = new Properties();
+            // props.put("user", "tuscany");
+            // props.put("password", "tuscany");
+            conn = DriverManager.getConnection(protocol + dbDirectory + ";create=true", props);
+        
+            conn.setAutoCommit(false);
+            return conn;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RemoteException(e.getClass().getName() ,e);
+        }        
+    }
+
+    public AccountLog getAccountLog(final int customerID) throws RemoteException {
+
+        try {
+            final AccountFactory accountFactory = AccountFactory.INSTANCE;
+            final AccountLog accountLog = accountFactory.createAccountLog();
+            InputStream mapping = createConfigStream();
+
+            Command select = Command.FACTORY.createCommand("SELECT logSeqNo, accountNumber, actionType, amount FROM acctLog where id = :id", mapping);
+            Connection conn = getConnection();
+            select.setConnection(conn);
+            select.setParameterValue("id", customerID);
+            TypeHelper helper = TypeHelper.INSTANCE;
+            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+            DataGraphRoot root = (DataGraphRoot) select.executeQuery();
+            accountLog.getAccountLogEntries().addAll(root.getAccountLogEntries());
+
+            select = Command.FACTORY.createCommand(
+                    "SELECT logSeqNo, Symbol, quantity, actionType, purchaseLotNumber  FROM stockLog where id = :id", createConfigStream());
+            select.setConnection(conn);
+            select.setParameterValue("id", customerID);
+            select.setDataObjectModel(helper.getType(DataGraphRoot.class));
+            root = (DataGraphRoot) select.executeQuery();
+            accountLog.getStockLogEntries().addAll(root.getStockLogEntries());
+
+            conn.close();
+
+            return accountLog;
+        } catch (Exception e) {
+            if (e instanceof RemoteException)
+                throw (RemoteException) e;
+            throw new RemoteException("getAccountLog failed. customerID ('" + customerID + "')" + e.getClass().getName() + "'. " + e.getMessage(),
+                    e);
+        }
+    }
+
+    protected InputStream createConfigStream() {
+        InputStream mapping = getClass().getClassLoader().getResourceAsStream("DasAccountConfiguration.xml");
+        return mapping;
+    }
+
+}

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/DasAccountConfiguration.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/DasAccountConfiguration.xml?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/DasAccountConfiguration.xml (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/DasAccountConfiguration.xml Tue May 23 11:41:55 2006
@@ -44,6 +44,26 @@
   </Table>
 
 	
+  <Table name="ACCTLOG" propertyName="AccountLogEntry">
+    <Column name="logSeqNo"/>
+    <Column name="ID"/> 
+    <Column name="ACCOUNTNUMBER"/>
+    <Column name="ACTIONTYPE"/>
+    <Column name="AMOUNT"/> 
+  </Table>
+
+
+
+  <Table name="STOCKLOG" propertyName="StockLogEntry" >
+    <Column name="logSeqNo"/>
+    <Column name="ID"/>
+    <Column name="Symbol"/>
+    <Column name="quantity"/>
+    <Column name="actionType"/>
+    <Column name="purchaseLotNumber"/>
+  </Table>
+
+	
   <Command name="update balance"
         SQL="update ACCOUNTS set BALANCE = :BALANCE where ACCOUNTNUMBER = :ACCOUNTNUMBER"
         kind="Update">

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/sca.module
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/sca.module?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/sca.module (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/sca.module Tue May 23 11:41:55 2006
@@ -36,7 +36,7 @@
             <v:currency>USD</v:currency>
         </properties>
         <references>
-            <v:accountDataService>AccountDataServiceComponent</v:accountDataService>
+            <v:accountDataService>AccountLoggerDataServiceComponent</v:accountDataService>
             <v:stockQuoteService>StockQuoteServiceComponent</v:stockQuoteService>
         </references>
     </component>
@@ -51,5 +51,17 @@
         <interface.wsdl interface="http://www.webserviceX.NET/#wsdl.interface(StockQuoteSoap)"/>
         <binding.ws port="http://www.webserviceX.NET/#wsdl.endpoint(StockQuote/StockQuoteSoap)"/>
     </externalService>
+
+    <component name="AccountLoggerDataServiceComponent">
+        <implementation.java class="bigbank.account.services.accountlogger.AccountLoggerDataServiceImpl"/>
+        <references>
+            <v:accountDataService>AccountDataServiceComponent</v:accountDataService>
+            <v:accountLoggerService>AccountLoggerServiceComponent</v:accountLoggerService>
+        </references>
+    </component>
+
+    <component name="AccountLoggerServiceComponent">
+        <implementation.java class="bigbank.account.services.accountlogger.AccountLoggerServiceImpl"/>
+    </component>
 
 </module>

Modified: incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/wsdl/AccountService.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/wsdl/AccountService.wsdl?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/wsdl/AccountService.wsdl (original)
+++ incubator/tuscany/java/sampleapps/bigbank/account/src/main/resources/wsdl/AccountService.wsdl Tue May 23 11:41:55 2006
@@ -35,6 +35,8 @@
             <xsd:element name="customerProfileData" type="account:CustomerProfileData" maxOccurs="unbounded" minOccurs="0" />
             <xsd:element name="StockSummaries" type="account:StockSummary" maxOccurs="unbounded" minOccurs="0" />
             <xsd:element name="AccountSummaries" type="account:AccountSummary" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="StockLogEntries" type="account:StockLogEntry" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="AccountLogEntries" type="account:AccountLogEntry" maxOccurs="unbounded" minOccurs="0" />
         </xsd:sequence>
 	</xsd:complexType>
 			
@@ -201,6 +203,50 @@
 				
 			</xsd:element>
 
+			<xsd:element name="getAccountLog">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerID"
+							type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="getAccountLogResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="accountLog"
+							type="account:AccountLog" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:complexType name="AccountLog">
+				<xsd:sequence>
+					<xsd:element name="accountLogEntries"
+						type="account:AccountLogEntry" maxOccurs="unbounded" />
+					<xsd:element name="stockLogEntries"
+						type="account:StockLogEntry" maxOccurs="unbounded" />
+						
+				</xsd:sequence>
+			</xsd:complexType>
+
+			<xsd:complexType name="AccountLogEntry">
+				<xsd:attribute name="logSeqNo" type="xsd:int" />
+				<xsd:attribute name="id" type="xsd:int" />
+				<xsd:attribute name="accountNumber" type="xsd:string" />
+				<xsd:attribute name="actionType" type="xsd:string" />
+				<xsd:attribute name="amount" type="xsd:float" />
+			</xsd:complexType>
+
+			<xsd:complexType name="StockLogEntry">
+				<xsd:attribute name="logSeqNo" type="xsd:int" />
+				<xsd:attribute name="id" type="xsd:int" />
+				<xsd:attribute name="symbol" type="xsd:string" />
+				<xsd:attribute name="quantity" type="xsd:int" />
+				<xsd:attribute name="actionType" type="xsd:string" />
+				<xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+			</xsd:complexType>
+
 		</xsd:schema>
 	</wsdl:types>
 	<wsdl:message name="getAccountReportRequest">
@@ -261,6 +307,16 @@
 		<wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
 	</wsdl:message>
 
+	<wsdl:message name="getAccountLogRequest">
+		<wsdl:part element="account:getAccountLog"
+			name="getAccountLogRequest" />
+	</wsdl:message>
+	
+	<wsdl:message name="getAccountLogResponse">
+		<wsdl:part element="account:getAccountLogResponse"
+			name="getAccountLogResponse" />
+	</wsdl:message>
+
 	<wsdl:portType name="AccountService">
 		<wsdl:operation name="getAccountReport">
 			<wsdl:input message="account:getAccountReportRequest" />
@@ -298,6 +354,11 @@
 			<wsdl:output message="account:createAccountResponse" />
 		</wsdl:operation>
 
+		<wsdl:operation name="getAccountLog">
+			<wsdl:input message="account:getAccountLogRequest" />
+			<wsdl:output message="account:getAccountLogResponse" />
+		</wsdl:operation>
+
 	</wsdl:portType>
 
 
@@ -373,6 +434,17 @@
 		<wsdl:operation name="createAccount">
 			<soap:operation
 				soapAction="http://www.bigbank.com/account/createAccount" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="getAccountLog">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/getAccountLog" />
 			<wsdl:input>
 				<soap:body use="literal" />
 			</wsdl:input>

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java Tue May 23 11:41:55 2006
@@ -22,6 +22,7 @@
 import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Service;
 
+import com.bigbank.account.AccountLog;
 import com.bigbank.account.AccountReport;
 import com.bigbank.account.AccountService;
 import com.bigbank.account.CustomerProfileData;
@@ -102,5 +103,14 @@
 
         return accountService.createAccount(customerProfile, createSavings, createCheckings);
     }
+    
+    public AccountLog getAccountLog(int customerID) throws RemoteException {
+        try {
+            return accountService.getAccountLog(customerID);
+        } catch (Exception e) {
+            throw new ServiceUnavailableException(e);
+        }
+    }
+
 
 }

Added: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountLogTag.java Tue May 23 11:41:55 2006
@@ -0,0 +1,114 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ModuleContext;
+
+import bigbank.webclient.services.profile.ProfileService;
+
+import com.bigbank.account.AccountLog;
+import com.bigbank.account.AccountReport;
+import com.bigbank.account.AccountService;
+
+public class AccountLogTag extends TagSupport {
+    
+    public AccountLogTag() {
+        super();
+    }
+
+    private String mAccountService;
+
+    public String getAccountService() {
+        return mAccountService;
+    }
+
+    public void setAccountService(String pAccountService) {
+        mAccountService = pAccountService;
+    }
+
+    private String mProfileService;
+
+    public String getProfileService() {
+        return mProfileService;
+    }
+
+    public void setProfileService(String pProfileService) {
+        mProfileService = pProfileService;
+    }
+
+    private String mId;
+
+    public String getId() {
+        return mId;
+    }
+
+    public void setId(String pId) {
+        mId = pId;
+    }
+
+    private Iterator mIterator;
+
+    public int doStartTag() throws JspException {
+        ModuleContext moduleContext = CurrentModuleContext.getContext();
+        ProfileService profile = (ProfileService) moduleContext.locateService(mProfileService);
+        if (profile == null) {
+            throw new JspException("Profile [" + mProfileService
+                    + "] not found in current module context");
+        }
+
+        AccountService service = (AccountService) moduleContext.locateService(mAccountService);
+        if (service == null) {
+            throw new JspException("Service [" + mAccountService
+                    + "] not found in current module context");
+        }
+        List entries;
+        try {
+            AccountLog accountLog = service.getAccountLog(profile.getId());
+            pageContext.setAttribute("StockLogEntries", accountLog.getStockLogEntries());
+            entries = accountLog.getAccountLogEntries();
+        } catch (Exception e) {
+            throw new JspException(e);
+        }
+        mIterator = entries.iterator();
+        if (mIterator.hasNext()) {
+            pageContext.setAttribute(mId, mIterator.next());
+            return EVAL_BODY_INCLUDE;
+        } else {
+            return SKIP_BODY;
+        }
+    }
+    
+    public int doAfterBody() {
+        if (mIterator.hasNext()) {
+            pageContext.setAttribute(mId, mIterator.next());
+            return EVAL_BODY_AGAIN;
+        } else {
+            return SKIP_BODY;
+        }
+    }
+
+    public void release() {
+        super.release();
+    }
+}

Added: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java (added)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockLogTag.java Tue May 23 11:41:55 2006
@@ -0,0 +1,72 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  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.
+ */
+package bigbank.webclient.tags.account;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class StockLogTag extends TagSupport {
+    
+    public StockLogTag() {
+        super();
+    }
+
+    private String mId;
+
+    public String getId() {
+        return mId;
+    }
+
+    public void setId(String pId) {
+        mId = pId;
+    }
+
+    private Iterator mIterator;
+
+    public int doStartTag() throws JspException {
+         
+        List entries = (List) pageContext.getAttribute("StockLogEntries");
+        if(null == entries) return SKIP_BODY;
+        mIterator = entries.iterator();
+        if (mIterator.hasNext()) {
+            pageContext.setAttribute(mId, mIterator.next());
+            return EVAL_BODY_INCLUDE;
+        } else {
+            return SKIP_BODY;
+        }
+    }
+
+    public int doAfterBody() {
+        if (mIterator.hasNext()) {
+            pageContext.setAttribute(mId, mIterator.next());
+            return EVAL_BODY_AGAIN;
+        } else {
+            pageContext.setAttribute("StockLogEntries", null);
+            return SKIP_BODY;
+        }
+    }
+
+    public void release() {
+        pageContext.setAttribute("StockLogEntries", null);
+        super.release();
+        mId = null;
+        mIterator = null;
+    }
+}

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl Tue May 23 11:41:55 2006
@@ -1,392 +1,464 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-	Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
-	
-	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.
--->
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-	xmlns:account="http://www.bigbank.com/account"
-	targetNamespace="http://www.bigbank.com/account"
-	name="AccountService">
-
-	<wsdl:types>
-		<xsd:schema targetNamespace="http://www.bigbank.com/account"
-			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-			xmlns:account="http://www.bigbank.com/account"
-			
-			> <!-- xmlns:sdojava="commonj.sdo/java" sdojava:package="org.apache.tuscany.samples.bigbank.account" -->
-			
-			
-	<xsd:complexType name="DataGraphRoot">		<!-- This was added temporarily for DAS 
-	                                                 changes are on the way to lift this requirement -->
-	 	<xsd:sequence>
-            <xsd:element name="customerProfileData" type="account:CustomerProfileData" maxOccurs="unbounded" minOccurs="0" />
-            <xsd:element name="StockSummaries" type="account:StockSummary" maxOccurs="unbounded" minOccurs="0" />
-            <xsd:element name="AccountSummaries" type="account:AccountSummary" maxOccurs="unbounded" minOccurs="0" />
-        </xsd:sequence>
-	</xsd:complexType>
-			
-
-			<xsd:element name="getAccountReport">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="customerID"
-							type="xsd:int" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-			<xsd:element name="getAccountReportResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="accountReport"
-							type="account:AccountReport" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:complexType name="AccountReport">
-				<xsd:sequence>
-					<xsd:element name="accountSummaries"
-						type="account:AccountSummary" maxOccurs="unbounded" />
-					<xsd:element name="stockSummaries"
-						type="account:StockSummary" maxOccurs="unbounded" />
-						
-				</xsd:sequence>
-			</xsd:complexType>
-			<xsd:complexType name="AccountSummary">
-				<xsd:attribute name="accountNumber" type="xsd:string" />
-				<xsd:attribute name="accountType" type="xsd:string" />
-				<xsd:attribute name="balance" type="xsd:float" />
-			</xsd:complexType>
-
-			<xsd:complexType name="StockSummary">
-				<xsd:attribute name="purchaseLotNumber" type="xsd:int" />
-				<!-- unique id for this purchase -->
-				<xsd:attribute name="symbol" type="xsd:string" />
-				<xsd:attribute name="quantity" type="xsd:int" />
-				<xsd:attribute name="purchaseDate" type="xsd:dateTime" />
-				<xsd:attribute name="purchasePrice" type="xsd:float" />
-				<xsd:attribute name="currentPrice" type="xsd:float" />
-				<xsd:attribute name="company" type="xsd:string" />
-				<xsd:attribute name="highPrice" type="xsd:float" />
-				<xsd:attribute name="lowPrice" type="xsd:float" />
-				
-			</xsd:complexType>
-
-			<!-- Profile in data base  -->
-			<xsd:element name="getCustomerProfile">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="loginID" type="xsd:string" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:complexType name="CustomerProfileData">
-				<xsd:sequence>
-					<xsd:element name="firstName" type="xsd:string" />
-					<xsd:element name="lastName" type="xsd:string" />
-					<xsd:element name="address" type="xsd:string" />
-					<xsd:element name="email" type="xsd:string" />
-					<xsd:element name="loginID" type="xsd:string" />
-					<xsd:element name="password" type="xsd:string" />
-					<xsd:element name="id" type="xsd:int" />
-				</xsd:sequence>
-			</xsd:complexType>
-
-			<xsd:element name="getCustomerProfileResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="customerProfile"
-							type="account:CustomerProfileData" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:element name="withdraw">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="accountNumber"
-							type="xsd:string" />
-						<xsd:element name="amount" type="xsd:float" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-			<xsd:element name="withdrawResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="balance" type="xsd:float" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:element name="deposit">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="accountNumber"
-							type="xsd:string" />
-						<xsd:element name="amount" type="xsd:float" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-			<xsd:element name="depositResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="balance" type="xsd:float" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:element name="purchaseStock">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="id" type="xsd:int" />
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+	
+	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.
+-->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:account="http://www.bigbank.com/account"
+	targetNamespace="http://www.bigbank.com/account"
+	name="AccountService">
+
+	<wsdl:types>
+		<xsd:schema targetNamespace="http://www.bigbank.com/account"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+			xmlns:account="http://www.bigbank.com/account"
+			
+			> <!-- xmlns:sdojava="commonj.sdo/java" sdojava:package="org.apache.tuscany.samples.bigbank.account" -->
+			
+			
+	<xsd:complexType name="DataGraphRoot">		<!-- This was added temporarily for DAS 
+	                                                 changes are on the way to lift this requirement -->
+	 	<xsd:sequence>
+            <xsd:element name="customerProfileData" type="account:CustomerProfileData" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="StockSummaries" type="account:StockSummary" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="AccountSummaries" type="account:AccountSummary" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="StockLogEntries" type="account:StockLogEntry" maxOccurs="unbounded" minOccurs="0" />
+            <xsd:element name="AccountLogEntries" type="account:AccountLogEntry" maxOccurs="unbounded" minOccurs="0" />
+        </xsd:sequence>
+	</xsd:complexType>
+			
+
+			<xsd:element name="getAccountReport">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerID"
+							type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="getAccountReportResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="accountReport"
+							type="account:AccountReport" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:complexType name="AccountReport">
+				<xsd:sequence>
+					<xsd:element name="accountSummaries"
+						type="account:AccountSummary" maxOccurs="unbounded" />
+					<xsd:element name="stockSummaries"
+						type="account:StockSummary" maxOccurs="unbounded" />
+						
+				</xsd:sequence>
+			</xsd:complexType>
+			<xsd:complexType name="AccountSummary">
+				<xsd:attribute name="accountNumber" type="xsd:string" />
+				<xsd:attribute name="accountType" type="xsd:string" />
+				<xsd:attribute name="balance" type="xsd:float" />
+			</xsd:complexType>
+
+			<xsd:complexType name="StockSummary">
+				<xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+				<!-- unique id for this purchase -->
+				<xsd:attribute name="symbol" type="xsd:string" />
+				<xsd:attribute name="quantity" type="xsd:int" />
+				<xsd:attribute name="purchaseDate" type="xsd:dateTime" />
+				<xsd:attribute name="purchasePrice" type="xsd:float" />
+				<xsd:attribute name="currentPrice" type="xsd:float" />
+				<xsd:attribute name="company" type="xsd:string" />
+				<xsd:attribute name="highPrice" type="xsd:float" />
+				<xsd:attribute name="lowPrice" type="xsd:float" />
+				
+			</xsd:complexType>
+
+			<!-- Profile in data base  -->
+			<xsd:element name="getCustomerProfile">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="loginID" type="xsd:string" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:complexType name="CustomerProfileData">
+				<xsd:sequence>
+					<xsd:element name="firstName" type="xsd:string" />
+					<xsd:element name="lastName" type="xsd:string" />
+					<xsd:element name="address" type="xsd:string" />
+					<xsd:element name="email" type="xsd:string" />
+					<xsd:element name="loginID" type="xsd:string" />
+					<xsd:element name="password" type="xsd:string" />
+					<xsd:element name="id" type="xsd:int" />
+				</xsd:sequence>
+			</xsd:complexType>
+
+			<xsd:element name="getCustomerProfileResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerProfile"
+							type="account:CustomerProfileData" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="withdraw">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="accountNumber"
+							type="xsd:string" />
+						<xsd:element name="amount" type="xsd:float" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="withdrawResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="balance" type="xsd:float" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="deposit">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="accountNumber"
+							type="xsd:string" />
+						<xsd:element name="amount" type="xsd:float" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="depositResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="balance" type="xsd:float" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="purchaseStock">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="id" type="xsd:int" />
 						<xsd:element name="stock" type="account:StockSummary" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:element name="purchaseStockResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="purchaseSummary"
-							type="account:StockSummary" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-
-
-			<xsd:element name="sellStock">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="purchaseLotNumber"
-							type="xsd:int" /><!-- unique id for this purchase -->
-						<xsd:element name="quantity" type="xsd:int" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>
-
-			<xsd:element name="createAccount">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="customerProfile"
-							type="account:CustomerProfileData" />
-                        <xsd:element name="createSavings"
-							type="xsd:boolean" />
-                        <xsd:element name="createCheckings"
-							type="xsd:boolean" />
-					</xsd:sequence>
-				</xsd:complexType>
-			</xsd:element>	
-			<xsd:element name="createAccountResponse">
-				<xsd:complexType>
-					<xsd:sequence>
-						<xsd:element name="customerProfile"
-							type="account:CustomerProfileData" />
-					</xsd:sequence>
-				</xsd:complexType>
-				
-			</xsd:element>
-
-		</xsd:schema>
-	</wsdl:types>
-	<wsdl:message name="getAccountReportRequest">
-		<wsdl:part element="account:getAccountReport"
-			name="getAccountReportRequest" />
-	</wsdl:message>
-	<wsdl:message name="getAccountReportResponse">
-		<wsdl:part element="account:getAccountReportResponse"
-			name="getAccountReportResponse" />
-	</wsdl:message>
-
-	<wsdl:message name="getCustomerProfileRequest">
-		<wsdl:part element="account:getCustomerProfile"
-			name="getCustomerProfile" />
-	</wsdl:message>
-	<wsdl:message name="getCustomerProfileResponse">
-		<wsdl:part element="account:getCustomerProfileResponse"
-			name="getCustomerProfileResponse" />
-	</wsdl:message>
-
-	<wsdl:message name="withdrawRequest">
-		<wsdl:part element="account:withdraw" name="withdrawRequest" />
-	</wsdl:message>
-
-	<wsdl:message name="withdrawResponse">
-		<wsdl:part element="account:withdrawResponse"
-			name="withdrawResponse" />
-	</wsdl:message>
-
-	<wsdl:message name="depositRequest">
-		<wsdl:part element="account:deposit" name="depositRequest" />
-	</wsdl:message>
-
-	<wsdl:message name="depositResponse">
-		<wsdl:part element="account:depositResponse"
-			name="depositResponse" />
-	</wsdl:message>
-
-	<wsdl:message name="purchaseStockRequest">
-		<wsdl:part element="account:purchaseStock"
-			name="purchaseStockRequest" />
-	</wsdl:message>
-
-	<wsdl:message name="purchaseStockResponse">
-		<wsdl:part element="account:purchaseStockResponse"
-			name="purchaseStockResponse" />
-	</wsdl:message>
-
-	<wsdl:message name="sellStockRequest">
-		<wsdl:part element="account:sellStock" name="sellStockRequest" />
-	</wsdl:message>
-	
-	<wsdl:message name="createAccountRequest">
-		<wsdl:part element="account:createAccount" name="createAccountRequest" />
-	</wsdl:message>
-
-	<wsdl:message name="createAccountResponse">
-		<wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
-	</wsdl:message>
-
-	<wsdl:portType name="AccountService">
-		<wsdl:operation name="getAccountReport">
-			<wsdl:input message="account:getAccountReportRequest" />
-			<wsdl:output message="account:getAccountReportResponse" />
-		</wsdl:operation>
-
-		<wsdl:operation name="getCustomerProfile">
-			<wsdl:input message="account:getCustomerProfileRequest" />
-			<wsdl:output message="account:getCustomerProfileResponse" />
-		</wsdl:operation>
-
-		<wsdl:operation name="withdraw">
-			<wsdl:input message="account:withdrawRequest" />
-			<wsdl:output message="account:withdrawResponse" />
-		</wsdl:operation>
-
-		<wsdl:operation name="deposit">
-			<wsdl:input message="account:depositRequest" />
-			<wsdl:output message="account:depositResponse" />
-		</wsdl:operation>
-
-		<wsdl:operation name="purchaseStock">
-			<wsdl:input message="account:purchaseStockRequest" />
-			<wsdl:output message="account:purchaseStockResponse" />
-		</wsdl:operation>
-
-		<wsdl:operation name="sellStock">
-			<wsdl:input message="account:sellStockRequest" />
-			<wsdl:output message="account:purchaseStockResponse" />
-		</wsdl:operation>
-
-
-		<wsdl:operation name="createAccount">
-			<wsdl:input message="account:createAccountRequest" />
-			<wsdl:output message="account:createAccountResponse" />
-		</wsdl:operation>
-
-	</wsdl:portType>
-
-
-
-	<wsdl:binding name="AccountServiceSOAP" type="account:AccountService">
-		<soap:binding style="document"
-			transport="http://schemas.xmlsoap.org/soap/http" />
-		<wsdl:operation name="getAccountReport">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/getAccountReport" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-		<wsdl:operation name="getCustomerProfile">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/getCustomerProfile" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-		<wsdl:operation name="withdraw">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/withdraw" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-		<wsdl:operation name="deposit">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/deposit" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-		<wsdl:operation name="purchaseStock">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/purchaseStock" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-		<wsdl:operation name="sellStock">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/sellStock" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-		<wsdl:operation name="createAccount">
-			<soap:operation
-				soapAction="http://www.bigbank.com/account/createAccount" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-
-	</wsdl:binding>
-	<wsdl:service name="AccountService">
-		<wsdl:port binding="account:AccountServiceSOAP"
-			name="AccountServiceSOAP">
-			<soap:address
-				location="http://localhost:8080/sample-bigbank-account/services/AccountService" />
-		</wsdl:port>
-	</wsdl:service>
-</wsdl:definitions>
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="purchaseStockResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="purchaseSummary"
+							type="account:StockSummary" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+
+
+			<xsd:element name="sellStock">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="purchaseLotNumber"
+							type="xsd:int" /><!-- unique id for this purchase -->
+						<xsd:element name="quantity" type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:element name="createAccount">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerProfile"
+							type="account:CustomerProfileData" />
+                        <xsd:element name="createSavings"
+							type="xsd:boolean" />
+                        <xsd:element name="createCheckings"
+							type="xsd:boolean" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>	
+			<xsd:element name="createAccountResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerProfile"
+							type="account:CustomerProfileData" />
+					</xsd:sequence>
+				</xsd:complexType>
+				
+			</xsd:element>
+
+			<xsd:element name="getAccountLog">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="customerID"
+							type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="getAccountLogResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="accountLog"
+							type="account:AccountLog" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+
+			<xsd:complexType name="AccountLog">
+				<xsd:sequence>
+					<xsd:element name="accountLogEntries"
+						type="account:AccountLogEntry" maxOccurs="unbounded" />
+					<xsd:element name="stockLogEntries"
+						type="account:StockLogEntry" maxOccurs="unbounded" />
+						
+				</xsd:sequence>
+			</xsd:complexType>
+
+			<xsd:complexType name="AccountLogEntry">
+				<xsd:attribute name="logSeqNo" type="xsd:int" />
+				<xsd:attribute name="id" type="xsd:int" />
+				<xsd:attribute name="accountNumber" type="xsd:string" />
+				<xsd:attribute name="actionType" type="xsd:string" />
+				<xsd:attribute name="amount" type="xsd:float" />
+			</xsd:complexType>
+
+			<xsd:complexType name="StockLogEntry">
+				<xsd:attribute name="logSeqNo" type="xsd:int" />
+				<xsd:attribute name="id" type="xsd:int" />
+				<xsd:attribute name="symbol" type="xsd:string" />
+				<xsd:attribute name="quantity" type="xsd:int" />
+				<xsd:attribute name="actionType" type="xsd:string" />
+				<xsd:attribute name="purchaseLotNumber" type="xsd:int" />
+			</xsd:complexType>
+
+		</xsd:schema>
+	</wsdl:types>
+	<wsdl:message name="getAccountReportRequest">
+		<wsdl:part element="account:getAccountReport"
+			name="getAccountReportRequest" />
+	</wsdl:message>
+	<wsdl:message name="getAccountReportResponse">
+		<wsdl:part element="account:getAccountReportResponse"
+			name="getAccountReportResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="getCustomerProfileRequest">
+		<wsdl:part element="account:getCustomerProfile"
+			name="getCustomerProfile" />
+	</wsdl:message>
+	<wsdl:message name="getCustomerProfileResponse">
+		<wsdl:part element="account:getCustomerProfileResponse"
+			name="getCustomerProfileResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="withdrawRequest">
+		<wsdl:part element="account:withdraw" name="withdrawRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="withdrawResponse">
+		<wsdl:part element="account:withdrawResponse"
+			name="withdrawResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="depositRequest">
+		<wsdl:part element="account:deposit" name="depositRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="depositResponse">
+		<wsdl:part element="account:depositResponse"
+			name="depositResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="purchaseStockRequest">
+		<wsdl:part element="account:purchaseStock"
+			name="purchaseStockRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="purchaseStockResponse">
+		<wsdl:part element="account:purchaseStockResponse"
+			name="purchaseStockResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="sellStockRequest">
+		<wsdl:part element="account:sellStock" name="sellStockRequest" />
+	</wsdl:message>
+	
+	<wsdl:message name="createAccountRequest">
+		<wsdl:part element="account:createAccount" name="createAccountRequest" />
+	</wsdl:message>
+
+	<wsdl:message name="createAccountResponse">
+		<wsdl:part element="account:createAccountResponse" name="createAccountResponse" />
+	</wsdl:message>
+
+	<wsdl:message name="getAccountLogRequest">
+		<wsdl:part element="account:getAccountLog"
+			name="getAccountLogRequest" />
+	</wsdl:message>
+	
+	<wsdl:message name="getAccountLogResponse">
+		<wsdl:part element="account:getAccountLogResponse"
+			name="getAccountLogResponse" />
+	</wsdl:message>
+
+	<wsdl:portType name="AccountService">
+		<wsdl:operation name="getAccountReport">
+			<wsdl:input message="account:getAccountReportRequest" />
+			<wsdl:output message="account:getAccountReportResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="getCustomerProfile">
+			<wsdl:input message="account:getCustomerProfileRequest" />
+			<wsdl:output message="account:getCustomerProfileResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="withdraw">
+			<wsdl:input message="account:withdrawRequest" />
+			<wsdl:output message="account:withdrawResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="deposit">
+			<wsdl:input message="account:depositRequest" />
+			<wsdl:output message="account:depositResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="purchaseStock">
+			<wsdl:input message="account:purchaseStockRequest" />
+			<wsdl:output message="account:purchaseStockResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="sellStock">
+			<wsdl:input message="account:sellStockRequest" />
+			<wsdl:output message="account:purchaseStockResponse" />
+		</wsdl:operation>
+
+
+		<wsdl:operation name="createAccount">
+			<wsdl:input message="account:createAccountRequest" />
+			<wsdl:output message="account:createAccountResponse" />
+		</wsdl:operation>
+
+		<wsdl:operation name="getAccountLog">
+			<wsdl:input message="account:getAccountLogRequest" />
+			<wsdl:output message="account:getAccountLogResponse" />
+		</wsdl:operation>
+
+	</wsdl:portType>
+
+
+
+	<wsdl:binding name="AccountServiceSOAP" type="account:AccountService">
+		<soap:binding style="document"
+			transport="http://schemas.xmlsoap.org/soap/http" />
+		<wsdl:operation name="getAccountReport">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/getAccountReport" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="getCustomerProfile">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/getCustomerProfile" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="withdraw">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/withdraw" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="deposit">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/deposit" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="purchaseStock">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/purchaseStock" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="sellStock">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/sellStock" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="createAccount">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/createAccount" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+		<wsdl:operation name="getAccountLog">
+			<soap:operation
+				soapAction="http://www.bigbank.com/account/getAccountLog" />
+			<wsdl:input>
+				<soap:body use="literal" />
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal" />
+			</wsdl:output>
+		</wsdl:operation>
+
+	</wsdl:binding>
+	<wsdl:service name="AccountService">
+		<wsdl:port binding="account:AccountServiceSOAP"
+			name="AccountServiceSOAP">
+			<soap:address
+				location="http://localhost:8080/sample-bigbank-account/services/AccountService" />
+		</wsdl:port>
+	</wsdl:service>
+</wsdl:definitions>

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld Tue May 23 11:41:55 2006
@@ -86,6 +86,39 @@
             <rtexprvalue>false</rtexprvalue>
         </attribute>
     </tag>
+
+    <tag>
+        <name>accountLog</name>
+        <tagclass>bigbank.webclient.tags.account.AccountLogTag</tagclass>
+        <bodycontent>JSP</bodycontent>
+        <info>Accesses and iterates the accounts log</info>
+        <attribute>
+            <name>id</name>
+            <required>true</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>accountService</name>
+            <required>true</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>profileService</name>
+            <required>true</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+    </tag>
+        <tag>
+        <name>stockLog</name>
+        <tagclass>bigbank.webclient.tags.account.StockLogTag</tagclass>
+        <bodycontent>JSP</bodycontent>
+        <info>Accesses and iterates the stocks log</info>
+        <attribute>
+            <name>id</name>
+            <required>true</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>
+    </tag>
     
 
 </taglib>

Added: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/accountLog.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/accountLog.jsp?rev=408980&view=auto
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/accountLog.jsp (added)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/accountLog.jsp Tue May 23 11:41:55 2006
@@ -0,0 +1,96 @@
+<%--
+  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+  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.
+ --%>
+
+  <%@ page import="com.bigbank.account.AccountLogEntry" %>
+  <%@ page import="com.bigbank.account.StockLogEntry" %>
+  <%@ page session="true" %>
+  <%@ page autoFlush="true" %>
+  <%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %>
+
+    <html>
+    <title>BigBank Account and Stock Log</title>
+
+    <body>
+
+    Account Log
+    
+    <table>
+        <tr>
+            <td><strong>Seq</strong></td>
+            <td><strong>Account</strong></td>
+            <td><strong>Action</strong></td>
+            <td><strong>Amount</strong></td>
+        </tr>
+        <sca:accountLog accountService="AccountServiceComponent" profileService="ProfileServiceComponent" id="accountlogentry">
+        <tr>
+            <td>
+                <jsp:getProperty name="accountlogentry" property="logSeqNo"/>
+            </td>
+            <td>
+                <jsp:getProperty name="accountlogentry" property="accountNumber"/>
+            </td>
+            <td>
+                <jsp:getProperty name="accountlogentry" property="actionType"/>
+            </td>
+            <td>
+                <jsp:getProperty name="accountlogentry" property="amount"/>
+            </td>
+        </tr>
+        </sca:accountLog>
+       </table>
+ 
+       
+       
+       <hr/>
+       Stock Log
+       
+        <table>
+
+        <tr>
+            <td><strong>Seq</strong></td>
+            <td><strong>Symbol</strong></td>
+            <td><strong>Quantity</strong></td>
+            <td>&nbsp;&nbsp;</td>  <%-- spacer --%>
+            <td><strong>Action</strong></td>
+            <td><strong>PurchaseLotNumber</strong></td>
+        </tr>
+        <sca:stockLog id="stocklogentry">
+        <tr>
+            <td>
+                <jsp:getProperty name="stocklogentry" property="logSeqNo"/>
+            </td>
+            <td>
+                <jsp:getProperty name="stocklogentry" property="symbol"/>
+            </td>
+            <td>
+                <jsp:getProperty name="stocklogentry" property="quantity"/>
+            </td>
+            <td>&nbsp;&nbsp;</td>  <%-- spacer --%>
+            <td>
+                <jsp:getProperty name="stocklogentry" property="actionType"/>
+            </td>
+            
+            <td>
+                <jsp:getProperty name="stocklogentry" property="purchaseLotNumber"/>
+            </td>
+        </tr>
+        </FORM>   
+        </sca:stockLog>
+       </table>
+
+       
+    </body>
+    </html>

Modified: incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp?rev=408980&r1=408979&r2=408980&view=diff
==============================================================================
--- incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp (original)
+++ incubator/tuscany/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp Tue May 23 11:41:55 2006
@@ -129,6 +129,11 @@
         </FORM>   
         </sca:stockStatus>
        </table>
+       
+       <hr/>
+       <FORM method="post" action='accountLog.jsp'>
+       Account and Stock Logs: &nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" name='Logs' value="Logs"><br/>
+       </FORM>   
 
        
     </body>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org