You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2007/05/22 12:14:13 UTC

svn commit: r540516 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/jackrabbit/ src/main/java/org/apache/jackrabbit/tools/ src/main...

Author: jukka
Date: Tue May 22 03:14:11 2007
New Revision: 540516

URL: http://svn.apache.org/viewvc?view=rev&rev=540516
Log:
JCR-891: Import-export tool contributed by Martijn Hendriks from GX.

Added:
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt   (with props)
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt   (with props)
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt   (with props)
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml   (with props)
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java   (with props)
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/
    jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties   (with props)

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt Tue May 22 03:14:11 2007
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt Tue May 22 03:14:11 2007
@@ -0,0 +1,8 @@
+Apache Jackrabbit
+Copyright 2007 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Based on source code originally developed by
+<GX> creative online development B.V. (http://www.gx.nl/).

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt Tue May 22 03:14:11 2007
@@ -0,0 +1,105 @@
+================================================
+Welcome to the Jackrabbit JCR Import/Export tool
+================================================
+
+This is the Jackrabbit JCR Import/Export tool which provides
+command-line functionality to import and export JCR content in a
+persistence-layer independent way.
+
+See the Apache Jackrabbit web site (http://jackrabbit.apache.org/)
+for documentation and other information. You are welcome to join the
+Jackrabbit mailing lists (http://jackrabbit.apache.org/mail-lists.html)
+to discuss this compoment and to use the Jackrabbit issue tracker
+(http://issues.apache.org/jira/browse/JCR) to report issues or request
+new features.
+
+Apache Jackrabbit is a project of the Apache Software Foundation
+(http://www.apache.org).
+
+
+License (see also LICENSE.txt)
+==============================
+
+Collective work: Copyright 2007 The Apache Software Foundation.
+
+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.
+
+
+Getting Started
+===============
+
+This compoment uses a Maven 2 (http://maven.apache.org/) build
+environment. If you have Maven 2 installed, you can compile and
+package the jacrabbit-api jar using the following command:
+
+    mvn package
+
+See the Maven 2 documentation for other build features.
+
+The latest source code for this compoment is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout http://svn.apache.org/repos/asf/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool
+
+See the Subversion documentation for other source control features.
+
+
+Installation
+============
+
+After building, the created jar file in the target/ directory can
+be "installed" by unpacking it's lib directory which contains libraries.
+
+  jar -xf jackrabbit-jcr-import-export-tool-<version>.jar lib/
+
+
+Exporting repository content
+============================
+
+Options (all required):
+ -c filename  : specifies the filename of the source repository configuration (repository.xml)
+ -d directory : specifies the source repository home directory
+ -nt          : specifies to include the nodetypes in the export
+ -ns          : specifies to include the namespace mappings in the export
+ -e filename [path list] : specifies the name of the zip file to which the exported content will be written,
+                           and also a list of absolute paths of nodes that will be exported
+
+To export the /myroot node and all namespace mappings and custom nodetypes:
+
+  java -Xmx512M -jar JcrImportExportTool-<version>.jar -c repository.xml -d repository/ -ns -nt -e export.zip /myroot
+
+
+Importing repository content
+============================
+Options (all required):
+ -c filename  : specifies the filename of the target repository configuration (repository.xml)
+ -d directory : specifies the target repository home directory
+ -nt          : specifies to include the nodetypes in the import
+ -ns          : specifies to include the namespace mappings in the import
+ -i filename  : specifies the name of the zip file from which the content will be read
+
+To import the content in the previously generated export.zip in another repository:
+
+  java -Xmx512M -jar JcrImportExportTool-<version>.jar -c repository2.xml -d repository2/ -ns -nt -i export.zip
+
+
+Open issues
+===========
+
+Think about using Workspace.importXML method to avoid out-of-memory errors. This
+might, however, give reference constraint violations when multiple nodes are imported.

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml Tue May 22 03:14:11 2007
@@ -0,0 +1,140 @@
+<?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.
+-->
+
+<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>
+
+	<!-- ====================================================================== -->
+	<!-- P R O J E C T  D E S C R I P T I O N                                   -->
+	<!-- ====================================================================== -->
+	<parent>
+		<groupId>org.apache.jackrabbit</groupId>
+		<artifactId>jackrabbit</artifactId>
+		<version>1.4-SNAPSHOT</version>
+		<relativePath>../..</relativePath>
+	</parent>
+	<artifactId>jackrabbit-jcr-import-export-tool</artifactId>
+	<name>Jackrabbit JCR Import/Export Tool</name>
+	<description>A command-line tool for import and export of Jackrabbit JCR content</description>
+
+	<scm>
+		<connection>
+			scm:svn:http://svn.apache.org/repos/asf/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool
+		</connection>
+		<developerConnection>
+			scm:svn:https://svn.apache.org/repos/asf/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool
+		</developerConnection>
+		<url>
+			http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool
+		</url>
+	</scm>
+
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.jackrabbit</groupId>
+			<artifactId>jackrabbit-core</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<scope>compile</scope>
+		</dependency>
+
+		<!--
+			Here is a list of database drivers to include in
+			the standalone tool. Uncomment some and/or add
+			your own drivers.
+		-->
+		<!--
+		<dependency>
+			<groupId>com.microsoft</groupId>
+			<artifactId>sqljdbc</artifactId>
+			<version>1.1</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>oracle</groupId>
+			<artifactId>oraclejdbcdriver</artifactId>
+			<version>10.2.0.3.0</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>mysql-connector-java</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.0.3</version>
+			<scope>compile</scope>
+		</dependency>
+		 -->
+	</dependencies>
+	<build>
+		<defaultGoal>package</defaultGoal>
+		<resources>
+			<resource>
+				<directory>${basedir}/src/main/resources</directory>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<archive>
+						<index>true</index>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix>lib</classpathPrefix>
+						</manifest>
+						<manifestEntries>
+							<Main-Class>
+								org.apache.jackrabbit.tools.importexport.JcrImportExportTool
+							</Main-Class>
+						</manifestEntries>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy-dependencies</id>
+						<phase>compile</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+					</execution>
+				</executions>
+				<configuration>
+					<outputDirectory>
+						${project.build.directory}/classes/lib
+					</outputDirectory>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java Tue May 22 03:14:11 2007
@@ -0,0 +1,656 @@
+/*
+ * 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.jackrabbit.tools.importexport;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Item;
+import javax.jcr.NamespaceException;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.jcr.Workspace;
+
+import org.apache.jackrabbit.core.TransientRepository;
+import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
+import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
+import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
+import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
+import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
+import org.apache.jackrabbit.core.nodetype.xml.NodeTypeWriter;
+import org.apache.jackrabbit.name.QName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The JcrImportExport tool for JCR-level import and export of content.
+ *
+ * <h1>Build and install</h1>
+ * After building, the jar file jackrabbit-jcr-import-export-tool-1.4-SNAPSHOT.jar can
+ * be "installed" by unpacking it's lib directory which contains libraries.
+ *
+ * <h1>Export</h1>
+ * Options (all required):
+ * <ul>
+ * <li>-c filename  : specifies the filename of the source repository configuration (repository.xml) </li>
+ * <li>-d directory : specifies the source repository home directory </li>
+ * <li>-nt          : specifies to include the nodetypes in the export</li>
+ * <li>-ns          : specifies to include the namespace mappings in the export</li>
+ * <li>-e filename [path list] : specifies the name of the zip file to which the exported content will be written,
+ * and also a list of absolute paths of nodes that will be exported</li>
+ * </ul>
+ *
+ * To export the <code>/myroot</code> node and all namespace mappings and custom nodetypes:
+ * <br>
+ * <code>java -Xmx512M -jar JcrImportExportTool-1.4-SNAPSHOT.jar -c repository.xml -d repository/ -ns -nt -e export.zip /myroot</code>
+ *
+ *
+ * <h1>Import</h1>
+ * Options (all required):
+ * <ul>
+ * <li>-c filename  : specifies the filename of the target repository configuration (repository.xml) </li>
+ * <li>-d directory : specifies the target repository home directory </li>
+ * <li>-nt          : specifies to include the nodetypes in the import</li>
+ * <li>-ns          : specifies to include the namespace mappings in the import</li>
+ * <li>-i filename  : specifies the name of the zip file from which the content will be read</li>
+ * </ul>
+ *
+ * To import the content in the previously generated <code>export.zip</code> in another repository:
+ * <br>
+ * <code>java -Xmx512M -jar JcrImportExportTool-1.4-SNAPSHOT.jar -c repository2.xml -d repository2/ -ns -nt -i export.zip</code>
+ *
+ * <h1>Things to do</h1>
+ * <ul>
+ * <li> Think about using Workspace.importXML method to avoid out-of-memory errors. This
+ * might, however, give reference constraint violations when multiple nodes are imported.</li>
+ * </ul>
+ *
+ */
+public class JcrImportExportTool {
+
+    // Some String constants
+    private static final String MAPPING = "mapping.txt";
+    private static final String NAMESPACES = "namespaces.xml";
+    private static final String NODETYPES = "custom_nodetypes.xml";
+    private static final String USER = "user";
+    private static final String PASSWORD = "password";
+    private static final String ENCODING = "utf-8";
+
+    /**
+     * A static logger for this class.
+     */
+    private static Logger LOG = LoggerFactory.getLogger(JcrImportExportTool.class);
+
+    /**
+     * The repository.xml configuration file.
+     */
+    private final String repoConfig;
+
+    /**
+     * The home directory of the repository.
+     */
+    private final String repoHome;
+
+    /**
+     * The name of the file to import from or export to.
+     */
+    private final String fileName;
+
+    /**
+     * Constructs a JcrImportExportTool.
+     *
+     * @param config the repository configuration file
+     * @param home the repository home directory
+     * @param file the import/export file
+     */
+    public JcrImportExportTool(String config, String home, String file) {
+        repoConfig = config;
+        repoHome = home;
+        fileName = file;
+    }
+
+    /**
+     * Performs the import.
+     *
+     * @param nameSpaces whether namespace mappings should be imported
+     * @param nodeTypes whether custom nodetypes should be imported
+     */
+    public void doImport(boolean nameSpaces, boolean nodeTypes) {
+
+        Session jcrSession = null;
+
+        try {
+            Repository repository = new TransientRepository(repoConfig, repoHome);
+            jcrSession = repository.login(new SimpleCredentials(USER, PASSWORD.toCharArray()));
+            Workspace workspace = jcrSession.getWorkspace();
+
+            UncloseableInputStream in = new UncloseableInputStream(new ZipInputStream(new FileInputStream(new File(fileName))));
+            Map entryToPath = readMapping(in);
+
+            // Assumes an order on the ZipEntries!
+            ZipEntry entry = registerNamespaces(workspace, in, nameSpaces);
+            entry = registerNodetypes(workspace, in, entry, nodeTypes);
+            importContent(jcrSession, in, entry, entryToPath);
+
+            in.myClose();
+
+        } catch (Exception e) {
+            // import failed: rollback the session!
+            LOG.error("import failed: rollback", e);
+            try {
+                jcrSession.refresh(false);
+            } catch (RepositoryException ee) {
+                LOG.error("rollback failed", ee);
+            }
+        } finally {
+            if (jcrSession != null) {
+                try {
+                    LOG.info("saving session");
+                    jcrSession.save();
+                } catch (RepositoryException e) {
+                    LOG.error("save failed", e);
+                }
+                jcrSession.logout();
+            }
+        }
+    }
+
+    /**
+     * Reads the mapping.txt entry.
+     *
+     * @param in the InputStream of the import file
+     * @throws IOException on IO error
+     */
+    private Map readMapping(UncloseableInputStream in) throws IOException {
+
+        Map entryToPath = new HashMap();
+        ZipEntry zipEntry = in.getNextEntry();
+
+        // check whether the entry is the mapping entry
+        if (zipEntry != null && MAPPING.equals(zipEntry.getName())) {
+
+            BufferedReader reader = new BufferedReader(new InputStreamReader(in, ENCODING));
+
+            // Read all lines of the entry
+            String entry = reader.readLine();
+            while (entry != null) {
+                String[] tokens = entry.split("\t");
+                if (tokens.length != 2) {
+                    throw new IOException(MAPPING + " in invalid format");
+                } else {
+                    entryToPath.put(tokens[0], tokens[1]);
+                }
+                entry = reader.readLine();
+            }
+        } else {
+            throw new IOException(MAPPING + " could not be found in file");
+        }
+        return entryToPath;
+    }
+
+    /**
+     * Registers the namespaces, if nameSpaces==true.
+     *
+     * @param jcrSession a JCR session
+     * @param in the InputStream of the import file
+     * @param nameSpaces whether the namespaces should be imported
+     * @throws RepositoryException on JCR error
+     * @throws IOException on IO error
+     * @return the ZipEntry of the entry after the namespace entry
+     */
+    private ZipEntry registerNamespaces(Workspace workspace, UncloseableInputStream in, boolean nameSpaces) throws RepositoryException, IOException {
+
+        NamespaceRegistry namespaceReg = workspace.getNamespaceRegistry();
+        ZipEntry zipEntry = in.getNextEntry();
+
+        // Create a set of reserved prefixes:
+        Set reservedPrefixes = new HashSet();
+        reservedPrefixes.add("xml");
+        reservedPrefixes.add("mix");
+        reservedPrefixes.add("nt");
+        reservedPrefixes.add("fn");
+        reservedPrefixes.add("xs");
+        reservedPrefixes.add("sv");
+        reservedPrefixes.add("rep");
+        reservedPrefixes.add("jcr");
+        reservedPrefixes.add("");
+
+        // check whether the entry is the namespaces entry
+        if (zipEntry != null && NAMESPACES.equals(zipEntry.getName())) {
+
+            // only import the namespaces if requested
+            if (nameSpaces) {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(in, ENCODING));
+
+                // Read all lines of the entry:
+                String entry = reader.readLine();
+                while (entry != null) {
+
+                    String[] tokens = entry.split("\t");
+                    if (entry.compareTo("\t")==0) {
+                        tokens = new String[]{"", ""};
+                    }
+                    if (tokens.length != 2) {
+                        throw new IOException(NAMESPACES + " in invalid format");
+                    } else {
+                        try {
+                            if (!reservedPrefixes.contains(tokens[0])) {
+                                namespaceReg.registerNamespace(tokens[0], tokens[1]);
+                                LOG.info("registering namespace: "+tokens[0]+" -> "+tokens[1]);
+                            }
+                        } catch (NamespaceException e) {
+                            throw new IOException("could not register namespace mapping "+tokens[0]+" -> "+tokens[1]);
+                        }
+                    }
+                    entry = reader.readLine();
+                }
+            }
+            // get the next ZipEntry (because this one is the namespaces entry)
+            zipEntry = in.getNextEntry();
+
+        // the entry is not the namespaces entry
+        } else if (nameSpaces){
+            throw new IOException(NAMESPACES+" entry not found");
+        }
+        return zipEntry;
+    }
+
+    /**
+     * Registers the custom nodetypes, if nodeTypes==true.
+     *
+     * @param jcrSession a JCR session
+     * @param in the InputStream of the import file
+     * @param zipEntry the current zipEntry
+     * @param nodeTypes whether the nodetypes should be imported
+     * @throws IOException on IO error
+     * @throws RepositoryException on JCR error
+     * @throws InvalidNodeTypeDefException on a JCR error caused by a wrong nodetype definition
+     * @return the entry after the nodetype entry
+     */
+    private ZipEntry registerNodetypes(Workspace workspace, UncloseableInputStream in, ZipEntry zipEntry, boolean nodeTypes) throws IOException, RepositoryException, InvalidNodeTypeDefException {
+
+        // check whether the current entry is the nodetypes entry
+        if (zipEntry != null && NODETYPES.equals(zipEntry.getName())) {
+
+            // only register the nodetypes if required
+            if (nodeTypes) {
+                NodeTypeManagerImpl ntm = (NodeTypeManagerImpl) workspace.getNodeTypeManager();
+                NodeTypeRegistry ntr = ntm.getNodeTypeRegistry();
+
+                NodeTypeDef[] defs = NodeTypeReader.read(in);
+                Set coll = new HashSet();
+                for (int i=0; i<defs.length; i++ ) {
+                    coll.add(defs[i]);
+                    LOG.info("marked nodetype \""+defs[i].getName().toString()+"\" for registration");
+                }
+
+                LOG.info("registering "+coll.size()+" nodetypes");
+                ntr.registerNodeTypes(coll);
+            }
+
+            // get the next ZipEntry (because this one is the nodetypes entry
+            zipEntry = in.getNextEntry();
+
+        } else if (nodeTypes){
+            throw new IOException(NODETYPES+" entry not found");
+        }
+        return zipEntry;
+    }
+
+    /**
+     * Imports the content entries: deletes the existing content!
+     *
+     * @param jcrSession a JCR session
+     * @param in the InputStream of the import file
+     * @param zipEntry the first content entry
+     * @param entryToPath the mapping of entry names to JCR paths
+     * @throws IOException on IO error
+     * @throws RepositoryException on JCR error
+     */
+    private void importContent(Session jcrSession, UncloseableInputStream in, ZipEntry zipEntry, Map entryToPath) throws IOException, RepositoryException {
+
+        while (zipEntry != null) {
+
+            String entryName = zipEntry.getName();
+            String absPath = (String) entryToPath.get(entryName);
+
+            if (absPath == null) {
+                throw new IOException("absolute path for entry \""+entryName+"\" not found");
+            }
+
+            String targetPath = null;
+
+            try {
+                // remove the item at absPath
+                Item item = jcrSession.getItem(absPath);
+                targetPath = item.getParent().getPath();
+                LOG.info("removing item at path: \""+absPath+"\"");
+                item.remove();
+            } catch (PathNotFoundException e) {
+                int lastSlashIndex = absPath.indexOf("/");
+                while (absPath.indexOf("/", lastSlashIndex+1) != -1) {
+                    lastSlashIndex = absPath.indexOf("/", lastSlashIndex+1);
+                }
+                targetPath = absPath.substring(0, lastSlashIndex+1);
+            }
+
+            // TODO: think about using Workspace.importXML method to prevent
+            // out-of-memory exceptions. This might, however, trigger reference
+            // constraint violations if multiple trees are imported
+            LOG.info("importing content of "+entryName+": \""+absPath+"\"");
+            jcrSession.importXML(targetPath, in, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
+
+            zipEntry = in.getNextEntry();
+        }
+    }
+
+    /**
+     * Performs the export.
+     *
+     * @param paths an array og absolute paths of nodes to export
+     * @param nameSpaces whether namespace mappings should be exported
+     * @param nodeTypes whether custom nodetypes should be exported
+     */
+    public void doExport(String[] paths, boolean nameSpaces, boolean nodeTypes) {
+
+        Session jcrSession = null;
+
+        try {
+            // get a JCR session:
+            Repository repository = new TransientRepository(repoConfig, repoHome);
+            jcrSession = repository.login(new SimpleCredentials(USER, PASSWORD.toCharArray()));
+
+            File result = new File(fileName);
+            ZipOutputStream zipout = new ZipOutputStream(new FileOutputStream(result));
+
+            createMappingEntry(zipout, paths);
+            if (nameSpaces) {
+                createNamespaceEntry(jcrSession, zipout);
+            }
+            if (nodeTypes) {
+                createNodeTypeEntry(jcrSession, zipout);
+            }
+            createContentEntries(jcrSession, zipout, paths);
+
+            zipout.close();
+
+        } catch (Exception e) {
+            LOG.error("export failed:", e);
+        } finally {
+            if (jcrSession != null) {
+                jcrSession.logout();
+            }
+        }
+    }
+
+    /**
+     * Creates the mapping zip entry.
+     *
+     * @param zipout zipout the OutputStream to write to
+     * @throws IOException on IO error
+     */
+    private void createMappingEntry(ZipOutputStream zipout, String paths[]) throws IOException {
+
+        ZipEntry ze = new ZipEntry(MAPPING);
+        zipout.putNextEntry(ze);
+        Writer out = new OutputStreamWriter(zipout, ENCODING);
+        for (int i=0; i<paths.length; i++) {
+            out.write(i+".xml\t"+paths[i]+"\n");
+        }
+        out.flush();
+        zipout.closeEntry();
+    }
+
+    /**
+     * Creates the namespaces zip entry.
+     *
+     * @param jcrSession a JCR session
+     * @param zipout the OutputStream to write to
+     * @throws IOException on IO error
+     * @throws RepositoryException on JCR error
+     */
+    private void createNamespaceEntry(Session jcrSession, ZipOutputStream zipout) throws IOException, RepositoryException {
+
+        ZipEntry ze = new ZipEntry(NAMESPACES);
+        Writer out = new OutputStreamWriter(zipout, ENCODING);
+        NamespaceRegistry namespaceReg = jcrSession.getWorkspace().getNamespaceRegistry();
+
+        zipout.putNextEntry(ze);
+        String[] uris = namespaceReg.getURIs();
+        for (int i=0; i<uris.length; i++) {
+            String prefix = namespaceReg.getPrefix(uris[i]);
+            out.write(prefix+"\t"+uris[i]+"\n");
+            LOG.info("exported namespace: "+prefix+" -> "+uris[i]);
+        }
+        out.flush();
+        zipout.closeEntry();
+    }
+
+    /**
+     * Creates the nodetype zip entry.
+     *
+     * @param jcrSession a JCR session
+     * @param zipout the OutputStream to write to
+     * @throws IOException on IO error
+     * @throws RepositoryException on JCR error
+     */
+    private void createNodeTypeEntry(Session jcrSession, ZipOutputStream zipout) throws IOException, RepositoryException {
+
+        NamespaceRegistry namespaceReg = jcrSession.getWorkspace().getNamespaceRegistry();
+        ZipEntry ze = new ZipEntry(NODETYPES);
+
+        zipout.putNextEntry(ze);
+        NodeTypeManagerImpl ntm = (NodeTypeManagerImpl) jcrSession.getWorkspace().getNodeTypeManager();
+        NodeTypeRegistry ntr = ntm.getNodeTypeRegistry();
+        Set custom = new HashSet();
+        QName[] names = ntr.getRegisteredNodeTypes();
+        for (int i=0; i<names.length; i++) {
+            if (!ntr.isBuiltIn(names[i])) {
+                custom.add(ntr.getNodeTypeDef(names[i]));
+                LOG.info("exported nodetype \""+names[i]+"\"");
+            }
+        }
+        NodeTypeDef[] defs = (NodeTypeDef[]) custom.toArray(new NodeTypeDef[custom.size()]);
+        NodeTypeWriter.write(zipout, defs, namespaceReg);
+        zipout.closeEntry();
+    }
+
+    /**
+     * Creates the content entries.
+     *
+     * @param jcrSession a JCR session
+     * @param zipout the OutputStream to write to
+     * @throws IOException on IO error
+     * @throws RepositoryException on JCR error
+     */
+    private void createContentEntries(Session jcrSession, ZipOutputStream zipout, String paths[]) throws IOException, RepositoryException {
+
+        // Export the specified nodes:
+        for (int i=0; i<paths.length; i++) {
+            ZipEntry ze = new ZipEntry(i+".xml");
+            zipout.putNextEntry(ze);
+            LOG.info("exporting content at path: \""+paths[i]+"\"");
+            jcrSession.exportSystemView(paths[i], zipout, false, false);
+            zipout.closeEntry();
+        }
+    }
+
+    /**
+     * Starts the JCR Import/Export tool.
+     *
+     * @param args the set of arguments to the Jcr Import tool
+     */
+    public static void main(String[] args) {
+
+        // these are constructed from the argument list:
+        boolean export = false;
+
+        boolean nodeTypes = false;
+        boolean nameSpaces = false;
+
+        String repoconfig = null;
+        boolean configSet = false;
+
+        String repodir = null;
+        boolean dirSet = false;
+
+        String filename = null;
+        boolean fileSet = false;
+
+        String[] paths = {"/"};
+
+        // try to parse the argument list:
+        for (int i=0; i<args.length; i++) {
+            if ("-c".equals(args[i]) && i+1 < args.length) {
+                repoconfig = args[i+1];
+                i++;
+                configSet = true;
+            } else if ("-d".equals(args[i]) && i+1 < args.length) {
+                repodir = args[i+1];
+                i++;
+                dirSet = true;
+            } else if ("-nt".equals(args[i])) {
+                nodeTypes = true;
+            } else if ("-ns".equals(args[i])) {
+                nameSpaces = true;
+            } else if ("-i".equals(args[i]) && i+1 < args.length) {
+                filename = args[i+1];
+                i++;
+                export = false;
+                fileSet = true;
+
+            } else if ("-e".equals(args[i]) && i+1 < args.length) {
+                export = true;
+                fileSet = true;
+                filename = args[i+1];
+                if (i+2 < args.length) {
+                    paths = new String[args.length-(i+2)];
+                    for (int j=i+2; j<args.length; j++) {
+                        paths[j-(i+2)] = args[j];
+                    }
+                }
+            }
+        }
+
+        if (!configSet || !dirSet || !fileSet) {
+            LOG.error("Invalid arguments.\nUsage:\n"
+                    + "  java -jar JcrImportExportTool-<version>.jar -c <path to repository.xml> \\\n"
+                    + "\t\t-d <path to repository home directory> [-nt] [-ns] {-i import_filename | -e export_filename [list of paths]}");
+        } else {
+
+            JcrImportExportTool jcrImport = new JcrImportExportTool(repoconfig, repodir, filename);
+            if (export) {
+                jcrImport.doExport(paths, nameSpaces, nodeTypes);
+            } else {
+                jcrImport.doImport(nameSpaces, nodeTypes);
+            }
+        }
+    }
+
+    /**
+     * Wrapper for the ZipInputStream because the Session.importXML() method
+     * of the JCR closes its argument InputStream before it returns.
+     *
+     */
+    static class UncloseableInputStream extends InputStream {
+        private final ZipInputStream zipInputStream;
+
+        UncloseableInputStream(ZipInputStream in) {
+            zipInputStream = in;
+        }
+
+        public int available() throws IOException {
+            return zipInputStream.available();
+        }
+
+        private void myClose() throws IOException {
+            zipInputStream.close();
+        }
+
+        public void close() throws IOException {
+            // We don't close it!
+            //zipInputStream.close();
+        }
+
+        public void closeEntry() throws IOException {
+            zipInputStream.closeEntry();
+        }
+
+        public boolean equals(Object obj) {
+            return zipInputStream.equals(obj);
+        }
+
+        public ZipEntry getNextEntry() throws IOException {
+            return zipInputStream.getNextEntry();
+        }
+
+        public int hashCode() {
+            return zipInputStream.hashCode();
+        }
+
+        public void mark(int readlimit) {
+            zipInputStream.mark(readlimit);
+        }
+
+        public boolean markSupported() {
+            return zipInputStream.markSupported();
+        }
+
+        public int read() throws IOException {
+            return zipInputStream.read();
+        }
+
+        public int read(byte[] b, int off, int len) throws IOException {
+            return zipInputStream.read(b, off, len);
+        }
+
+        public int read(byte[] b) throws IOException {
+            return zipInputStream.read(b);
+        }
+
+        public void reset() throws IOException {
+            zipInputStream.reset();
+        }
+
+        public long skip(long n) throws IOException {
+            return zipInputStream.skip(n);
+        }
+
+        public String toString() {
+            return zipInputStream.toString();
+        }
+    }
+}

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/java/org/apache/jackrabbit/tools/importexport/JcrImportExportTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties?view=auto&rev=540516
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties (added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties Tue May 22 03:14:11 2007
@@ -0,0 +1,26 @@
+#  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.
+
+log4j.rootLogger=ERROR, stdout
+log4j.org.apache.jackrabbit=WARN
+log4j.org.apache.jackrabbit.tools.importexport=INFO
+
+
+# 'stdout' is set to be a ConsoleAppender.
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+
+# 'stdout' uses PatternLayout
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L)\n

Propchange: jackrabbit/trunk/contrib/jackrabbit-jcr-import-export-tool/src/main/resources/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native