summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp')
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/Company.jsp93
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/context.xml25
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml25
-rw-r--r--sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml35
4 files changed, 178 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/Company.jsp b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/Company.jsp
new file mode 100644
index 0000000000..0a156de1c7
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/Company.jsp
@@ -0,0 +1,93 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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="java.util.*" %>
+
+<%@ page import="org.apache.tuscany.sca.host.embedded.SCADomain"%>
+
+<%@ page import="commonj.sdo.*" %>
+<%@ page import="das.*" %>
+
+<html>
+<head>
+<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
+<%
+
+ SCADomain domain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+ if (domain == null) {
+ System.out.println("domain == NULL");
+ }
+
+
+ DASService dasService = domain.getService(DASService.class, "DASServiceComponent");
+
+ if (dasService == null) {
+ System.out.println("DASService == NULL");
+ }
+
+ List companyList = null;
+
+ try{
+ dasService.configureService(getClass().getClassLoader().getResourceAsStream("CompanyConfig.xml"));
+ DataObject root = dasService.executeCommand("all companies", null);
+ companyList = root.getList("COMPANY");
+ }catch(Exception e){
+ //TODO: handle case where dasService can't be initiated properly
+ }
+
+%>
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>DASService Client Test</title>
+</head>
+<body>
+
+<H2>Tuscany DAS Service WEB Client Application Example</H2>
+
+<!-- Do Fill -->
+<table border>
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody>
+
+ <%
+ java.util.Iterator i = companyList.iterator();
+ while (i.hasNext()) {
+ DataObject company = (DataObject)i.next();
+ %>
+ <tr>
+ <td><%=company.getInt("ID")%></td>
+ <td><%=company.getString("NAME")%></td>
+ <tr>
+ <%
+ }
+ %>
+ </tbody>
+</table>
+
+
+
+</form>
+</body>
+</html>
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/context.xml b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/context.xml
new file mode 100644
index 0000000000..0e90eb0a83
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/context.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+ -->
+<Context path="/DAS Stand alone app" debug="5" reloadable="true" crossContext="true">
+
+ <Manager pathname=""/>
+ <ResourceLink name="jdbc/dastest" global="jdbc/dastest" type="javax.sql.DataSource" />
+
+</Context>
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..25849fa6b9
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+-->
+
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:DASService"/>
+</contribution> \ No newline at end of file
diff --git a/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..67a782269e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-1.0.1/samples/company-das-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+ -->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>Tuscany DAS Service Client Application</display-name>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>Company.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>