You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2006/11/16 17:51:39 UTC
svn commit: r475810 - in
/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin: ./
META-INF/ resources/ resources/help/ resources/help/images/
resources/icons/ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/mai...
Author: pamarcelot
Date: Thu Nov 16 08:51:36 2006
New Revision: 475810
URL: http://svn.apache.org/viewvc?view=rev&rev=475810
Log:
Importing project ldapstudio-dsml-plugin
Added:
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.classpath
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.project
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/MANIFEST.MF
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.properties
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.xml
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/ivy.xml
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/plugin.xml
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/executing.html
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/console.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/error.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/input-file.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/menu.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/output-file.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/window.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.html
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.xml
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/icons/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/icons/wizard_DSML.png (with props)
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/Activator.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/PreferenceInitializer.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/ExecuteAction.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ConsoleDialog.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizard.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizardPage.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ImageKeys.java
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/test/
directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/test/java/
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.classpath?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.classpath (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.classpath Thu Nov 16 08:51:36 2006
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <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/dom4j-1.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/nlog4j-1.2.25.jar"/>
+ <classpathentry kind="lib" path="lib/xpp3-1.1.3_8.jar"/>
+ <classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
+ <classpathentry kind="lib" path="lib/shared-asn1-0.9.6-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="lib/shared-ldap-0.9.6-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="lib/ldapstudio-dsml-parser-0.1.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.project
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.project?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.project (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/.project Thu Nov 16 08:51:36 2006
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ldapstudio-dsml-plugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/MANIFEST.MF?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/MANIFEST.MF (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/META-INF/MANIFEST.MF Thu Nov 16 08:51:36 2006
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: LDAP Studio DSMLv2 Plug-in
+Bundle-SymbolicName: org.apache.directory.ldapstudio.dsmlv2plugin;singleton:=true
+Bundle-Version: 0.0.1
+Bundle-Activator: org.apache.directory.ldapstudio.dsmlv2.Activator
+Bundle-Vendor: apache.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Eclipse-LazyStart: true
+Bundle-ClassPath: lib/dom4j-1.6.1.jar,
+ lib/ldapstudio-dsml-parser-0.1.jar,
+ lib/nlog4j-1.2.25.jar,
+ lib/shared-asn1-0.9.6-SNAPSHOT.jar,
+ lib/shared-ldap-0.9.6-SNAPSHOT.jar,
+ lib/xpp3-1.1.3_8.jar,
+ lib/commons-collections-3.1.jar,
+ .
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.properties?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.properties (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.properties Thu Nov 16 08:51:36 2006
@@ -0,0 +1,5 @@
+source.. = src/main/java,\
+ src/test/java
+output.. = target
+bin.includes = lib/,\
+ resources/
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.xml?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/build.xml Thu Nov 16 08:51:36 2006
@@ -0,0 +1,141 @@
+<!--
+ 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-dsml-plugin" default="jar" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+ <property name="project.name" value="org.apache.directory.ldapstudio.dsmlPlugin" />
+ <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}/resources" />
+ <copy todir="${project.build}/resources">
+ <fileset dir="${basedir}/resources">
+ <include name="**" />
+ </fileset>
+ </copy>
+ <mkdir dir="${project.build}/META-INF" />
+ <copy todir="${project.build}/META-INF">
+ <fileset dir="${basedir}/META-INF">
+ <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>
+
+ <!-- ================================== -->
+ <!-- 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>
+
+ <!-- ================================== -->
+ <!-- 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>
+
+ <!-- ================================== -->
+ <!-- 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.xml" />
+ <exclude name="build.properties" />
+ <exclude name="ivy.xml" />
+ <exclude name="plugin.xml" />
+ <exclude name="resources/**" />
+ <exclude name="META-INF/**" />
+ <exclude name="src/**" />
+ </fileset>
+ </delete>
+ </target>
+</project>
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/ivy.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/ivy.xml?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/ivy.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/ivy.xml Thu Nov 16 08:51:36 2006
@@ -0,0 +1,24 @@
+<!--
+ 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-dsml-plugin"/>
+ <dependencies>
+ <dependency org="org.apache.directory.ldapstudio" name="ldapstudio-dsml-parser" rev="0.1"/>
+ </dependencies>
+</ivy-module>
\ No newline at end of file
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/plugin.xml?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/plugin.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/plugin.xml Thu Nov 16 08:51:36 2006
@@ -0,0 +1,58 @@
+<?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
+ id="org.apache.directory.ldapstudio.dsmlv2"
+ name="LDAP Studio DSMLv2 Plugin"
+ version="0.1"
+ provider-name="apache.org">
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ </requires>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.apache.directory.ldapstudio.dsmlv2.actionset"
+ label="Action Set"
+ visible="true">
+ <menu
+ id="org.apache.directory.ldapstudio.dsmlv2.menu"
+ label="DSML"/>
+ <action
+ class="org.apache.directory.ldapstudio.dsmlv2.controller.actions.ExecuteAction"
+ id="org.apache.directory.ldapstudio.dsmlv2.execute"
+ label="Execute..."
+ menubarPath="org.apache.directory.ldapstudio.dsmlv2.menu/actions"
+ style="push"
+ tooltip="Executes a DSML request"/>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.apache.directory.ldapstudio.dsmlv2.controller.PreferenceInitializer"/>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="resources/help/toc.xml"
+ primary="true"/>
+ </extension>
+</plugin>
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/executing.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/executing.html?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/executing.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/executing.html Thu Nov 16 08:51:36 2006
@@ -0,0 +1,38 @@
+<!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>Executing a DSMLv2 file</title>
+</head>
+
+<body>
+ <h2>Executing a DSMLv2 file</h2>
+
+<p>In this section, you will learn how to execute a DSMLv2 file.</p>
+<ol>
+ <li>Select <b>Execute...</b> from the <b>DSML</b> menu.<br>
+
+<img src="images/menu.png" align="absmiddle" border="0"></li>
+ <li>A wizard shows up.<br>
+<img src="images/window.png" align="absmiddle" border="0"></li>
+ <li>The <em><strong>"Server Settings"</strong></em> section, allows you to enter the host, port, user's DN and password of the LDAP server you want to connect to.</li>
+ <li>The <em><strong>"Input file"</strong></em> section, allows you to browse your file system to select the DSML file to execute. <br>
+ <img src="images/input-file.png" align="absmiddle" border="0"></li>
+ <li>The <em><strong>"Output"</strong></em> section, offers you the choice between:
+ <ul>
+ <li>Show the response (in DSML format) in a console<br>
+ <img src="images/console.png" align="absmiddle" border="0"></li>
+ <li>Save the response to a file, allowing you to browse your file system to select the file.<br>
+ <img src="images/output-file.png" align="absmiddle" border="0"></li>
+ </ul>
+ </li>
+ <li>Click the <b>Finish</b> to execute the DSML file on the server.</li>
+ <li>All fields of the <em><strong>"Server Settings"</strong></em> section are required (except
+ password, which can be empty), as well as a valid input file, and, if you choose the corresponding
+ option, an ouput file.<br>
+ Any error is notified at the bottom of the window.
+<img src="images/error.png" align="absmiddle" border="0"></li>
+</ol>
+</body>
+</html>
\ No newline at end of file
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/console.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/console.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/console.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/error.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/error.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/error.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/input-file.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/input-file.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/input-file.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/menu.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/menu.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/menu.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/output-file.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/output-file.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/output-file.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/window.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/window.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/images/window.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.html
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.html?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.html (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.html Thu Nov 16 08:51:36 2006
@@ -0,0 +1,15 @@
+<!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="executing.html">Executing a DSMLv2 file.</a></li>
+</ul>
+</body>
+</html>
\ No newline at end of file
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.xml?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.xml (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/help/toc.xml Thu Nov 16 08:51:36 2006
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="DSMLv2 Plugin Help" topic="resources/help/toc.html">
+ <topic label="Executing a DSMLv2 file" href="resources/help/executing.html" />
+</toc>
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/icons/wizard_DSML.png
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/icons/wizard_DSML.png?view=auto&rev=475810
==============================================================================
Binary file - no diff available.
Propchange: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/resources/icons/wizard_DSML.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/Activator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/Activator.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/Activator.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/Activator.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,81 @@
+/*
+ * 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.dsmlv2;
+
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin
+{
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.directory.ldapstudio.dsmlv2plugin"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+
+ /**
+ * The constructor
+ */
+ public Activator()
+ {
+ plugin = this;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start( BundleContext context ) throws Exception
+ {
+ 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;
+ super.stop( context );
+ }
+
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault()
+ {
+ return plugin;
+ }
+
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/PreferenceInitializer.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/PreferenceInitializer.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/PreferenceInitializer.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,47 @@
+/*
+ * 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.dsmlv2.controller;
+
+
+import org.apache.directory.ldapstudio.dsmlv2.Activator;
+import org.apache.directory.ldapstudio.dsmlv2.view.ExecuteWizardPage;
+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( ExecuteWizardPage.HOST, "" );
+ store.setDefault( ExecuteWizardPage.PORT, "" );
+ store.setDefault( ExecuteWizardPage.USER_DN, "" );
+ store.setDefault( ExecuteWizardPage.INPUT_FILE_PATH, "" );
+ store.setDefault( ExecuteWizardPage.OUTPUT_FILE_PATH, "" );
+ store.setDefault( ExecuteWizardPage.OUTPUT_CHOICE, ExecuteWizardPage.OUTPUT_CHOICE_CONSOLE );
+ }
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/ExecuteAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/ExecuteAction.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/ExecuteAction.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/controller/actions/ExecuteAction.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,69 @@
+/*
+ * 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.dsmlv2.controller.actions;
+
+
+import org.apache.directory.ldapstudio.dsmlv2.view.ExecuteWizard;
+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;
+
+
+/**
+ * This class implements the Execute Action
+ */
+public class ExecuteAction implements IWorkbenchWindowActionDelegate
+{
+ /**
+ * This method is run when the menu item is clicked
+ */
+ public void run( IAction action )
+ {
+ ExecuteWizard wizard = new ExecuteWizard();
+ 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();
+ }
+
+
+ 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
+ }
+
+
+ public void selectionChanged( IAction action, ISelection selection )
+ {
+ // This method does nothing, but is needed by the IWorkbenchWindowActionDelegate Interface
+ }
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ConsoleDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ConsoleDialog.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ConsoleDialog.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ConsoleDialog.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,88 @@
+/*
+ * 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.dsmlv2.view;
+
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+
+public class ConsoleDialog extends Dialog
+{
+ private String text;
+
+
+ protected ConsoleDialog( Shell parentShell, String text )
+ {
+ super( parentShell );
+ this.text = text;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell( Shell newShell )
+ {
+ super.configureShell( newShell );
+ newShell.setText( "Console" );
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea( Composite parent )
+ {
+ Composite composite = new Composite( parent, SWT.NONE );
+ GridLayout layout = new GridLayout( 1, true );
+ composite.setLayout( layout );
+
+ Text textWidget = new Text( composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL );
+ textWidget.setText( text );
+ GridData gridData = new GridData( SWT.FILL, SWT.FILL, true, true );
+ gridData.heightHint = 400;
+ gridData.minimumHeight = 400;
+ gridData.widthHint = 500;
+ gridData.minimumWidth = 500;
+ textWidget.setLayoutData( gridData );
+ textWidget.setEditable( false );
+
+ return composite;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void createButtonsForButtonBar( Composite parent )
+ {
+ createButton( parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true );
+ }
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizard.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizard.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizard.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,59 @@
+/*
+ * 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.dsmlv2.view;
+
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+
+public class ExecuteWizard extends Wizard implements INewWizard
+{
+ ExecuteWizardPage executeWizardPage;
+
+
+ @Override
+ public boolean performFinish()
+ {
+ return executeWizardPage.performFinish();
+ }
+
+
+ public void init( IWorkbench workbench, IStructuredSelection selection )
+ {
+ executeWizardPage = new ExecuteWizardPage();
+ addPage( executeWizardPage );
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ @Override
+ public void addPages()
+ {
+ // TODO Auto-generated method stub
+ super.addPages();
+ }
+
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizardPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizardPage.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizardPage.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ExecuteWizardPage.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,580 @@
+/*
+ * 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.dsmlv2.view;
+
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+
+import org.apache.directory.ldapstudio.dsmlv2.Activator;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.apache.directory.ldapstudio.dsmlv2.engine.Dsmlv2Engine;
+import org.xmlpull.v1.XmlPullParserException;
+
+
+/**
+ * This class implements the
+ *
+ */
+public class ExecuteWizardPage extends WizardPage
+{
+ // Preferences identifiers (used to keep the last information entered in the fields)
+ public static final String HOST = "HOST";
+ public static final String PORT = "PORT";
+ public static final String USER_DN = "USER_DN";
+ public static final String INPUT_FILE_PATH = "INPUT_FILE_PATH";
+ public static final String OUTPUT_CHOICE = "OUTPUT_CHOICE";
+ public static final int OUTPUT_CHOICE_CONSOLE = 0;
+ public static final int OUTPUT_CHOICE_FILE = 1;
+ public static final String OUTPUT_FILE_PATH = "OUTPUT_FILE_PATH";
+
+ // UI fields
+ private Text host_text;
+ private Text port_text;
+ private Text userDN_text;
+ private Text password_text;
+ private Text inputFile_text;
+ private Button inputFile_button;
+ private Text outputFile_text;
+ private Button outputFile_button;
+ private Button outputFileConsoleChoice_radio;
+ private Button outputFileFileChoice_radio;
+ private Label outputFile_label;
+
+
+ /**
+ * Default constructor
+ */
+ protected ExecuteWizardPage()
+ {
+ super( "ExecuteDSML" );
+ setTitle( "Execute a DSML File" );
+ setDescription( "Executes a DSML File" );
+ setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.WIZARD_DSML ) );
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl( Composite parent )
+ {
+ Composite container = new Composite( parent, SWT.NULL );
+ GridLayout layout = new GridLayout();
+ container.setLayout( layout );
+ layout.numColumns = 1;
+
+ // Server Settings Group
+ Group serverGroup = new Group( container, SWT.NULL );
+ serverGroup.setText( "Server settings" );
+ layout = new GridLayout();
+ serverGroup.setLayout( layout );
+ layout.numColumns = 3;
+ serverGroup.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 1, 1 ) );
+
+ // Host
+ Label host_label = new Label( serverGroup, SWT.NONE );
+ host_label.setText( "Host:" );
+
+ host_text = new Text( serverGroup, SWT.BORDER );
+ host_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+ // Port
+ Label port_label = new Label( serverGroup, SWT.NONE );
+ port_label.setText( "Port:" );
+
+ port_text = new Text( serverGroup, SWT.BORDER );
+ port_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+ // User DN
+ Label userDN_label = new Label( serverGroup, SWT.NONE );
+ userDN_label.setText( "User DN:" );
+
+ userDN_text = new Text( serverGroup, SWT.BORDER );
+ userDN_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+ // Password
+ Label password_label = new Label( serverGroup, SWT.NONE );
+ password_label.setText( "Password:" );
+
+ password_text = new Text( serverGroup, SWT.BORDER | SWT.PASSWORD );
+ password_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 2, 1 ) );
+
+ // Input Group
+ Group inputGroup = new Group( container, SWT.NULL );
+ inputGroup.setText( "Input file" );
+ layout = new GridLayout();
+ inputGroup.setLayout( layout );
+ layout.numColumns = 3;
+ inputGroup.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 1, 1 ) );
+
+ // Input File
+ Label inputFile_label = new Label( inputGroup, SWT.NONE );
+ inputFile_label.setText( "Input File:" );
+
+ inputFile_text = new Text( inputGroup, SWT.BORDER );
+ inputFile_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false ) );
+
+ inputFile_button = new Button( inputGroup, SWT.BORDER );
+ inputFile_button.setText( "Browse..." );
+
+ // Output Group
+ Group outputGroup = new Group( container, SWT.NULL );
+ outputGroup.setText( "Output" );
+ layout = new GridLayout();
+ outputGroup.setLayout( layout );
+ layout.numColumns = 3;
+ outputGroup.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 1, 1 ) );
+
+ // Console
+ outputFileConsoleChoice_radio = new Button( outputGroup, SWT.RADIO );
+ outputFileConsoleChoice_radio.setText( "Show the response in a console." );
+ outputFileConsoleChoice_radio.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 3, 1 ) );
+
+ // Output File
+ outputFileFileChoice_radio = new Button( outputGroup, SWT.RADIO );
+ outputFileFileChoice_radio.setText( "Save the response to a file :" );
+ outputFileFileChoice_radio.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false, 3, 1 ) );
+
+ outputFile_label = new Label( outputGroup, SWT.NONE );
+ outputFile_label.setText( "Output File:" );
+
+ outputFile_text = new Text( outputGroup, SWT.BORDER );
+ outputFile_text.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false ) );
+
+ outputFile_button = new Button( outputGroup, SWT.BORDER );
+ outputFile_button.setText( "Browse..." );
+
+ setControl( container );
+
+ initListeners();
+ initFields();
+
+ updatePageComplete();
+ }
+
+
+ /**
+ * Initializes SWT widgets listeners
+ */
+ private void initListeners()
+ {
+ // Host
+ host_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+
+ // Port
+ port_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+
+ // User DN
+ userDN_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+
+ // Password
+ password_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+
+ // Input File Browse Button
+ inputFile_button.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ FileDialog fd = new FileDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ SWT.OPEN );
+ fd.setText( "Choose an input file." );
+ if ( ( inputFile_text.getText() == null ) || ( "".equals( inputFile_text.getText() ) ) )
+ {
+ fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
+ }
+ else
+ {
+ fd.setFilterPath( inputFile_text.getText() );
+ }
+ fd.setFilterExtensions( new String[]
+ { "*.dsml;*.DSML", "*.xml;*.XML", "*.*" } );
+ fd.setFilterNames( new String[]
+ { "DSML files", "XML files", "All files" } );
+ inputFile_text.setText( fd.open() );
+ updatePageComplete();
+ }
+ } );
+
+ // Input File Text
+ inputFile_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+
+ // Output Radio Buttons
+ outputFileFileChoice_radio.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ outputFileConsoleChoice_radio.setSelection( false );
+ outputFile_label.setEnabled( true );
+ outputFile_text.setEnabled( true );
+ outputFile_button.setEnabled( true );
+ outputFileFileChoice_radio.setSelection( true ); // We force selection
+ updatePageComplete();
+ }
+ } );
+ outputFileConsoleChoice_radio.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ outputFileFileChoice_radio.setSelection( false );
+ outputFile_label.setEnabled( false );
+ outputFile_text.setEnabled( false );
+ outputFile_button.setEnabled( false );
+ outputFileConsoleChoice_radio.setSelection( true ); // We force selection
+ updatePageComplete();
+ }
+ } );
+
+ // Output File Browse Button
+ outputFile_button.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ FileDialog fd = new FileDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ SWT.SAVE );
+ fd.setText( "Specify an output file." );
+ if ( ( outputFile_text.getText() == null ) || ( "".equals( outputFile_text.getText() ) ) )
+ {
+ fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
+ }
+ else
+ {
+ fd.setFilterPath( outputFile_text.getText() );
+ }
+ fd.setFilterExtensions( new String[]
+ { "*.dsml;*.DSML", "*.xml;*.XML", "*.*" } );
+ fd.setFilterNames( new String[]
+ { "DSML files", "XML files", "All files" } );
+ outputFile_text.setText( fd.open() );
+ updatePageComplete();
+ }
+ } );
+
+ // Output File Text
+ outputFile_text.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent e )
+ {
+ updatePageComplete();
+ }
+ } );
+ }
+
+
+ /**
+ * Initializes the fields with default value
+ */
+ private void initFields()
+ {
+ // Getting the preferences store
+ Preferences store = Activator.getDefault().getPluginPreferences();
+
+ host_text.setText( store.getString( HOST ) );
+ port_text.setText( store.getString( PORT ) );
+ userDN_text.setText( store.getString( USER_DN ) );
+
+ inputFile_text.setText( store.getString( INPUT_FILE_PATH ) );
+
+ int outputChoice = store.getInt( OUTPUT_CHOICE );
+ if ( outputChoice == OUTPUT_CHOICE_CONSOLE )
+ {
+ outputFileConsoleChoice_radio.setSelection( true );
+ outputFile_label.setEnabled( false );
+ outputFile_text.setEnabled( false );
+ outputFile_button.setEnabled( false );
+ outputFileFileChoice_radio.setSelection( false );
+ }
+ else if ( outputChoice == OUTPUT_CHOICE_FILE )
+ {
+ outputFileFileChoice_radio.setSelection( true );
+ outputFileConsoleChoice_radio.setSelection( false );
+ outputFile_text.setText( store.getString( OUTPUT_FILE_PATH ) );
+ }
+ }
+
+
+ /**
+ * Checks if the page is complete and the user allowed to hit the 'Finish' button
+ */
+ private void updatePageComplete()
+ {
+ setPageComplete( false );
+ setErrorMessage( null );
+
+ // Host
+ if ( ( host_text.getText() == null ) || ( "".equals( host_text.getText() ) ) )
+ {
+ setErrorMessage( "An host must be provided." );
+ return;
+ }
+
+ // Port
+ if ( ( port_text.getText() == null ) || ( "".equals( port_text.getText() ) ) )
+ {
+ setErrorMessage( "A port must be provided." );
+ return;
+ }
+ else
+ {
+ try
+ {
+ int port = Integer.parseInt( port_text.getText() );
+
+ if ( ( port < 0 ) || ( port > 65536 ) )
+ {
+ setErrorMessage( "The port value must be between 1 to 65536." );
+ return;
+ }
+ }
+ catch ( NumberFormatException e )
+ {
+ setErrorMessage( "The port value must be an integer." );
+ return;
+ }
+ }
+
+ // User DN
+ if ( ( userDN_text.getText() == null ) || ( "".equals( userDN_text.getText() ) ) )
+ {
+ setErrorMessage( "A user DN must be provided." );
+ return;
+ }
+
+ // Input
+ if ( ( inputFile_text.getText() == null ) || ( "".equals( inputFile_text.getText() ) ) )
+ {
+ // TODO Add verification of presence of the file
+ setErrorMessage( "An input file must be provided." );
+ return;
+ }
+ else
+ {
+ File checkFile = new File( inputFile_text.getText() );
+
+ if ( !checkFile.exists() )
+ {
+ setErrorMessage( "The input file doesn't exit." );
+ return;
+ }
+ }
+
+ // Output
+ if ( ( outputFileFileChoice_radio.getSelection() ) || ( outputFileConsoleChoice_radio.getSelection() ) )
+ {
+ if ( outputFileFileChoice_radio.getSelection()
+ && ( ( outputFile_text.getText() == null ) || ( "".equals( outputFile_text.getText() ) ) ) )
+ {
+ setErrorMessage( "An output file must be provided." );
+ return;
+ }
+ }
+
+ setPageComplete( true );
+ }
+
+
+ /**
+ * Performs any actions appropriate in response to the user having pressed the Finish
+ * button, or refuse if finishing now is not permitted.
+ * @return true to indicate the finish request was accepted, and false to indicate that
+ * the finish request was refused
+ */
+ public boolean performFinish()
+ {
+ // Getting the preferences store
+ Preferences store = Activator.getDefault().getPluginPreferences();
+
+ // Registering preferences
+ store.setValue( HOST, host_text.getText() );
+ store.setValue( PORT, port_text.getText() );
+ store.setValue( USER_DN, userDN_text.getText() );
+ store.setValue( INPUT_FILE_PATH, inputFile_text.getText() );
+ if ( outputFileFileChoice_radio.getSelection() )
+ {
+ store.setValue( OUTPUT_CHOICE, OUTPUT_CHOICE_FILE );
+ store.setValue( OUTPUT_FILE_PATH, outputFile_text.getText() );
+ }
+ else if ( outputFileConsoleChoice_radio.getSelection() )
+ {
+ store.setValue( OUTPUT_CHOICE, OUTPUT_CHOICE_CONSOLE );
+ }
+
+ int port = Integer.parseInt( port_text.getText() ); // There's no need to catch NumberFormatException Exception since the verification has already been done.
+
+ Dsmlv2Engine engine = new Dsmlv2Engine( host_text.getText(), port, userDN_text.getText(), password_text
+ .getText() );
+
+ // Processing DSMLv2 input file on the server
+ String response = null;
+ try
+ {
+ response = engine.processDSMLFile( inputFile_text.getText() );
+ }
+ catch ( FileNotFoundException e )
+ {
+ setErrorMessage( "The input file could not been found." );
+ return false;
+ }
+ catch ( XmlPullParserException e )
+ {
+ setErrorMessage( "An error ocurred when parsing the input file.\n Error: " + e.getMessage() );
+ return false;
+ }
+
+ // Managing Output
+ if ( outputFileConsoleChoice_radio.getSelection() )
+ {
+ ConsoleDialog consoleDialog = new ConsoleDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell(), response );
+ consoleDialog.open();
+ }
+ else if ( outputFileFileChoice_radio.getSelection() )
+ {
+ String outputFile = outputFile_text.getText();
+
+ if ( outputFile == null )
+ {
+ setErrorMessage( "The output file can't be null" );
+ return false;
+ }
+ File checkFile = new File( outputFile );
+
+ if ( checkFile.exists() )
+ {
+ MessageBox messageBox = new MessageBox(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_QUESTION | SWT.YES
+ | SWT.NO );
+ messageBox.setText( "Replace existing file?" ); //$NON-NLS-1$
+ messageBox
+ .setMessage( "The file " + checkFile.getName() + "already exists. Do you want to replace it?" ); //$NON-NLS-1$ //$NON-NLS-2$
+ if ( SWT.YES != messageBox.open() )
+ {
+ return false;
+ }
+ else
+ {
+ checkFile.delete();
+ }
+ }
+ else
+ {
+ // File doesn't exists, but does parent directories exists ?
+ String parentPathName = checkFile.getParent();
+ if ( parentPathName == null )
+ {
+ setErrorMessage( "The path to the destination file seems to be wrong" );
+ return false;
+ }
+ else
+ {
+ File parent = new File( parentPathName );
+ if ( !parent.exists() )
+ {
+ MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO );
+ messageBox.setText( "Create directory?" );
+ messageBox.setMessage( "ExportWizard.Target_directory_doesnt_exist" );
+ if ( SWT.YES != messageBox.open() )
+ {
+ return false;
+ }
+ else
+ {
+ // Creating target directory (and its sub-directories if necessary)
+ parent.mkdirs();
+ }
+ }
+ }
+ }
+
+ // Saving the file to disk
+ try
+ {
+ // Open an output stream
+ FileOutputStream fout = new FileOutputStream( checkFile );
+
+ // Print a line of text
+ new PrintStream( fout ).println( response );
+
+ // Close our output stream
+ fout.close();
+ }
+ // Catches any error conditions
+ catch ( IOException e )
+ {
+ setErrorMessage( "An error ocurred when writine file to disk" );
+ return false;
+ }
+ }
+
+ return false;
+ }
+}
Added: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ImageKeys.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ImageKeys.java?view=auto&rev=475810
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ImageKeys.java (added)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-dsml-plugin/src/main/java/org/apache/directory/ldapstudio/dsmlv2/view/ImageKeys.java Thu Nov 16 08:51:36 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.dsmlv2.view;
+
+
+/**
+ * This class is used to define path for images
+ */
+public class ImageKeys
+{
+ /** The DSML Wizard icon */
+ public static final String WIZARD_DSML = "resources/icons/wizard_DSML.png";
+}