summaryrefslogtreecommitdiffstats
path: root/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags')
-rw-r--r--tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java125
-rw-r--r--tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java87
-rw-r--r--tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java100
3 files changed, 0 insertions, 312 deletions
diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java
deleted file mode 100644
index ecdb0c49b4..0000000000
--- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/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 org.apache.tuscany.samples.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.apache.tuscany.samples.bigbank.account.services.account.AccountService;
-import org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileService;
-import org.osoa.sca.CurrentModuleContext;
-import org.osoa.sca.ModuleContext;
-
-/**
- * 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 {
- summaries = service.getAccountReport(profile.getId()).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-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java
deleted file mode 100644
index 31fa27fa6f..0000000000
--- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java
+++ /dev/null
@@ -1,87 +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 org.apache.tuscany.samples.bigbank.webclient.tags.sca;
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.TagSupport;
-
-import org.osoa.sca.CurrentModuleContext;
-import org.osoa.sca.ModuleContext;
-
-import org.apache.tuscany.samples.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;
- }
-
- 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 {
- pageContext.forward(mUrl);
- 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 EVAL_PAGE;
- }
-
- public void release() {
- super.release();
- }
-
-}
diff --git a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java b/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java
deleted file mode 100644
index df5697c11f..0000000000
--- a/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java
+++ /dev/null
@@ -1,100 +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 org.apache.tuscany.samples.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