portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r331919 - in /portals/jetspeed-2/trunk: etc/import/ etc/import/assembly/ etc/import/assembly/import-page-manager.xml etc/import/assembly/repository-datasource-spring.xml etc/import/import.properties maven.xml
Date Tue, 08 Nov 2005 22:56:38 GMT
Author: taylor
Date: Tue Nov  8 14:56:36 2005
New Revision: 331919

URL: http://svn.apache.org/viewcvs?rev=331919&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-395

moving importer out of unit test into Java class
can be ran from Maven/Ant builds
Note: Im not going to put this in a plugin
Its simply going into the maven.xml for the root project

Added:
    portals/jetspeed-2/trunk/etc/import/
    portals/jetspeed-2/trunk/etc/import/assembly/
    portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml
    portals/jetspeed-2/trunk/etc/import/assembly/repository-datasource-spring.xml
    portals/jetspeed-2/trunk/etc/import/import.properties
Modified:
    portals/jetspeed-2/trunk/maven.xml

Added: portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml?rev=331919&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml (added)
+++ portals/jetspeed-2/trunk/etc/import/assembly/import-page-manager.xml Tue Nov  8 14:56:36
2005
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans>
+
+  <bean id="org.apache.jetspeed.page.PageManagerImpl" 
+        name="pageManagerImpl"
+        init-method="init"
+        class="org.apache.jetspeed.page.impl.DatabasePageManager">
+      <!-- OJB configuration file resource path -->
+      <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>
      
+      <!-- folder/page/link cache size, default=128 -->
+      <constructor-arg index="1"><value>128</value></constructor-arg>
+      <!-- permissions security enabled flag, default=false -->
+      <constructor-arg index="2"><value>false</value></constructor-arg>
+      <!-- constraints security enabled flag, default=true -->
+      <constructor-arg index="3"><value>false</value></constructor-arg>
+  </bean>
+
+    <!-- Proxying -->
+    <bean id="org.apache.jetspeed.page.PageManager" name="dbPageManager" parent="baseTransactionProxy">
+        <property name="proxyInterfaces">
+            <value>org.apache.jetspeed.page.PageManager</value>
+        </property>
+        <property name="target">
+            <ref bean="pageManagerImpl" />
+        </property>
+        <property name="transactionAttributes">
+            <props>
+                <prop key="*">PROPAGATION_SUPPORTS</prop>
+                <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.PageNotUpdatedException</prop>
                               
+                <prop key="remove*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.PageNotRemovedException</prop>
                                               
+            </props>
+        </property>
+    </bean>
+
+  <!-- PageManager -->
+  <bean id="PsmlDocumentHandler"      
+       class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
+       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="1"><value>.psml</value></constructor-arg>
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageImpl</value></constructor-arg>
      
+       <constructor-arg index="3" ><value>./src/webapp/WEB-INF/pages</value></constructor-arg>
+       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+  </bean>
+  
+  <bean id="LinkDocumentHandler"       
+       class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
+       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="1"><value>.link</value></constructor-arg>
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.LinkImpl</value></constructor-arg>
      
+       <constructor-arg index="3" ><value>./src/webapp/WEB-INF/pages</value></constructor-arg>
+       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+  </bean>
+  
+  <bean id="FolderMetaDataDocumentHandler"         
+       class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
+       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="1"><value>folder.metadata</value></constructor-arg>
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.psml.FolderMetaDataImpl</value></constructor-arg>
      
+       <constructor-arg index="3" ><value>./src/webapp/WEB-INF/pages</value></constructor-arg>
+       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+  </bean>
+  
+  <bean id="PageSecurityDocumentHandler"       
+       class="org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler" >
        
+       <constructor-arg index="0"><value>/JETSPEED-INF/castor/page-mapping.xml</value></constructor-arg>
+       <constructor-arg index="1"><value>page.security</value></constructor-arg>
+       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.psml.PageSecurityImpl</value></constructor-arg>
      
+       <constructor-arg index="3" ><value>./src/webapp/WEB-INF/pages</value></constructor-arg>
+       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
+  </bean>
+  
+  <bean id="DocumentHandlerFactory"        
+       class="org.apache.jetspeed.page.document.psml.DocumentHandlerFactoryImpl" >   
  
+        <constructor-arg>
+        <map>
+          <entry key=".psml">
+            <ref bean="PsmlDocumentHandler" />
+          </entry>
+          <entry key=".link">
+            <ref bean="LinkDocumentHandler" />
+          </entry>  
+          <entry key="folder.metadata">
+            <ref bean="FolderMetaDataDocumentHandler" />
+          </entry>        
+          <entry key="page.security">
+            <ref bean="PageSecurityDocumentHandler" />
+          </entry>        
+        </map>
+       </constructor-arg>
+  </bean>
+  
+  <bean id="FolderHandler"         
+       class="org.apache.jetspeed.page.document.psml.FileSystemFolderHandler" >      
  
+       <constructor-arg index="0"><value>./src/webapp/WEB-INF/pages</value></constructor-arg>
+       <constructor-arg index="1"><ref bean="DocumentHandlerFactory"/></constructor-arg>
+       <constructor-arg index="2"><ref bean="PageFileCache"/></constructor-arg>
       
+  </bean>
+    
+  <bean id="org.apache.jetspeed.page.CastorPageManager" 
+       name="castorPageManager"
+       class="org.apache.jetspeed.page.psml.CastorXmlPageManager">         
+       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
+       <constructor-arg index="1"><ref bean="DocumentHandlerFactory"/></constructor-arg>
+       <constructor-arg index="2"><ref bean="FolderHandler"/></constructor-arg>
+       <constructor-arg index="3"><ref bean="PageFileCache"/></constructor-arg>
       
+       <!-- permissions security enabled flag, default=false -->
+       <constructor-arg index="4"><value>false</value></constructor-arg>
+       <!-- constraints security enabled flag, default=true -->
+       <constructor-arg index="5"><value>false</value></constructor-arg>
+  </bean>
+
+    <!-- Page File Cache -->
+    <bean id="PageFileCache" class="org.apache.jetspeed.cache.file.FileCache" init-method="startFileScanner"
destroy-method="stopFileScanner">
+        <!-- Scan rate for changes in cached files on the file system -->
+        <constructor-arg index="0">
+            <value>10</value>
+        </constructor-arg>
+        <!-- Cache size -->
+        <constructor-arg index="1">
+            <value>100</value>
+        </constructor-arg>
+    </bean>
+
+    <bean id="IdGenerator" class="org.apache.jetspeed.idgenerator.JetspeedIdGenerator"
init-method="start" destroy-method="stop">
+        <!-- ID Start value -->
+        <constructor-arg index="0">
+            <value>65536</value>
+        </constructor-arg>
+        <!-- ID Prefix -->
+        <constructor-arg index="1">
+            <value>P-</value>
+        </constructor-arg>
+        <!-- ID Suffix -->
+        <constructor-arg index="2">
+            <value></value>
+        </constructor-arg>
+    </bean>
+
+
+</beans>

Added: portals/jetspeed-2/trunk/etc/import/assembly/repository-datasource-spring.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/import/assembly/repository-datasource-spring.xml?rev=331919&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/etc/import/assembly/repository-datasource-spring.xml (added)
+++ portals/jetspeed-2/trunk/etc/import/assembly/repository-datasource-spring.xml Tue Nov
 8 14:56:36 2005
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<beans>		
+
+  <!-- datasource bean -->
+  <bean id="JetspeedDS" class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry">
+    <property name="driverClassName">
+      <value>${org.apache.jetspeed.database.driver}</value>
+    </property>
+    <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>     
+     
+  <!-- properties configurer used to pick up system properties -->
+  <bean id="propertiesConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+</beans>

Added: portals/jetspeed-2/trunk/etc/import/import.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/etc/import/import.properties?rev=331919&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/etc/import/import.properties (added)
+++ portals/jetspeed-2/trunk/etc/import/import.properties Tue Nov  8 14:56:36 2005
@@ -0,0 +1,12 @@
+# comma-separated list of boot assemblies for Spring
+boot.assemblies =  repository-datasource-spring.xml
+# comma-separated list of assemblies for Spring
+assemblies = import-page-manager.xml, transaction.xml
+# root folder to start importing from
+root.folder = /
+# overwrite folders flag, set to true to replace existing folders
+overwrite.folders = true
+# overwrite pages flag, set to true to replace existing pages 
+overwrite.pages = true
+# if this flag is true, will also try to import page.security 
+full.import = true
\ No newline at end of file

Modified: portals/jetspeed-2/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven.xml?rev=331919&r1=331918&r2=331919&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven.xml (original)
+++ portals/jetspeed-2/trunk/maven.xml Tue Nov  8 14:56:36 2005
@@ -238,5 +238,37 @@
         <path id="jdbc.drivers.path" path="${org.apache.jetspeed.test.jdbc.drivers.path}"
/>
         <maven:addPath id="maven.dependency.classpath" refid="jdbc.drivers.path" />
     </goal>
-
+    
+    <goal name='import'>
+        <filterset id="dbSet" begintoken="$" endtoken="}">
+          <filter token="{org.apache.jetspeed.database.driver" value="${org.apache.jetspeed.production.database.driver}"/>
+          <filter token="{org.apache.jetspeed.database.url" value="${org.apache.jetspeed.production.database.url}"/>
     
+          <filter token="{org.apache.jetspeed.database.user" value="${org.apache.jetspeed.production.database.user}"/>
           
+          <filter token="{org.apache.jetspeed.database.password" value="${org.apache.jetspeed.production.database.password}"/>
           
+        </filterset>            
+        <copy file="./etc/import/assembly/repository-datasource-spring.xml"
+              tofile="${maven.build.dir}/classes/repository-datasource-spring.xml"
+              overwrite="true"
+              failonerror="true">
+          <filterset refid="dbSet"/>
+        </copy>        
+        <copy todir='${maven.build.dir}/classes'
+          file="./etc/log4j/log4j.properties"/>
+        <copy todir='${maven.build.dir}/classes'>
+          <fileset dir="./etc/db-ojb/"/>
+        </copy>              
+        <copy todir="${maven.build.dir}/classes"
+              file="./etc/import/assembly/import-page-manager.xml"/>
+        <copy todir="${maven.build.dir}/classes"
+              file="./src/webapp/WEB-INF/assembly/transaction.xml"/>
+        <java classname="org.apache.jetspeed.page.PageImporter" fork="yes">
+          <classpath>
+            <path refid="maven.dependency.classpath"/>
+            <pathelement path="${maven.build.dest}"/>
+            <pathelement path="${org.apache.jetspeed.production.jdbc.drivers.path}"/>
           
+          </classpath>
+		<sysproperty key="org.apache.jetspeed.page.import.configuration" 
+                     value="./etc/import/import.properties"/>		
+        </java>
+    </goal>
 </project>



---------------------------------------------------------------------
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