/*
*    jETeL/Clover - Java based ETL application framework.
*    Copyright (C) 2002  David Pavlis
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*    This program 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 General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

package javaExamples;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import org.jetel.component.ComponentFactory;
import org.jetel.data.Defaults;
import org.jetel.graph.TransformationGraph;
import org.jetel.graph.TransformationGraphXMLReaderWriter;

public class testXMLGraph{

	public static void main(String args[]){
		FileInputStream in;
        
        //initialization; must be present
        Defaults.init();
        ComponentFactory.init();

		System.out.println("Graph definition file: "+args[0]);
		
		try{
			in=new FileInputStream(args[0]);
		}
		catch(FileNotFoundException e){
			e.printStackTrace();
			return;
		}
		
		
		TransformationGraph graph= new TransformationGraph();
		TransformationGraphXMLReaderWriter graphReader=new TransformationGraphXMLReaderWriter(graph);
		
		try{
			graphReader.read(in);
		}catch(Exception ex){
			ex.printStackTrace();
		}
		
		if(!graph.init()){
		System.err.println("Graph initialization failed !");
		return;
		}
		
		graph.dumpGraphConfiguration();
		
		if (!graph.run()){ // start all Nodes (each node is one thread)
		System.out.println("Failed starting all nodes!");
		return;		
		}
	
	}











}

@@ -1102,16 +1102,49 @@
 rWriter;
+%0Aimport org.jetel.plugin.Plugins;
 %0A%0Apublic
@@ -1212,27 +1212,247 @@
 %7B%0A%09%09
-FileInputStream in;
+%0A%09%09if (args.length%3C1)%7B%0A%09%09%09System.out.println(%22Usage: testXMLGraph %3Cgraph file name%3E %3Cplug-ins directory%3E%22);%0A%09%09%7D%0A%09%09%0A%09%09FileInputStream in;%0A%09%09String plugins;%0A%09%09if (args.length==1)%7B%0A%09%09%09plugins = %22../plugins%22;%0A%09%09%7Delse%7B%0A%09%09%09plugins = args%5B1%5D;%0A%09%09%7D
 %0A   
@@ -1524,16 +1524,47 @@
 init();%0A
+        Plugins.init(plugins);%0A
         
@@ -1646,16 +1646,69 @@
 gs%5B0%5D);%0A
+%09%09System.out.println(%22Plugins directory: %22+plugins);%0A
 %09%09%0A%09%09try

change example to ver. 2