[teiid-commits] teiid SVN: r2002 - in trunk: adminshell/src/main/resources and 2 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Mar 25 16:13:40 EDT 2010


Author: shawkins
Date: 2010-03-25 16:13:40 -0400 (Thu, 25 Mar 2010)
New Revision: 2002

Added:
   trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java
   trunk/adminshell/src/main/resources/connector.xsl
   trunk/adminshell/src/main/resources/vdb.xsl
   trunk/build/kit-adminshell/migrate.bat
   trunk/build/kit-adminshell/migrate.sh
Modified:
   trunk/client/src/main/resources/vdb-deployer.xsd
Log:
TEIID-833 adding a migration tool to quickly modifiy older vdbs

Added: trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java	                        (rev 0)
+++ trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java	2010-03-25 20:13:40 UTC (rev 2002)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import com.metamatrix.common.util.ApplicationInfo;
+import com.metamatrix.core.util.FileUtils;
+import com.metamatrix.core.util.ObjectConverterUtil;
+
+ at SuppressWarnings("nls")
+public class MigrationUtil {
+
+	//TODO: sys out info on what ds needs creating
+	public static void main(String[] args) throws IOException, TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException {
+		if (args.length != 1) {
+			System.err.println(
+					"Teiid 7.0 VDB Migration Utility" +
+					"\n\nUsage:" +
+					"\n  A vdb or .def file must be specified as the only argument." +
+					"\n\nResult:"+
+					"\n  7.0 compatible replacement files will be created in the same directory " +
+					"\n  as your file." +
+					"\n  If you supply a vdb, the new vdb file will have a _70.vdb suffix." +
+					"\n  If you supply a dynamic vdb file, then two new files will be created: " +
+					"\n  <file name>-vdb.xml and <file name>-bindings.xml" +
+					"\n\nNote: this program will only create connector binding connection factories " +
+					"\n      if the bindings are present in the specified file." +
+					"\n\nNote: this program will NOT create the -ds.xml files needed by JBoss to " +
+					"\n      create underlying DataSource connection pools." +
+					"\n      You will need to manually create one -ds.xml for each JDBC DataSource " +
+					"\n      with a JNDI name of <connector binding name>DS, " +
+					"\n      where any spaces in the name are replace by _"); 
+			System.exit(-1);
+		}
+		File file = new File(args[0]);
+		if (!file.exists()) {
+			System.err.println(args[0] + " does not exist."); //$NON-NLS-1$
+			System.exit(-1);
+		}
+		String fullName = file.getName();
+		String fileName = fullName.substring(0, fullName.length() - 4);
+		String ext = FileUtils.getExtension(file);
+		if (ext == null) {
+			System.err.println(fullName + " is not a vdb or xml file."); //$NON-NLS-1$
+			System.exit(-1);
+		}
+		ext = ext.toLowerCase();
+		if (ext.endsWith("vdb")) {
+			File dir = createTempDirectory();
+			try {
+				extract(file, dir);
+				File metainf = new File(dir, "META-INF");
+				File config = new File(dir, "ConfigurationInfo.def"); 
+				File manifest = new File(dir, "MetaMatrix-VdbManifestModel.xmi");
+				if (manifest.exists()) {
+					String configStr = ObjectConverterUtil.convertFileToString(config);
+					String manifestStr = ObjectConverterUtil.convertFileToString(manifest);
+					int index = configStr.lastIndexOf("</VDB>");
+					int manifestBegin = manifestStr.indexOf("<xmi");
+					configStr = configStr.substring(0, index) + manifestStr.substring(manifestBegin) + "</VDB>";
+					FileUtils.write(configStr.getBytes(), config);
+					manifest.delete();
+				}
+				transformConfig(config, "/vdb.xsl", new StreamResult(new File(metainf, "vdb.xml")));
+				transformConfig(config, "/connector.xsl", new StreamResult(new File(metainf, "bindings-ds.xml")));
+				config.delete();
+				FileOutputStream out = new FileOutputStream(new File(file.getParent(), fileName + "_70.vdb"));
+				ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(out));
+				int parentLength = dir.getPath().length();
+				addDirectory(dir, zos, parentLength);
+				zos.close();
+			} finally {
+				FileUtils.removeDirectoryAndChildren(dir);
+			}
+		} else if (ext.endsWith("xml") || ext.endsWith("def")){
+			File parent = file.getParentFile();
+			transformConfig(file, "/vdb.xsl", new StreamResult(new File(parent, fileName + "-vdb.xml")));
+			transformConfig(file, "/connector.xsl", new StreamResult(new File(parent, fileName + "-bindings-ds.xml")));
+		} else {
+			System.err.println(fullName + " is not a vdb or xml file.  Run with no arguments for help."); //$NON-NLS-1$
+			System.exit(-1);
+		}
+	}
+
+	private static void addDirectory(File dir, ZipOutputStream zos,
+			int parentLength) throws IOException {
+		String[] files = dir.list();
+		for (String entry : files) {
+			File f = new File(dir, entry);
+			if (f.isDirectory()) {
+				addDirectory(f, zos, parentLength);
+			} else {
+				ZipEntry e = new ZipEntry(f.getPath().substring(parentLength));
+				zos.putNextEntry(e);
+				FileUtils.write(f, zos);
+				zos.closeEntry();
+			}
+		}
+	}
+
+	private static void transformConfig(File config, String styleSheet, Result target)
+			throws TransformerFactoryConfigurationError,
+			TransformerConfigurationException, TransformerException {
+		TransformerFactory tf = TransformerFactory.newInstance();
+		Transformer t = tf.newTransformer(new StreamSource(MigrationUtil.class.getResourceAsStream(styleSheet)));
+		t.setParameter("version", ApplicationInfo.getInstance().getReleaseNumber()); //$NON-NLS-1$
+		t.transform(new StreamSource(config), target);
+	}
+
+	/**
+	 * Extract the given zip file to the given destination directory base.
+	 * 
+	 * @param zipFileName
+	 *            The full path and file name of the Zip file to extract.
+	 * @param destinationDirectory
+	 *            The root directory to extract to.
+	 * @throws IOException
+	 */
+	static void extract(final File sourceZipFile, File unzipDestinationDirectory) throws IOException {
+		// Open Zip file for reading
+		ZipFile zipFile = new ZipFile(sourceZipFile, ZipFile.OPEN_READ);
+
+		// Create an enumeration of the entries in the zip file
+		Enumeration zipFileEntries = zipFile.entries();
+
+		// Process each entry
+		while (zipFileEntries.hasMoreElements()) {
+			// grab a zip file entry
+			ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();
+
+			String currentEntry = entry.getName();
+
+			File destFile = new File(unzipDestinationDirectory, currentEntry);
+
+			// grab file's parent directory structure
+			File destinationParent = destFile.getParentFile();
+
+			// create the parent directory structure if needed
+			destinationParent.mkdirs();
+
+			// extract file if not a directory
+			if (!entry.isDirectory()) {
+				ObjectConverterUtil.write(zipFile.getInputStream(entry),
+						destFile);
+			}
+		}
+		zipFile.close();
+	}
+
+	static File createTempDirectory() throws IOException {
+		File temp = File.createTempFile("temp", Long.toString(System.nanoTime()));
+
+		temp.delete();
+
+		if (!(temp.mkdir())) {
+			throw new IOException("Could not create temp directory: "
+					+ temp.getAbsolutePath());
+		}
+
+		return temp;
+	}
+
+}


Property changes on: trunk/adminshell/src/main/java/org/teiid/MigrationUtil.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/adminshell/src/main/resources/connector.xsl
===================================================================
--- trunk/adminshell/src/main/resources/connector.xsl	                        (rev 0)
+++ trunk/adminshell/src/main/resources/connector.xsl	2010-03-25 20:13:40 UTC (rev 2002)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:param name="version">7.0</xsl:param>
+	<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
+	<xsl:strip-space elements="*"/>
+	<xsl:template match="Header"/>
+	<xsl:template match="VDB/ConnectorBindings/Connector">
+		<no-tx-connection-factory>
+		   <jndi-name><xsl:value-of select="translate(@Name, ' ', '_')" /></jndi-name>
+		   <xsl:choose>
+		   	<xsl:when test="@ComponentType='Text File Connector'">
+		   	<rar-name>connector-text-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="starts-with(@ComponentType,'Apache ') or starts-with(@ComponentType,'MySQL ')
+		   	   or starts-with(@ComponentType,'Oracle ') or starts-with(@ComponentType,'PostgreSQL ')
+		   	   or starts-with(@ComponentType,'SQL Server ') or starts-with(@ComponentType,'DB2 ')
+		   	   or starts-with(@ComponentType,'MS Access ') or starts-with(@ComponentType,'MS Excel ')
+		   	   or starts-with(@ComponentType,'JDBC ') or starts-with(@ComponentType,'Teiid ')
+		   	   or starts-with(@ComponentType,'MM ') or starts-with(@ComponentType,'H2 ')
+		   	   or starts-with(@ComponentType,'HSQLDB ') or starts-with(@ComponentType,'Sybase ')
+		   	   ">
+		   	<rar-name>connector-jdbc-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='LDAP Connector'">
+		   	<rar-name>connector-ldap-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='Loopback Connector'">
+		   	<rar-name>connector-loopback-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='Salesforce Connector'">
+		   	<rar-name>connector-salesforce-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='XML File Connector' or @ComponentType='XML-Relational File Connector'">
+		   	<rar-name>connector-xml-file-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='XML SOAP Connector' or @ComponentType='XML-Relational Soap Connector'">
+		   	<rar-name>connector-xml-soap-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   	<xsl:when test="@ComponentType='XML-Relational HTTP Connector'">
+		   	<rar-name>connector-xml-http-<xsl:value-of select="$version"/>.rar</rar-name>
+		   	</xsl:when>
+		   </xsl:choose>
+	                <connection-definition>org.teiid.connector.api.Connector</connection-definition>
+		   <xsl:for-each select="Properties/Property">
+		   		<xsl:choose>
+		   			<xsl:when test="@Name='ConnectorMaxConnections' or @Name='UsePostDelegation'
+		   		or @Name='ConnectorThreadTTL' or @Name='DeployedName'
+		   		or @Name='ConnectorMaxThreads'
+		        or @Name='ConnectorClassPath' or @Name='SourceConnectionTestInterval'
+		        or @Name='metamatrix.service.essentialservice' or @Name='ServiceMonitoringEnabled'
+		        or @Name='ConnectorClass' or @Name='ServiceClassName'
+		        or @Name='SynchWorkers' or @Name='UseCredentialMap'
+		        or @Name='ConnectionPoolEnabled' or @Name='AdminConnectionsAllowed'
+		        or @Name='com.metamatrix.data.pool.max_connections_for_each_id' or @Name='com.metamatrix.data.pool.live_and_unused_time'
+		        or @Name='com.metamatrix.data.pool.wait_for_source_time' or @Name='com.metamatrix.data.pool.cleaning_interval'
+		        or @Name='com.metamatrix.data.pool.enable_shrinking' or starts-with(@Name, 'getMax')
+		        or starts-with(@Name, 'supports') or starts-with(@Name, 'getSupported')
+		        or @Name='requiresCriteria' or @Name='useAnsiJoin'
+		        or @Name='URL' or @Name='ConnectionSource'
+		        or @Name='User' or @Name='Password'"/>
+		        	<xsl:when test="@Name='MaxResultRows' and text()='0'">
+     	        <config-property>
+		           <xsl:attribute name="name">
+		           	<xsl:value-of select="@Name"/>
+		           </xsl:attribute>-1</config-property>		        	
+		        	</xsl:when>
+		   			<xsl:otherwise>
+     	        <config-property>
+		           <xsl:attribute name="name">
+		           	<xsl:value-of select="@Name"/>
+		           </xsl:attribute>
+		           <xsl:value-of select="text()"/>
+		        </config-property>
+		   			</xsl:otherwise>
+		   		</xsl:choose>
+		   </xsl:for-each>
+		   <xsl:if test="starts-with(@ComponentType,'Apache ') or starts-with(@ComponentType,'MySQL ')
+		   	   or starts-with(@ComponentType,'Oracle ') or starts-with(@ComponentType,'PostgreSQL ')
+		   	   or starts-with(@ComponentType,'SQL Server ') or starts-with(@ComponentType,'DB2 ')
+		   	   or starts-with(@ComponentType,'MS Access ') or starts-with(@ComponentType,'MS Excel ')
+		   	   or starts-with(@ComponentType,'JDBC ') or starts-with(@ComponentType,'Teiid ')
+		   	   or starts-with(@ComponentType,'MM ') or starts-with(@ComponentType,'H2 ')
+		   	   or starts-with(@ComponentType,'HSQLDB ') or starts-with(@ComponentType,'Sybase ')
+		   	   ">
+		   <config-property name="SourceJNDIName">java:<xsl:value-of select="translate(@Name, ' ', '_')" />DS</config-property>
+		  	<xsl:choose>
+			<xsl:when test="starts-with(@ComponentType,'Apache ')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.derby.DerbySQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'MySQL 5 ')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.mysql.MySQL5Translator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'MySQL JDBC')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.mysql.MySQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'Oracle')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.oracle.OracleSQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'PostgreSQL')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'SQL Server')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.sqlserver.SQLServerSQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'DB2')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.sqlserver.DB2SQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'H2')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.h2.H2Translator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'HSQLDQ')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.hsql.HSSQLTranslator</config-property>
+		  	</xsl:when>
+			<xsl:when test="starts-with(@ComponentType,'Sybase')">
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.sybase.SybaseSQLTranslator</config-property>
+		  	</xsl:when>
+		  	<xsl:otherwise>
+		   <config-property name="ExtensionTranslationClassName">org.teiid.connector.jdbc.translator.Translator</config-property>
+		  	</xsl:otherwise>
+		   	</xsl:choose>
+		   </xsl:if>
+		   <xsl:if test="contains(@ComponentType,'XA')">
+		   <config-property name="IsXA">true</config-property>
+		   </xsl:if>
+		   <xsl:if test="Properties/Property[@Name='ConnectorMaxConnections']">
+		   <max-pool-size><xsl:value-of select="Properties/Property[@Name='ConnectorMaxConnections']/text()"/></max-pool-size>
+		   </xsl:if>
+		</no-tx-connection-factory>
+	</xsl:template>
+</xsl:stylesheet>


Property changes on: trunk/adminshell/src/main/resources/connector.xsl
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/adminshell/src/main/resources/vdb.xsl
===================================================================
--- trunk/adminshell/src/main/resources/vdb.xsl	                        (rev 0)
+++ trunk/adminshell/src/main/resources/vdb.xsl	2010-03-25 20:13:40 UTC (rev 2002)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="xml" indent="yes" />
+	<xsl:strip-space elements="*" />
+	<xsl:template match="VDB">
+		<vdb>
+			<xsl:attribute name="name"><xsl:value-of select="VDBInfo/Property[@Name='Name']/@Value" /></xsl:attribute>
+			<xsl:attribute name="version"><xsl:value-of select="VDBInfo/Property[@Name='Version']/@Value" /></xsl:attribute>
+			<xsl:if test="VDBInfo/Property[@Name='Description']">
+				<description><xsl:value-of select="VDBInfo/Property[@Name='Description']/@Value" /></description>
+			</xsl:if>
+			<xsl:for-each select="VDBInfo/Property">
+				<xsl:if
+					test="@Name!='Name' and @Name!='Version' and @Name!='Description' and @Name!='GUID' and @Name!='VDBArchiveName'">
+					<property>
+						<xsl:attribute name="name"><xsl:value-of select="@Name" /></xsl:attribute>
+						<xsl:attribute name="value"><xsl:value-of select="@Value" /></xsl:attribute>
+					</property>
+				</xsl:if>
+			</xsl:for-each>
+			<xsl:for-each select="Model">
+				<model>
+					<xsl:attribute name="name"><xsl:value-of select="Property[@Name='Name']/@Value" /></xsl:attribute>
+					<xsl:if test="Property[@Name='Visibility' and @Value='Private']">
+						<xsl:attribute name="visible">false</xsl:attribute>
+					</xsl:if>
+					<xsl:variable name="name" select="Property[@Name='Name']/@Value" />
+					<xsl:if test="//models[starts-with(@name, concat($name, '.'))]">
+						<xsl:attribute name="type"><xsl:value-of
+							select="//models[starts-with(@name, concat($name, '.'))]/@modelType" /></xsl:attribute>
+					</xsl:if>
+					<xsl:for-each select="Property">
+						<xsl:if test="@Name!='Name' and @Name!='Visibility'">
+							<property>
+								<xsl:attribute name="name"><xsl:value-of select="@Name" /></xsl:attribute>
+								<xsl:attribute name="value"><xsl:value-of select="@Value" /></xsl:attribute>
+							</property>
+						</xsl:if>
+					</xsl:for-each>
+					<xsl:for-each select="ConnectorBindings/Connector">
+						<source>
+							<xsl:attribute name="name"><xsl:value-of select="@Name" /></xsl:attribute>
+							<xsl:attribute name="jndi-name"><xsl:value-of select="concat('java:',translate(@Name, ' ', '_'))" /></xsl:attribute>
+						</source>
+					</xsl:for-each>
+				</model>
+			</xsl:for-each>
+		</vdb>
+	</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file


Property changes on: trunk/adminshell/src/main/resources/vdb.xsl
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/build/kit-adminshell/migrate.bat
===================================================================
--- trunk/build/kit-adminshell/migrate.bat	                        (rev 0)
+++ trunk/build/kit-adminshell/migrate.bat	2010-03-25 20:13:40 UTC (rev 2002)
@@ -0,0 +1,64 @@
+ at ECHO OFF
+ at setlocal
+
+ at REM JBoss, Home of Professional Open Source.
+ at REM Copyright (C) 2008 Red Hat, Inc.
+ at REM Licensed to Red Hat, Inc. under one or more contributor 
+ at REM license agreements.  See the copyright.txt file in the
+ at REM distribution for a full listing of individual contributors.
+ at REM 
+ at REM This library is free software; you can redistribute it and/or
+ at REM modify it under the terms of the GNU Lesser General Public
+ at REM License as published by the Free Software Foundation; either
+ at REM version 2.1 of the License, or (at your option) any later version.
+ at REM 
+ at REM This library is distributed in the hope that it will be useful,
+ at REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+ at REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ at REM Lesser General Public License for more details.
+ at REM 
+ at REM You should have received a copy of the GNU Lesser General Public
+ at REM License along with this library; if not, write to the Free Software
+ at REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ at REM 02110-1301 USA.
+
+ at REM This assumes it's run from its installation directory. It is also assumed there is a java
+ at REM executable defined along the PATH
+
+ at if not "%ECHO%" == ""  echo %ECHO%
+ at if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+  set "DIRNAME=%~dp0%"
+) else (
+  set DIRNAME=.\
+)
+
+pushd %DIRNAME%
+if "x%TEIID_HOME%" == "x" (
+  set "TEIID_HOME=%CD%"
+)
+popd
+
+set DIRNAME=
+
+if "x%JAVA_HOME%" == "x" (
+  set  JAVA=java
+  echo JAVA_HOME is not set. Unexpected results may occur.
+  echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
+) else (
+  set "JAVA=%JAVA_HOME%\bin\java"
+  if exist "%JAVA_HOME%\lib\tools.jar" (
+    set "JAVAC_JAR=%JAVA_HOME%\lib\tools.jar"
+  )
+)
+
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\lib\*;
+
+rem JVM memory allocation pool parameters. Modify as appropriate.
+set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -XX:MaxPermSize=256m
+set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.config.file=log.properties
+
+"%JAVA%" %JAVA_OPTS% ^
+   -classpath "%TEIID_CLASSPATH%" ^
+   org.teiid.MigrationUtil %*


Property changes on: trunk/build/kit-adminshell/migrate.bat
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/build/kit-adminshell/migrate.sh
===================================================================
--- trunk/build/kit-adminshell/migrate.sh	                        (rev 0)
+++ trunk/build/kit-adminshell/migrate.sh	2010-03-25 20:13:40 UTC (rev 2002)
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# JBoss, Home of Professional Open Source.
+# Copyright (C) 2008 Red Hat, Inc.
+# Licensed to Red Hat, Inc. under one or more contributor 
+# license agreements.  See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+# 
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+DIRNAME=`dirname $0`
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+linux=false;
+case "`uname`" in
+    CYGWIN*)
+        cygwin=true
+        ;;
+        
+    Linux)
+        linux=true
+        ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+    [ -n "$TEIID_HOME" ] &&
+        TEIID_HOME=`cygpath --unix "$TEIID_HOME"`
+    [ -n "$JAVA_HOME" ] &&
+        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Setup TEIID_HOME
+if [ "x$TEIID_HOME" = "x" ]; then
+    # get the full path (without any relative bits)
+    TEIID_HOME=`cd $DIRNAME; pwd`
+fi
+export TEIID_HOME
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+    if [ "x$JAVA_HOME" != "x" ]; then
+	JAVA="$JAVA_HOME/bin/java"
+    else
+	JAVA="java"
+    fi
+fi
+
+# JPDA options. Uncomment and modify as appropriate to enable remote debugging.
+# JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/lib/*"
+JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx256m -XX:MaxPermSize=256m"
+JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.config.file=log.properties"
+
+$JAVA $JAVA_OPTS -cp $TEIID_CLASSPATH -Xmx256m  org.teiid.MigrationUtil $*
\ No newline at end of file


Property changes on: trunk/build/kit-adminshell/migrate.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/client/src/main/resources/vdb-deployer.xsd
===================================================================
--- trunk/client/src/main/resources/vdb-deployer.xsd	2010-03-25 16:55:55 UTC (rev 2001)
+++ trunk/client/src/main/resources/vdb-deployer.xsd	2010-03-25 20:13:40 UTC (rev 2002)
@@ -42,6 +42,10 @@
 									<xs:enumeration value="PHYSICAL"/>
 									<xs:enumeration value="VIRTUAL"/>
 									<xs:enumeration value="FUNCTION"/>
+									<xs:enumeration value="TYPE"/>
+									<xs:enumeration value="EXTENSION"/>
+									<xs:enumeration value="LOGICAL"/>
+									<xs:enumeration value="MATERIALIZATION"/>
 								</xs:restriction>
 							</xs:simpleType>
 						</xs:attribute>



More information about the teiid-commits mailing list