Author: lresende
Date: Sun Aug 10 20:32:25 2008
New Revision: 684626
URL: http://svn.apache.org/viewvc?rev=684626&view=rev
Log:
Adding spring layer to organization sample application
Added:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/
(props changed)
- copied from r684376,
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/org/osoa/services/
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
(with props)
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
(with props)
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
(with props)
Removed:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/org/osoa/services/
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization.composite
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
Modified: tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml?rev=684626&r1=684625&r2=684626&view=diff
==============================================================================
--- tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml (original)
+++ tuscany/sandbox/lresende/sca/samples/organization-das/pom.xml Sun Aug 10
20:32:25 2008
@@ -51,6 +51,34 @@
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-impl</artifactId>
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/
------------------------------------------------------------------------------
svn:mergeinfo =
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java?rev=684626&r1=684376&r2=684626&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataService.java
Sun Aug 10 20:32:25 2008
@@ -17,10 +17,12 @@
* under the License.
*/
-package org.osoa.services;
+package organization.das;
+import org.osoa.sca.annotations.Remotable;
import org.soa.types.SchemaInfoType;
[EMAIL PROTECTED]
public interface OrganizationDataService {
public commonj.sdo.DataObject findOrganizationBugTwo(java.lang.String
id, SchemaInfoType schemaInfo);
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java?rev=684626&r1=684376&r2=684626&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/das/OrganizationDataServiceImpl.java
Sun Aug 10 20:32:25 2008
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.osoa.services;
+package organization.das;
import java.io.InputStream;
import java.sql.Connection;
Added:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java?rev=684626&view=auto
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
(added)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
Sun Aug 10 20:32:25 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package organization.services;
+
+import org.osoa.sca.annotations.Remotable;
+import org.soa.types.SchemaInfoType;
+
+import commonj.sdo.DataObject;
+
[EMAIL PROTECTED]
+public interface OrganizationService {
+
+ public DataObject findOrganizationBugTwo(String id, SchemaInfoType
schemaInfo);
+
+ public DataObject findOrganizationBugOne(String id, SchemaInfoType
schemaInfo);
+
+ public void updateOrganization(DataObject organization, SchemaInfoType
schemaInfo);
+}
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java?rev=684626&view=auto
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
(added)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
Sun Aug 10 20:32:25 2008
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+package organization.services;
+
+import org.osoa.sca.annotations.Service;
+import org.soa.types.SchemaInfoType;
+
+import organization.das.OrganizationDataService;
+
+import commonj.sdo.DataObject;
+
[EMAIL PROTECTED](OrganizationService.class)
+public class OrganizationServiceImpl implements OrganizationService {
+
+ private OrganizationDataService organizationDataService;
+
+ public OrganizationDataService getOrganizationDataService() {
+ return organizationDataService;
+ }
+
+ public void setOrganizationDataService(OrganizationDataService
organizationDataService) {
+ this.organizationDataService = organizationDataService;
+ }
+
+ public DataObject findOrganizationBugTwo(String id, SchemaInfoType
schemaInfo) {
+ return organizationDataService.findOrganizationBugTwo(id,
schemaInfo);
+ }
+
+ public DataObject findOrganizationBugOne(String id, SchemaInfoType
schemaInfo) {
+ return organizationDataService.findOrganizationBugOne(id,
schemaInfo);
+ }
+
+ public void updateOrganization(DataObject organization, SchemaInfoType
schemaInfo) {
+ organizationDataService.updateOrganization(organization,
schemaInfo);
+ }
+}
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/java/organization/services/OrganizationServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml?rev=684626&view=auto
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
(added)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
Sun Aug 10 20:32:25 2008
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca
http://www.springframework.org/schema/sca/spring-sca.xsd">
+
+ <sca:service name="OrganizationService"
+ type="organization.services.OrganizationService"
target="OrganizationServiceBean"/>
+
+ <bean id="OrganizationServiceBean"
class="organization.services.OrganizationServiceImpl">
+ <property name="organizationDataService"
ref="OrganizationDataServiceBean"/>
+ </bean>
+
+ <bean id="OrganizationDataServiceBean"
class="organization.das.OrganizationDataServiceImpl">
+
+ </bean>
+</beans>
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization-spring-context.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization.composite
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization.composite?rev=684626&r1=684625&r2=684626&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization.composite
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/main/resources/organization.composite
Sun Aug 10 20:32:25 2008
@@ -5,17 +5,17 @@
xmlns:soa="http://org.soa.services"
name="Organization-Service-Composite">
- <component name="OrganizationServiceComponent">
- <implementation.spring location="Organization-spring-context.xml"/>
- <service name="OrganizationService"/>
- </component>
-
<service name="OrganizationService"
promote="OrganizationServiceComponent/OrganizationService">
<binding.ws/>
</service>
+
+ <component name="OrganizationServiceComponent">
+ <implementation.spring location="organization-spring-context.xml"/>
+ <service name="OrganizationService"/>
+ </component>
<component name="OrganizationDataServiceComponent">
- <implementation.spring location="Organization-spring-context.xml"/>
+ <implementation.spring location="organization-spring-context.xml"/>
</component>
Modified:
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java?rev=684626&r1=684625&r2=684626&view=diff
==============================================================================
---
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
(original)
+++
tuscany/sandbox/lresende/sca/samples/organization-das/src/test/java/organization/OrganizationTestCase.java
Sun Aug 10 20:32:25 2008
@@ -21,8 +21,6 @@
import java.io.InputStream;
import java.util.Random;
-import junit.framework.Assert;
-
import org.apache.tuscany.das.rdb.Command;
import org.apache.tuscany.das.rdb.DAS;
import org.apache.tuscany.sca.host.embedded.SCADomain;
@@ -30,6 +28,7 @@
import org.soa.types.SchemaInfoType;
import org.soa.types.TypesFactory;
+import organization.services.OrganizationService;
import util.ConnectionHelper;
import commonj.sdo.DataObject;
@@ -46,7 +45,7 @@
DataObject root = null;
InputStream in =
getClass().getClassLoader().getResourceAsStream("organizationConfiguration.xml");
- // Need to put in valid values for your DB
+ // Need to put in valid values for your DB
SchemaInfoType schemaInfo =
TypesFactory.INSTANCE.createSchemaInfoType();
schemaInfo.setPASSWORD("");
schemaInfo.setSCHEMA("");
@@ -84,23 +83,25 @@
@Test
public void testRetrieveOrganizationSCA() {
- /*
System.out.println("\n1. Organization-Service-Composite
OrganizationClientRunner ");
- SCADomain scaDomain =
-
SCADomain.newInstance("Organization-Service-Composite.composite");
+ SCADomain scaDomain = SCADomain.newInstance("organization.composite");
OrganizationService organizationService =
scaDomain.getService(OrganizationService.class,
"OrganizationServiceComponent");
// Need to put in valid values for your DB
- SchemaInfoType schemaInfo =
org.soa.types.TypeFactory.INSTANCE.createSchemaInfoType();
+ SchemaInfoType schemaInfo =
TypesFactory.INSTANCE.createSchemaInfoType();
schemaInfo.setPASSWORD("");
schemaInfo.setSCHEMA("");
schemaInfo.setUSERNAME("");
// This doesn't work. Just retreive account, make a change, then
apply changes
- //commonj.sdo.DataObject root =
organizationService.findOrganizationBugOne("16", schemaInfo);
+ DataObject root = organizationService.findOrganizationBugOne(id,
schemaInfo);
+ DataObject account = root.getDataObject("ACCOUNT[1]");
+
+ org.junit.Assert.assertEquals("TestNode2",
account.get("ACCOUNT_NAME"));
+
// This doesn't work either. The root datagraph is null
// If you call das.applyChanges for a dataObject that has null as the
dataGraph,
@@ -110,7 +111,5 @@
//organizationService.updateOrganization(rootOne, schemaInfo);
scaDomain.close();
-
- */
}
}