You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ja...@apache.org on 2011/09/12 09:27:09 UTC
svn commit: r1169629 - in /incubator/rave/trunk: rave-portal/
rave-portal/src/main/resources/ rave-portal/src/main/resources/META-INF/
rave-portal/src/main/webapp/WEB-INF/ rave-portal/src/test/resources/
rave-shindig/ rave-shindig/src/main/resources/ r...
Author: jasha
Date: Mon Sep 12 07:27:08 2011
New Revision: 1169629
URL: http://svn.apache.org/viewvc?rev=1169629&view=rev
Log:
RAVE-244 use properties for database configuration
exclude model classes that are not entities
clean up log configuration to prevent duplicate messages
Added:
incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml (contents, props changed)
- copied, changed from r1167121, incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext.xml
incubator/rave/trunk/rave-portal/src/test/resources/portal.properties
incubator/rave/trunk/rave-shindig/src/test/resources/rave.shindig.properties
Modified:
incubator/rave/trunk/rave-portal/pom.xml
incubator/rave/trunk/rave-portal/src/main/resources/META-INF/persistence.xml
incubator/rave/trunk/rave-portal/src/main/resources/log4j.xml
incubator/rave/trunk/rave-portal/src/main/resources/portal.properties
incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext.xml
incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/dataContext.xml
incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/web.xml
incubator/rave/trunk/rave-portal/src/test/resources/log4j.xml
incubator/rave/trunk/rave-portal/src/test/resources/portal-test-applicationContext.xml
incubator/rave/trunk/rave-portal/src/test/resources/portal-test-dataContext.xml
incubator/rave/trunk/rave-shindig/pom.xml
incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-applicationContext.xml
incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-dataContext.xml
incubator/rave/trunk/rave-shindig/src/main/resources/rave.shindig.properties
incubator/rave/trunk/rave-shindig/src/test/resources/META-INF/persistence.xml
incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-applicationContext.xml
incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-dataContext.xml
Modified: incubator/rave/trunk/rave-portal/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/pom.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/pom.xml (original)
+++ incubator/rave/trunk/rave-portal/pom.xml Mon Sep 12 07:27:08 2011
@@ -263,6 +263,8 @@
<version>1.2</version>
<configuration>
<includes>org/apache/rave/portal/model/*.class</includes>
+ <excludes>org/apache/rave/portal/model/NewUser.class,
+ org/apache/rave/portal/model/WidgetStatus.class</excludes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
@@ -286,7 +288,6 @@
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>${openjpa.version}</version>
-
</dependency>
</dependencies>
</plugin>
Modified: incubator/rave/trunk/rave-portal/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/resources/META-INF/persistence.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/resources/META-INF/persistence.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/resources/META-INF/persistence.xml Mon Sep 12 07:27:08 2011
@@ -22,7 +22,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="ravePersistenceUnit" transaction-type="RESOURCE_LOCAL">
- <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>org.apache.rave.portal.model.Page</class>
<class>org.apache.rave.portal.model.Region</class>
<class>org.apache.rave.portal.model.User</class>
Copied: incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml (from r1167121, incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext.xml)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml?p2=incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml&p1=incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext.xml&r1=1167121&r2=1169629&rev=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml Mon Sep 12 07:27:08 2011
@@ -22,16 +22,12 @@
<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"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
- http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<!-- make the the portal.properties props available to autowire injectors, location of the properties can
@@ -41,7 +37,12 @@
<property name="location" value="classpath:portal.properties"/>
</bean>
- <context:component-scan base-package="org.apache.rave" annotation-config="true" />
+ <!-- bean post-processor for JPA annotations -->
+ <context:annotation-config/>
+
+ <!-- base-package scan on org.apache.rave lets junit tests fail from the IDE -->
+ <context:component-scan base-package="org.apache.rave.portal"/>
+ <context:component-scan base-package="org.apache.rave.provider"/>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
@@ -49,41 +50,39 @@
<tx:annotation-driven transaction-manager="transactionManager" />
- <!-- Bean that executes the given set of resources (SQL scripts) in order
- To remove runtime initialization of initial data, remove this bean and change teh entity manager factory to the default
- Spring implementation
- -->
- <bean id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
- <property name="executeScriptQuery" value="SELECT * FROM WIDGETS"/>
- <property name="scriptLocations">
- <list>
- <value>classpath:initial_data.sql</value>
- </list>
- </property>
- </bean>
-
<bean id="entityManagerFactory"
class="org.apache.rave.persistence.jpa.PopulatedLocalContainerEntityManagerFactory">
<property name="populator" ref="dataSourcePopulator" />
+ <property name="loadTimeWeaver">
+ <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
+ </property>
<property name="persistenceUnitName" value="ravePersistenceUnit"/>
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"
- p:databasePlatform="org.apache.openjpa.jdbc.sql.H2Dictionary"
- p:database="H2"
- p:showSql="true"/>
+ p:databasePlatform="${portal.jpaVendorAdapter.databasePlatform}"
+ p:database="${portal.jpaVendorAdapter.database}"
+ p:showSql="${portal.jpaVendorAdapter.showSql}"/>
</property>
<property name="jpaDialect">
- <bean class="org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect"/>
- </property>
+ <bean class="${portal.jpaDialect}"/>
+ </property>
<property name="jpaPropertyMap">
<map>
- <entry key="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
- <entry key="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
- <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+ <entry key="openjpa.Log" value="${portal.openjpa.Log}"/>
+ <entry key="openjpa.RuntimeUnenhancedClasses" value="${portal.openjpa.RuntimeUnenhancedClasses}"/>
+ <entry key="openjpa.jdbc.SynchronizeMappings" value="${portal.openjpa.jdbc.SynchronizeMappings}"/>
</map>
</property>
</bean>
+
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="url" value="${portal.dataSource.url}"/>
+ <property name="driverClassName" value="${portal.dataSource.driver}"/>
+ <property name="username" value="${portal.dataSource.username}"/>
+ <property name="password" value="${portal.dataSource.password}"/>
+ </bean>
+
<!-- A RestTemplate instance that can be used to call a web service which expects Content-Type and Accept headers of
application/json with a pre-built string of JSON data. -->
Propchange: incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: incubator/rave/trunk/rave-portal/src/main/resources/applicationContext.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/rave/trunk/rave-portal/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/resources/log4j.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/resources/log4j.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/resources/log4j.xml Mon Sep 12 07:27:08 2011
@@ -33,9 +33,8 @@
<!-- Springframework logger -->
<logger name="org.springframework">
<level value="info" />
- <appender-ref ref="console" />
</logger>
-
+
<!-- Root Logger -->
<root>
<priority value="warn" />
Modified: incubator/rave/trunk/rave-portal/src/main/resources/portal.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/resources/portal.properties?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/resources/portal.properties (original)
+++ incubator/rave/trunk/rave-portal/src/main/resources/portal.properties Mon Sep 12 07:27:08 2011
@@ -31,4 +31,20 @@ portal.opensocial_security.container=def
portal.opensocial_security.domain=default
# the default page name to create for new users
-portal.page.default_name=Main
\ No newline at end of file
+portal.page.default_name=Main
+
+#Default Rave Portal database settings with in memory H2 database
+portal.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1
+portal.dataSource.driver=org.h2.Driver
+portal.dataSource.username=sa
+portal.dataSource.password=local
+
+portal.jpaDialect=org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect
+portal.jpaVendorAdapter.databasePlatform=org.apache.openjpa.jdbc.sql.H2Dictionary
+portal.jpaVendorAdapter.database=H2
+
+# General Rave portal database settings
+portal.jpaVendorAdapter.showSql=true
+portal.openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
+portal.openjpa.RuntimeUnenhancedClasses=unsupported
+portal.openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/dataContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/dataContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/dataContext.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/dataContext.xml Mon Sep 12 07:27:08 2011
@@ -21,17 +21,24 @@
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/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <!--property name="url" value="jdbc:h2:file:./portal;FILE_LOCK=NO" />-->
- <property name="url" value="jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1"/>
- <property name="driverClassName" value="org.h2.Driver"/>
- <property name="username" value="sa"/>
- <property name="password" value="local"/>
+ <!--
+ Bean that executes the given set of resources (SQL scripts) in order
+ To remove runtime initialization of initial data, remove this bean and change the entity manager factory to the default
+ Spring implementation
+ -->
+ <bean id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
+ <property name="executeScriptQuery" value="SELECT * FROM WIDGET"/>
+ <property name="scriptLocations">
+ <list>
+ <value>classpath:initial_data.sql</value>
+ </list>
+ </property>
+ </bean>
+
+ <!-- provides a H2 console to look into the db if necessary -->
+ <bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server"
+ factory-method="createWebServer" depends-on="dataSource"
+ init-method="start" lazy-init="false" destroy-method="stop">
+ <constructor-arg value="-web,-webPort,11111"/>
</bean>
- <!-- provides a H2 console to look into the db if necessary -->
- <bean id="org.h2.tools.Server-WebServer" class="org.h2.tools.Server"
- factory-method="createWebServer" depends-on="dataSource"
- init-method="start" lazy-init="false" destroy-method="stop">
- <constructor-arg value="-web,-webPort,11111" />
- </bean>
</beans>
\ No newline at end of file
Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/web.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/web.xml Mon Sep 12 07:27:08 2011
@@ -31,8 +31,8 @@
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
+ classpath:applicationContext.xml
/WEB-INF/dataContext.xml
- /WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-security.xml
</param-value>
</context-param>
Modified: incubator/rave/trunk/rave-portal/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/log4j.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/log4j.xml (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/log4j.xml Mon Sep 12 07:27:08 2011
@@ -33,13 +33,11 @@
<!-- Springframework logger -->
<logger name="org.springframework">
<level value="info" />
- <appender-ref ref="console" />
</logger>
<!-- Rave logger -->
<logger name="org.apache.rave">
<level value="debug" />
- <appender-ref ref="console" />
</logger>
<!-- Root Logger -->
Modified: incubator/rave/trunk/rave-portal/src/test/resources/portal-test-applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/portal-test-applicationContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/portal-test-applicationContext.xml (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/portal-test-applicationContext.xml Mon Sep 12 07:27:08 2011
@@ -19,106 +19,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"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:oxm="http://www.springframework.org/schema/oxm"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
- http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
- <!-- make the the portal.properties props available to autowire injectors, location of the properties can
- be overridden by setting a system property "portal.override.properties" -->
- <bean id="portalPropertyPlaceholder" class="org.apache.rave.util.OverridablePropertyPlaceholderConfigurer">
- <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
- <property name="location" value="classpath:portal.properties"/>
- </bean>
-
- <!-- base-package scan on org.apache.rave lets junit tests fail from the IDE -->
- <context:component-scan base-package="org.apache.rave.portal"/>
- <context:component-scan base-package="org.apache.rave.provider"/>
-
- <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory"/>
- </bean>
-
- <tx:annotation-driven transaction-manager="transactionManager"/>
-
- <!-- Bean that executes the given set of resources (SQL scripts) in order
- To remove runtime initialization of initial data, remove this bean and change teh entity manager factory to the default
- Spring implementation
- -->
- <bean id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
- <property name="executeScriptQuery" value="SELECT * FROM WIDGETS"/>
- <property name="scriptLocations">
- <list>
- <value>classpath:initial_data.sql</value>
- <value>classpath:portal_test_data.sql</value>
- </list>
- </property>
- </bean>
-
- <bean id="entityManagerFactory"
- class="org.apache.rave.persistence.jpa.PopulatedLocalContainerEntityManagerFactory">
- <property name="populator" ref="dataSourcePopulator"/>
- <property name="persistenceUnitName" value="ravePersistenceUnit"/>
- <property name="dataSource" ref="dataSource"/>
- <property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
- <property name="showSql" value="true"/>
- </bean>
- </property>
- <property name="jpaPropertyMap">
- <map>
- <entry key="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
- <!-- Allow to enhance classes at runtime -->
- <entry key="openjpa.RuntimeUnenhancedClasses" value="supported"/>
- <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
- </map>
- </property>
- </bean>
-
- <!-- A RestTemplate instance that can be used to call a web service which expects Content-Type and Accept headers of
- application/json with a pre-built string of JSON data. -->
- <bean id="jsonStringCompatibleRestTemplate" class="org.springframework.web.client.RestTemplate">
- <property name="messageConverters">
- <list>
- <bean class="org.springframework.http.converter.StringHttpMessageConverter">
- <property name="supportedMediaTypes">
- <list>
- <util:constant static-field="org.springframework.http.MediaType.APPLICATION_JSON"/>
- </list>
- </property>
- </bean>
- </list>
- </property>
- </bean>
-
- <!-- Environment variables for opensocial calls from the portal -->
- <bean id="openSocialEnvironment" class="org.apache.rave.provider.opensocial.config.OpenSocialEnvironment">
- <property name="engineProtocol" value="${portal.opensocial_engine.protocol}"/>
- <property name="engineRoot" value="${portal.opensocial_engine.root}"/>
- <property name="engineGadgetPath" value="${portal.opensocial_engine.gadget_path}"/>
- </bean>
-
- <!-- Validators -->
- <bean id="newAccountValidator" class="org.apache.rave.portal.web.validator.NewAccountValidator"/>
- <bean id="userProfileValidator" class="org.apache.rave.portal.web.validator.UserProfileValidator"/>
- <bean id="newWidgetValidator" class="org.apache.rave.portal.web.validator.NewWidgetValidator"/>
-
- <!-- Configuring messages.properties file -->
- <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
- p:basename="messages"/>
-
- <!-- Password encoding and salting-->
- <bean class="org.springframework.security.authentication.encoding.ShaPasswordEncoder" id="passwordEncoder"/>
- <bean class="org.springframework.security.authentication.dao.ReflectionSaltSource" id="saltSource">
- <property name="userPropertyToUse" value="username"/>
- </bean>
+ <import resource="classpath*:applicationContext.xml"/>
</beans>
\ No newline at end of file
Modified: incubator/rave/trunk/rave-portal/src/test/resources/portal-test-dataContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/portal-test-dataContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/portal-test-dataContext.xml (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/portal-test-dataContext.xml Mon Sep 12 07:27:08 2011
@@ -21,10 +21,13 @@
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/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="url" value="jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1"/>
- <property name="driverClassName" value="org.h2.Driver"/>
- <property name="username" value="sa"/>
- <property name="password" value="local"/>
+ <bean id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
+ <property name="executeScriptQuery" value="SELECT * FROM WIDGET"/>
+ <property name="scriptLocations">
+ <list>
+ <value>classpath:initial_data.sql</value>
+ <value>classpath:portal_test_data.sql</value>
+ </list>
+ </property>
</bean>
</beans>
\ No newline at end of file
Added: incubator/rave/trunk/rave-portal/src/test/resources/portal.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/portal.properties?rev=1169629&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/portal.properties (added)
+++ incubator/rave/trunk/rave-portal/src/test/resources/portal.properties Mon Sep 12 07:27:08 2011
@@ -0,0 +1,50 @@
+#
+# 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.
+#
+
+#
+# These properties are used to construct the opensocial engine's URL. See
+# for example home.jsp. Changing them does not change the actual path configuration
+# of shindig.
+#
+portal.opensocial_engine.protocol=http
+portal.opensocial_engine.root=localhost:8080
+portal.opensocial_engine.gadget_path=/gadgets
+
+portal.opensocial_security.encryptionkey=classpath:security_token_encryption_key.txt
+portal.opensocial_security.container=default
+portal.opensocial_security.domain=default
+
+# the default page name to create for new users
+portal.page.default_name=Main
+
+#Default Rave Portal database settings with in memory H2 database
+portal.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1
+portal.dataSource.driver=org.h2.Driver
+portal.dataSource.username=sa
+portal.dataSource.password=local
+
+portal.jpaDialect=org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect
+portal.jpaVendorAdapter.databasePlatform=org.apache.openjpa.jdbc.sql.H2Dictionary
+portal.jpaVendorAdapter.database=H2
+
+# General Rave portal database settings
+portal.jpaVendorAdapter.showSql=true
+portal.openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
+portal.openjpa.RuntimeUnenhancedClasses=supported
+portal.openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
Modified: incubator/rave/trunk/rave-shindig/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/pom.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/pom.xml (original)
+++ incubator/rave/trunk/rave-shindig/pom.xml Mon Sep 12 07:27:08 2011
@@ -136,7 +136,14 @@
<artifactId>openjpa-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
- <!--<includes>org/apache/rave/opensocial/model/*.class</includes>-->
+ <includes>org/apache/rave/gadgets/oauth/model/*.class,
+ org/apache/rave/opensocial/model/*.class,
+ org/apache/shindig/social/opensocial/jpa/*.class
+ </includes>
+ <excludes>
+ org/apache/shindig/social/opensocial/jpa/EnumDb.class,
+ org/apache/rave/gadgets/oauth/model/OAuthConsumerStore$KeyType.class
+ </excludes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
Modified: incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-applicationContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-applicationContext.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-applicationContext.xml Mon Sep 12 07:27:08 2011
@@ -21,44 +21,53 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
- <context:property-placeholder location="classpath:rave.shindig.properties" />
- <context:component-scan base-package="org.apache.rave" annotation-config="true" />
+ <context:property-placeholder location="classpath:rave.shindig.properties"/>
+ <context:component-scan base-package="org.apache.rave" annotation-config="true"/>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
- <tx:annotation-driven transaction-manager="transactionManager" />
+ <tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="entityManagerFactory"
class="org.apache.rave.persistence.jpa.PopulatedLocalContainerEntityManagerFactory">
<property name="persistenceUnitName" value="raveShindigPersistenceUnit"/>
<property name="dataSource" ref="dataSource"/>
- <property name="populator" ref="dataSourcePopulator" />
+ <property name="populator" ref="dataSourcePopulator"/>
<property name="jpaVendorAdapter">
- <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
- <property name="showSql" value="true" />
- </bean>
+ <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"
+ p:databasePlatform="${rave-shindig.jpaVendorAdapter.databasePlatform}"
+ p:database="${rave-shindig.jpaVendorAdapter.database}"
+ p:showSql="${rave-shindig.jpaVendorAdapter.showSql}"/>
</property>
<property name="jpaPropertyMap">
<map>
- <entry key="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
- <!--<entry key="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>-->
- <entry key="openjpa.RuntimeUnenhancedClasses" value="warn"/>
- <entry key="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+ <entry key="openjpa.Log" value="${rave-shindig.openjpa.Log}"/>
+ <entry key="openjpa.RuntimeUnenhancedClasses" value="${rave-shindig.openjpa.RuntimeUnenhancedClasses}"/>
+ <entry key="openjpa.jdbc.SynchronizeMappings" value="${rave-shindig.openjpa.jdbc.SynchronizeMappings}"/>
</map>
</property>
</bean>
- <bean id="oAuthStore" class="org.apache.rave.gadgets.oauth.inject.DefaultOAuthStore">
- <constructor-arg name="defaultCallbackUrl" value="${shindig.signing.global-callback-url}"/>
- <constructor-arg name="pathToPrivateKey" value="${shindig.signing.key-file}"/>
- <constructor-arg name="privateKeyName" value="${shindig.signing.key-name}"/>
- </bean>
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+ <property name="url" value="${rave-shindig.dataSource.url}"/>
+ <property name="driverClassName" value="${rave-shindig.dataSource.driver}"/>
+ <property name="username" value="${rave-shindig.dataSource.username}"/>
+ <property name="password" value="${rave-shindig.dataSource.password}"/>
+ </bean>
+
+
+ <bean id="oAuthStore" class="org.apache.rave.gadgets.oauth.inject.DefaultOAuthStore">
+ <constructor-arg name="defaultCallbackUrl" value="${shindig.signing.global-callback-url}"/>
+ <constructor-arg name="pathToPrivateKey" value="${shindig.signing.key-file}"/>
+ <constructor-arg name="privateKeyName" value="${shindig.signing.key-name}"/>
+ </bean>
</beans>
Modified: incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-dataContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-dataContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-dataContext.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/main/resources/rave-shindig-dataContext.xml Mon Sep 12 07:27:08 2011
@@ -16,20 +16,10 @@
specific language governing permissions and limitations
under the License.
-->
+
<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"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="url" value="jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1"/>
- <property name="driverClassName" value="org.h2.Driver"/>
- <property name="username" value="sa"/>
- <property name="password" value="local"/>
- </bean>
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
<property name="executeScriptQuery" value="SELECT * FROM PERSON"/>
Modified: incubator/rave/trunk/rave-shindig/src/main/resources/rave.shindig.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/resources/rave.shindig.properties?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/resources/rave.shindig.properties (original)
+++ incubator/rave/trunk/rave-shindig/src/main/resources/rave.shindig.properties Mon Sep 12 07:27:08 2011
@@ -20,4 +20,20 @@ shindig.spring.base-package=org.apache.r
shindig.signing.key-name=
shindig.signing.key-file=
-shindig.signing.global-callback-url=http://localhost:8080/gadgets/oauthcallback
\ No newline at end of file
+shindig.signing.global-callback-url=http://localhost:8080/gadgets/oauthcallback
+
+# Default Rave Shindig database settings with in memory H2 database
+rave-shindig.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1
+rave-shindig.dataSource.driver=org.h2.Driver
+rave-shindig.dataSource.username=sa
+rave-shindig.dataSource.password=local
+
+rave-shindig.jpaDialect=org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect
+rave-shindig.jpaVendorAdapter.databasePlatform=org.apache.openjpa.jdbc.sql.H2Dictionary
+rave-shindig.jpaVendorAdapter.database=H2
+
+# General Rave Shindig database settings
+rave-shindig.jpaVendorAdapter.showSql=true
+rave-shindig.openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
+rave-shindig.openjpa.RuntimeUnenhancedClasses=warn
+rave-shindig.openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
Modified: incubator/rave/trunk/rave-shindig/src/test/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/resources/META-INF/persistence.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/resources/META-INF/persistence.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/test/resources/META-INF/persistence.xml Mon Sep 12 07:27:08 2011
@@ -26,14 +26,6 @@
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>org.apache.rave.gadgets.oauth.model.OAuthConsumerStore</class>
<class>org.apache.rave.gadgets.oauth.model.OAuthTokenInfo</class>
- <properties>
- <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
- <property name="openjpa.ConnectionDriverName" value="org.h2.Driver"/>
- <property name="openjpa.ConnectionURL" value="jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000"/>
- <property name="openjpa.ConnectionUserName" value="sa"/>
- <property name="openjpa.ConnectionPassword" value="sa"/>
- </properties>
</persistence-unit>
</persistence>
Modified: incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-applicationContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-applicationContext.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-applicationContext.xml Mon Sep 12 07:27:08 2011
@@ -18,11 +18,7 @@
-->
<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"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<import resource="classpath:rave-shindig-applicationContext.xml"/>
Modified: incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-dataContext.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-dataContext.xml?rev=1169629&r1=1169628&r2=1169629&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-dataContext.xml (original)
+++ incubator/rave/trunk/rave-shindig/src/test/resources/rave-shindig-test-dataContext.xml Mon Sep 12 07:27:08 2011
@@ -19,18 +19,7 @@
<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"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="url" value="jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1"/>
- <property name="driverClassName" value="org.h2.Driver"/>
- <property name="username" value="sa"/>
- <property name="password" value="local"/>
- </bean>
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean primary="true" id="dataSourcePopulator" class="org.apache.rave.jdbc.util.DataSourcePopulator">
<property name="executeScriptQuery" value="SELECT * FROM PERSON"/>
Added: incubator/rave/trunk/rave-shindig/src/test/resources/rave.shindig.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/resources/rave.shindig.properties?rev=1169629&view=auto
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/resources/rave.shindig.properties (added)
+++ incubator/rave/trunk/rave-shindig/src/test/resources/rave.shindig.properties Mon Sep 12 07:27:08 2011
@@ -0,0 +1,39 @@
+#
+# 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.
+#
+shindig.spring.base-package=org.apache.rave
+
+shindig.signing.key-name=
+shindig.signing.key-file=
+shindig.signing.global-callback-url=http://localhost:8080/gadgets/oauthcallback
+
+# Default Rave Shindig database settings with in memory H2 database
+rave-shindig.dataSource.url=jdbc:h2:mem:portal;DB_CLOSE_DELAY=-1
+rave-shindig.dataSource.driver=org.h2.Driver
+rave-shindig.dataSource.username=sa
+rave-shindig.dataSource.password=local
+
+rave-shindig.jpaDialect=org.apache.rave.persistence.jpa.impl.H2OpenJpaDialect
+rave-shindig.jpaVendorAdapter.databasePlatform=org.apache.openjpa.jdbc.sql.H2Dictionary
+rave-shindig.jpaVendorAdapter.database=H2
+
+# General Rave Shindig database settings
+rave-shindig.jpaVendorAdapter.showSql=true
+rave-shindig.openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
+rave-shindig.openjpa.RuntimeUnenhancedClasses=supported
+rave-shindig.openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
\ No newline at end of file