portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r643656 - /portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml
Date Tue, 01 Apr 2008 23:56:15 GMT
Author: ate
Date: Tue Apr  1 16:56:13 2008
New Revision: 643656

URL: http://svn.apache.org/viewvc?rev=643656&view=rev
Log:
First example of the new Spring assembly filtering for different JetspeedDS configurations

Modified:
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml?rev=643656&r1=643655&r2=643656&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/boot/datasource.xml
Tue Apr  1 16:56:13 2008
@@ -6,131 +6,113 @@
   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
-
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-    
-    <!-- 
-       Simply use the JNDI data source provided via Spring
-     -->           
-     <bean id="JetspeedDS" class="org.springframework.jndi.JndiObjectFactoryBean">
-        <property name="resourceRef"><value>false</value></property>

-        <property name="jndiName">
-            <value>java:comp/env/jdbc/jetspeed</value>
-        </property>
-    </bean>
-    		
-    <bean id="ojbConfigurer" class="org.springframework.orm.ojb.support.LocalOjbConfigurer"/>

-
-    <!-- 
-         Dynamically configures Database Platform for OJB by looking at the connection string
-         and figuring out the OJB platform using an OJB metadata utility
-         Its important to get this right otherwise you will be sending the wrong (most likely
HSQL)
-         flavor of SQL statements to the backend database.
-     -->
-     <bean id="PlatformConfigurator" 
-           class="org.apache.jetspeed.components.rdbms.ojb.DatabasePlatformConfigurator"
-           init-method="init"
-      >
-    	<constructor-arg index='0'>
-    		<ref bean="JetspeedDS"/>
-    	</constructor-arg>         
-        <!-- JNDI Name -->
-    	<constructor-arg index='1'>
-    		<value>JetspeedDS</value>
-    	</constructor-arg>                  
-     </bean>
-            
-	<!-- 	
-			Optional configuration for table schema aware datasource.
-			
-			The way to inject the schema switching is database specific. Here only the DB2 way
-			is shown (set current schema = xx). Oracle statement might 
-			be: "alter session set current_schema=xx", PostGres
-			may look like this: "SET search_path TO xx"
-			
-			The idea was taken from http://forum.springframework.org/showthread.php?t=10728
-			
-			The runtime schema switching support was dropped because it is not needed here.
-	-->
-	<!--
-		<bean id="JetspeedDS"
-			class="org.apache.jetspeed.components.datasource.SchemaAwareDataSourceProxy">
-			<property name="targetDataSource">
-				<ref local="dataSourceTarget" />
-			</property>
-			<property name="schemaSql">
-				<value>set current schema = xx</value>
-			</property>
-		</bean>
-		
-		<bean id="dataSourceTarget"
-			class="org.springframework.jndi.JndiObjectFactoryBean">
-			<property name="resourceRef">
-				<value>false</value>
-			</property>
-			<property name="jndiName">
-				<value>java:comp/env/jdbc/jetspeed</value>
-			</property>
-		</bean>
-	-->
-            
+<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-2.5.xsd">
+
+  <!--
+    Simply use the JNDI data source provided via Spring
+  -->
+  <bean id="JetspeedDS" class="org.springframework.jndi.JndiObjectFactoryBean">
+    <property name="resourceRef" value="false"/>
+    <property name="jndiName" value="java:comp/env/jdbc/jetspeed"/>
+  </bean>
+
+  <bean id="ojbConfigurer" class="org.springframework.orm.ojb.support.LocalOjbConfigurer"
/>
+
+  <!-- 
+    Dynamically configures Database Platform for OJB by looking at the connection string
+    and figuring out the OJB platform using an OJB metadata utility
+    Its important to get this right otherwise you will be sending the wrong (most likely
HSQL)
+    flavor of SQL statements to the backend database.
+  -->
+  <bean id="PlatformConfigurator" class="org.apache.jetspeed.components.rdbms.ojb.DatabasePlatformConfigurator"
init-method="init">
+    <constructor-arg index='0' ref="JetspeedDS"/>
+    <!-- JNDI Name -->
+    <constructor-arg index='1' value="JetspeedDS"/>
+  </bean>
+
+  <!-- 	
+    Optional configuration for table schema aware datasource.
+    
+    The way to inject the schema switching is database specific. Here only the DB2 way
+    is shown (set current schema = xx). Oracle statement might 
+    be: "alter session set current_schema=xx", PostGres
+    may look like this: "SET search_path TO xx"
+    
+    The idea was taken from http://forum.springframework.org/showthread.php?t=10728
+    
+    The runtime schema switching support was dropped because it is not needed here.
+  -->
+
+  <bean class="org.apache.jetspeed.components.datasource.SchemaAwareDataSourceProxy">
+    <meta key="j2:cat" value="schemaAwareDS" />
+    <meta key="j2:alias" value="JetspeedDS" />
+    <property name="targetDataSource" ref="dataSourceTarget"/>
+    <property name="schemaSql"><value>${org.apache.jetspeed.database.set.schema.sql}</value></property>
+  </bean>
+
+  <bean class="org.springframework.jndi.JndiObjectFactoryBean">
+    <meta key="j2:cat" value="schemaAwareDS" />
+    <meta key="j2:alias" value="dataSourceTarget" />
+    <property name="resourceRef" value="false"/>
+    <property name="jndiName" value="java:comp/env/jdbc/jetspeed"/>
+  </bean>
+
+
   <!--       
-      Creates a JNDI-based datasource bean name "JetspeedDS". The information
-      provided here is merged with the basic configuration for the 
-      jdbc-connection-descriptor with the matching jcd-alias property
-      ("JetspeedDS") located under /etc/db-ojb/repository_database.xml in the
-      source tree.
-
-      Another requirement for this to work is to have the 
-      ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
-      or to have
-      ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl.
-      (either will do, both are recommended, see comments in configuration file).
-      These properties are located in /etc/db-ojb/OJB.properties in the source tree.
-          
-      FYI: The two OJB configuration files mentioned above are currently already setup this
way 
-      in the default Jetspeed implementation.  
-          
-      However, if you need to locate/modify these files in a running instance of jetspeed,
-      they will be located under /WEB-INF/classes.
-     -->
-    <!--
-  <bean id="JetspeedDS" class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry">
-    <property name="jndiName">
-      <value>java:comp/env/jdbc/jetspeed</value>
-    </property>
-  </bean>     
-       -->
-  
+    Creates a JNDI-based datasource bean name "JetspeedDS". The information
+    provided here is merged with the basic configuration for the 
+    jdbc-connection-descriptor with the matching jcd-alias property
+    ("JetspeedDS") located under /etc/db-ojb/repository_database.xml in the
+    source tree.
+    
+    Another requirement for this to work is to have the 
+    ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl
+    or to have
+    ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl.
+    (either will do, both are recommended, see comments in configuration file).
+    These properties are located in /etc/db-ojb/OJB.properties in the source tree.
+    
+    FYI: The two OJB configuration files mentioned above are currently already setup this
way 
+    in the default Jetspeed implementation.  
+    
+    However, if you need to locate/modify these files in a running instance of jetspeed,
+    they will be located under /WEB-INF/classes.
+  -->
+
+  <bean class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry">
+    <meta key="j2:cat" value="ojbConnectionRepositoryDS" />
+    <meta key="j2:alias" value="JetspeedDS" />
+    <property name="jndiName" value="java:comp/env/jdbc/jetspeed"/>
+  </bean>
+
+
   <!-- If would like use a commons DBCP Pooled datasource as opposed to the default 
-       JNDI one above you can uncomment the configuration below and fill in 
-       the datasource information as it relates to your environment.
+    JNDI one above you can uncomment the configuration below and fill in 
+    the datasource information as it relates to your environment.
+    
+    A requirement for this to work is to have the 
+    ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
+    or to have
+    ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl
+    This property is located in /etc/db-ojb/OJB.properties in the source tree.
+  -->
+  <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
+    <meta key="j2:cat" value="jdbcDS" />
+    <meta key="j2:alias" value="JetspeedDS" />
+    <property name="driverClassName" value="${org.apache.jetspeed.database.driver}"/>
+    <property name="url"><value>${org.apache.jetspeed.database.url}</value></property>
+    <property name="username"><value>${org.apache.jetspeed.database.user}</value></property>
+    <property name="password"><value>${org.apache.jetspeed.database.password}</value></property>
+  </bean>
 
-       A requirement for this to work is to have the 
-       ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl
-       or to have
-       ConnectionManagerClass=org.apache.jetspeed.components.rdbms.ojb.ConnectionManagerImpl
-       This property is located in /etc/db-ojb/OJB.properties in the source tree.
-    -->    
-    
-<!--        
-    <bean id="JetspeedDS" class="org.apache.commons.dbcp.BasicDataSource" 
-        destroy-method="close"
-        >
-                <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
-                <property name="url"><value>jdbc:mysql://localhost/j2test</value></property>
-                <property name="username"><value>j2</value></property>
-                <property name="password"><value>XXX</value></property>
-        </bean>    
-    -->
 </beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message