You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/04/10 13:16:18 UTC

svn commit: r646759 - in /portals/jetspeed-2/portal/trunk/components: ./ jetspeed-db-tools/ jetspeed-db-tools/src/ jetspeed-db-tools/src/main/ jetspeed-db-tools/src/main/java/ jetspeed-db-tools/src/main/java/org/ jetspeed-db-tools/src/main/java/org/apa...

Author: ate
Date: Thu Apr 10 04:16:12 2008
New Revision: 646759

URL: http://svn.apache.org/viewvc?rev=646759&view=rev
Log:
New jetspeed-db-tools module: intended to provide (offline) Jetspeed Engine access involving the persistence store (and other components)
Initial tool provided: a new implementation of the JetspeedSerializerApplication, allowing offline import/export of Jetspeed data using the Jetspeed components themselves. 

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties   (with props)
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/
    portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/components/pom.xml

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml?rev=646759&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml Thu Apr 10 04:16:12 2008
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  
+  $Id$
+-->
+<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">
+
+  <modelVersion>4.0.0</modelVersion>
+  <prerequisites>
+    <maven>2.0.7</maven>
+  </prerequisites>
+
+  <artifactId>jetspeed-db-tools</artifactId>
+  <name>Jetspeed-2 Database Tools</name>
+  <description>Jetspeed Database Tools</description>
+  <parent>
+    <groupId>org.apache.portals.jetspeed-2</groupId>
+    <artifactId>components</artifactId>
+    <version>2.2-SNAPSHOT</version>
+  </parent>
+  <packaging>jar</packaging>
+
+  <dependencies>
+
+    <!-- Runtime container dependencies (for commandline or standalone maven plugin executions) -->
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>${javax.servlet.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>portlet-api</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>${portlet-api.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.pluto</groupId>
+      <artifactId>pluto</artifactId>
+      <version>${org.apache.pluto.version}</version>
+    </dependency>
+
+    <!-- Build Dependencies -->
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-commons</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>jetspeed-cm</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>dom4j</groupId>
+          <artifactId>dom4j</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-prefs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-search</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-security</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-registry</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-id-generator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-file-cache</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-locator</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-capability</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-profiler</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-page-manager</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.portals.jetspeed-2</groupId>
+      <artifactId>jetspeed-serializer</artifactId>
+      <exclusions>
+        <exclusion>
+          <!-- brought in by ddlutils -->
+          <groupId>stax</groupId>
+          <artifactId>stax-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>${org.apache.jetspeed.test.jdbc.driver.groupId}</groupId>
+      <artifactId>${org.apache.jetspeed.test.jdbc.driver.artifactId}</artifactId>
+      <version>${org.apache.jetspeed.test.jdbc.driver.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>**/TestJetspeedSerializerApplication.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>${pom.groupId}</groupId>
+        <artifactId>jetspeed-unpack-maven-plugin</artifactId>
+        <version>${pom.version}</version>
+        <executions>
+          <execution>
+            <id>unpack-test-resources</id>
+            <goals>
+              <goal>unpack</goal>
+            </goals>
+            <phase>process-test-resources</phase>
+            <configuration>
+              <skip>${maven.test.skip}</skip>
+              <unpack>
+                <targetDirectory>${project.build.testOutputDirectory}</targetDirectory>
+                <resources>
+                  <resource>
+                    <path>assembly</path>
+                    <destination>webapp/WEB-INF/assembly</destination>
+                  </resource>
+                  <resource>
+                    <path>conf/jetspeed</path>
+                    <destination>webapp/WEB-INF/conf</destination>
+                  </resource>
+                  <resource>
+                    <path>seed</path>
+                    <destination>seed</destination>
+                  </resource>
+                  <resource>
+                    <path>db-ojb</path>
+                  </resource>
+                </resources>
+              </unpack>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java?rev=646759&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java Thu Apr 10 04:16:12 2008
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.tools.db.serializer;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.components.JetspeedBeanDefinitionFilter;
+import org.apache.jetspeed.components.SpringComponentManager;
+import org.apache.jetspeed.serializer.CommonsToolsLogger;
+import org.apache.jetspeed.serializer.JetspeedSerializer;
+import org.apache.jetspeed.serializer.JetspeedSerializerApplication;
+import org.apache.jetspeed.serializer.SerializerException;
+import org.apache.jetspeed.tools.ToolsLogger;
+
+/**
+ * Jetspeed Serializer Application
+ * 
+ * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
+ * @version $Id$
+ */
+public class JetspeedSerializerApplicationImpl implements JetspeedSerializerApplication
+{    
+    private static final Log logger = LogFactory.getLog(JetspeedSerializerApplicationImpl.class);
+    
+    public static void main(String[] args) throws Exception
+    {
+        JetspeedSerializerApplicationImpl app = new JetspeedSerializerApplicationImpl();
+        
+        String propertyFileName = null;
+        String applicationRootPath = null;
+        String categories = null;
+        
+        boolean doExport = false;
+        boolean doImport = false;
+        
+        String fileName = null;
+        String exportName = null;
+        
+        if (args == null)
+        {
+            throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
+        }
+
+        // Parse all the command-line arguments
+        for (int n = 0; n < args.length; n++)
+        {
+            if (args[n].equals("-c"))
+                categories = args[++n];
+            if (args[n].equals("-p"))
+                propertyFileName = args[++n];
+            else if (args[n].equals("-a"))
+                applicationRootPath = args[++n];
+            else if (args[n].equals("-E"))
+            {
+                doExport = true;
+                fileName = args[++n];
+            } 
+            else if (args[n].equals("-I"))
+            {
+                doImport = true;
+                fileName = args[++n];
+            } 
+            else if (args[n].equals("-N"))
+            {
+                exportName = args[++n];
+            }
+            else
+            {
+                throw new IllegalArgumentException("Unknown argument: " + args[n]);
+            }
+        
+            if ((!doImport) && (!doExport))
+            {
+              throw new IllegalArgumentException("Either import or export have to be defined (-I or -E follwoed by the filename");
+            }
+
+            if ((doImport) && (doExport))
+            {
+                throw new IllegalArgumentException("Only one - either import or export - can be requested");
+            }
+            
+            if (categories == null)
+            {
+                throw new IllegalArgumentException("Argument -c defining the assembly categories filters (or the propertyFile key to it) is required");
+            }
+            
+            if (applicationRootPath == null)
+            {
+                throw new IllegalArgumentException("Argument -a specifying the path to (web)application root, is required");
+            }
+            if (doImport)
+            {
+                app.importFiles(logger, applicationRootPath, categories, propertyFileName, null, getTokens(fileName));
+            }
+            else if (doExport)
+            {
+                app.export(logger, applicationRootPath, categories, propertyFileName, null, fileName, exportName);
+            }
+        }
+    }
+        
+    
+    public static  String[] getTokens(String _line)
+    {
+        if ((_line == null) || (_line.length() == 0))
+            return null;
+        
+        StringTokenizer st = new StringTokenizer(_line, ",");
+        int count = st.countTokens();
+        String tokens[] = new String[count];
+        for (int i = 0; i < count; i++)
+        {
+            tokens[i] = st.nextToken();
+        }
+        return tokens;
+    }
+    
+    public JetspeedSerializerApplicationImpl()
+    {        
+    }
+       
+    public void importFiles(ToolsLogger logger, String applicationRootPath, String categories, String filterPropertiesFileName, Properties initProperties, String[] seedFiles) throws SerializerException
+    {        
+        importFiles(new CommonsToolsLogger(logger), applicationRootPath, categories, filterPropertiesFileName, initProperties, seedFiles);
+    }
+    
+    
+    public void importFiles(Log logger, String applicationRootPath, String categories, String filterPropertiesFileName, Properties initProperties, String[] seedFiles) throws SerializerException
+    {        
+        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+        SpringComponentManager scm = null;
+        try
+        {
+            JetspeedBeanDefinitionFilter filter = null;
+            
+            if (filterPropertiesFileName != null)
+            {
+                filter = new JetspeedBeanDefinitionFilter("file:"+filterPropertiesFileName, categories);
+            }
+            else
+            {
+                filter = new JetspeedBeanDefinitionFilter(categories);
+            }
+            
+            String assemblyRootPath = "file:"+applicationRootPath+"/WEB-INF/assembly";
+            String[] bootConfig = {assemblyRootPath+"/boot/*.xml"};
+            String[] appConfig = { assemblyRootPath+"/*.xml", assemblyRootPath+"/override/*.xml" };                       
+            
+            ClassLoader extendedClassLoader = contextClassLoader;
+            File webInfClasses = new File(applicationRootPath, "WEB-INF/classes");
+            if (webInfClasses.exists())
+            {
+                extendedClassLoader = new URLClassLoader(new URL[]{webInfClasses.toURL()}, contextClassLoader);
+            }
+            Thread.currentThread().setContextClassLoader(extendedClassLoader);
+            
+            scm = new SpringComponentManager(filter, bootConfig, appConfig, applicationRootPath, initProperties, true);
+            scm.start();
+            JetspeedSerializer serializer = (JetspeedSerializer)scm.getComponent(JetspeedSerializer.class.getName());
+            HashMap settings = new HashMap();
+            settings.put(JetspeedSerializer.KEY_LOGGER, logger);
+            if (seedFiles != null)
+            {
+                for (int i = 0; i < seedFiles.length; i++)
+                {
+                    serializer.importData(seedFiles[i], settings);
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            if (e instanceof SerializerException)
+            {
+                throw (SerializerException)e;
+            }
+            logger.error(e);
+            throw new SerializerException(SerializerException.IMPORT_ERROR.create(e.getMessage()));
+        }
+        finally
+        {
+            Thread.currentThread().setContextClassLoader(contextClassLoader);
+            if (scm != null)
+            {
+                scm.stop();
+            }
+        }
+    }
+
+    public void export(ToolsLogger logger, String applicationRootPath, String categories, String filterPropertiesFileName, Properties initProperties, String exportFile, String exportName) throws SerializerException
+    {
+        export(new CommonsToolsLogger(logger), applicationRootPath, categories, filterPropertiesFileName, initProperties, exportFile, exportName);
+    }
+    
+    public void export(Log logger, String applicationRootPath, String categories, String filterPropertiesFileName, Properties initProperties, String exportFile, String exportName) throws SerializerException
+    {
+        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+        SpringComponentManager scm = null;
+        try
+        {
+            JetspeedBeanDefinitionFilter filter = null;
+            
+            if (filterPropertiesFileName != null)
+            {
+                filter = new JetspeedBeanDefinitionFilter("file:"+filterPropertiesFileName, categories);
+            }
+            else
+            {
+                filter = new JetspeedBeanDefinitionFilter(categories);
+            }
+            
+            String assemblyRootPath = "file:"+applicationRootPath+"/WEB-INF/assembly";
+            String[] bootConfig = {assemblyRootPath+"/boot/*.xml"};
+            String[] appConfig = { assemblyRootPath+"/*.xml", assemblyRootPath+"/override/*.xml" };
+            
+            ClassLoader extendedClassLoader = contextClassLoader;
+            File webInfClasses = new File(applicationRootPath, "WEB-INF/classes");
+            if (webInfClasses.exists())
+            {
+                extendedClassLoader = new URLClassLoader(new URL[]{webInfClasses.toURL()}, contextClassLoader);
+            }
+            Thread.currentThread().setContextClassLoader(extendedClassLoader);
+            
+            scm = new SpringComponentManager(filter, bootConfig, appConfig, applicationRootPath, true);
+            scm.start();
+            JetspeedSerializer serializer = (JetspeedSerializer)scm.getComponent(JetspeedSerializer.class.getName());
+            HashMap settings = new HashMap();
+            settings.put(JetspeedSerializer.KEY_LOGGER, logger);
+            if (exportFile != null)
+            {
+                if (exportName == null)
+                {
+                    exportName = JetspeedSerializer.TAG_SNAPSHOT;
+                }
+                serializer.exportData(exportName, exportFile, settings);
+            }
+            scm.stop();
+        }
+        catch (Exception e)
+        {
+            if (e instanceof SerializerException)
+            {
+                throw (SerializerException)e;
+            }
+            logger.error(e);
+            throw new SerializerException(SerializerException.EXPORT_ERROR.create(e.getMessage()));
+        }
+        finally
+        {
+            Thread.currentThread().setContextClassLoader(contextClassLoader);
+            if (scm != null)
+            {
+                scm.stop();
+            }
+        }
+    }
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/main/java/org/apache/jetspeed/tools/db/serializer/JetspeedSerializerApplicationImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties?rev=646759&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties Thu Apr 10 04:16:12 2008
@@ -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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id$
+#
+# ------------------------------------------------------------------------
+
+log4j.rootLogger = ERROR, errorlogging 
+
+log4j.category.org.apache.jetspeed = INFO, infologging
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.appender.errorlogging = org.apache.log4j.FileAppender
+log4j.appender.errorlogging.file = ${basedir}/target/surefire-reports/tests-error.log
+log4j.appender.errorlogging.layout = org.apache.log4j.PatternLayout
+log4j.appender.errorlogging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.errorlogging.append = false
+
+log4j.appender.infologging = org.apache.log4j.FileAppender
+log4j.appender.infologging.file = ${basedir}/target/surefire-reports/tests-info.log
+log4j.appender.infologging.layout = org.apache.log4j.PatternLayout
+log4j.appender.infologging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.infologging.append = false

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/log4j.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java?rev=646759&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java (added)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java Thu Apr 10 04:16:12 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jetspeed.tools.db.serializer;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.test.JetspeedTestCase;
+
+/**
+ * @version $Id$
+ *
+ */
+public class TestJetspeedSerializerApplication extends JetspeedTestCase
+{
+    private static Log logger = LogFactory.getLog(TestJetspeedSerializerApplication.class);
+    
+    public void testSerializer() throws Exception
+    {
+        JetspeedSerializerApplicationImpl app = new JetspeedSerializerApplicationImpl();
+        app.importFiles(logger, getBaseDir()+"target/test-classes/webapp", "serializer", getBaseDir()+"target/test-classes/webapp/WEB-INF/conf/spring-filter.properties", null, new String[]{getBaseDir()+"target/test-classes/seed/j2-seed.xml"});
+        app.export(logger, getBaseDir()+"target/test-classes/webapp", "serializer", getBaseDir()+"target/test-classes/webapp/WEB-INF/conf/spring-filter.properties", null, getBaseDir()+"target/test-classes/seed/j2-seed-export.xml",null);
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-db-tools/src/test/java/org/apache/jetspeed/tools/db/serializer/TestJetspeedSerializerApplication.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/portal/trunk/components/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/pom.xml?rev=646759&r1=646758&r2=646759&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/pom.xml Thu Apr 10 04:16:12 2008
@@ -61,6 +61,7 @@
         <module>jetspeed-web-content</module>
         <module>jetspeed-webapp-logging</module>
         <module>jetspeed-layout-portlets</module>
-</modules>
+        <module>jetspeed-db-tools</module>
+    </modules>
     
 </project>



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