directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r475795 [1/2] - in /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin: ./ META-INF/ ressources/ ressources/help/ ressources/help/images/ ressources/help/images/exporting/ ressources/help/images/importing/ ressources/hel...
Date Thu, 16 Nov 2006 16:20:25 GMT
Author: pamarcelot
Date: Thu Nov 16 08:20:22 2006
New Revision: 475795

URL: http://svn.apache.org/viewvc?view=rev&rev=475795
Log:
Importing project ldapstudio-importexport-plugin

Added:
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.classpath
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.project
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/MANIFEST.MF
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.properties
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.xml
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ivy.xml
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/plugin.xml
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/exporting.html
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/create_directory.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/existing_file.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/menu.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page1.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page2.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/progress_monitor.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/file_menu.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_error.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_on_error_entries.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_successful.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/open_dialog.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/progress_monitor.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/menu.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/preferences-import-export.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/importing.html
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/preferences.html
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.html
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.xml
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry.gif   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_added.gif   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_error.gif   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/export.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/import.png   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/wizard_export.gif   (with props)
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/log4j.conf
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Activator.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Messages.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Plugin.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/PreferenceInitializer.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ExportAction.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ImportAction.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ShowPrefsAction.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ExportWizard.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ExportWizardFirstPage.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ExportWizardSecondPage.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ImageKeys.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ImportEntriesOnErrorDialog.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/view/ServerPreferencePage.java
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/apache/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/apache/directory/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/apache/directory/ldapstudio/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/apache/directory/ldapstudio/importexport/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/org/apache/directory/ldapstudio/importexport/messages.properties
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/resources/plugin.properties
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/test/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/test/java/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/target/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/target/classes/
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/target/test-classes/

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.classpath?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.classpath (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.classpath Thu Nov 16 08:20:22 2006
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="lib" path="lib/shared-ldap-0.9.6-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/shared-asn1-0.9.6-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/nlog4j-1.2.24.jar"/>
+	<classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
+	<classpathentry kind="lib" path="lib/spring-context-1.2.1.jar"/>
+	<classpathentry kind="lib" path="lib/spring-beans-1.2.1.jar"/>
+	<classpathentry kind="lib" path="lib/spring-core-1.2.1.jar"/>
+	<classpathentry kind="lib" path="lib/apacheds-server-tools-1.1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.project
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.project?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.project (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/.project Thu Nov 16 08:20:22 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ldapstudio-importexport-plugin</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/MANIFEST.MF?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/MANIFEST.MF (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/META-INF/MANIFEST.MF Thu Nov 16 08:20:22 2006
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: LDAP Studio Import/Export Plug-in
+Bundle-SymbolicName: org.apache.directory.ldapstudio.importexport;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.apache.directory.ldapstudio.importexport.Activator
+Bundle-Vendor: apache.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Eclipse-LazyStart: true
+Bundle-ClassPath: lib/shared-ldap-0.9.6-SNAPSHOT.jar,
+ lib/shared-asn1-0.9.6-SNAPSHOT.jar,
+ lib/apacheds-server-tools-1.1.0-SNAPSHOT.jar,
+ lib/nlog4j-1.2.24.jar,
+ lib/commons-collections-3.1.jar,
+ lib/spring-context-1.2.1.jar,
+ lib/spring-beans-1.2.1.jar,
+ lib/spring-core-1.2.1.jar,
+ .

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.properties?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.properties (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.properties Thu Nov 16 08:20:22 2006
@@ -0,0 +1,7 @@
+source.. = src/main/java,\
+           src/test/java,\
+           src/main/resources/
+output.. = target
+bin.includes = META-INF/,\
+               .,\
+               lib/

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.xml?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/build.xml Thu Nov 16 08:20:22 2006
@@ -0,0 +1,147 @@
+<!--
+  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 name="ldapstudio-importexport-plugin" default="jar" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+	<property name="project.name" value="org.apache.directory.ldapstudio.importexport" />
+	<property name="project.version" value="0.0.1" />
+
+	<property name="project.output" value="${basedir}/target" />
+	<property name="project.build" value="${project.output}/build" />
+	<property name="project.src" value="${basedir}/src/main/java" />
+
+	<property name="lib.dir" value="lib" />
+
+	<property name="repository.dir" location="../dependencies/externals/"/>
+
+	<!-- Configuring Ivy (Needs to be AFTER the $repository.dir declaration) -->
+	<ivy:configure file="../tools/ivyconf.xml"/>
+
+	<!-- ================================== -->
+	<!--               RESOLVE              -->
+	<!-- ================================== -->
+	<target name="resolve" description="--> retreive dependencies with ivy">
+		<ivy:retrieve/>
+	</target>
+
+	<!-- ================================== -->
+	<!--             CLASSPATH              -->
+	<!-- ================================== -->
+	<target name="build-classpath" description="Computes a classpath according to current OS" >
+		<path id="classpath">
+			<fileset dir="../dependencies/eclipse/3.2">
+				<include name="**/*.jar"/>
+			</fileset>
+			<fileset dir="${lib.dir}" />
+		</path>
+	</target>
+
+	<!-- ================================== -->
+	<!--             COMPILE                -->
+	<!-- ================================== -->
+	<target name="compile" depends="resolve,checkclasses,build-classpath" unless="classes-up2date" description="Compiles the plugin">
+		<mkdir dir="${project.build}" />
+		<copy todir="${project.build}">
+			<fileset dir="${basedir}">
+				<include name="plugin.xml" />
+			</fileset>
+		</copy>
+		<mkdir dir="${project.build}/${lib.dir}" />
+		<copy todir="${project.build}/${lib.dir}">
+			<fileset dir="${basedir}/${lib.dir}">
+				<include name="*.jar" />
+			</fileset>
+		</copy>
+		<mkdir dir="${project.build}/META-INF" />
+		<copy todir="${project.build}/META-INF">
+			<fileset dir="${basedir}/META-INF">
+				<include name="**" />
+			</fileset>
+		</copy>
+		<mkdir dir="${project.build}/ressources" />
+		<copy todir="${project.build}/ressources">
+			<fileset dir="${basedir}/ressources">
+				<include name="**" />
+			</fileset>
+		</copy>
+		<copy todir="${project.build}">
+			<fileset dir="${basedir}/src/main/resources">
+				<include name="**" />
+			</fileset>
+		</copy>
+		<javac
+			source="1.5"
+			debug="yes"
+			srcdir="${project.src}"
+			excludes=""
+			destdir="${project.build}"
+			classpathref="classpath"
+			listfiles="yes" />
+
+		<tstamp>
+			<format pattern="yyyy-MMM-dd, HH:mm 'GMT'Z" property="timestamp" locale="en" />
+		</tstamp>
+		<echo message="${project.name}-${project.version} compiled ${timestamp} by ${user.name}" file="${project.build}/compile.timestamp" />
+	</target>
+
+	<target name="checkclasses">
+		<uptodate property="classes-up2date" targetfile="${project.build}/compile.timestamp">
+			<srcfiles dir="${project.src}" />
+		</uptodate>
+	</target>
+
+	<!-- ================================== -->
+	<!--              JAR                   -->
+	<!-- ================================== -->
+	<target name="jar" description="Creates jar file" depends="compile">
+		<jar destfile="${project.output}/${project.name}_${project.version}.jar" manifest="${project.build}/META-INF/MANIFEST.MF">
+			<fileset dir="${project.build}" excludes="compile.timestamp" />
+		</jar>
+	</target>
+	
+	<!-- ================================== -->
+	<!--              JAVADOC               -->
+	<!-- ================================== -->
+	<target name="javadoc" description="Generate javadoc files">
+		<mkdir dir="${basedir}/doc" />
+		<javadoc destdir="${basedir}/doc">
+			<fileset dir="src/main/java" defaultexcludes="yes">
+				<include name="org/apache/directory/ldapstudio/**"/>
+			</fileset>
+		</javadoc>
+	</target>
+	
+	<!-- ================================== -->
+	<!--               CLEAN                -->
+	<!-- ================================== -->
+	<target name="clean" description="Deletes any generated file (javadoc, classes, jars, distribution)">
+		<delete includeemptydirs="true">
+			<fileset dir="${basedir}">
+				<exclude name=".project" />
+				<exclude name=".classpath" />
+				<exclude name="build.properties" />
+				<exclude name="build.xml" />
+				<exclude name="ivy.xml" />
+				<exclude name="META-INF/**" />
+				<exclude name="plugin.properties" />
+				<exclude name="plugin.xml" />
+				<exclude name="ressources/**" />
+				<exclude name="src/**" />
+			</fileset>
+		</delete>
+	</target>
+</project>

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ivy.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ivy.xml?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ivy.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ivy.xml Thu Nov 16 08:20:22 2006
@@ -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.
+-->
+<ivy-module version="1.0">
+	<info organisation="org.apache.directory.ldapstudio" module="ldapdstudio-importexport"/>
+	<dependencies>
+		<dependency org="org.slf4j" name="nlog4j" rev="1.2.24"/>
+		<dependency org="org.apache.directory.server" name="apacheds-server-tools" rev="1.1.0-SNAPSHOT"/>
+		<dependency org="org.apache.directory.shared" name="shared-ldap" rev="0.9.6-SNAPSHOT"/>
+    </dependencies>
+</ivy-module>
\ No newline at end of file

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/plugin.xml?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/plugin.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/plugin.xml Thu Nov 16 08:20:22 2006
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<!--
+  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.
+-->
+<plugin>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            class="org.apache.directory.ldapstudio.importexport.view.ServerPreferencePage"
+            id="org.apache.directory.ldapstudio.importexport.server"
+            name="Import/Export"/>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer class="org.apache.directory.ldapstudio.importexport.controller.PreferenceInitializer"/>
+   </extension>
+   <extension
+         point="org.eclipse.ui.actionSets">
+      <actionSet
+            id="org.apache.directory.ldapstudio.importexport.actionSet"
+            label="Action Set"
+            visible="true">
+         <menu
+               id="org.apache.directory.ldapstudio.importexport.menu"
+               label="%ldapstudio-importexport.menu.name"/>
+         <action
+               class="org.apache.directory.ldapstudio.importexport.controller.actions.ExportAction"
+               icon="ressources/icons/export.png"
+               id="org.apache.directory.ldapstudio.importexport.export"
+               label="%ldapstudio-importexport.actions.export.label"
+               menubarPath="org.apache.directory.ldapstudio.importexport.menu/actions"
+               style="push"
+               tooltip="%ldapstudio-importexport.actions.export.tooltip"/>
+         <action
+               class="org.apache.directory.ldapstudio.importexport.controller.actions.ImportAction"
+               icon="ressources/icons/import.png"
+               id="org.apache.directory.ldapstudio.importexport.import"
+               label="%ldapstudio-importexport.actions.import.label"
+               menubarPath="org.apache.directory.ldapstudio.importexport.menu/actions"
+               style="push"
+               tooltip="%ldapstudio-importexport.actions.import.tooltip"/>
+         <action
+               class="org.apache.directory.ldapstudio.importexport.controller.actions.ShowPrefsAction"
+               id="org.apache.directory.ldapstudio.importexport.showprefs"
+               label="%ldapstudio-importexport.actions.preferences.label"
+               menubarPath="org.apache.directory.ldapstudio.importexport.menu/prefs"
+               style="push"
+               tooltip="%ldapstudio-importexport.actions.preferences.tooltip"/>
+      </actionSet>
+   </extension>
+   <extension
+         point="org.eclipse.ui.newWizards">
+      <wizard
+            class="org.apache.directory.ldapstudio.importexport.view.ExportWizard"
+            id="org.apache.directory.ldapstudio.importexport.view.exportwizard"
+            name="%ldapstudio-importexport.wizards.export.name"/>
+   </extension>
+   <extension
+         point="org.eclipse.help.toc">
+      <toc
+            file="ressources/help/toc.xml"
+            primary="true"/>
+   </extension>
+</plugin>

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/exporting.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/exporting.html?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/exporting.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/exporting.html Thu Nov 16 08:20:22 2006
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<title>Exporting to LDIF file</title>
+</head>
+
+<body>
+            <h2>Exporting to LDIF file</h2>
+
+<p>In this section, you will learn how to export LDAP entries to a LDIF file.</p>
+<ol>
+	<li>Select <b>Export</b> from the <b>LDIF</b> menu.<br>
+
+<img src="images/exporting/menu.png" align="absmiddle" border="0"></li>
+	<li>A wizard shows up.</li>
+	<li>The first page of the wizard allows to set up the Export Point, the scope of the export and the destination file.<br>
+<img src="images/exporting//page1.png" align="absmiddle" border="0"></li>
+	<li>Click the <b>Finish</b> to export entries.</li>
+	<li>If the destination already exists, you will be asked for confirmation before replacing the file.<br>
+
+<img src="images/exporting//existing_file.png" align="absmiddle" border="0"></li>
+	<li>If the target directory does not exist, you will be asked for confirmation before creating the right path.<br>
+<img src="images/exporting//create_directory.png" align="absmiddle" border="0"></li>
+	<li>A progression bar representing the state of the export shows up at the bottom of the window, just above the buttons.<br>
+<img src="images/exporting//progress_monitor.png" align="absmiddle" border="0"></li>
+	<li>The second page of the wizard allows you to preview what is going to be exported (the number of entries and which entries). To access this page, click on the <b>Next</b> Button.<br>
+<img src="images/exporting//page2.png" align="absmiddle" border="0"></li>
+
+</ol>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/create_directory.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/create_directory.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/create_directory.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/existing_file.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/existing_file.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/existing_file.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/menu.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/menu.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/menu.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page1.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page1.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page1.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page2.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page2.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/page2.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/progress_monitor.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/progress_monitor.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/exporting/progress_monitor.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/file_menu.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/file_menu.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/file_menu.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_error.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_error.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_error.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_on_error_entries.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_on_error_entries.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_on_error_entries.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_successful.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_successful.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/import_successful.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/open_dialog.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/open_dialog.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/open_dialog.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/progress_monitor.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/progress_monitor.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/importing/progress_monitor.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/menu.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/menu.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/menu.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/preferences-import-export.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/preferences-import-export.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/images/preferences/preferences-import-export.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/importing.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/importing.html?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/importing.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/importing.html Thu Nov 16 08:20:22 2006
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<title>Importing from a LDIF file</title>
+</head>
+
+<body>
+<h2>Importing from a LDIF file</h2>
+
+<p>In this section, you will learn how to import a LDIF file.</p>
+<ol>
+	<li>Select <b>Import...</b> from the <b>LDIF</b> menu.<br>
+
+<img src="images/importing/file_menu.png" align="absmiddle" border="0"></li>
+	<li>Browse the filesystem and select the LDIF file. Then click <b>Open</b>.<br>
+<img src="images/importing/open_dialog.png" align="absmiddle" border="0"></li>
+	<li>The progression of the import is displayed by the window.<br>
+<img src="images/importing/progress_monitor.png" align="absmiddle" border="0"></li>
+	<li>If all the entries in the file are successfully imported, this message will be displayed.<br>
+<img src="images/importing/import_successful.png" align="absmiddle" border="0"></li>
+	<li>If an error occurs (connection problem, error reading the file, etc.) an error window will be displayed.<br>
+
+<img src="images/importing/import_error.png" align="absmiddle" border="0"></li>
+	<li>If some entries during an import are successfully imported, but some others not. This windows will show the entries that were correctly imported and those that couldn't.<br>
+<img src="images/importing/import_on_error_entries.png" align="absmiddle" border="0"></li>
+</ol>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/preferences.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/preferences.html?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/preferences.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/preferences.html Thu Nov 16 08:20:22 2006
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>Import/Export Preferences</title>
+</head>
+
+<body>
+<h2>Import/Export Preferences</h2>
+
+<p>To access the Import/Export preferences, select <b>Show preferences...</b> in the <b>LDIF</b> menu.<br>
+Preferences are also available through <b>Window</b> &gt; <b>Preferences</b> &gt; <b>Import/Export</b><br>
+
+<img src="images/preferences/menu.png" align="absmiddle" border="0"></p>
+
+<p>Use this preference page to change the settings used to connect to the LDAP server that the servers uses.</p>
+<table cellspacing="0" border="1"><tbody>
+<tr>
+<th class="confluenceTh"> Option </th>
+<th class="confluenceTh"> Description </th>
+<th class="confluenceTh"> Default </th>
+</tr>
+<tr>
+
+<td class="confluenceTd"> Host </td>
+<td class="confluenceTd"> Name or address of a local IP interface to be used by the server. </td>
+<td class="confluenceTd"> localhost </td>
+</tr>
+<tr>
+<td class="confluenceTd"> Port </td>
+<td class="confluenceTd"> IP port for server to listen on. </td>
+
+<td class="confluenceTd"> 10389 </td>
+</tr>
+<tr>
+<td class="confluenceTd"> User DN </td>
+<td class="confluenceTd"> DN of the user to use to connect </td>
+<td class="confluenceTd"> uid=admin,ou=system </td>
+</tr>
+<tr>
+<td class="confluenceTd"> Password </td>
+
+<td class="confluenceTd"> Password associated with the user </td>
+<td class="confluenceTd"> secret </td>
+</tr>
+<tr>
+<td class="confluenceTd"> Base DN </td>
+<td class="confluenceTd"> The Base DN to connect to </td>
+<td class="confluenceTd"> ou=system </td>
+
+</tr>
+</tbody></table>
+<p>Here is what the Import/Export preferences page looks like:<br>
+<img src="images/preferences/preferences-import-export.png" align="absmiddle" border="0"></p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.html?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.html Thu Nov 16 08:20:22 2006
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+<ul>
+<li><a href="importing.html">Importing from a LDIF file</a></li>
+<li><a href="exporting.html">Exporting to a LDIF file</a></li>
+<li><a href="preferences.html">Preferences</a></li>
+</ul>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.xml?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/help/toc.xml Thu Nov 16 08:20:22 2006
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Import/Export Plugin Help" topic="ressources/help/toc.html">
+	<topic label="Importing from a LDIF file"  href="ressources/help/importing.html" /> 
+	<topic label="Exporting to a LDIF file"  href="ressources/help/exporting.html" />
+	<topic label="Preferences"  href="ressources/help/preferences.html" /> 
+</toc>

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry.gif?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_added.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_added.gif?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_added.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_error.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_error.gif?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/entry_error.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/export.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/export.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/export.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/import.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/import.png?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/import.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/wizard_export.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/wizard_export.gif?view=auto&rev=475795
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/icons/wizard_export.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/log4j.conf
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/log4j.conf?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/log4j.conf (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/ressources/log4j.conf Thu Nov 16 08:20:22 2006
@@ -0,0 +1,9 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=DEBUG, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Activator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Activator.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Activator.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Activator.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,87 @@
+/*
+ *  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.directory.ldapstudio.importexport;
+
+import org.apache.directory.ldapstudio.importexport.controller.actions.ExportAction;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PropertyConfigurator;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "ldapstudio_importexport_plugin"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+    
+	// The logger
+    private static org.slf4j.Logger logger = LoggerFactory.getLogger( ExportAction.class );
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+        // Configuring NLog4J
+        PropertyConfigurator.configure( Platform.getBundle(Plugin.ID).getResource("ressources/log4j.conf") ); //$NON-NLS-1$
+        // Setting up logging level for Apache DS libraries
+        Logger  loggerBis = Logger.getLogger("org.apache.directory"); //$NON-NLS-1$
+        loggerBis.setLevel( Level.ERROR );
+        
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+        logger.info( "Starting Import/Export plugin" ); //$NON-NLS-1$
+		super.start(context);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+        logger.info( "Stopping Import/Export plugin" ); //$NON-NLS-1$
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Messages.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Messages.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Messages.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Messages.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,66 @@
+/*
+ *  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.directory.ldapstudio.importexport;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.apache.log4j.Logger;
+
+/**
+ * This class is used to get Strings to display in the User Interface
+ */
+public class Messages
+{
+    // The logger
+    private static Logger logger = Logger.getLogger( Messages.class );
+
+    private static final String BUNDLE_NAME = "org.apache.directory.ldapstudio.importexport.messages"; //$NON-NLS-1$
+
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
+
+    
+    /**
+     * Default constuctor
+     */
+    private Messages()
+    {
+    }
+
+    /**
+     * Returns a String associated with the key given in parameter
+     * @param key the key associated to the String 
+     * @return the corresponding String
+     */
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            logger.warn( "Associated ressource not found for key {}", key ); //$NON-NLS-1$
+            return '!' + key + '!';
+        }
+    }
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Plugin.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Plugin.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Plugin.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/Plugin.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,30 @@
+/*
+ *  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.directory.ldapstudio.importexport;
+
+/**
+ * This class stores the Plugin informations.
+ *
+ */
+public class Plugin
+{
+    public static final String ID = "org.apache.directory.ldapstudio.importexport"; //$NON-NLS-1$
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/PreferenceInitializer.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/PreferenceInitializer.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/PreferenceInitializer.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,44 @@
+/*
+ *  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.directory.ldapstudio.importexport.controller;
+
+import org.apache.directory.ldapstudio.importexport.Activator;
+import org.apache.directory.ldapstudio.importexport.view.ServerPreferencePage;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * This class initializes the preferences of the LDAP Studio Import/Export Plugin
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer
+{
+    @Override
+    public void initializeDefaultPreferences()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+        
+        store.setDefault( ServerPreferencePage.HOST, ServerPreferencePage.HOST_DEFAULT );
+        store.setDefault( ServerPreferencePage.BASE_BN, ServerPreferencePage.BASE_BN_DEFAULT );
+        store.setDefault( ServerPreferencePage.PASSWORD, ServerPreferencePage.PASSWORD_DEFAULT );
+        store.setDefault( ServerPreferencePage.PORT, ServerPreferencePage.PORT_DEFAULT );
+        store.setDefault( ServerPreferencePage.USER_DN, ServerPreferencePage.USER_DN_DEFAULT );
+    }
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ExportAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ExportAction.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ExportAction.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ExportAction.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,77 @@
+/*
+ *  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.directory.ldapstudio.importexport.controller.actions;
+
+import org.apache.directory.ldapstudio.importexport.view.ExportWizard;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements the Export Action
+ */
+public class ExportAction implements IWorkbenchWindowActionDelegate
+{
+    // The logger
+    private static Logger logger = LoggerFactory.getLogger( ExportAction.class );
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    /**
+     * This method is run when the menu item is clicked
+     */
+    public void run( IAction action )
+    {
+        logger.info( "Opening Export Wizard" ); //$NON-NLS-1$
+        
+        // Instantiates and initializes the wizard
+        ExportWizard wizard = new ExportWizard();
+        wizard.init(PlatformUI.getWorkbench(), StructuredSelection.EMPTY);
+        // Instantiates the wizard container with the wizard and opens it
+        WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
+        dialog.create();
+        dialog.open();
+        
+        logger.info( "Closing Export Wizard" ); //$NON-NLS-1$
+    }
+
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+
+    public void dispose()
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+
+    public void init( IWorkbenchWindow window )
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ImportAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ImportAction.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ImportAction.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ImportAction.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,455 @@
+/*
+ *  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.directory.ldapstudio.importexport.controller.actions;
+
+import java.io.File;
+import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.NamingException;
+
+import org.apache.directory.ldapstudio.importexport.Activator;
+import org.apache.directory.ldapstudio.importexport.Messages;
+import org.apache.directory.ldapstudio.importexport.view.ImportEntriesOnErrorDialog;
+import org.apache.directory.ldapstudio.importexport.view.ServerPreferencePage;
+import org.apache.directory.server.tools.ToolCommandListener;
+import org.apache.directory.server.tools.commands.importcmd.ImportCommandExecutor;
+import org.apache.directory.server.tools.util.ListenerParameter;
+import org.apache.directory.server.tools.util.Parameter;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements the Import Action. It uses the Apache DS Tools
+ * library to import entries from a LDIF file.
+ */
+public class ImportAction implements IWorkbenchWindowActionDelegate, IRunnableWithProgress
+{
+    // The logger
+    private static Logger logger = LoggerFactory.getLogger( ImportAction.class );
+    
+    // Fields used to call the Import Command
+    private String host;
+    private int port;
+    private String userDN;
+    private String password;
+    private Parameter[] params;
+    private ListenerParameter[] listenerParams;
+
+    // Flag to know if the preferences are filled and correct
+    private boolean preferencesOk = false;
+
+    // The progress monitor to update
+    private IProgressMonitor monitor;
+
+    // Fields used for displaying error message after the progress monitor is closed,
+    // since we can't update UI when the progress monitor is working
+    private boolean hasRaisedAnException = false;
+    private Exception exceptionRaised;
+    
+    private List<String> addedEntries;
+    private List<String> errorEntries;
+    private int numberOfEntriesInFile = 0;
+    private int progressMonitorCount = 0;
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    /**
+     * This method is run when the menu item is clicked
+     */
+    public void run( IAction action )
+    {
+        logger.info( "Starting Import Action" ); //$NON-NLS-1$
+        
+        // Re-setting up fields to defaults for another import
+        numberOfEntriesInFile = 0;
+        progressMonitorCount = 0;
+        addedEntries = new ArrayList<String>();
+        errorEntries = new ArrayList<String>();
+        hasRaisedAnException = false;
+        exceptionRaised = null;
+        
+        // We first look at prefs to see if we can communicate correctly with the server
+        processPreferences();
+
+        if ( !preferencesOk )
+        {
+            // If prefs are not well filled, we stop here. It's no use to try importing.
+            return;
+        }
+
+        // We prompt user for the input file
+        FileDialog fd = new FileDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN );
+        fd.setText( Messages.getString("ImportAction.Open_a_LDIF_file") ); //$NON-NLS-1$
+        fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
+        fd.setFilterExtensions( new String[]
+            { "*.ldif;*.LDIF", "*.*" } ); //$NON-NLS-1$ //$NON-NLS-2$
+        fd.setFilterNames( new String[]
+            { Messages.getString("ImportAction.LDIF_Files"), Messages.getString("ImportAction.All_files") } ); //$NON-NLS-1$ //$NON-NLS-2$
+
+        String selected = fd.open();
+        if ( selected == null )
+        {
+            // User has canceled the dialog, we stop
+            logger.info( "User has canceled the Open Dialog" ); //$NON-NLS-1$
+            return;
+        }
+                
+        File ldifFile = new File( selected );
+        if ( !ldifFile.exists() )
+        {
+            logger.error( "The selected file \"" + ldifFile.getName() + "\" doesn't exist. Stoping Import Action." ); //$NON-NLS-1$ //$NON-NLS-2$
+            showAlertError( Messages.getString("ImportAction.The_Selected_file") + ldifFile.getName() + Messages.getString("ImportAction.Doesnt_exist") ); //$NON-NLS-1$ //$NON-NLS-2$
+            return;
+        }
+
+        // We parse the input file once to count how many entries it contains
+        logger.info( "Parsing file " + ldifFile.getName() + "(" + ldifFile.getAbsolutePath() + ")" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        try
+        {
+            numberOfEntriesInFile = getNumberOfEntries( ldifFile, selected );
+        }
+        catch ( NamingException ne )
+        {
+            logger.error( "An error occured while parsing the LDIF File. " + ne.getMessage() ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.Error_occurred_parsing_file") + ne.getMessage() ); //$NON-NLS-1$
+            return;
+        }
+
+        // Preparing the call of theImport Command of the Apache DS Tools
+        // Parameters
+        Parameter param_ldifFile = new Parameter( ImportCommandExecutor.FILE_PARAMETER, ldifFile );
+        Parameter param_host = new Parameter( ImportCommandExecutor.HOST_PARAMETER, host );
+        Parameter param_port = new Parameter( ImportCommandExecutor.PORT_PARAMETER, new Integer( port ) );
+        Parameter param_user = new Parameter( ImportCommandExecutor.USER_PARAMETER, userDN );
+        Parameter param_password = new Parameter( ImportCommandExecutor.PASSWORD_PARAMETER, password );
+        Parameter param_auth = new Parameter( ImportCommandExecutor.AUTH_PARAMETER, "simple" ); //$NON-NLS-1$
+        Parameter param_ignoreErrors = new Parameter( ImportCommandExecutor.IGNOREERRORS_PARAMETER, new Boolean( true ) );
+        params = new Parameter[]{ param_ldifFile, param_host, param_port, param_user, param_password, param_auth, param_ignoreErrors };
+        
+        // Listeners
+        listenerParams = initListeners();
+        
+        ProgressMonitorDialog dialog = new ProgressMonitorDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() );
+        
+        try
+        {
+            dialog.run( true, false, this );
+        }
+        catch ( InvocationTargetException ex )
+        {
+            logger.error( "An error has occured when running the import. ", ex ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.An_error_has_occurred") ); //$NON-NLS-1$
+            return;
+        }
+        catch ( InterruptedException ex )
+        {
+            logger.error( "An error has occured when running the import. ", ex ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.An_error_has_occurred") ); //$NON-NLS-1$
+            return;
+        }
+        
+        if ( !isImportSuccessful() )
+        {
+            // Testing if the import has raised an exception
+            if ( hasRaisedAnException )
+            {
+                logger.error( "Import is not successful, an error has occurred. ", exceptionRaised ); //$NON-NLS-1$
+                showAlertError( exceptionRaised.getMessage() );
+                hasRaisedAnException = false;
+            }
+            else
+            {
+                // If the import has not raised an exception and the import is not successful
+                // then it means that some entries could not have been imported
+                logger.error( "Some entries could not have been imported "); //$NON-NLS-1$
+                ImportEntriesOnErrorDialog errorDialog = new ImportEntriesOnErrorDialog(
+                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), addedEntries, errorEntries );
+                errorDialog.open();
+            }
+        }
+        else
+        {
+            logger.info( "Import succesful" ); //$NON-NLS-1$
+            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                SWT.ICON_INFORMATION );
+            messageBox.setText( Messages.getString("ImportAction.Import_successful") ); //$NON-NLS-1$
+            messageBox.setMessage( numberOfEntriesInFile + Messages.getString("ImportAction.Entries_were_successfully_added") ); //$NON-NLS-1$
+            messageBox.open();
+        }
+        
+        logger.info( "Stopping Import Action" ); //$NON-NLS-1$
+    }   
+
+    /**
+     * Returns the array of ListenerParameter for the Import Command
+     * @return the array of ListenerParameter for the Import Command
+     */
+    private ListenerParameter[] initListeners()
+    {
+        ListenerParameter exceptionListener = new ListenerParameter( ImportCommandExecutor.EXCEPTIONLISTENER_PARAMETER, new ToolCommandListener() { //$NON-NLS-1$
+            public void notify( Serializable o )
+            {
+                if ( o instanceof Exception )
+                {
+                    logger.error( "An exception was raised during the import.", o); //$NON-NLS-1$
+                    hasRaisedAnException = true;
+                    exceptionRaised = ( Exception ) o;
+                }
+            } 
+        });
+        ListenerParameter entryAddedListener = new ListenerParameter( ImportCommandExecutor.ENTRYADDEDLISTENER_PARAMETER, new ToolCommandListener() { //$NON-NLS-1$
+            public void notify( Serializable o )
+            {
+                if ( o instanceof String )
+                {
+                    String entry = ( String ) o;
+                    logger.debug( "Entry added: " + entry ); //$NON-NLS-1$
+                    addedEntries.add( entry );
+                    updateProgressMonitor();
+                }
+                
+            } 
+        });
+        ListenerParameter entryAddFailedListener = new ListenerParameter( ImportCommandExecutor.ENTRYADDFAILEDLISTENER_PARAMETER, new ToolCommandListener() { //$NON-NLS-1$
+            public void notify( Serializable o )
+            {
+                if ( o instanceof String )
+                {
+                    String entry = ( String ) o;
+                    logger.debug( "Entry add failed: " + entry ); //$NON-NLS-1$
+                    errorEntries.add( entry );
+                    updateProgressMonitor();
+                }
+            }     
+        });
+        
+        return new ListenerParameter[] { exceptionListener, entryAddedListener, entryAddFailedListener } ;
+    }
+    
+
+    /**
+     * Returns the number of entries in a LDIF file
+     * @param ldifFile
+     * @param path
+     * @return
+     * @throws NamingException
+     */
+    private int getNumberOfEntries( File ldifFile, String path ) throws NamingException
+    {
+        LdifReader ldifReader;
+        int counter = 0;
+        
+        ldifReader = new LdifReader( ldifFile );
+
+        List entries = ldifReader.parseLdifFile( path );
+
+        Iterator entriesIterator = entries.iterator();
+        while ( entriesIterator.hasNext() )
+        {
+            counter++;
+            entriesIterator.next();
+        }
+        return counter;
+    }
+
+    /**
+     * Verifies that the preferences are Ok.
+     */
+    private void processPreferences()
+    {
+        logger.info( "Processing Preferences" ); //$NON-NLS-1$
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+        // HOST
+        String prefHost = store.getString( ServerPreferencePage.HOST );
+        if ( ( prefHost == null ) || ( "".equals( prefHost ) ) ) //$NON-NLS-1$
+        {
+            logger.error( "Host value in the preference page is empty." ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.Host_empy") ); //$NON-NLS-1$
+            openPreferenceWindow();
+            return;
+        }
+        host = prefHost;
+
+        // PORT
+        String prefPort = store.getString( ServerPreferencePage.PORT );
+        int portValue;
+        if ( ( prefPort == null ) || ( "".equals( prefPort ) ) ) //$NON-NLS-1$
+        {
+            logger.error( "Port value in the preference page is empty." ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.Port_empty") ); //$NON-NLS-1$
+            openPreferenceWindow();
+            return;
+        }
+        else
+        {
+            try
+            {
+                portValue = Integer.parseInt( prefPort );
+            }
+            catch ( NumberFormatException nfe )
+            {
+                logger.error( "Port value in the preference page does not seem to be a number." ); //$NON-NLS-1$
+                showAlertError( Messages.getString("ImportAction.Port_not_a_number") ); //$NON-NLS-1$
+                openPreferenceWindow();
+                return;
+            }
+        }
+        port = portValue;
+
+        // USER-DN
+        String prefUserDN = store.getString( ServerPreferencePage.USER_DN );
+        if ( ( prefUserDN == null ) || ( "".equals( prefUserDN ) ) ) //$NON-NLS-1$
+        {
+            logger.error( "User DN value in the preference page is empty." ); //$NON-NLS-1$
+            showAlertError( Messages.getString("ImportAction.UserDN_empty") ); //$NON-NLS-1$
+            openPreferenceWindow();
+            return;
+        }
+        userDN = prefUserDN;
+
+        // PASSWORD
+        String prefPassword = store.getString( ServerPreferencePage.PASSWORD );
+        password = prefPassword;
+
+        // Server preferences are clean
+        preferencesOk = true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    /**
+     * This method is run by the ProgressMonitorDialog and is used to display the progress window
+     */
+    public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException
+    {
+        this.monitor = monitor;
+        monitor.beginTask( Messages.getString("ImportAction.Importing_entries"), numberOfEntriesInFile ); //$NON-NLS-1$
+        monitor.subTask( Messages.getString("ImportAction.Adding_entries_1_on") + numberOfEntriesInFile + Messages.getString("ImportAction.Parenthesis_close") ); //$NON-NLS-1$ //$NON-NLS-2$
+        progressMonitorCount++;
+
+        // Logging the Import Command Call
+        logger.debug( "Calling the Apache DS Tools Import command with the following parameters:" ); //$NON-NLS-1$
+        if ( logger.isDebugEnabled() )
+        {
+            for ( int i = 0; i < params.length; i++ )
+            {
+                Parameter param = params[i];
+                if ( !param.getName().equals( "password" ) ) //$NON-NLS-1$
+                {
+                    logger.debug( "Parameter - name: " + param.getName() + " - value: " + param.getValue() ); //$NON-NLS-1$ //$NON-NLS-2$
+                }
+            }
+            for ( int i = 0; i < listenerParams.length; i++ )
+            {
+                ListenerParameter param = listenerParams[i];
+                logger.debug( "ListenerParameter - name: " + param.getName() ); //$NON-NLS-1$
+            }
+        }
+        
+        
+        // Calling the Apache DS Tools Import Command
+        ImportCommandExecutor cmd = new ImportCommandExecutor();
+        cmd.execute( params, listenerParams );
+        
+        monitor.subTask( Messages.getString("ImportAction.Done") ); //$NON-NLS-1$
+        monitor.done();
+    }   
+
+    /**
+     * Updates the progress monitor.
+     * Notifies that a work unit of the import task has been completed.
+     */
+    private void updateProgressMonitor()
+    {
+        monitor.worked( 1 );
+        monitor.subTask( Messages.getString("ImportAction.Adding_entries_x") + progressMonitorCount++ + Messages.getString("ImportAction.Adding_on") + numberOfEntriesInFile + Messages.getString("ImportAction.Parenthesis_close") ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+    } 
+
+    /**
+     * Displays an Error Message Box with the provided message
+     * @param msg
+     *              the message to be displayed
+     */
+    private void showAlertError( String msg )
+    {
+        MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+            SWT.ICON_ERROR );
+        messageBox.setText( Messages.getString("ImportAction.Import_error") ); //$NON-NLS-1$
+        messageBox.setMessage( msg );
+        messageBox.open();
+    }
+
+    /**
+     * Opens the Server Configuration preference page
+     */
+    private void openPreferenceWindow()
+    {
+        PreferenceDialog pd = new PreferenceDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+            PlatformUI.getWorkbench().getPreferenceManager() );
+        pd.setSelectedNode( "org.apache.directory.ldapstudio.importexport.server" ); //$NON-NLS-1$
+        pd.open();
+    }
+    
+    /**
+     * Returns true if the import was successful
+     * @return true if the import was successful
+     */
+    private boolean isImportSuccessful()
+    {
+        return ( ( !hasRaisedAnException ) && ( exceptionRaised == null) && ( errorEntries.size() == 0 ) );
+    }
+    
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+
+    public void dispose()
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+
+    public void init( IWorkbenchWindow window )
+    {
+        // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+    }
+}

Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ShowPrefsAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ShowPrefsAction.java?view=auto&rev=475795
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ShowPrefsAction.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-importexport-plugin/src/main/java/org/apache/directory/ldapstudio/importexport/controller/actions/ShowPrefsAction.java Thu Nov 16 08:20:22 2006
@@ -0,0 +1,68 @@
+/*
+ *  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.directory.ldapstudio.importexport.controller.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements the Show Preferences Action. It launches the Preferences Window
+ * and displays the LDAP Server Configuration preference page.
+ */
+public class ShowPrefsAction implements IWorkbenchWindowActionDelegate
+{
+    // The logger
+    private static Logger logger = LoggerFactory.getLogger( ShowPrefsAction.class );
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    public void run( IAction action )
+    {
+        logger.info( "Opening Import/Export preference page window" ); //$NON-NLS-1$
+        
+        PreferenceDialog pd = new PreferenceDialog(
+            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+            PlatformUI.getWorkbench().getPreferenceManager() );
+        pd.setSelectedNode( "org.apache.directory.ldapstudio.importexport.server" ); //$NON-NLS-1$
+        pd.open();
+        
+        logger.info( "Closing Import/Export preference page window" ); //$NON-NLS-1$
+    }
+
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+    }
+
+    public void dispose()
+    {
+    }
+
+    public void init( IWorkbenchWindow window )
+    {
+    }
+}



Mime
View raw message