Index: tmp/org.txm.imports.metopes/bin/org/txm/imports/metopes/DoInstallStep.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.imports.metopes/bin/org/txm/imports/metopes/DoInstallStep.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.imports.metopes/bin/org/txm/imports/metopes/Activator.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.imports.metopes/bin/org/txm/imports/metopes/Activator.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.imports.metopes/bin/org/txm/xml/xsl/metopes/test.xsl
===================================================================
Index: tmp/org.txm.imports.metopes/bin/org/txm/importer/metopes/metopesLoader.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.imports.metopes/bin/org/txm/importer/metopes/metopesLoader.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.imports.metopes/bin/org/txm/importer/metopes/preferences/MetopesPreferences.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.imports.metopes/bin/org/txm/importer/metopes/preferences/MetopesPreferences.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.imports.metopes/bin/org/txm/macro/metopes/testMacro.class
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: tmp/org.txm.imports.metopes/bin/org/txm/macro/metopes/testMacro.class
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: tmp/org.txm.imports.metopes/res/org/txm/xml/xsl/metopes/test.xsl
===================================================================

Property changes on: tmp/org.txm.imports.metopes/res/org/txm/xml/xsl/metopes/test.xsl
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/build.properties
===================================================================
--- tmp/org.txm.imports.metopes/build.properties	(revision 0)
+++ tmp/org.txm.imports.metopes/build.properties	(revision 472)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Property changes on: tmp/org.txm.imports.metopes/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/plugin.xml
===================================================================
--- tmp/org.txm.imports.metopes/plugin.xml	(revision 0)
+++ tmp/org.txm.imports.metopes/plugin.xml	(revision 472)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
+         <command
+               commandId="org.txm.rcpapplication.commands.ExecuteScriptImport"
+               label="XML-TEI Metopes"
+               style="push"
+               tooltip="Metopes">
+            <parameter
+                  name="org.txm.rcpapplication.commands.commandParameter3"
+                  value="metopesLoader.groovy">
+            </parameter>
+         </command>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.txm.rcp.extentionpoint.command">
+      <installcommand
+            class="org.txm.imports.metopes.DoInstallStep">
+      </installcommand>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.imports.metopes/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.imports.metopes/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.imports.metopes/.settings/org.eclipse.jdt.core.prefs	(revision 472)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

Property changes on: tmp/org.txm.imports.metopes/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/.classpath
===================================================================
--- tmp/org.txm.imports.metopes/.classpath	(revision 0)
+++ tmp/org.txm.imports.metopes/.classpath	(revision 472)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
+	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.imports.metopes/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.imports.metopes/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.imports.metopes/META-INF/MANIFEST.MF	(revision 472)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Metopes
+Bundle-SymbolicName: org.txm.imports.metopes;singleton:=true
+Bundle-Version: 1.0.1.qualifier
+Bundle-Activator: org.txm.imports.metopes.Activator
+Require-Bundle: org.txm.core;bundle-version="0.7.0",
+ org.txm.rcp;bundle-version="0.7.8",
+ org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy

Property changes on: tmp/org.txm.imports.metopes/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/.project
===================================================================
--- tmp/org.txm.imports.metopes/.project	(revision 0)
+++ tmp/org.txm.imports.metopes/.project	(revision 472)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.imports.metopes</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.jdt.groovy.core.groovyNature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.imports.metopes/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/Activator.java
===================================================================
--- tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/Activator.java	(revision 0)
+++ tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/Activator.java	(revision 472)
@@ -0,0 +1,50 @@
+package org.txm.imports.metopes;
+
+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.txm.imports.metopes"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (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;
+	}
+
+}

Property changes on: tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/Activator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/DoInstallStep.java
===================================================================
--- tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/DoInstallStep.java	(revision 0)
+++ tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/DoInstallStep.java	(revision 472)
@@ -0,0 +1,68 @@
+package org.txm.imports.metopes;
+
+import java.io.File;
+
+import org.osgi.framework.Version;
+import org.txm.PostInstallationStep;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.importer.metopes.preferences.MetopesPreferences;
+import org.txm.utils.BundleUtils;
+import org.txm.utils.logger.Log;
+
+/**
+ * Copy macros from bundle to TXM macro directory
+ * 
+ * @author mdecorde
+ *
+ */
+public class DoInstallStep  extends PostInstallationStep {
+
+	/** The ID. */
+	public static String ID = "org.txm.imports.metopes.DoInstallStep"; //$NON-NLS-1$
+	public static final String VERSION = "org.txm.imports.metopes.version";
+
+	public DoInstallStep() { name = "Metopes"; }
+	
+	public void install() { // after the Toolbox is initialized
+		
+		Log.info("Metopes.DoInstallStep.install()");
+		String saved = TXMPreferences.getString(MetopesPreferences.VERSION, MetopesPreferences.PREFERENCES_NODE);
+		Version currentVersion = BundleUtils.getBundleVersion("org.txm.imports.metopes");
+		
+		if (saved != null && saved.length() > 0) {
+			Version savedVersion = new Version(saved);
+			if (currentVersion.compareTo(savedVersion) <= 0) {
+				Log.info("No post-installation of Metopes to do");
+				//System.out.println("No post-installation of Metopes to do");
+				return; // nothing to do
+			}
+		}
+		System.out.println("Post-installing Metopes version="+currentVersion);
+		
+		File macroDirectory = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "scripts/macro/org/txm/macro");
+		macroDirectory.mkdirs();
+		if (!BundleUtils.copyFiles("org.txm.imports.metopes", "src", "org/txm/macro/", "metopes", macroDirectory)) {
+			System.out.println("Error while coping Metopes org/txm/macro/metopes in "+macroDirectory.getAbsolutePath());
+			return;
+		}
+		
+		File importDirectory = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "scripts/import");
+		importDirectory.mkdirs();
+		if (!BundleUtils.copyFiles("org.txm.imports.metopes", "src", "org/txm/importer/metopes", "metopesLoader.groovy", importDirectory)) {
+			System.out.println("Error while coping Metopes org/txm/importer/metopes in "+importDirectory.getAbsolutePath());
+			return;
+		}
+		
+		File xslDirectory = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "xsl");
+		xslDirectory.mkdirs();
+		if (!BundleUtils.copyFiles("org.txm.imports.metopes", "res", "org/txm/xml/xsl", "metopes", xslDirectory)) {
+			System.out.println("Error while coping Metopes org/txm/xml/xsl/metopes in "+xslDirectory.getAbsolutePath());
+			return;
+		}
+		
+		Log.warning("Metopes post-installation done.");
+		TXMPreferences.put(MetopesPreferences.PREFERENCES_NODE, MetopesPreferences.VERSION, currentVersion.toString());
+		return;
+	}
+}

Property changes on: tmp/org.txm.imports.metopes/src/org/txm/imports/metopes/DoInstallStep.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/metopesLoader.groovy
===================================================================
--- tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/metopesLoader.groovy	(revision 0)
+++ tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/metopesLoader.groovy	(revision 472)
@@ -0,0 +1 @@
+package org.txm.importer.metopes
Index: tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/preferences/MetopesPreferences.java
===================================================================
--- tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/preferences/MetopesPreferences.java	(revision 0)
+++ tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/preferences/MetopesPreferences.java	(revision 472)
@@ -0,0 +1,18 @@
+package org.txm.importer.metopes.preferences;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+public class MetopesPreferences extends TXMPreferences{
+
+	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(MetopesPreferences.class).getSymbolicName();
+	public static final String VERSION = "metopes.version"; //$NON-NLS-1$
+	
+	@Override
+	public void initializeDefaultPreferences() {
+		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+		preferences.put(VERSION, "");
+	}
+}

Property changes on: tmp/org.txm.imports.metopes/src/org/txm/importer/metopes/preferences/MetopesPreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.imports.metopes/src/org/txm/macro/metopes/testMacro.groovy
===================================================================
--- tmp/org.txm.imports.metopes/src/org/txm/macro/metopes/testMacro.groovy	(revision 0)
+++ tmp/org.txm.imports.metopes/src/org/txm/macro/metopes/testMacro.groovy	(revision 472)
@@ -0,0 +1,3 @@
+package org.txm.macro.metopes
+
+println "test"
\ No newline at end of file
