Adds initial state of tutorial branch safepoint_00_strart_here
diff --git a/greenpages/db/data.bat b/greenpages/db/data.bat
deleted file mode 100755
index 69b814f..0000000
--- a/greenpages/db/data.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-setlocal
-
-call h2
-java -cp "%H2CP%" org.h2.tools.RunScript -url jdbc:h2:tcp://localhost/~/greenpages-db/greenpages -user greenpages -password pass -script db.sql
\ No newline at end of file
diff --git a/greenpages/db/data.sh b/greenpages/db/data.sh
deleted file mode 100755
index 7744e9d..0000000
--- a/greenpages/db/data.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env bash
-. ./h2.sh
-
-java -cp $CLASSPATH org.h2.tools.RunScript -url jdbc:h2:tcp://localhost/~/greenpages-db/greenpages -user greenpages -password pass -script ./db.sql
diff --git a/greenpages/db/db.sql b/greenpages/db/db.sql
deleted file mode 100644
index 394c60c..0000000
--- a/greenpages/db/db.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-DROP TABLE IF EXISTS LISTING;
-
-CREATE TABLE LISTING (
- LISTING_NUMBER INT PRIMARY KEY,
- FIRST_NAME VARCHAR(255),
- LAST_NAME VARCHAR(255),
- EMAIL_ADDRESS VARCHAR(255)
-);
-
-INSERT INTO LISTING VALUES(1, 'Rod', 'Johnson', 'rod.johnson@springsource.com');
-INSERT INTO LISTING VALUES(2, 'Rob', 'Harrop', 'rob.harrop@springsource.com');
-INSERT INTO LISTING VALUES(3, 'Glyn', 'Normington', 'glyn.normington@springsource.com');
-INSERT INTO LISTING VALUES(4, 'Andy', 'Wilkinson', 'andy.wilkinson@springsource.com');
-INSERT INTO LISTING VALUES(5, 'Ben', 'Hale', 'ben.hale@springsource.com');
-INSERT INTO LISTING VALUES(6, 'Chris', 'Frost', 'chris.frost@springsource.com');
-INSERT INTO LISTING VALUES(7, 'Steve', 'Powell', 'steve.powell@springsource.com');
-INSERT INTO LISTING VALUES(8, 'Christian', 'Dupuis', 'christian.dupuis@springsource.com');
diff --git a/greenpages/db/h2.bat b/greenpages/db/h2.bat
deleted file mode 100755
index 1ba3fc3..0000000
--- a/greenpages/db/h2.bat
+++ /dev/null
@@ -1,9 +0,0 @@
-for /r "%HOMEDRIVE%%HOMEPATH%\.m2" %%X in (*h2*.jar) do (set H2CP=%H2CP%;%%X)
-
-if "%H2CP%" == "" (goto h2NotFound) else goto end
-
-:h2NotFound
-echo Cannot find H2 jars in .m2 Maven repository
-exit /b -1s
-
-:end
diff --git a/greenpages/db/h2.sh b/greenpages/db/h2.sh
deleted file mode 100755
index e83c106..0000000
--- a/greenpages/db/h2.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env bash
-JARS=`find $HOME/.m2 -iname "com.springsource.org.h2*"`
-
-for JAR in $JARS
-do
- CLASSPATH=$CLASSPATH:$JAR
-done
-
-if [ -z $CLASSPATH ]
-then
- echo "Cannot find H2 jars in .m2 Maven repository"
- exit -1
-fi
\ No newline at end of file
diff --git a/greenpages/db/run.bat b/greenpages/db/run.bat
deleted file mode 100755
index 57a0394..0000000
--- a/greenpages/db/run.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-@echo off
-setlocal
-
-call h2
-start java -cp "%H2CP%" org.h2.tools.Server
\ No newline at end of file
diff --git a/greenpages/db/run.sh b/greenpages/db/run.sh
deleted file mode 100755
index c3403e4..0000000
--- a/greenpages/db/run.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-. ./h2.sh
-
-java -cp $CLASSPATH org.h2.tools.Server
-
diff --git a/greenpages/greenpages.core/src/main/resources/META-INF/spring/osgi-context.xml b/greenpages/greenpages.core/src/main/resources/META-INF/spring/osgi-context.xml
index 0dab573..6f2554b 100644
--- a/greenpages/greenpages.core/src/main/resources/META-INF/spring/osgi-context.xml
+++ b/greenpages/greenpages.core/src/main/resources/META-INF/spring/osgi-context.xml
@@ -5,8 +5,6 @@
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"
xmlns:osgi="http://www.springframework.org/schema/osgi">
- <!-- uncomment the line below to publish the mock Directory into the OSGi service registry -->
-
- <!-- <osgi:service interface="greenpages.Directory" ref="directory"/> -->
-
+ <!-- TODO 0.3 export spring bean "directory" with interface "greenpages.Directory" -->
+
</beans>
diff --git a/greenpages/greenpages.db/pom.xml b/greenpages/greenpages.db/pom.xml
deleted file mode 100644
index 3d993e9..0000000
--- a/greenpages/greenpages.db/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.parent</artifactId>
- <version>3.0.0.RELEASE</version>
- <relativePath>../greenpages.parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>greenpages.db</artifactId>
- <name>GreenPages DataSource</name>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>META-INF/spring/*</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Bundle>
- com.springsource.org.eclipse.persistence.jpa;version="[2, 3)"
- </Import-Bundle>
- <Import-Package>
- org.h2;version="[1.0.71,2)",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>com.springsource.javax.persistence</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.spring-library</artifactId>
- <type>libd</type>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>com.springsource.org.eclipse.persistence</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>com.springsource.org.eclipse.persistence.jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>com.springsource.org.h2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>com.springsource.org.aspectj.weaver</artifactId>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/greenpages/greenpages.db/src/main/resources/META-INF/MANIFEST.MF b/greenpages/greenpages.db/src/main/resources/META-INF/MANIFEST.MF
deleted file mode 100644
index 698edc1..0000000
--- a/greenpages/greenpages.db/src/main/resources/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,11 +0,0 @@
-Manifest-Version: 1.0
-Bundle-Vendor: SpringSource
-Bundle-Classpath: .
-Bundle-Version: 3.0.0
-Tool: Bundlor 1.1.2.RELEASE
-Bundle-Name: GreenPages DataSource
-Bundle-ManifestVersion: 2
-Import-Package: javax.sql;version="0",org.apache.commons.dbcp;version=
- "[1.2.2.osgi, 1.2.2.osgi]",org.h2;version="[1.0.71, 1.0.71]"
-Bundle-SymbolicName: greenpages.db
-
diff --git a/greenpages/greenpages.db/src/main/resources/META-INF/spring/module-context.xml b/greenpages/greenpages.db/src/main/resources/META-INF/spring/module-context.xml
deleted file mode 100644
index 5337e8a..0000000
--- a/greenpages/greenpages.db/src/main/resources/META-INF/spring/module-context.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="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.xsd"
- xmlns:p="http://www.springframework.org/schema/p">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
- p:driverClassName="org.h2.Driver" p:url="jdbc:h2:~/greenpages-db/greenpages"
- p:username="greenpages" p:password="pass"
- init-method="createDataSource" destroy-method="close"/>
-
-</beans>
diff --git a/greenpages/greenpages.db/src/main/resources/META-INF/spring/osgi-context.xml b/greenpages/greenpages.db/src/main/resources/META-INF/spring/osgi-context.xml
deleted file mode 100644
index 92962cd..0000000
--- a/greenpages/greenpages.db/src/main/resources/META-INF/spring/osgi-context.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="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.xsd
- http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"
- xmlns:osgi="http://www.springframework.org/schema/osgi">
-
- <osgi:service ref="dataSource" interface="javax.sql.DataSource"/>
-
-</beans>
diff --git a/greenpages/greenpages.jpa/pom.xml b/greenpages/greenpages.jpa/pom.xml
deleted file mode 100644
index 1340dbb..0000000
--- a/greenpages/greenpages.jpa/pom.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.parent</artifactId>
- <version>3.0.0.RELEASE</version>
- <relativePath>../greenpages.parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>greenpages.jpa</artifactId>
- <name>GreenPages JPA</name>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>META-INF/spring/*</include>
- <include>META-INF/*</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Bundle>
- com.springsource.org.eclipse.persistence;version="[2.0.0,
- 2.1.0)",
- com.springsource.org.eclipse.persistence.jpa;version="[2.0.0,
- 2.1.0)"
- </Import-Bundle>
- <Import-Package>
- org.springframework.context.weaving;version="[3,
- 4)",
- org.springframework.transaction.aspectj;version="[3.0, 3.5)",
- javax.persistence.criteria;version="[2, 2.1)",
- javax.persistence;version="[2, 2.1)",
- javax.sql;version="0",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.spring-library</artifactId>
- <type>libd</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>javax.persistence</artifactId>
- <version>2.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>com.springsource.org.eclipse.persistence.internal.libraries.antlr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>com.springsource.org.eclipse.persistence</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>com.springsource.org.eclipse.persistence.jpa</artifactId>
- </dependency>
- <dependency>
- <groupId>org.junit</groupId>
- <artifactId>com.springsource.org.junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.instrument</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.aspects</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.logging</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>com.springsource.org.h2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>com.springsource.org.aspectj.weaver</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaDirectory.java b/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaDirectory.java
deleted file mode 100644
index c51200d..0000000
--- a/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaDirectory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.jpa;
-
-import greenpages.Directory;
-import greenpages.Listing;
-
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-import org.springframework.stereotype.Repository;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * Implementation of {@link Directory} that uses JPA for persistence.<p />
- *
- * This class is marked as {@link Transactional}. The Spring configuration for this module, enables AspectJ weaving for
- * adding transaction demarcation to classes annotated with <code>@Transactional</code>.
- */
-@Transactional
-@Repository
-final class JpaDirectory implements Directory {
-
- private static final String SEARCH_QUERY = "select l from Listing l where upper(l.lastName) like :term";
-
- /**
- * Spring will inject a managed JPA {@link EntityManager} into this field.
- */
- @PersistenceContext
- private EntityManager em;
-
- public Listing findListing(int id) {
- return em.find(JpaListing.class, id);
- }
-
- @SuppressWarnings("unchecked")
- public List<Listing> search(String term) {
- return em.createQuery(SEARCH_QUERY).setParameter("term", "%" + term.toUpperCase() + "%").getResultList();
- }
-
-}
diff --git a/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaListing.java b/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaListing.java
deleted file mode 100644
index 1965495..0000000
--- a/greenpages/greenpages.jpa/src/main/java/greenpages/jpa/JpaListing.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.jpa;
-
-import greenpages.Listing;
-
-/**
- * Basic implementation of {@link Listing} that is configured as a persistent type in JPA.
- */
-public class JpaListing implements Listing {
-
- private Integer listingNumber;
-
- private String firstName;
-
- private String lastName;
-
- private String emailAddress;
-
- public Integer getListingNumber() {
- return listingNumber;
- }
-
- public void setListingNumber(Integer listingNumber) {
- this.listingNumber = listingNumber;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public String getEmailAddress() {
- return emailAddress;
- }
-
- public void setEmailAddress(String emailAddress) {
- this.emailAddress = emailAddress;
- }
-
-}
diff --git a/greenpages/greenpages.jpa/src/main/resources/META-INF/orm.xml b/greenpages/greenpages.jpa/src/main/resources/META-INF/orm.xml
deleted file mode 100644
index 66352f0..0000000
--- a/greenpages/greenpages.jpa/src/main/resources/META-INF/orm.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
- version="1.0">
- <package>greenpages.jpa</package>
- <entity class="greenpages.jpa.JpaListing" name="Listing">
- <table name="LISTING"/>
- <attributes>
- <id name="listingNumber">
- <column name="LISTING_NUMBER"/>
- <generated-value strategy="TABLE"/>
- </id>
- <basic name="firstName">
- <column name="FIRST_NAME"/>
- </basic>
- <basic name="lastName">
- <column name="LAST_NAME"/>
- </basic>
- <basic name="emailAddress">
- <column name="EMAIL_ADDRESS"/>
- </basic>
- </attributes>
- </entity>
-</entity-mappings>
\ No newline at end of file
diff --git a/greenpages/greenpages.jpa/src/main/resources/META-INF/persistence.xml b/greenpages/greenpages.jpa/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index df42af5..0000000
--- a/greenpages/greenpages.jpa/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
-
- <persistence-unit name="GreenPages" transaction-type="RESOURCE_LOCAL">
- <class>greenpages.jpa.JpaListing</class>
- </persistence-unit>
-
-</persistence>
diff --git a/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/module-context.xml b/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/module-context.xml
deleted file mode 100644
index 3fc3b2a..0000000
--- a/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/module-context.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Application context definition for GreenPages JPA.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
-
- <!-- ========================= RESOURCE DEFINITIONS ========================= -->
-
- <!--
- Activates a load-time weaver for the context. Any bean within the context that
- implements LoadTimeWeaverAware (such as LocalContainerEntityManagerFactoryBean)
- will receive a reference to the autodetected load-time weaver.
- -->
- <context:load-time-weaver aspectj-weaving="on"/>
-
- <!-- JPA EntityManagerFactory -->
- <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" p:dataSource-ref="dataSource">
- <property name="jpaVendorAdapter">
- <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter"
- p:databasePlatform="org.eclipse.persistence.platform.database.HSQLPlatform" p:showSql="true"/>
- </property>
- </bean>
-
- <!-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -->
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
- p:entityManagerFactory-ref="entityManagerFactory"/>
-
-
- <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->
-
- <!--
- Activates various annotations to be detected in bean classes: Spring's
- @Required and @Autowired, as well as JSR 250's @PostConstruct,
- @PreDestroy and @Resource (if available) and JPA's @PersistenceContext
- and @PersistenceUnit (if available).
- -->
- <context:annotation-config/>
-
- <!--
- Instruct Spring to perform declarative transaction management
- automatically on annotated classes.
- -->
- <tx:annotation-driven mode="aspectj"/>
-
- <!--
- Post-processor to perform exception translation on @Repository classes (from native
- exceptions such as JPA PersistenceExceptions to Spring's DataAccessException hierarchy).
- -->
- <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
-
- <!--
- Will automatically be transactional due to @Transactional.
- EntityManager will be auto-injected due to @PersistenceContext.
- PersistenceExceptions will be auto-translated due to @Repository.
- -->
- <bean id="directory" class="greenpages.jpa.JpaDirectory"/>
-
-</beans>
diff --git a/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/osgi-context.xml b/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/osgi-context.xml
deleted file mode 100644
index c527d76..0000000
--- a/greenpages/greenpages.jpa/src/main/resources/META-INF/spring/osgi-context.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="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.xsd
- http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"
- xmlns:osgi="http://www.springframework.org/schema/osgi">
-
- <!-- import the DataSource from OSGi -->
- <osgi:reference id="dataSource" interface="javax.sql.DataSource"/>
-
-
- <!-- export the directory bean to OSGi under the Directory interface -->
- <osgi:service ref="directory" interface="greenpages.Directory"/>
-
-
-</beans>
diff --git a/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/JpaDirectorySpringContextTests.java b/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/JpaDirectorySpringContextTests.java
deleted file mode 100644
index 7ecd706..0000000
--- a/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/JpaDirectorySpringContextTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.jpa;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import greenpages.Directory;
-import greenpages.Listing;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestExecutionListeners;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath:/META-INF/spring/module-context.xml", "classpath:/META-INF/spring/test-context.xml" })
-@TestExecutionListeners(value = DependencyInjectionTestExecutionListener.class)
-public class JpaDirectorySpringContextTests {
-
- @Autowired
- private Directory directory;
-
- @Test
- public void search() {
- List<Listing> results = this.directory.search("johnson");
- assertNotNull(results);
- assertEquals(1, results.size());
-
- Listing listing = results.get(0);
- assertNotNull(listing);
- assertEquals("Johnson", listing.getLastName());
- }
-}
diff --git a/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/TestDataPopulator.java b/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/TestDataPopulator.java
deleted file mode 100644
index 24f779b..0000000
--- a/greenpages/greenpages.jpa/src/test/java/greenpages/jpa/TestDataPopulator.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.jpa;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import javax.sql.DataSource;
-
-import org.springframework.core.io.Resource;
-
-/**
- * A class that populates a datasource with test data
- */
-public class TestDataPopulator {
-
- private final DataSource dataSource;
-
- private final Resource testDataLocation;
-
- public TestDataPopulator(DataSource dataSource, Resource testDataLocation) {
- this.dataSource = dataSource;
- this.testDataLocation = testDataLocation;
- }
-
- public void populate() {
- Connection connection = null;
- try {
- connection = dataSource.getConnection();
- insertTestData(connection);
- } catch (SQLException e) {
- throw new RuntimeException("SQL exception occurred acquiring connection", e);
- } finally {
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- }
- }
- }
- }
-
- private void insertTestData(Connection connection) {
- try {
- String sql = parseSqlIn(testDataLocation);
- executeSql(sql, connection);
- } catch (IOException e) {
- throw new RuntimeException("I/O exception occurred accessing the test data file", e);
- } catch (SQLException e) {
- throw new RuntimeException("SQL exception occurred loading test data", e);
- }
- }
-
- private String parseSqlIn(Resource resource) throws IOException {
- InputStream is = null;
- try {
- is = resource.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-
- StringWriter sw = new StringWriter();
- BufferedWriter writer = new BufferedWriter(sw);
-
- for (int c = reader.read(); c != -1; c = reader.read()) {
- writer.write(c);
- }
- writer.flush();
- return sw.toString();
-
- } finally {
- if (is != null) {
- is.close();
- }
- }
- }
-
- private void executeSql(String sql, Connection connection) throws SQLException {
- Statement statement = connection.createStatement();
- statement.execute(sql);
- }
-}
diff --git a/greenpages/greenpages.jpa/src/test/resources/META-INF/spring/test-context.xml b/greenpages/greenpages.jpa/src/test/resources/META-INF/spring/test-context.xml
deleted file mode 100644
index bc0e415..0000000
--- a/greenpages/greenpages.jpa/src/test/resources/META-INF/spring/test-context.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
- p:driverClassName="org.h2.Driver" p:url="jdbc:h2:.~/greenpages-db/greenpages"
- p:username="greenpages" p:password="pass"
- init-method="createDataSource" destroy-method="close"/>
-
- <bean class="greenpages.jpa.TestDataPopulator" init-method="populate">
- <constructor-arg ref="dataSource"/>
- <constructor-arg value="file:../db/db.sql"/>
- </bean>
-
-</beans>
diff --git a/greenpages/greenpages.par/META-INF/MANIFEST.MF b/greenpages/greenpages.par/META-INF/MANIFEST.MF
deleted file mode 100644
index db1a5d7..0000000
--- a/greenpages/greenpages.par/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,5 +0,0 @@
-Manifest-Version: 1.0
-Application-SymbolicName: greenpages
-Application-Version: 3.0.0.RELEASE
-Application-Name: Greenpages PAR
-
diff --git a/greenpages/greenpages.par/com.springsource.org.h2-1.0.71.jar b/greenpages/greenpages.par/com.springsource.org.h2-1.0.71.jar
deleted file mode 100644
index 41dc982..0000000
--- a/greenpages/greenpages.par/com.springsource.org.h2-1.0.71.jar
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.par/pom.xml b/greenpages/greenpages.par/pom.xml
deleted file mode 100644
index 86780a2..0000000
--- a/greenpages/greenpages.par/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.parent</artifactId>
- <version>3.0.0.RELEASE</version>
- <relativePath>../greenpages.parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>greenpages.par</artifactId>
- <name>greenpages.par</name>
- <description>GreenPages PAR</description>
- <packaging>par</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.jpa</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.db</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.web</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- Needs to be included in the PAR so that its classes are loadable via the PAR's synthetic context class loader -->
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>com.springsource.org.h2</artifactId>
- </dependency>
- <!-- Required for the web bundle as dependencies are not propagated up from war build types -->
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>com.springsource.freemarker</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-par-plugin</artifactId>
- <version>1.0.0.RELEASE</version>
- <configuration>
- <applicationSymbolicName>greenpages</applicationSymbolicName>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <configuration>
- <outputDirectory>${project.build.directory}/par-provided</outputDirectory>
- <overWriteIfNewer>true</overWriteIfNewer>
- <excludeGroupIds>org.eclipse.virgo,org.apache.log4j,com.h2database</excludeGroupIds>
- </configuration>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.apache.maven.plugins
- </groupId>
- <artifactId>
- maven-dependency-plugin
- </artifactId>
- <versionRange>
- [2.1,)
- </versionRange>
- <goals>
- <goal>
- copy-dependencies
- </goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
-</project>
diff --git a/greenpages/greenpages.par/src/main/resources/.gitignore b/greenpages/greenpages.par/src/main/resources/.gitignore
deleted file mode 100644
index e69de29..0000000
--- a/greenpages/greenpages.par/src/main/resources/.gitignore
+++ /dev/null
diff --git a/greenpages/greenpages.web/pom.xml b/greenpages/greenpages.web/pom.xml
deleted file mode 100644
index 890dc5d..0000000
--- a/greenpages/greenpages.web/pom.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.parent</artifactId>
- <version>3.0.0.RELEASE</version>
- <relativePath>../greenpages.parent</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>greenpages.web</artifactId>
- <name>GreenPages Web</name>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>META-INF/spring/*</include>
- <include>META-INF/*</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/webapp</directory>
- <includes>
- <include>index.html</include>
- <include>images/*</include>
- <include>styles/*</include>
- <include>WEB-INF/*</include>
- <include>WEB-INF/ftl/*</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Web-ContextPath>greenpages</Web-ContextPath>
- <Import-Library>
- org.springframework.spring;version="[3.1, 3.5)"
- </Import-Library>
- <Import-Bundle>
- com.springsource.org.eclipse.persistence;version="[2.0.0, 2.1.0)",
- com.springsource.org.eclipse.persistence.jpa;version="[2.0.0, 2.1.0)"
- </Import-Bundle>
- <Import-Package>
- javax.servlet.jsp.jstl.core;version="[1.2.0, 2)",
- javax.servlet;version="[3.0.0, 3.1)",
- org.eclipse.virgo.web.dm;version="[3.6, 4)",
- freemarker.cache;version="[2.3.18,2.3.18]",
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.spring-library</artifactId>
- <type>libd</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.freemarker</groupId>
- <artifactId>com.springsource.freemarker</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.persistence</groupId>
- <artifactId>javax.persistence</artifactId>
- <version>2.0.0</version>
- </dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>com.springsource.javax.persistence</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.virgo</groupId>
- <artifactId>greenpages.jpa</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit</groupId>
- <artifactId>com.springsource.org.junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.aspects</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.logging</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>com.springsource.org.h2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.instrument</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>com.springsource.org.aspectj.weaver</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/greenpages/greenpages.web/src/main/java/greenpages/web/GreenPagesController.java b/greenpages/greenpages.web/src/main/java/greenpages/web/GreenPagesController.java
deleted file mode 100644
index 56463fc..0000000
--- a/greenpages/greenpages.web/src/main/java/greenpages/web/GreenPagesController.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.web;
-
-import greenpages.Directory;
-import greenpages.Listing;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-/**
- * Controller class for GreenPages web application.<p/>
- *
- * This class is configured using Spring 2.5-style MVC annotations. Documentation for this feature can be found <a
- * href="http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-annotation">here</a>.<p/>
- *
- * The use of {@link Controller} makes this class eligible for autodetection by <context:component-scan/> in the
- * context configuration.
- */
-@Controller
-public class GreenPagesController {
-
- /**
- * This field is injected automatically by Spring. For this injection to be satisfied, the greenpages.web module
- * must either declare a bean of type {@link Directory} or it must import a <code>Directory</code> from OSGi.
- */
- @Autowired
- private Directory directory;
-
-
- @RequestMapping("/home.htm")
- public void home() {
- }
-
- @RequestMapping("/search.htm")
- public List<Listing> search(@RequestParam("query") String query) {
- return this.directory.search(query);
- }
-
- @RequestMapping("/entry.htm")
- public Listing entry(@RequestParam("id") int id) {
- return this.directory.findListing(id);
- }
-}
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/applicationContext.xml b/greenpages/greenpages.web/src/main/webapp/WEB-INF/applicationContext.xml
deleted file mode 100644
index 36b743e..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/applicationContext.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:osgi="http://www.springframework.org/schema/osgi"
- 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-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
- http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
- <!-- import a service from OSGi implementing the Directory interface and make available as a bean called directory -->
- <osgi:reference id="directory" interface="greenpages.Directory" />
-
-</beans>
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/entry.ftl b/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/entry.ftl
deleted file mode 100644
index 504e6ec..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/entry.ftl
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>GreenPages</title>
- <link rel="stylesheet" href="/greenpages/styles/main.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/local.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/print.css" type="text/css" media="print" />
-</head>
-<body class="main tundra">
- <div id="page">
- <div id="mini-header">
- <div id="mini-header-left"></div>
- <div id="mini-header-right"></div>
- </div> <!-- /mini-header -->
-
- <div id="primary-navigation">
- <div id="primary-left">
- <ul>
- <li><a href="/greenpages" title="Admin Console">GreenPages</a></li>
- </ul>
- </div>
- <img id="left-curve" src="/greenpages/images/menu-curve-left.png"/>
- <div id="primary-right">
- <ul>
- <li><a href="/admin" title="Admin Console">Admin Console</a></li>
- <li><a href="http://www.eclipse.org/virgo" title="Admin Console">Virgo</a></li>
- </ul>
- </div>
- <img id="right-curve" src="/greenpages/images/menu-curve-right.png"/>
- </div><!-- /primary-navigation -->
-
- <div id="container">
- <div id="content-no-nav">
- <h1>Virgo Web Server - Greenpages sample</h1>
- <p/>
- <h2>${listing.firstName} ${listing.lastName}</h2>
- <a href="mailto:${listing.emailAddress}">${listing.emailAddress}</a>
- </div> <!-- /content -->
- </div> <!-- /container -->
-
- <div id="footer-wrapper">
- <div id="footer-left">© Copyright 2008, 2010 VMware Inc. Licensed under the Eclipse Public License v1.0.</div>
- <div id="footer-right"></div>
- </div> <!-- /footer-wrapper -->
-
- </div> <!-- /page -->
-
-</body>
-</html>
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/home.ftl b/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/home.ftl
deleted file mode 100644
index bec4830..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/home.ftl
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>GreenPages</title>
- <link rel="stylesheet" href="/greenpages/styles/main.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/local.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/print.css" type="text/css" media="print" />
-</head>
-<body class="main tundra">
- <div id="page">
- <div id="mini-header">
- <div id="mini-header-left"></div>
- <div id="mini-header-right"></div>
- </div> <!-- /mini-header -->
-
- <div id="primary-navigation">
- <div id="primary-left">
- <ul>
- <li><a href="/greenpages" title="Admin Console">GreenPages</a></li>
- </ul>
- </div>
- <img id="left-curve" src="/greenpages/images/menu-curve-left.png"/>
- <div id="primary-right">
- <ul>
- <li><a href="/admin" title="Admin Console">Admin Console</a></li>
- <li><a href="http://www.eclipse.org/virgo" title="Admin Console">Virgo</a></li>
- </ul>
- </div>
- <img id="right-curve" src="/greenpages/images/menu-curve-right.png"/>
- </div><!-- /primary-navigation -->
-
- <div id="container">
- <div id="content-no-nav">
- <h1>Virgo Web Server - Greenpages sample</h1>
- <p/>
- <form name="searchForm" method="GET" action="search.htm">
- <input name="query" type="text"/> <input type="submit"/>
- </form>
- </div> <!-- /content -->
- </div> <!-- /container -->
-
- <div id="footer-wrapper">
- <div id="footer-left">© Copyright 2008, 2010 VMware Inc. Licensed under the Eclipse Public License v1.0.</div>
- <div id="footer-right"></div>
- </div> <!-- /footer-wrapper -->
-
- </div> <!-- /page -->
-
-</body>
-</html>
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/search.ftl b/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/search.ftl
deleted file mode 100644
index f116e48..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/ftl/search.ftl
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<title>GreenPages</title>
- <link rel="stylesheet" href="/greenpages/styles/main.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/local.css" type="text/css" />
- <link rel="stylesheet" href="/greenpages/styles/print.css" type="text/css" media="print" />
-</head>
-<body class="main tundra">
- <div id="page">
- <div id="mini-header">
- <div id="mini-header-left"></div>
- <div id="mini-header-right"></div>
- </div> <!-- /mini-header -->
-
- <div id="primary-navigation">
- <div id="primary-left">
- <ul>
- <li><a href="/greenpages" title="Admin Console">GreenPages</a></li>
- </ul>
- </div>
- <img id="left-curve" src="/greenpages/images/menu-curve-left.png"/>
- <div id="primary-right">
- <ul>
- <li><a href="/admin" title="Admin Console">Admin Console</a></li>
- <li><a href="http://www.eclipse.org/virgo" title="Admin Console">Virgo</a></li>
- </ul>
- </div>
- <img id="right-curve" src="/greenpages/images/menu-curve-right.png"/>
- </div><!-- /primary-navigation -->
-
- <div id="container">
- <div id="content-no-nav">
- <h1>Virgo Web Server - Greenpages sample</h1>
- <p/>
- <form name="searchForm" method="GET" action="search.htm">
- <input name="query" type="text"/> <input type="submit"/>
- </form>
- <#if listingList?? && (listingList?size > 0)>
- <table id="results">
- <thead>
- <tr>
- <th>Last Name</th>
- <th>First Name</th>
- <th> </th>
- </tr>
- </thead>
- <tbody>
- <#list listingList as listing>
- <tr>
- <td>${listing.lastName}</td>
- <td>${listing.firstName}</td>
- <td><a href="entry.htm?id=${listing.listingNumber}">view</a></td>
- </tr>
- </#list>
- </tbody>
- </table>
- <#else>
- <h2>No results found.</h2>
- </#if>
- </div> <!-- /content -->
- </div> <!-- /container -->
-
- <div id="footer-wrapper">
- <div id="footer-left">© Copyright 2008, 2010 VMware Inc. Licensed under the Eclipse Public License v1.0.</div>
- <div id="footer-right"></div>
- </div> <!-- /footer-wrapper -->
-
- </div> <!-- /page -->
-
-</body>
-</html>
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/greenpages-servlet.xml b/greenpages/greenpages.web/src/main/webapp/WEB-INF/greenpages-servlet.xml
deleted file mode 100644
index 61d2256..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/greenpages-servlet.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
-
- <!-- enable classpath scanning -->
- <context:component-scan base-package="greenpages.web" />
-
- <!-- enable anntotation-driven controllers -->
- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
-
-
- <!-- configure FreeMarker support -->
- <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
- <property name="templateLoaderPath" value="/WEB-INF/ftl/" />
- </bean>
-
- <bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
- <property name="cache" value="true" />
- <property name="suffix" value=".ftl" />
- </bean>
-</beans>
diff --git a/greenpages/greenpages.web/src/main/webapp/WEB-INF/web.xml b/greenpages/greenpages.web/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index f5a6641..0000000
--- a/greenpages/greenpages.web/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
-
- <display-name>Greenpages - web</display-name>
-
-
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- </welcome-file-list>
-
-<!-- CONFIGURE A PARENT APPLICATION CONTEXT -->
-
- <context-param>
- <param-name>contextClass</param-name>
- <param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
- </context-param>
-
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
-
-
- <!-- DISPATCHER SERVLET CONFIG -->
- <servlet>
- <servlet-name>greenpages</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>greenpages</servlet-name>
- <url-pattern>/app/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/images/favicon.ico b/greenpages/greenpages.web/src/main/webapp/images/favicon.ico
deleted file mode 100755
index 9244a9c..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/footer-left.png b/greenpages/greenpages.web/src/main/webapp/images/footer-left.png
deleted file mode 100644
index 8bfe3b1..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/footer-left.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/footer-right.png b/greenpages/greenpages.web/src/main/webapp/images/footer-right.png
deleted file mode 100644
index 51527ad..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/footer-right.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/footer-stretch.png b/greenpages/greenpages.web/src/main/webapp/images/footer-stretch.png
deleted file mode 100644
index c58f721..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/footer-stretch.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/header-left.png b/greenpages/greenpages.web/src/main/webapp/images/header-left.png
deleted file mode 100644
index 4920a0a..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/header-left.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/header-right.png b/greenpages/greenpages.web/src/main/webapp/images/header-right.png
deleted file mode 100644
index 09b0a59..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/header-right.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/loader-white-large.gif b/greenpages/greenpages.web/src/main/webapp/images/loader-white-large.gif
deleted file mode 100644
index aa4ec5a..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/loader-white-large.gif
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/loader-white-small.gif b/greenpages/greenpages.web/src/main/webapp/images/loader-white-small.gif
deleted file mode 100644
index 75ad2b3..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/loader-white-small.gif
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/menu-curve-left.png b/greenpages/greenpages.web/src/main/webapp/images/menu-curve-left.png
deleted file mode 100644
index c48a2e0..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/menu-curve-left.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/menu-curve-right.png b/greenpages/greenpages.web/src/main/webapp/images/menu-curve-right.png
deleted file mode 100644
index 1f3b100..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/menu-curve-right.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/menu-stretch.png b/greenpages/greenpages.web/src/main/webapp/images/menu-stretch.png
deleted file mode 100644
index 0ca66f7..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/menu-stretch.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/mini-header-left.png b/greenpages/greenpages.web/src/main/webapp/images/mini-header-left.png
deleted file mode 100644
index 72551e7..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/mini-header-left.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/mini-header-right.png b/greenpages/greenpages.web/src/main/webapp/images/mini-header-right.png
deleted file mode 100644
index 8aaf50c..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/mini-header-right.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/s2ap_soda_can.png b/greenpages/greenpages.web/src/main/webapp/images/s2ap_soda_can.png
deleted file mode 100644
index 8eb53a8..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/s2ap_soda_can.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/spring.png b/greenpages/greenpages.web/src/main/webapp/images/spring.png
deleted file mode 100644
index 05a1940..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/spring.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/images/table-header-background.png b/greenpages/greenpages.web/src/main/webapp/images/table-header-background.png
deleted file mode 100644
index 8f2ba1b..0000000
--- a/greenpages/greenpages.web/src/main/webapp/images/table-header-background.png
+++ /dev/null
Binary files differ
diff --git a/greenpages/greenpages.web/src/main/webapp/index.html b/greenpages/greenpages.web/src/main/webapp/index.html
deleted file mode 100644
index a541368..0000000
--- a/greenpages/greenpages.web/src/main/webapp/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
- <head>
- <title>GreenPages</title>
- <meta http-equiv="REFRESH" content="0;url=/greenpages/app/home.htm">
- </head>
- <body>
-
- </body>
-</html>
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/styles/local.css b/greenpages/greenpages.web/src/main/webapp/styles/local.css
deleted file mode 100644
index 8302e89..0000000
--- a/greenpages/greenpages.web/src/main/webapp/styles/local.css
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Local style information for the Virgo Splash Screen
- *
- * Contains both style and colour information and
- * overrides content from the dojo/tundra style.
- *
- * Christopher Frost - March 2010
- *
- */
-
-#mini-header, #mini-header-left, #mini-header-right {
- height: 7px;
- width: 7px;
- margin: 0px;
- padding: 0px;
-}
-
-#mini-header {
- width: 100%;
- background-color: #002e62;
-}
-
-#mini-header-left {
- background-image: url(../images/mini-header-left.png);
- background-repeat: no-repeat;
- background-position: left top;
- float: left;
-}
-
-#mini-header-right {
- background-image: url(../images/mini-header-right.png);
- background-repeat: no-repeat scroll;
- background-position: right top;
- float: right;
-}
-
-#content-no-nav {
- background: transparent url(../images/s2ap_soda_can.png) no-repeat bottom right;
- height: 400px;
-}
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/main/webapp/styles/main.css b/greenpages/greenpages.web/src/main/webapp/styles/main.css
deleted file mode 100644
index 8eac83a..0000000
--- a/greenpages/greenpages.web/src/main/webapp/styles/main.css
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * MAIN CSS
- *
- * All styles for the screen, other than color-specific styles,
- * should be included here.
- *
- * COMMON STYLES
- */
-body {
- font: 12px Helvetica, Arial, "Bitstream Vera Sans", sans-serif;
- background-color: #dfdfdf;
-}
-
-#page {
- margin: auto;
- width: 800px;
- color: #333;
-}
-
-/*
- * HEADER STYLES
- */
-#header {
- background: #fff url(../images/header-right.png) no-repeat scroll right top;
- width: 100%;
- height: 100px;
-}
-
-#name-and-company {
- background: transparent url(../images/header-left.png) no-repeat top left;
- width: 100%;
- height: 100px;
- top: 0px;
- left: 0px;
-}
-
-#site-name {
- background: transparent url(../images/header-title-left.png) no-repeat scroll center center;
- height: 100px;
- width: 345px;
-}
-
-#site-name a, #site-name a:hover {
- height: 60px;
- width: 190px;
-}
-
-#company-name a, #site-name a:hover {
- height: 60px;
- width: 190px;
-}
-
-
-/*
- * TEXT FORMATTING STYLES
- */
-h1 {
- font-size: 1.4em;
- padding: 12px 0 5px 0;
- line-height: 125%;
- color: #002E62;
- border-bottom: 1px solid #BAD9EC;
-}
-
-h2 {
- font-size: 1.2em;
- padding: 10px 0 2px 0;
- color: #002E62;
-}
-
-h3 {
- font-size: 1em;
- padding: 8px 0 5px 0;
- color: #002E62;
-}
-
-h4 {
- font-size: 1em;
- padding-top: 8px;
- color: #333;
-}
-
-h5 {
- font-size: 1em;
- padding-top: 6px;
- color: #333;
-}
-
-/*
- * LINK STYLES
- */
-
-a:link, a:visited {
- color: #333;
- text-decoration: underline;
-}
-
-a:hover, a:focus {
- color: #0093CF;
- text-decoration: underline;
-}
-
-a:active, a.active {
- color: #0093CF;
-}
-
-/*
- * MENU STYLES
- */
-#primary-navigation {
- background: #fff url(../images/menu-stretch.png) repeat-x scroll 0 0;
- height:29px;
- margin:0;
- padding:0;
- position: relative;
-}
-
-#primary-left {
- background: #002E62;
- float: left;
- height: 26px;
- line-height: normal;
- padding: 3px 0 0;
- position: relative;
-}
-
-#primary-right {
- background: #002E62;
- float: right;
- height: 26px;
- line-height: normal;
- padding: 3px 0 0;
- position: relative;
-}
-
-#primary-left ul, #primary-right ul {
- padding: 0 4px 0 4px;
- margin: 2px 0 0 0;
- list-style: none;
-}
-
-#primary-left li, #primary-right li {
- display: inline;
-}
-
-#primary-left a, #primary-right a {
- color: #ffffff;
- display: block;
- float: left;
- font-weight:normal;
- margin: 0 1px 0 1px;
- padding: 7px 8px 4px 10px;
- text-decoration: none;
-}
-
-#primary-left a:hover, #primary-right a:hover, .selected-menu {
- background: #ffffff;
- color:#002E62;
- text-decoration: none;
-}
-
-#left-curve {
- float: left;
-}
-
-#right-curve {
- float: right;
-}
-
-/*
- * CONTAINER STYLES
- */
-#content-no-nav {
- display: block;
- margin: 0px 22px 20px 22px;
- padding: 0;
-}
-
-#container {
- margin: 0;
- padding-bottom: 20px;
- overflow:hidden;
- background:#fff;
-}
-
-/*
- * TABLE STYLES
- */
-table {
- border-spacing: 0;
- margin: 0;
- border-collapse: collapse;
- color:#666;
-}
-
-th {
- height: 19px;
- text-align: left;
- font-weight: bold;
- margin: 0;
- padding: 3px 6px 0 6px;
- line-height: 19px;
- color:#333;
-}
-
-.bordered-table {
- border:1px solid #BAD9EC;
-}
-
-.bordered-table th {
- background-image: url(../images/table-header-background.png);
- background-repeat: repeat-x;
- white-space: nowrap;
- border-bottom: 1px solid #BAD9EC;
-}
-
-td {
- margin: 0;
- padding: 4px 6px 4px 6px;
- vertical-align: top;
-}
-
-td.table-icon {
- padding-top: 2px;
- padding-bottom: 1px;
-}
-
-.sublevel1-odd {
- background:#fff;
-}
-
-.sublevel1-even {
- background:#E8F6FF;
-}
-
-.two-tables {
- width:100%;
-}
-
-.two-tables .left {
- float:left;
-}
-
-.two-tables .right {
- float:right;
-}
-
-/*
- * FOOTER STYLES
- */
-#footer-wrapper {
- clear: both;
- margin: 0;
- background-image: url(../images/footer-stretch.png);
- background-repeat: repeat-x;
- height: 29px;
- width: 100%;
-}
-
-#footer-left, #footer-right {
- margin: 0;
- font-size: 85%;
- padding: 1em;
- height: 29px;
- color: #bbb;
-}
-
-#footer-left {
- text-align: left;
- background-image: url(../images/footer-left.png);
- background-repeat: no-repeat;
- position: relative;
- left: 0;
- float: left;
-}
-
-#footer-right {
- text-align: right;
- background-image: url(../images/footer-right.png);
- background-repeat: no-repeat;
- background-position: top right;
- position: relative;
- right: 0;
- float: right;
-}
-
-#footer-left a, #footer-right a {
- color: #999;
- text-decoration:none;
-}
diff --git a/greenpages/greenpages.web/src/main/webapp/styles/print.css b/greenpages/greenpages.web/src/main/webapp/styles/print.css
deleted file mode 100644
index f325cfc..0000000
--- a/greenpages/greenpages.web/src/main/webapp/styles/print.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/* White background, black text, arial font, decent font size */
-body {
- background-color: #fff;
- color: #000;
- font-family: Arial, Helvetica, "Bitstream Vera Sans", sans-serif;
- font-size: 10pt;
- width: 100%;
-}
-
-/* Change the layout to remove columns */
-html body {
- background: transparent;
- width: auto;
-}
-
-#main,#container {
- width: 100%;
-}
-
-#page {
- margin: 0;
- width: 90%;
-}
-
-#content {
- margin: 0;
- overflow: visible;
-}
-
-/* Hide header and nav elements */
-#header,#primary-navigation,#secondary-navigation,#footer-wrapper {
- visibility: hidden;
- display: none;
-}
-
-/* Style links */
-a:link,a:visited {
- color: #520;
- background: transparent;
- text-decoration: underline !important;
-}
-
-/* Remove table header graphic */
-.bordered-table th {
- background-image: none;
-}
\ No newline at end of file
diff --git a/greenpages/greenpages.web/src/test/java/greenpages/web/GreenPagesSpringContextTests.java b/greenpages/greenpages.web/src/test/java/greenpages/web/GreenPagesSpringContextTests.java
deleted file mode 100644
index dd3086e..0000000
--- a/greenpages/greenpages.web/src/test/java/greenpages/web/GreenPagesSpringContextTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.web;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import greenpages.Listing;
-import greenpages.web.GreenPagesController;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestExecutionListeners;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "classpath*:/META-INF/spring/module-context.xml", "file:src/main/webapp/WEB-INF/greenpages-servlet.xml", "classpath:/META-INF/spring/test-context.xml" })
-@TestExecutionListeners(value = DependencyInjectionTestExecutionListener.class)
-public class GreenPagesSpringContextTests {
-
- @Autowired
- private GreenPagesController controller;
-
- @Test
- public void search() {
- List<Listing> results = this.controller.search("johnson");
- assertNotNull(results);
- assertEquals(1, results.size());
-
- Listing listing = results.get(0);
- assertNotNull(listing);
- assertEquals("Johnson", listing.getLastName());
- }
-
- @Test
- public void entry() {
- Listing listing = this.controller.entry(1);
- assertNotNull(listing);
- assertEquals("Johnson", listing.getLastName());
- }
-}
diff --git a/greenpages/greenpages.web/src/test/java/greenpages/web/TestDataPopulator.java b/greenpages/greenpages.web/src/test/java/greenpages/web/TestDataPopulator.java
deleted file mode 100644
index 945c19a..0000000
--- a/greenpages/greenpages.web/src/test/java/greenpages/web/TestDataPopulator.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 VMware Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VMware Inc. - initial contribution
- *******************************************************************************/
-
-package greenpages.web;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import javax.sql.DataSource;
-
-import org.springframework.core.io.Resource;
-
-/**
- * A class that populates a datasource with test data
- */
-public class TestDataPopulator {
-
- private final DataSource dataSource;
-
- private final Resource testDataLocation;
-
- public TestDataPopulator(DataSource dataSource, Resource testDataLocation) {
- this.dataSource = dataSource;
- this.testDataLocation = testDataLocation;
- }
-
- public void populate() {
- Connection connection = null;
- try {
- connection = dataSource.getConnection();
- insertTestData(connection);
- } catch (SQLException e) {
- throw new RuntimeException("SQL exception occurred acquiring connection", e);
- } finally {
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- }
- }
- }
- }
-
- private void insertTestData(Connection connection) {
- try {
- String sql = parseSqlIn(testDataLocation);
- executeSql(sql, connection);
- } catch (IOException e) {
- throw new RuntimeException("I/O exception occurred accessing the test data file", e);
- } catch (SQLException e) {
- throw new RuntimeException("SQL exception occurred loading test data", e);
- }
- }
-
- private String parseSqlIn(Resource resource) throws IOException {
- InputStream is = null;
- try {
- is = resource.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-
- StringWriter sw = new StringWriter();
- BufferedWriter writer = new BufferedWriter(sw);
-
- for (int c = reader.read(); c != -1; c = reader.read()) {
- writer.write(c);
- }
- writer.flush();
- return sw.toString();
-
- } finally {
- if (is != null) {
- is.close();
- }
- }
- }
-
- private void executeSql(String sql, Connection connection) throws SQLException {
- Statement statement = connection.createStatement();
- statement.execute(sql);
- }
-}
diff --git a/greenpages/greenpages.web/src/test/resources/META-INF/spring/test-context.xml b/greenpages/greenpages.web/src/test/resources/META-INF/spring/test-context.xml
deleted file mode 100644
index a0d7cbf..0000000
--- a/greenpages/greenpages.web/src/test/resources/META-INF/spring/test-context.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
- p:driverClassName="org.h2.Driver" p:url="jdbc:h2:.~/greenpages-db/greenpages"
- p:username="greenpages" p:password="pass"
- init-method="createDataSource" destroy-method="close"/>
-
- <bean class="greenpages.web.TestDataPopulator" init-method="populate">
- <constructor-arg ref="dataSource"/>
- <constructor-arg value="file:../db/db.sql"/>
- </bean>
-
-</beans>
diff --git a/greenpages/pom.xml b/greenpages/pom.xml
index ec58208..78d5f17 100644
--- a/greenpages/pom.xml
+++ b/greenpages/pom.xml
@@ -12,10 +12,6 @@
<packaging>pom</packaging>
<modules>
<module>greenpages.parent</module>
- <module>greenpages.db</module>
<module>greenpages.core</module>
- <module>greenpages.jpa</module>
- <module>greenpages.web</module>
- <module>greenpages.par</module>
</modules>
</project>