From 0f72626e59d77f0365c1e6bbb9420f6693ffc67d Mon Sep 17 00:00:00 2001 From: lresende Date: Sat, 21 Nov 2009 07:55:01 +0000 Subject: Moving 1.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882848 13f79535-47bb-0310-9956-ffa450edef68 --- .../account/AccountServiceComponentImpl.java | 106 ++++++ .../services/profile/AccountLoginServiceImpl.java | 50 +++ .../webclient/services/profile/LoginService.java | 30 ++ .../webclient/services/profile/ProfileService.java | 36 ++ .../services/profile/ProfileServiceImpl.java | 67 ++++ .../services/profile/SimpleLoginServiceImpl.java | 49 +++ .../webclient/tags/account/AccountStatusTag.java | 125 +++++++ .../webclient/tags/account/StockStatusTag.java | 79 +++++ .../webclient/tags/sca/LoginBarrierTag.java | 97 +++++ .../bigbank/webclient/tags/sca/ServiceTag.java | 98 ++++++ .../java/bigbank/webclient/ui/FormServlet.java | 156 ++++++++ .../java/bigbank/webclient/ui/LoginServlet.java | 91 +++++ .../webclient/src/main/resources/sca.module | 51 +++ .../webclient/src/main/resources/sca.subsystem | 27 ++ .../src/main/resources/wsdl/AccountService.wsdl | 392 +++++++++++++++++++++ .../webclient/src/main/webapp/CustomerProfile.jsp | 97 +++++ .../src/main/webapp/WEB-INF/bigbank-tags.tld | 91 +++++ .../webclient/src/main/webapp/WEB-INF/web.xml | 44 +++ .../src/main/webapp/accountTransaction.jsp | 47 +++ .../bigbank/webclient/src/main/webapp/login.html | 42 +++ .../webclient/src/main/webapp/purchaseStock.jsp | 56 +++ .../webclient/src/main/webapp/stockSale.jsp | 53 +++ .../bigbank/webclient/src/main/webapp/summary.jsp | 136 +++++++ 23 files changed, 2020 insertions(+) create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.module create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.subsystem create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/CustomerProfile.jsp create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/accountTransaction.jsp create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/login.html create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/purchaseStock.jsp create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/stockSale.jsp create mode 100644 sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp (limited to 'sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main') diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java new file mode 100644 index 0000000000..7de9658d34 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/account/AccountServiceComponentImpl.java @@ -0,0 +1,106 @@ +/** + * + * 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.services.account; + +import java.rmi.RemoteException; + +import org.osoa.sca.ServiceUnavailableException; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.bigbank.account.AccountReport; +import com.bigbank.account.AccountService; +import com.bigbank.account.CustomerProfileData; +import com.bigbank.account.StockSummary; + +/** + */ +@Service(AccountService.class) +public class AccountServiceComponentImpl implements AccountService { + + private AccountService accountService; + + @Reference + public void setAccountService(AccountService accountService) { + this.accountService = accountService; + } + + /** + * + */ + public AccountServiceComponentImpl() { + super(); + } + + /** + * @see bigbank.account.services.account.AccountService#getAccountReport(java.lang.String) + */ + public AccountReport getAccountReport(int customerID) { + try { + return accountService.getAccountReport(customerID); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public StockSummary purchaseStock(int customerID, StockSummary stockSummary) throws RemoteException { + try { + return accountService.purchaseStock(customerID, stockSummary); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public CustomerProfileData getCustomerProfile(String param2) throws RemoteException { + try { + return accountService.getCustomerProfile(param2); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public float deposit(String account, float amount) throws RemoteException { + try { + return accountService.deposit(account, amount); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public StockSummary sellStock(int purchaseLotNumber, int quantity) throws RemoteException { + try { + return accountService.sellStock(purchaseLotNumber, quantity); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public float withdraw(String account, float amount) throws RemoteException { + try { + return accountService.withdraw(account, amount); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + + public CustomerProfileData createAccount(CustomerProfileData customerProfile, boolean createSavings, boolean createCheckings) + throws RemoteException { + + return accountService.createAccount(customerProfile, createSavings, createCheckings); + } + +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java new file mode 100644 index 0000000000..0de0ef85c3 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/AccountLoginServiceImpl.java @@ -0,0 +1,50 @@ +/** + * + * 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.services.profile; + +import java.rmi.RemoteException; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import com.bigbank.account.AccountService; +import com.bigbank.account.CustomerProfileData; + +@Service(LoginService.class) +public class AccountLoginServiceImpl implements LoginService { + @Reference + public AccountService accountService; + + @Reference + public ProfileService profileService; + + public int login(String userName, String password) throws RemoteException { + + CustomerProfileData profileData = accountService.getCustomerProfile(userName); + + if (!password.equals(profileData.getPassword())) { + return INVALID_PASSWORD; + } + + profileService.setLoggedIn(true); + profileService.setFirstName(profileData.getFirstName()); + profileService.setLastName(profileData.getLastName()); + profileService.setId(profileData.getId()); + + return SUCCESS; + } +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java new file mode 100644 index 0000000000..465c1b3e7e --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/LoginService.java @@ -0,0 +1,30 @@ +/** + * + * 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.services.profile; + +import java.rmi.RemoteException; + +public interface LoginService { + + public static final int SUCCESS = 1; + + public static final int INVALID_LOGIN = -1; + + public static final int INVALID_PASSWORD = -2; + + public int login(String userName, String password) throws RemoteException; +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java new file mode 100644 index 0000000000..2cbfbf489a --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileService.java @@ -0,0 +1,36 @@ +/** + * + * 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.services.profile; + +public interface ProfileService { + + public String getFirstName(); + + public void setFirstName(String pName); + + public String getLastName(); + + public void setLastName(String pName); + + public boolean isLoggedIn(); + + public void setLoggedIn(boolean pStatus); + + public int getId(); + + public void setId(int pId); +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java new file mode 100644 index 0000000000..4ae808f31a --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/ProfileServiceImpl.java @@ -0,0 +1,67 @@ +/** + * + * 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.services.profile; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ProfileService.class) +@Scope("session") +public class ProfileServiceImpl implements ProfileService { + + private String firstName; + + public String getFirstName() { + return firstName; + } + + @Property + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + private String lastName; + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + private boolean loggedIn; + + public boolean isLoggedIn() { + return loggedIn; + } + + public void setLoggedIn(boolean status) { + loggedIn = status; + } + + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java new file mode 100644 index 0000000000..a8d57fb506 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java @@ -0,0 +1,49 @@ +/** + * + * 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.services.profile; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(LoginService.class) +public class SimpleLoginServiceImpl implements LoginService { + + public ProfileService profileService; + + @Reference + public void setProfileService(ProfileService profileService) { + this.profileService = profileService; + } + + public int login(String userName, String password) { + + if (!"test".equals(userName)) { + return INVALID_LOGIN; + } + + if (!"password".equals(password)) { + return INVALID_PASSWORD; + } + + profileService.setLoggedIn(true); + profileService.setFirstName("John"); + profileService.setLastName("Doe"); + profileService.setId(12345); + + return SUCCESS; + } +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java new file mode 100644 index 0000000000..c11d3f9e46 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java @@ -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.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.AccountReport; +import com.bigbank.account.AccountService; + +/** + * Retrieves and iterates over account summary information for the current profile by accessing the remotable account service component + */ + +public class AccountStatusTag extends TagSupport { + + // ---------------------------------- + // Constructors + // ---------------------------------- + + public AccountStatusTag() { + super(); + } + + // ---------------------------------- + // Methods + // ---------------------------------- + + 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 summaries; + try { + AccountReport accountReport = service.getAccountReport(profile.getId()); + pageContext.setAttribute("StockSummaries", accountReport.getStockSummaries()); + summaries = accountReport.getAccountSummaries(); + } catch (Exception e) { + throw new JspException(e); + } + mIterator = summaries.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(); + mId = null; + mIterator = null; + } +} \ No newline at end of file diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java new file mode 100644 index 0000000000..ac0b5f4467 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java @@ -0,0 +1,79 @@ +/** + * + * 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; + +/** + * Retrieves and iterates over account summary information for the current profile by accessing the remotable account service component + */ + +public class StockStatusTag extends TagSupport { + + + public StockStatusTag() { + 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 summaries = (List) pageContext.getAttribute("StockSummaries"); + if (null == summaries) + return SKIP_BODY; + mIterator = summaries.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("StockSummaries", null); + return SKIP_BODY; + } + } + + public void release() { + pageContext.setAttribute("StockSummaries", null); + super.release(); + mId = null; + mIterator = null; + } +} \ No newline at end of file diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java new file mode 100644 index 0000000000..e923596bae --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java @@ -0,0 +1,97 @@ +/** + * + * 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.sca; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletResponse; +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; + +public class LoginBarrierTag extends TagSupport { + + public LoginBarrierTag() { + super(); + } + + private String mProfile; + + public String getProfile() { + return mProfile; + } + + public void setProfile(String pProfile) { + mProfile = pProfile; + } + + private String mUrl; + + public String getUrl() { + return mUrl; + } + + public void setUrl(String pUrl) { + mUrl = pUrl; + } + + int doPage = EVAL_PAGE; + + + public int doStartTag() throws JspException { + if (mProfile == null || mProfile.length() < 1) { + throw new JspException("Invalid profile location specified"); + } + + ModuleContext moduleContext = CurrentModuleContext.getContext(); + + ProfileService profile = (ProfileService) moduleContext.locateService(mProfile); + + if (profile == null) { + throw new JspException("Profile [" + mProfile + "] not found in current module context"); + } + + if (profile.isLoggedIn()) { + return EVAL_BODY_INCLUDE; + } else { + try { + doPage = SKIP_PAGE; + pageContext.forward(mUrl); + ((HttpServletResponse) (pageContext.getResponse())).sendRedirect("login.html"); + return SKIP_BODY; + } catch (ServletException e) { + throw new JspException("Unable to forward to [" + mUrl + "]"); + } catch (IOException e) { + throw new JspException("Unable to forward to [" + mUrl + "]"); + } + } + } + + public int doEndTag() throws JspException { + return doPage; + } + + public void release() { + super.release(); + } + +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java new file mode 100644 index 0000000000..1fa4252c0c --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java @@ -0,0 +1,98 @@ +/** + * + * 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.sca; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +/** + * Places an SCA service in the JSP page context, making it available to other tags corresponding to its id value. + */ + +public class ServiceTag extends TagSupport { + + // ---------------------------------- + // Constructors + // ---------------------------------- + + public ServiceTag() { + super(); + } + + // ---------------------------------- + // Methods + // ---------------------------------- + + private String mName; + + /** + * Returns the name of the SCA service to import into the page context. + */ + public String getName() { + return mName; + } + + /** + * Sets name of the SCA service to import into the page context. + */ + public void setName(String pName) { + mName = pName; + } + + private String mId; + + /** + * Returns the id of the service in the page context + */ + public String getId() { + return mId; + } + + /** + * Sets the id of the service for the page context + */ + + public void setId(String pId) { + mId = pId; + } + + public int doStartTag() throws JspException { + ModuleContext moduleContext = CurrentModuleContext.getContext(); + Object service = moduleContext.locateService(mName); + if (service == null) { + throw new JspException("Service [" + mName + "] not found in current module context"); + } + if (mId == null) { + // if the Id name was not specified, default to the basic name of the + // service + mId = mName; + } + pageContext.setAttribute(mId, service); + return EVAL_BODY_INCLUDE; + } + + public int doEndTag() throws JspException { + return EVAL_PAGE; + } + + public void release() { + super.release(); + } +} \ No newline at end of file diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java new file mode 100644 index 0000000000..bad6d370b0 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/FormServlet.java @@ -0,0 +1,156 @@ +/** + * + * 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.ui; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +import bigbank.webclient.services.profile.ProfileService; + +import com.bigbank.account.AccountFactory; +import com.bigbank.account.AccountService; +import com.bigbank.account.CustomerProfileData; +import com.bigbank.account.StockSummary; + +public class FormServlet extends HttpServlet { + + // private ServletContext mContext; + // public void init(ServletConfig pCfg) throws ServletException { + // mContext = pCfg.getServletContext(); + // } + + public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException { + + try { + final String action = pReq.getParameter("action"); + ModuleContext moduleContext = CurrentModuleContext.getContext(); + AccountService accountServices = (AccountService) moduleContext.locateService("AccountServiceComponent"); + if (accountServices == null) { + throw new ServletException("AccountServiceComponent"); + } + ProfileService profileServices = null; + if (!"createAccount".equals(action)) { + profileServices = (ProfileService) moduleContext.locateService("ProfileServiceComponent"); + if (profileServices == null) { + throw new ServletException("ProfileServiceComponent not found."); + } + if (!profileServices.isLoggedIn()) { + throw new ServletException("User id '" + profileServices.getId() + "' not logged on."); + } + } + + if ("createAccount".equals(action)) { + createAccount(pReq, pResp, accountServices); + } else if ("account".equals(action)) { + accountTransaction(pReq, pResp, accountServices); + } else if ("stockPurchase".equals(action)) { + stockPurchase(pReq, pResp, profileServices, accountServices); + } else if ("stockSale".equals(action)) { + stockSale(pReq, pResp, profileServices, accountServices); + } else { + throw new IllegalArgumentException("Unknown action in Form servlet '" + action + "'."); + } + // mContext.getRequestDispatcher("summary.jsp").forward(pReq, pResp); + pResp.sendRedirect("summary.jsp"); + } catch (ServletException e) { + e.printStackTrace(); + throw e; + + } catch (Exception e) { + + throw new ServletException(e); + } + + } + + private void stockSale(HttpServletRequest req, HttpServletResponse resp, ProfileService profileServices, AccountService accountServices) + throws ServletException { + try { + if (!"cancel".equals(req.getParameter("cancel"))) { + + int quantity = Integer.parseInt(req.getParameter("quantity")); + int purchaseLotNumber = Integer.parseInt(req.getParameter("purchaseLotNumber")); + accountServices.sellStock(purchaseLotNumber, quantity); + } + + } catch (Exception e) { + + throw new ServletException("stockSale " + e.getMessage(), e); + } + + } + + private void stockPurchase(HttpServletRequest req, HttpServletResponse resp, ProfileService profileServices, AccountService accountServices) + throws ServletException { + try { + if (!"cancel".equals(req.getParameter("cancel"))) { + + String symbol = req.getParameter("symbol").trim().toUpperCase(); + int quantity = Integer.parseInt(req.getParameter("quantity")); + StockSummary stockSummry = AccountFactory.INSTANCE.createStockSummary(); + stockSummry.setSymbol(symbol); + stockSummry.setQuantity(quantity); + accountServices.purchaseStock(profileServices.getId(), stockSummry); + } + } catch (Exception e) { + throw new ServletException("stockPurchase " + e.getMessage(), e); + } + } + + private void accountTransaction(HttpServletRequest req, HttpServletResponse resp, AccountService accountServices) throws ServletException { + try { + if (!"cancel".equals(req.getParameter("cancel"))) { + String account = req.getParameter("account"); + String amount = req.getParameter("Amount"); + if ("deposit".equals(req.getParameter("actionType"))) + accountServices.deposit(account, Float.parseFloat(amount)); + else + accountServices.withdraw(account, Float.parseFloat(amount)); + } + } catch (Exception e) { + throw new ServletException("accountTransaction " + e.getMessage(), e); + } + + } + + private void createAccount(HttpServletRequest pReq, HttpServletResponse pResp, AccountService accountServices) throws ServletException { + try { + CustomerProfileData customerProfileData = AccountFactory.INSTANCE.createCustomerProfileData(); + customerProfileData.setFirstName(pReq.getParameter("firstName")); + customerProfileData.setLastName(pReq.getParameter("lastName")); + customerProfileData.setAddress(pReq.getParameter("address")); + customerProfileData.setEmail(pReq.getParameter("email")); + customerProfileData.setLoginID(pReq.getParameter("loginID")); + customerProfileData.setPassword(pReq.getParameter("password")); + + CustomerProfileData resp = accountServices.createAccount(customerProfileData, "savings".equals(pReq.getParameter("savings")), "checkings" + .equals(pReq.getParameter("checkings"))); + LoginServlet.login(resp.getLoginID(), resp.getPassword()); + + } catch (IOException e) { + throw new ServletException(e); + } + + } +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java new file mode 100644 index 0000000000..886f42a778 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/ui/LoginServlet.java @@ -0,0 +1,91 @@ +/** + * + * 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.ui; + +import java.io.IOException; +import java.rmi.RemoteException; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +import bigbank.webclient.services.profile.LoginService; + +public class LoginServlet extends HttpServlet { + + public void init(ServletConfig pCfg) throws ServletException { + + } + + public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException { + + if ("logout".equals(pReq.getParameter("logout")) || "logoutHIDDEN".equals(pReq.getParameter("logoutHIDDEN"))) { + HttpSession sess = pReq.getSession(); + if (sess != null) + sess.invalidate(); + try { + pResp.sendRedirect("login.html"); + } catch (IOException e) { + + e.printStackTrace(); + throw new ServletException(e); + } + + } else { + + String login = pReq.getParameter("login"); + String password = pReq.getParameter("password"); + try { + int resp = login(login, password); + if (resp == LoginService.SUCCESS) { + + pResp.sendRedirect("summary.jsp"); + } else { + + pResp.sendRedirect("login.html"); + } + } catch (IOException e) { + throw new ServletException(e); + } + } + } + + static int login(final String login, final String password) throws ServletException { + + ModuleContext moduleContext = CurrentModuleContext.getContext(); + LoginService loginMgr = (LoginService) moduleContext.locateService("LoginServiceComponent"); + + if (loginMgr == null) { + throw new ServletException("LoginManager not found"); + } + + try { + return loginMgr.login(login, password); + } catch (RemoteException e) { + + throw new ServletException(e); + } + + } + +} diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.module b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.module new file mode 100644 index 0000000000..05e3859587 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.module @@ -0,0 +1,51 @@ + + + + + + + + + + + + AccountServiceComponent + ProfileServiceComponent + + + + + + + Anonymous + + + + + + + AccountService + + + + + + + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.subsystem b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.subsystem new file mode 100644 index 0000000000..c0b66ca4e7 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/sca.subsystem @@ -0,0 +1,27 @@ + + + + + + + sample-bigbank-account-subsystem/sample-bigbank-account/AccountService + + + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl new file mode 100644 index 0000000000..c44b826440 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/CustomerProfile.jsp b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/CustomerProfile.jsp new file mode 100644 index 0000000000..6fc0484056 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/CustomerProfile.jsp @@ -0,0 +1,97 @@ + +<%-- + 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 language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + +<%-- LINK href="theme/Master.css" rel="stylesheet" type="text/css" --%> +BigBank- Customer Account + +

Customer Account
+
+

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First name
Last name
Address
email
 
Checkings
Savings
 
Logon ID
Password
+
+   +
+


+

+ + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld new file mode 100644 index 0000000000..36554640cd --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld @@ -0,0 +1,91 @@ + + + + 1.0 + 2.0 + BigBank Tags + Tag library containing BigBank tags + + service + bigbank.webclient.tags.sca.ServiceTag + JSP + Places a reference to an SCA Service in the page context + + id + true + false + + + name + true + false + + + + login + bigbank.webclient.tags.sca.LoginBarrierTag + JSP + Redirects if user is not logged in + + profile + true + false + + + url + true + false + + + + + accountStatus + bigbank.webclient.tags.account.AccountStatusTag + JSP + Accesses and iterates the account service + + id + true + false + + + accountService + true + false + + + profileService + true + false + + + + stockStatus + bigbank.webclient.tags.account.StockStatusTag + JSP + Accesses and iterates the stocks + + id + true + false + + + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..3b4c735a62 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,44 @@ + + + + + Tuscany Bigbank Web UI sample + + login.html + + + + LoginServlet + bigbank.webclient.ui.LoginServlet + 1 + + + FormServlet + bigbank.webclient.ui.FormServlet + 0 + + + + LoginServlet + /loginAction/* + + + FormServlet + /FormServlet/* + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/accountTransaction.jsp b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/accountTransaction.jsp new file mode 100644 index 0000000000..4188b70b71 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/accountTransaction.jsp @@ -0,0 +1,47 @@ + +<%-- + 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 language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +BigBank - <%=request.getParameter("account") %> + + +

Account <%= request.getParameter("account") %>
+
+
+

+
+ + + +Amount to <%=request.getParameter("transaction")%>
+
+
+
+      +
+ + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/login.html b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/login.html new file mode 100644 index 0000000000..83f8fd3d2c --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/login.html @@ -0,0 +1,42 @@ + +Welcome to Big Bank + + + +
+ + + + +
Please login in to access your account
+ + + + + + + + + + + +   + +   + +
Login(test)
Password(password)
+
+


+
+
+
New to Big Bank? Please open a new account with us. +
+

+ + +

+ + + + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/purchaseStock.jsp b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/purchaseStock.jsp new file mode 100644 index 0000000000..b0838a9a81 --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/purchaseStock.jsp @@ -0,0 +1,56 @@ + +<%-- + 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 language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + +BigBank- Stock purchase + +

Stock purchase
+
+

+
+ + + + + + + + + + + + + + + + + + + +
Symbol
Quantity
+
+   +
+


+

+ + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/stockSale.jsp b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/stockSale.jsp new file mode 100644 index 0000000000..de4c438ffb --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/stockSale.jsp @@ -0,0 +1,53 @@ + +<%-- + 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 language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + +BigBank- Stock sale + +

Stock sale
+
+

+
+ + + + + + + + + + + + + + + + +
Quantity
+
+   +
+


+

+ + diff --git a/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp new file mode 100644 index 0000000000..263ab9e1ac --- /dev/null +++ b/sca-java-1.x/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/webapp/summary.jsp @@ -0,0 +1,136 @@ +<%-- + 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.AccountSummary" %> + <%@ page import="com.bigbank.account.StockSummary" %> + <%@ page session="true" %> + <%@ page autoFlush="true" %> +<%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %> + + + + + BigBank Account Summary + + + + Account Information for +
+ + + +    +
+ + + + + + + + + + + + + + + + + + + + + +
Account Balance
+ + + + + + + + + + +
+ + + +
+
+ Stocks:     
+
+ + + + + + + + <%-- spacer --%> + + + + + + <%-- spacer --%> + + + +
+
+ + + + <%-- spacer --%> + + + + + + + + <%-- spacer --%> + + + + +
SymbolQuantityPurchase Date  Purchase PriceCurrent PriceCompany NameToday HighToday Low   <%-- sell button --%>
+ + + + + +    + + + + + + + + + +    +
+ +
+ + + + +
-- cgit v1.2.3