flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [05/51] [partial] flex-blazeds git commit: - Moved old stuff to an "attic" directory - Changed the directory structure to comply to a default maven directory structure
Date Tue, 04 Aug 2015 09:51:43 GMT
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/spring/app-config.xml
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/spring/app-config.xml b/attic/apps/samples-spring/WEB-INF/spring/app-config.xml
new file mode 100755
index 0000000..1ad0b11
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/spring/app-config.xml
@@ -0,0 +1,58 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:security="http://www.springframework.org/schema/security"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="
+		http://www.springframework.org/schema/beans
+		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+		http://www.springframework.org/schema/security
+		http://www.springframework.org/schema/security/spring-security-3.0.xsd
+		http://www.springframework.org/schema/context
+		http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+	<!-- 
+		Enable annotation-based configuration. companyService and industryService 
+		(used in the Company Manager sample) are configured using annotations. 
+		Open CompanyDAO.java and IndustryDAO.java for details. 
+	-->
+	<context:annotation-config />
+	<context:component-scan base-package="org.springframework.flex.samples" />
+
+	<!-- Implementation of ProductDAO using low-level JDBC -->
+	<bean id="productService" class="org.springframework.flex.samples.product.ProductDAO">
+		<constructor-arg ref="dataSource" />
+	</bean>
+
+	<!-- Implementation of ContactDAO using Spring's JdbcTemplate -->
+	<bean id="contactService" class="org.springframework.flex.samples.contact.ContactDAO">
+		<constructor-arg ref="dataSource" />
+	</bean>
+
+	<!-- A secured implementation of ProductDAO -->
+	<bean id="securedProductService" class="org.springframework.flex.samples.product.ProductDAO">
+		<constructor-arg ref="dataSource" />
+		<security:intercept-methods>
+			<security:protect method="find*" access="ROLE_USER" />
+		</security:intercept-methods>
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml b/attic/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
new file mode 100755
index 0000000..96413af
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:amq="http://activemq.apache.org/schema/core"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/jdbc
+        http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
+ 
+    <!-- Create and populate the tables of the embedded database -->
+    <bean id="dbInit" class="org.springframework.flex.samples.util.DatabaseInitializer">
+        <constructor-arg ref="dataSource" />
+    </bean>
+
+    <!--
+        Simple Spring-managed DataSource for embedded HSQL database
+        The dbInit bean takes care of creating and populating the sample tables.
+    -->
+    <jdbc:embedded-database id="dataSource" type="HSQL" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/spring/security-config.xml
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/spring/security-config.xml b/attic/apps/samples-spring/WEB-INF/spring/security-config.xml
new file mode 100755
index 0000000..802973d
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/spring/security-config.xml
@@ -0,0 +1,43 @@
+<?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.
+
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
+
+	<http entry-point-ref="entryPoint">
+	    <anonymous enabled="false"/>
+		<form-login default-target-url="/spring-blazeds-security-101/index.html" login-page="/login.jsp" />
+	</http>
+    
+	<beans:bean id="entryPoint" 
+	    class="org.springframework.flex.security3.FlexAuthenticationEntryPoint"/>
+	
+	<authentication-manager>
+	   <authentication-provider>
+	       <user-service>
+	        <user name="john" password="john" authorities="ROLE_USER" />
+            <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
+            <user name="guest" password="guest" authorities="ROLE_GUEST" />
+	       </user-service>
+	   </authentication-provider>
+	</authentication-manager>
+
+</beans:beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/.classpath b/attic/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
new file mode 100755
index 0000000..f5f24a9
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
@@ -0,0 +1,68 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aopalliance-1.0.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aspectjrt-1.6.3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aspectjweaver-1.6.5.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/backport-util-concurrent-2.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/cglib-nodep-2.1_3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-codec-1.3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-logging-1.1.1.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-common.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-core.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-opt.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-proxy.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-remoting.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-rds-server.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/hsqldb.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/jackson-core-asl-1.0.0.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/jstl-1.1.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.aop-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.asm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.aspects-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.beans-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.context.support-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.context-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.core-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.expression-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.flex-1.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.instrument.tomcat-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.instrument-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.integration-1.0.4.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.jdbc-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.jms-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.orm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.oxm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.test-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.transaction-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.portlet-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.servlet-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.struts-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-config-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-core-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-web-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/standard-1.1.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/.project
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/.project b/attic/apps/samples-spring/WEB-INF/src/spring-samples/.project
new file mode 100755
index 0000000..fa94ab5
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/.project
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>spring-samples</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
new file mode 100755
index 0000000..f220d2f
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.company;
+
+import java.io.Serializable;
+
+import org.springframework.flex.samples.industry.Industry;
+
+public class Company implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String name;
+
+    private String address;
+
+    private String city;
+
+    private String state;
+
+    private String zip;
+
+    private String phone;
+
+    private Industry industry;
+
+    public Company() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return this.address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCity() {
+        return this.city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return this.state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return this.zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getPhone() {
+        return this.phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Industry getIndustry() {
+        return this.industry;
+    }
+
+    public void setIndustry(Industry industry) {
+        this.industry = industry;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
new file mode 100755
index 0000000..713e56f
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.company;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.flex.remoting.RemotingDestination;
+import org.springframework.flex.remoting.RemotingExclude;
+import org.springframework.flex.remoting.RemotingInclude;
+import org.springframework.flex.samples.industry.IIndustryDAO;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.stereotype.Service;
+
+@Service("companyService")
+@RemotingDestination(channels = { "my-amf" })
+public class CompanyDAO implements ICompanyDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertCompany;
+
+    private final IIndustryDAO industryDAO;
+
+    private final RowMapper<Company> rowMapper = new ParameterizedRowMapper<Company>() {
+
+        public Company mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Company company = new Company();
+            company.setId(rs.getInt("id"));
+            company.setName(rs.getString("name"));
+            company.setAddress(rs.getString("address"));
+            company.setCity(rs.getString("city"));
+            company.setState(rs.getString("state"));
+            company.setZip(rs.getString("zip"));
+            company.setPhone(rs.getString("phone"));
+            company.setIndustry(CompanyDAO.this.industryDAO.findById(rs.getInt("industry_id")));
+            return company;
+        }
+    };
+
+    @Autowired
+    public CompanyDAO(DataSource dataSource, IIndustryDAO industryDAO) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertCompany = new SimpleJdbcInsert(dataSource).withTableName("COMPANY").usingGeneratedKeyColumns("ID");
+        this.industryDAO = industryDAO;
+    }
+
+    @RemotingInclude
+    public Company findById(int id) {
+        return this.template.queryForObject("SELECT * FROM company WHERE id=?", this.rowMapper, id);
+    }
+
+    @RemotingInclude
+    public List<Company> findAll() {
+        return this.template.query("SELECT * FROM company ORDER BY name", this.rowMapper);
+    }
+
+    @RemotingInclude
+    public List<Company> findByName(String name) {
+        return this.template.query("SELECT * FROM company WHERE UPPER(name) LIKE ? ORDER BY name", this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    @RemotingInclude
+    public Company create(Company company) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("name", company.getName());
+        parameters.put("address", company.getAddress());
+        parameters.put("city", company.getCity());
+        parameters.put("state", company.getState());
+        parameters.put("zip", company.getZip());
+        parameters.put("phone", company.getPhone());
+        parameters.put("industry_id", company.getIndustry().getId());
+        Number id = this.insertCompany.executeAndReturnKey(parameters);
+        company.setId(id.intValue());
+        return company;
+    }
+
+    @RemotingInclude
+    public boolean update(Company company) {
+        int count = this.template.update("UPDATE company SET name=?, address=?, city=?, state=?, zip=?, phone=?, industry_id=? WHERE id=?",
+            company.getName(), company.getAddress(), company.getCity(), company.getState(), company.getZip(), company.getPhone(),
+            company.getIndustry().getId(), company.getId());
+        return count == 1;
+    }
+
+    @RemotingExclude
+    public boolean remove(Company company) {
+        int count = this.template.update("DELETE FROM company WHERE id=?", company.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
new file mode 100755
index 0000000..30e66df
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.company;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+public interface ICompanyDAO extends IGenericDAO<Company> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
new file mode 100755
index 0000000..364e128
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.contact;
+
+import java.io.Serializable;
+
+public class Contact implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String firstName;
+
+    private String lastName;
+
+    private String address;
+
+    private String city;
+
+    private String state;
+
+    private String zip;
+
+    private String phone;
+
+    private String email;
+
+    public Contact() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getFirstName() {
+        return this.firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return this.lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getAddress() {
+        return this.address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCity() {
+        return this.city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return this.state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return this.zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getPhone() {
+        return this.phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getEmail() {
+        return this.email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
new file mode 100755
index 0000000..8c7115a
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.
+ */
+ 
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: April 10, 2010
+  * Reason: Migrated the DB used for samples-spring web app to HSQL.
+  */
+
+package org.springframework.flex.samples.contact;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+
+public class ContactDAO implements IContactDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertContact;
+
+    private final RowMapper<Contact> rowMapper = new ParameterizedRowMapper<Contact>() {
+
+        public Contact mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Contact contact = new Contact();
+            contact.setId(rs.getInt("id"));
+            contact.setFirstName(rs.getString("first_name"));
+            contact.setLastName(rs.getString("last_name"));
+            contact.setAddress(rs.getString("address"));
+            contact.setCity(rs.getString("city"));
+            contact.setState(rs.getString("state"));
+            contact.setZip(rs.getString("zip"));
+            contact.setPhone(rs.getString("phone"));
+            contact.setEmail(rs.getString("email"));
+            return contact;
+        }
+    };
+
+    public ContactDAO(DataSource dataSource) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertContact = new SimpleJdbcInsert(dataSource).withTableName("CONTACT").usingGeneratedKeyColumns("ID");
+    }
+
+    public List<Contact> findAll() {
+        return this.template.query("SELECT * FROM contact ORDER BY first_name, last_name", this.rowMapper);
+    }
+
+    public List<Contact> findByName(String name) {
+        return this.template.query("SELECT * FROM contact WHERE UPPER(CONCAT(CONCAT(first_name, ' '), last_name)) LIKE ? ORDER BY first_name, last_name",
+            this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    public Contact findById(int id) {
+        return this.template.queryForObject("SELECT * FROM contact WHERE id=?", this.rowMapper, id);
+    }
+
+    public Contact create(Contact contact) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("first_name", contact.getFirstName());
+        parameters.put("last_name", contact.getLastName());
+        parameters.put("address", contact.getAddress());
+        parameters.put("city", contact.getCity());
+        parameters.put("state", contact.getState());
+        parameters.put("zip", contact.getZip());
+        parameters.put("phone", contact.getPhone());
+        parameters.put("email", contact.getEmail());
+        Number id = this.insertContact.executeAndReturnKey(parameters);
+        contact.setId(id.intValue());
+        return contact;
+    }
+
+    public boolean update(Contact contact) {
+        int count = this.template.update(
+            "UPDATE contact SET first_name=?, last_name=?, address=?, city=?, state=?, zip=?, phone=?, email=? WHERE id=?", contact.getFirstName(),
+            contact.getLastName(), contact.getAddress(), contact.getCity(), contact.getState(), contact.getZip(), contact.getPhone(),
+            contact.getEmail(), contact.getId());
+        return count == 1;
+    }
+
+    public boolean remove(Contact contact) {
+        int count = this.template.update("DELETE FROM contact WHERE id=?", contact.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
new file mode 100755
index 0000000..5096acf
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.contact;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+public interface IContactDAO extends IGenericDAO<Contact> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
new file mode 100755
index 0000000..ecd5a6e
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.dao;
+
+import java.util.List;
+
+public interface IGenericDAO<T> {
+
+    public List<T> findAll();
+
+    public List<T> findByName(String name);
+
+    public T findById(int id);
+
+    public T create(T item);
+
+    public boolean update(T item);
+
+    public boolean remove(T item);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
new file mode 100755
index 0000000..2444f6f
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.industry;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+public interface IIndustryDAO extends IGenericDAO<Industry> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
new file mode 100755
index 0000000..92292b2
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.industry;
+
+import java.io.Serializable;
+
+public class Industry implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String name;
+
+    public Industry() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
new file mode 100755
index 0000000..47cda01
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.industry;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.flex.remoting.RemotingDestination;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.stereotype.Service;
+
+@Service("industryService")
+@RemotingDestination(channels = { "my-amf" })
+public class IndustryDAO implements IIndustryDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertIndustry;
+
+    private final RowMapper<Industry> rowMapper = new ParameterizedRowMapper<Industry>() {
+
+        public Industry mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Industry industry = new Industry();
+            industry.setId(rs.getInt("id"));
+            industry.setName(rs.getString("name"));
+            return industry;
+        }
+    };
+
+    public List<Industry> findAll() {
+        return this.template.query("SELECT * FROM industry ORDER BY name", this.rowMapper);
+    }
+
+    public List<Industry> findByName(String name) {
+        return this.template.query("SELECT * FROM industry WHERE UPPER(name) LIKE ? ORDER BY name", this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    @Autowired
+    public IndustryDAO(DataSource dataSource) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertIndustry = new SimpleJdbcInsert(dataSource).withTableName("INDUSTRY").usingGeneratedKeyColumns("ID");
+    }
+
+    public Industry findById(int id) {
+        return this.template.queryForObject("SELECT * FROM industry WHERE id=?", this.rowMapper, id);
+    }
+
+    public Industry create(Industry industry) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("name", industry.getName());
+        Number id = this.insertIndustry.executeAndReturnKey(parameters);
+        industry.setId(id.intValue());
+        return industry;
+    }
+
+    public boolean update(Industry industry) {
+        int count = this.template.update("UPDATE industry SET name=? WHERE id=?", industry.getName());
+        return count == 1;
+    }
+
+    public boolean remove(Industry industry) {
+        int count = this.template.update("DELETE FROM industry WHERE id=?", industry.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
new file mode 100755
index 0000000..b7dd467
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.integration;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class Counter {
+
+    private volatile boolean running;
+
+    private final Log log = LogFactory.getLog(Counter.class);
+
+    private final AtomicInteger count = new AtomicInteger();
+
+    public Integer next() {
+        return this.running ? this.count.getAndIncrement() : null;
+    }
+
+    public void handle(String message) {
+        if ("start".equalsIgnoreCase(message)) {
+            this.running = true;
+        } else if ("stop".equalsIgnoreCase(message)) {
+            this.running = false;
+        } else {
+            try {
+                this.count.set(Integer.parseInt(message));
+            } catch (NumberFormatException e) {
+                this.log.info("UNSUPPORTED FLEX MESSAGE RECEIVED: " + message);
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
new file mode 100755
index 0000000..db0423f
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.
+ */
+
+  /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: May 19, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-533: unexploded war fails to deploy on weblogic
+  * 
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+
+package org.springframework.flex.samples.marketfeed;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.springframework.core.io.Resource;
+import org.springframework.flex.messaging.AsyncMessageCreator;
+import org.springframework.flex.messaging.MessageTemplate;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import flex.messaging.messages.AsyncMessage;
+
+public class MarketFeed {
+
+    private static FeedThread thread;
+
+    private final MessageTemplate template;
+
+    private final List<Stock> stockList;
+
+    public MarketFeed(MessageTemplate template, Resource filePath) throws IOException {
+        this.template = template;
+        this.stockList = getStocks(filePath.getInputStream());
+    }
+
+    public void start() {
+        if (thread == null) {
+            thread = new FeedThread(this.template, this.stockList);
+            thread.start();
+        }
+    }
+
+    public void stop() {
+        if (thread != null) {
+            thread.running = false;
+            thread = null;
+        }
+    }
+
+    private List<Stock> getStocks(InputStream fileInputStream) {
+
+        List<Stock> list = new ArrayList<Stock>();
+
+        try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            factory.setValidating(false);
+            Document doc = factory.newDocumentBuilder().parse(fileInputStream);
+            NodeList stockNodes = doc.getElementsByTagName("stock");
+            int length = stockNodes.getLength();
+            Stock stock;
+            Node stockNode;
+            for (int i = 0; i < length; i++) {
+                stockNode = stockNodes.item(i);
+                stock = new Stock();
+                stock.setSymbol(getStringValue(stockNode, "symbol"));
+                stock.setName(getStringValue(stockNode, "company"));
+                stock.setLast(getDoubleValue(stockNode, "last"));
+                stock.setHigh(stock.getLast());
+                stock.setLow(stock.getLast());
+                stock.setOpen(stock.getLast());
+                stock.setChange(0);
+                list.add(stock);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return list;
+    }
+
+    private String getStringValue(Node node, String name) {
+        return ((Element) node).getElementsByTagName(name).item(0).getFirstChild().getNodeValue();
+    }
+
+    private double getDoubleValue(Node node, String name) {
+        return Double.parseDouble(getStringValue(node, name));
+    }
+
+    public static class FeedThread extends Thread {
+
+        public boolean running = false;
+
+        private final MessageTemplate template;
+
+        private final List<Stock> stockList;
+
+        private final Random random = new Random();
+
+        public FeedThread(MessageTemplate template, List<Stock> stockList) {
+            this.template = template;
+            this.stockList = stockList;
+        }
+
+        @Override
+        public void run() {
+            this.running = true;
+
+            int size = this.stockList.size();
+            int index = 0;
+
+            Stock stock;
+
+            while (this.running) {
+
+                stock = this.stockList.get(index);
+                simulateChange(stock);
+
+                index++;
+                if (index >= size) {
+                    index = 0;
+                }
+
+                sendStockUpdate(stock);
+
+                try {
+                    Thread.sleep(20);
+                } catch (InterruptedException e) {
+                }
+
+            }
+        }
+
+        private void sendStockUpdate(final Stock stock) {
+            template.send(new AsyncMessageCreator() {
+
+                public AsyncMessage createMessage() {
+                    AsyncMessage msg = template.createMessageForDestination("market-feed");
+                    msg.setHeader("DSSubtopic", stock.getSymbol());
+                    msg.setBody(stock);
+                    return msg;
+                }
+            });
+        }
+
+        private void simulateChange(Stock stock) {
+
+            double maxChange = stock.open * 0.005;
+            double change = maxChange - this.random.nextDouble() * maxChange * 2;
+            stock.change = change;
+            double last = stock.last + change;
+
+            if (last < stock.open + stock.open * 0.15 && last > stock.open - stock.open * 0.15) {
+                stock.last = last;
+            } else {
+                stock.last = stock.last - change;
+            }
+
+            if (stock.last > stock.high) {
+                stock.high = stock.last;
+            } else if (stock.last < stock.low) {
+                stock.low = stock.last;
+            }
+            stock.date = new Date();
+
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
new file mode 100755
index 0000000..c5cbf45
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.marketfeed;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Stock implements Serializable {
+
+    private static final long serialVersionUID = -1763421100056755200L;
+
+    protected String symbol;
+
+    protected String name;
+
+    protected double low;
+
+    protected double high;
+
+    protected double open;
+
+    protected double last;
+
+    protected double change;
+
+    protected Date date;
+
+    public double getChange() {
+        return this.change;
+    }
+
+    public void setChange(double change) {
+        this.change = change;
+    }
+
+    public double getHigh() {
+        return this.high;
+    }
+
+    public void setHigh(double high) {
+        this.high = high;
+    }
+
+    public double getLast() {
+        return this.last;
+    }
+
+    public void setLast(double last) {
+        this.last = last;
+    }
+
+    public double getLow() {
+        return this.low;
+    }
+
+    public void setLow(double low) {
+        this.low = low;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getOpen() {
+        return this.open;
+    }
+
+    public void setOpen(double open) {
+        this.open = open;
+    }
+
+    public String getSymbol() {
+        return this.symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+
+    public Date getDate() {
+        return this.date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
new file mode 100755
index 0000000..a5f2f54
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.product;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+public interface IProductDAO extends IGenericDAO<Product> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
new file mode 100755
index 0000000..5e37e19
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.product;
+
+import java.io.Serializable;
+
+public class Product implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int productId;
+
+    private String name;
+
+    private String description;
+
+    private String image;
+
+    private String category;
+
+    private double price;
+
+    private int qty;
+
+    public Product() {
+
+    }
+
+    public Product(int productId, String name, String description, String image, String category, double price, int qty) {
+        this.productId = productId;
+        this.name = name;
+        this.description = description;
+        this.image = image;
+        this.category = category;
+        this.price = price;
+        this.qty = qty;
+    }
+
+    public String getCategory() {
+        return this.category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getImage() {
+        return this.image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getPrice() {
+        return this.price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+
+    public int getProductId() {
+        return this.productId;
+    }
+
+    public void setProductId(int productId) {
+        this.productId = productId;
+    }
+
+    public int getQty() {
+        return this.qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
new file mode 100755
index 0000000..881b22a
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.springframework.flex.samples.product;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+public class ProductDAO implements IProductDAO {
+
+    private final DataSource dataSource;
+
+    public ProductDAO(DataSource dataSource) {
+        this.dataSource = dataSource;
+    }
+
+    public List<Product> findAll() {
+        List<Product> list = new ArrayList<Product>();
+        Connection c = null;
+
+        try {
+            c = this.dataSource.getConnection();
+            Statement s = c.createStatement();
+            ResultSet rs = s.executeQuery("SELECT * FROM product ORDER BY name");
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("id"), rs.getString("name"), rs.getString("description"), rs.getString("image"),
+                    rs.getString("category"), rs.getDouble("price"), rs.getInt("qty")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return list;
+    }
+
+    public List<Product> findByName(String name) {
+        List<Product> list = new ArrayList<Product>();
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE UPPER(name) LIKE ? ORDER BY name");
+            ps.setString(1, "%" + name.toUpperCase() + "%");
+            ResultSet rs = ps.executeQuery();
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("id"), rs.getString("name"), rs.getString("description"), rs.getString("image"),
+                    rs.getString("category"), rs.getDouble("price"), rs.getInt("qty")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return list;
+    }
+
+    public Product findById(int id) {
+        Product product = new Product();
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE id=?");
+            ps.setInt(1, id);
+            ResultSet rs = ps.executeQuery();
+            if (rs.next()) {
+                product = new Product();
+                product.setProductId(rs.getInt("id"));
+                product.setName(rs.getString("name"));
+                product.setDescription(rs.getString("description"));
+                product.setImage(rs.getString("image"));
+                product.setCategory(rs.getString("category"));
+                product.setPrice(rs.getDouble("price"));
+                product.setQty(rs.getInt("qty"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return product;
+    }
+
+    public Product create(Product product) {
+        Connection c = null;
+        PreparedStatement ps = null;
+        try {
+            c = this.dataSource.getConnection();
+            ps = c.prepareStatement("INSERT INTO product (name, description, image, category, price, qty) VALUES (?, ?, ?, ?, ?, ?)",
+                new String[] { "ID" });
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQty());
+            ps.executeUpdate();
+            ResultSet rs = ps.getGeneratedKeys();
+            rs.next();
+            // Update the id in the returned object. This is important as this value must be returned to the client.
+            int id = rs.getInt(1);
+            product.setProductId(id);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return product;
+    }
+
+    public boolean update(Product product) {
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("UPDATE product SET name=?, description=?, image=?, category=?, price=?, qty=? WHERE id=?");
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQty());
+            ps.setInt(7, product.getProductId());
+            return ps.executeUpdate() == 1;
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    public boolean remove(Product product) {
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("DELETE FROM product WHERE id=?");
+            ps.setInt(1, product.getProductId());
+            int count = ps.executeUpdate();
+            return count == 1;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
new file mode 100755
index 0000000..60e0fa2
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.springframework.flex.samples.secured;
+
+import java.util.Map;
+
+import org.springframework.flex.security3.AuthenticationResultUtils;
+
+
+public class Security3Helper {
+
+    public Map<String, Object> getAuthentication() {
+        return AuthenticationResultUtils.getAuthenticationResult();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
new file mode 100755
index 0000000..759cbd6
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.
+ */
+
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+
+package org.springframework.flex.samples.simplefeed;
+
+import java.util.Random;
+
+import org.springframework.flex.messaging.MessageTemplate;
+
+public class SimpleFeed {
+
+    private static FeedThread thread;
+
+    private final MessageTemplate template;
+
+    public SimpleFeed(MessageTemplate template) {
+        this.template = template;
+    }
+
+    public void start() {
+        if (thread == null) {
+            thread = new FeedThread(this.template);
+            thread.start();
+        }
+    }
+
+    public void stop() {
+        if (thread != null) {
+            thread.running = false;
+            thread = null;
+        }
+    }
+
+    public static class FeedThread extends Thread {
+
+        public boolean running = false;
+
+        private final MessageTemplate template;
+
+        public FeedThread(MessageTemplate template) {
+            this.template = template;
+        }
+
+        @Override
+        public void run() {
+            this.running = true;
+            Random random = new Random();
+            double initialValue = 35;
+            double currentValue = 35;
+            double maxChange = initialValue * 0.005;
+
+            while (this.running) {
+                double change = maxChange - random.nextDouble() * maxChange * 2;
+                double newValue = currentValue + change;
+
+                if (currentValue < initialValue + initialValue * 0.15 && currentValue > initialValue - initialValue * 0.15) {
+                    currentValue = newValue;
+                } else {
+                    currentValue -= change;
+                }
+
+                this.template.send("simple-feed", new Double(currentValue));
+
+                try {
+                    Thread.sleep(300);
+                } catch (InterruptedException e) {
+                }
+
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/75229759/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
----------------------------------------------------------------------
diff --git a/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
new file mode 100755
index 0000000..4f67140
--- /dev/null
+++ b/attic/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * 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.
+ */
+
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: Apr 10, 2010
+  * Reason: Migrated the DB used for samples-spring web app to HSQL
+  * 
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+ 
+package org.springframework.flex.samples.util;
+
+import javax.sql.DataSource;
+
+import org.springframework.jdbc.core.JdbcTemplate;
+
+public class DatabaseInitializer {
+
+    private final JdbcTemplate template;
+
+    public DatabaseInitializer(DataSource ds) {
+        this.template = new JdbcTemplate(ds);
+        createTableProduct();
+        insertProducts();
+        createTableContact();
+        insertContacts();
+        createTableIndustry();
+        insertIndustries();
+        createTableCompany();
+        insertCompanies();
+        createTableAccount();
+        insertAccounts();
+    }
+
+    public void createTableContact() {
+        String sql = "CREATE TABLE CONTACT (" + "ID INT IDENTITY PRIMARY KEY, " + "FIRST_NAME VARCHAR(50), "
+            + "LAST_NAME VARCHAR(50), " + "ADDRESS VARCHAR(50), " + "CITY VARCHAR(50), " + "STATE VARCHAR(20), " + "ZIP VARCHAR(20), "
+            + "PHONE VARCHAR(50), " + "EMAIL VARCHAR(50), " + "DOB DATE)";
+        this.template.execute(sql);
+    }
+
+    public void createTableCompany() {
+        String sql = "CREATE TABLE COMPANY (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50), " + "ADDRESS VARCHAR(50), "
+            + "CITY VARCHAR(50), " + "STATE VARCHAR(20), " + "ZIP VARCHAR(20), " + "PHONE VARCHAR(50), " + "INDUSTRY_ID INT)";
+        this.template.execute(sql);
+    }
+
+    public void createTableIndustry() {
+        String sql = "CREATE TABLE INDUSTRY (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50))";
+        this.template.execute(sql);
+    }
+
+    public void createTableProduct() {
+        String sql = "CREATE TABLE PRODUCT (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50), " + "CATEGORY VARCHAR(50), "
+            + "DESCRIPTION LONGVARCHAR, " + "IMAGE VARCHAR(255), " + "PRICE DOUBLE, " + "QTY INT)";
+        this.template.execute(sql);
+    }
+
+    public void createTableAccount() {
+        String sql = "CREATE TABLE ACCOUNT (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50)," + "TYPE INT,"
+            + "INDUSTRY INT," + "OWNER INT," + "PHONE VARCHAR(30)," + "FAX VARCHAR(30)," + "TICKER VARCHAR(10)," + "OWNERSHIP VARCHAR(20),"
+            + "NUMBER_EMPLOYEES INT," + "ANNUAL_REVENUE DOUBLE," + "PRIORITY INT," + "RATING INT," + "ADDRESS1 VARCHAR(50),"
+            + "ADDRESS2 VARCHAR(50)," + "CITY VARCHAR(50)," + "STATE VARCHAR(50)," + "ZIP VARCHAR(20)," + "URL VARCHAR(50)," + "NOTES LONGVARCHAR,"
+            + "CURRENT_YEAR_RESULTS DOUBLE," + "LAST_YEAR_RESULTS DOUBLE)";
+        this.template.execute(sql);
+    }
+
+    public void insertContacts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM CONTACT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO CONTACT (FIRST_NAME, LAST_NAME, ADDRESS, CITY, STATE, ZIP, PHONE, EMAIL) VALUES (?,?,?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Christophe", "Coenraets", "275 Grove St", "Newton", "MA", "02476", "617-219-2000",
+            "ccoenrae@adobe.com" });
+        this.template.update(sql, new Object[] { "John", "Smith", "1 Main st", "Boston", "MA", "01744", "617-219-2001", "jsmith@mail.com" });
+        this.template.update(sql, new Object[] { "Lisa", "Taylor", "501 Townsend st", "San Francisco", "CA", "", "415-534-7865", "ltaylor@mail.com" });
+        this.template.update(sql, new Object[] { "Noah", "Jones", "1200 5th Avenue ", "New York", "NY", "", "212-764-2345", "njones@mail.com" });
+        this.template.update(sql, new Object[] { "Bill", "Johnson", "1345 6th street", "Chicago", "IL", "", "", "bjohnson@mail.com" });
+        this.template.update(sql, new Object[] { "Chloe", "Rodriguez", "34 Elm street", "Dallas", "TX", "", "415-534-7865", "crodriguez@mail.com" });
+        this.template.update(sql, new Object[] { "Jorge", "Espinosa", "23 Putnam Avenue", "Seattle", "WA", "", "", "jespinosa@mail.com" });
+        this.template.update(sql, new Object[] { "Amy", "King", "11 Summer st", "Miami", "FL", "", "", "aking@mail.com" });
+        this.template.update(sql, new Object[] { "Boris", "Jefferson", "222 Spring st", "Denver", "CO", "", "415-534-7865", "bjefferson@mail.com" });
+        this.template.update(sql, new Object[] { "Linda", "Madison", "564 Winter st", "Washington", "DC", "", "", "lmadison@mail.com" });
+    }
+
+    public void insertCompanies() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM COMPANY");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO COMPANY (NAME, ADDRESS, CITY, STATE, ZIP, PHONE, INDUSTRY_ID) VALUES (?,?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Adobe", "", "San Jose", "CA", "", "408", 1 });
+        this.template.update(sql, new Object[] { "SpringSource", "", "New York", "NY", "", "212", 2 });
+        this.template.update(sql, new Object[] { "Allaire", "", "Cambridge", "MA", "", "212", 3 });
+        this.template.update(sql, new Object[] { "Acme", "", "Denver", "CO", "", "212", 4 });
+        this.template.update(sql, new Object[] { "Macromedia", "", "San Francisco", "CA", "", "212", 1 });
+        this.template.update(sql, new Object[] { "Alpha Corp", "", "Chicago", "IL", "", "", 1 });
+    }
+
+    public void insertIndustries() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM INDUSTRY");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO INDUSTRY (NAME) VALUES (?)";
+        this.template.update(sql, new Object[] { "Telecommunication" });
+        this.template.update(sql, new Object[] { "Government" });
+        this.template.update(sql, new Object[] { "Financial Services" });
+        this.template.update(sql, new Object[] { "Life Sciences" });
+        this.template.update(sql, new Object[] { "Manufacturing" });
+        this.template.update(sql, new Object[] { "Education" });
+    }
+
+    public void insertProducts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM PRODUCT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO PRODUCT (NAME, CATEGORY, IMAGE, PRICE, DESCRIPTION, QTY) VALUES (?,?,?,?,?,?)";
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6010",
+                "6000",
+                "Nokia_6010.gif",
+                99.0E0,
+                "Easy to use without sacrificing style, the Nokia 6010 phone offers functional voice communication supported by text messaging, multimedia messaging, mobile internet, games and more.",
+                21 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3100 Blue",
+                "9000",
+                "Nokia_3100_blue.gif",
+                109.0E0,
+                "Light up the night with a glow-in-the-dark cover - when it is charged with light you can easily find your phone in the dark. When you get a call, the Nokia 3100 phone flashes in tune with your ringing tone. And when you snap on a Nokia Xpress-on gaming cover, you will get luminescent light effects in time to the gaming action.",
+                99 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3100 Pink",
+                "3000",
+                "Nokia_3100_pink.gif",
+                139.0E0,
+                "Light up the night with a glow-in-the-dark cover - when it is charged with light you can easily find your phone in the dark. When you get a call, the Nokia 3100 phone flashes in tune with your ringing tone. And when you snap on a Nokia Xpress-on gaming cover, you will get luminescent light effects in time to the gaming action.",
+                30 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3120",
+                "3000",
+                "Nokia_3120.gif",
+                159.99E0,
+                "Designed for both business and pleasure, the elegant Nokia 3120 phone offers a pleasing mix of features. Enclosed within its chic, compact body, you will discover the benefits of tri-band compatibility, a color screen, MMS, XHTML browsing, cheerful screensavers, and much more.",
+                10 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3220",
+                "3000",
+                "Nokia_3220.gif",
+                199.0E0,
+                "The Nokia 3220 phone is a fresh new cut on some familiar ideas - animate your MMS messages with cute characters, see the music with lights that flash in time with your ringing tone, download wallpapers and screensavers with matching color schemes for the interface.",
+                20 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3650",
+                "3000",
+                "Nokia_3650.gif",
+                200.0E0,
+                "Messaging is more personal, versatile and fun with the Nokia 3650 camera phone.  Capture experiences as soon as you see them and send the photos you take to you friends and family.",
+                11 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6820",
+                "6000",
+                "Nokia_6820.gif",
+                299.99E0,
+                "Messaging just got a whole lot smarter. The Nokia 6820 messaging device puts the tools you need for rich communication - full messaging keyboard, digital camera, mobile email, MMS, SMS, and Instant Messaging - right at your fingertips, in a small, sleek device.",
+                8 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6670",
+                "6000",
+                "Nokia_6670.gif",
+                319.99E0,
+                "Classic business tools meet your creative streak in the Nokia 6670 imaging smartphone. It has a Netfront Web browser with PDF support, document viewer applications for email attachments, a direct printing application, and a megapixel still camera that also shoots up to 10 minutes of video.",
+                2 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6620",
+                "6000",
+                "Nokia_6620.gif",
+                329.99E0,
+                "Shoot a basket. Shoot a movie. Video phones from Nokia... the perfect way to save and share life\u2019s playful moments. Feel connected.",
+                10 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3230 Silver",
+                "3000",
+                "Nokia_3230_black.gif",
+                500.0E0,
+                "Get creative with the Nokia 3230 smartphone. Create your own ringing tones, print your mobile images, play multiplayer games over a wireless Bluetooth connection, and browse HTML and xHTML Web pages. ",
+                10 });
+        this.template.update(sql,
+            new Object[] { "Nokia 6680", "6000", "Nokia_6680.gif", 222.0E0, "The Nokia 6680 is an imaging smartphone that", 36 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6630",
+                "6000",
+                "Nokia_6630.gif",
+                379.0E0,
+                "The Nokia 6630 imaging smartphone is a 1.3 megapixel digital imaging device (1.3 megapixel camera sensor, effective resolution 1.23 megapixels for image capture, image size 1280 x 960 pixels});.",
+                8 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 7610 Black",
+                "7000",
+                "Nokia_7610_black.gif",
+                450.0E0,
+                "The Nokia 7610 imaging phone with its sleek, compact design stands out in any crowd. Cut a cleaner profile with a megapixel camera and 4x digital zoom. Quality prints are all the proof you need of your cutting edge savvy.",
+                20 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 7610 White",
+                "7000",
+                "Nokia_7610_white.gif",
+                399.99E0,
+                "The Nokia 7610 imaging phone with its sleek, compact design stands out in any crowd. Cut a cleaner profile with a megapixel camera and 4x digital zoom. Quality prints are all the proof you need of your cutting edge savvy.",
+                7 });
+        this.template.update(sql, new Object[] { "Nokia 6680", "6000", "Nokia_6680.gif", 219.0E0, "The Nokia 6680 is an imaging smartphone.", 15 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 9300",
+                "9000",
+                "Nokia_9300_close.gif",
+                599.0E0,
+                "The Nokia 9300 combines popular voice communication features with important productivity applications in one well-appointed device. Now the tools you need to stay in touch and on top of schedules, email, news, and messages are conveniently at your fingertips.",
+                26 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 9500",
+                "9000",
+                "Nokia_9500_close.gif",
+                799.99E0,
+                "Fast data connectivity with Wireless LAN. Browse the Internet in full color, on a wide, easy-to-view screen. Work with office documents not just email with attachments and memos, but presentations and databases too.",
+                54 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia N90",
+                "9000",
+                "Nokia_N90.gif",
+                499.0E0,
+                "Twist and shoot. It is a pro-photo taker. A personal video-maker. Complete with Carl Zeiss Optics for crisp, bright images you can view, edit, print and share. Meet the Nokia N90.",
+                12 });
+    }
+
+    public void insertAccounts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM ACCOUNT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO ACCOUNT (NAME, ADDRESS1, CITY, STATE, ZIP, PHONE) VALUES (?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Adobe", "", "San Jose", "CA", "", "408" });
+        this.template.update(sql, new Object[] { "SpringSource", "", "New York", "NY", "", "212" });
+        this.template.update(sql, new Object[] { "Allaire", "", "Cambridge", "MA", "", "212" });
+        this.template.update(sql, new Object[] { "Acme", "", "Denver", "CO", "", "212" });
+        this.template.update(sql, new Object[] { "Macromedia", "", "San Francisco", "CA", "", "212" });
+        this.template.update(sql, new Object[] { "Alpha Corp", "", "Chicago", "IL", "", "" });
+    }
+}


Mime
View raw message