summaryrefslogtreecommitdiffstats
path: root/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags')
-rw-r--r--tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java125
-rw-r--r--tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java79
-rw-r--r--tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java97
-rw-r--r--tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java98
4 files changed, 0 insertions, 399 deletions
diff --git a/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java b/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java
deleted file mode 100644
index c11d3f9e46..0000000000
--- a/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/AccountStatusTag.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- *
- * 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/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java b/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java
deleted file mode 100644
index ac0b5f4467..0000000000
--- a/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/account/StockStatusTag.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- *
- * 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/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java b/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java
deleted file mode 100644
index e923596bae..0000000000
--- a/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/LoginBarrierTag.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- *
- * 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/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java b/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java
deleted file mode 100644
index 1fa4252c0c..0000000000
--- a/tags/java-M1-20060518/java/sampleapps/bigbank/webclient/src/main/java/bigbank/webclient/tags/sca/ServiceTag.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- *
- * 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