Index: trunk/greenstone3-extensions/vishnu/src/vishnu/builder/CollectionBuilder.java
===================================================================
--- trunk/greenstone3-extensions/vishnu/src/vishnu/builder/CollectionBuilder.java	(revision 8289)
+++ trunk/greenstone3-extensions/vishnu/src/vishnu/builder/CollectionBuilder.java	(revision 8290)
@@ -12,9 +12,10 @@
     String collDesc;
     String indexer;
+    boolean use_views;
     long numDocs=0;
     
     private static void usage()
     {
-	System.out.println("java vishnu.builder.CollectionBuilder\n -collsHome (directory where collections live) \n -collection (directory name of collection)\n -name (descriptive name for collection) \n -description (collection description)\n -index (\"mg\" or \"luc\")");
+	System.out.println("java vishnu.builder.CollectionBuilder\n -collsHome (directory where collections live) \n -collection (directory name of collection)\n -name (descriptive name for collection) \n -description (collection description)\n -index (\"mg\" or \"luc\")\n [-use_views]");
     }
     
@@ -32,5 +33,5 @@
 	String collDesc = "";
 	String indexer = null;
-	
+	boolean use_views = false;
 	int a = 0;
 	while( a < args.length ){
@@ -47,4 +48,6 @@
 	    else if( args[a].equals("-index") )
 		indexer = args[++a];
+	    else if (args[a].equals("-use_views")) 
+		use_views = true;
 	    a++;
 	}
@@ -66,10 +69,10 @@
 	String coll_home = collsHome + collID + File.separator;
 	//CollectionBuilder cb = new CollectionBuilder(site,collName,gHome,indexer);
-	CollectionBuilder cb = new CollectionBuilder(coll_home,collID, collName,collDesc, indexer);
-    }
-    
-    
-    
-    public CollectionBuilder(String coll_home, String coll_id, String coll_name,String coll_desc,  String ind)
+	CollectionBuilder cb = new CollectionBuilder(coll_home,collID, collName,collDesc, indexer, use_views);
+    }
+    
+    
+    
+    public CollectionBuilder(String coll_home, String coll_id, String coll_name,String coll_desc,  String ind, boolean use_views)
     {
 	this.collHome = coll_home;
@@ -78,5 +81,6 @@
 	this.collDesc = coll_desc;
 	this.indexer = ind;
-
+	this.use_views = use_views;
+	
 	if (!setupCollection()) {
 	    System.err.println("Couldn't setup the collection. Quitting build");
@@ -144,4 +148,8 @@
 	    buffer.append("\" />");
 	    
+	    // add in views
+	    if (use_views) {
+
+	    }
 	    out.print(buffer.toString());
 	    out.close();
@@ -185,13 +193,13 @@
     private void CKIndexing()
     {
-	CKWrapper ckw = new CKWrapper();
-	
+	//CKWrapper ckw = new CKWrapper();
+	CKIndexer cki = new CKIndexer();
 	String in = collHome + "import"+File.separator;
 	String out = collHome + "building"+File.separator+"ck_index"+File.separator;
 	
-	ckw.setCollectionName(collID);
-	ckw.setOutputDirectory(out);
-	ckw.setInputDirectory(in);
-	ckw.startIndexing();
+	cki.setCollectionName(collID);
+	cki.setOutputDirectory(out);
+	cki.setInputDirectory(in);
+	cki.startIndexing();
     }
     
Index: trunk/greenstone3-extensions/vishnu/src/vishnu/builder/Indexer.java
===================================================================
--- trunk/greenstone3-extensions/vishnu/src/vishnu/builder/Indexer.java	(revision 8289)
+++ trunk/greenstone3-extensions/vishnu/src/vishnu/builder/Indexer.java	(revision 8290)
@@ -1,12 +1,25 @@
 package vishnu.builder;
 
+import java.io.File;
 abstract public class Indexer
 { 
-    String name;
+    
+    // views stuff
+//     public static final int DEFAULT = 0;
+//     public static final int DIP = 1;
+//     public static final int REG = 2;
+//     public static final int LEM = 3;
+//     public static final int SYN = 4;
+
+//     public static final String[] types = new String[]{"full","dip","reg","lem","syn"};
+    
+//     boolean use_views = false;
+//     int type = -1;
+    String name = null;
+    //String limiter = null;
     String outputDir = null;
     String inputDir = null;
     String collName = null;
-    //String GSDL3_HOME = null;
-    
+
     public Indexer(String n)
     {
@@ -15,10 +28,12 @@
     
     
-//     public void setRootDirectory(String root)
+//     public void setUseViews(boolean use_v) {
+// 	use_views = use_v;
+//     }
+    
+//     public void setIndexingType(int t)
 //     {
-// 	GSDL3_HOME = root;
-//     }
-
-
+// 	type = t;
+//     }    
     public void setOutputDirectory(String s)
     {
@@ -26,4 +41,8 @@
     }
     
+//     public void setLimiter(String s)
+//     {
+//         limiter = s;
+//     }
     
     public void setInputDirectory(String s)
@@ -38,4 +57,33 @@
     }
 
+    // this should be called at the start of startIndexing()
+    protected void initialize() {
+
+	if( inputDir == null || outputDir == null ){
+	    System.err.println("Input dir or output dir is null");
+	    System.exit(0);
+	}
+	
+	/* check if index dir exists */
+	File in = new File(inputDir);
+	if (!in.isDirectory()) {
+	    System.err.println("input directory ("+inputDir+") not a directory, exiting...");
+	    System.exit(0);
+	}
+
+	/**** check if output directory exists, if not create it ****/	
+        File f = new File(outputDir);
+        if( !f.exists() ){
+	    try {
+		f.mkdirs();
+	    } catch (Exception e) {
+		System.err.println("Couldn't create output directory "+outputDir);
+		System.err.println(e);
+		System.exit(0);
+	    }
+	}
+	
+    }
+    
     abstract public void startIndexing();
 }
Index: trunk/greenstone3-extensions/vishnu/src/vishnu/builder/IndexerGUI.java
===================================================================
--- trunk/greenstone3-extensions/vishnu/src/vishnu/builder/IndexerGUI.java	(revision 8289)
+++ trunk/greenstone3-extensions/vishnu/src/vishnu/builder/IndexerGUI.java	(revision 8290)
@@ -6,4 +6,5 @@
 import javax.swing.SpringLayout;
 import java.io.File;
+import vishnu.util.SpringUtilities;
 
 public class IndexerGUI {
@@ -100,5 +101,5 @@
 
 	//CollectionBuilder builder = new CollectionBuilder(dir,name,home,indexer);
-	CollectionBuilder builder = new CollectionBuilder(coll_home, coll_id, coll_name, coll_desc, indexer);
+	CollectionBuilder builder = new CollectionBuilder(coll_home, coll_id, coll_name, coll_desc, indexer, false); // no views for now - change this
 	output += "\n Indexing Finished";
 	ja.setText(output);
Index: trunk/greenstone3-extensions/vishnu/src/vishnu/builder/LuceneWrapper.java
===================================================================
--- trunk/greenstone3-extensions/vishnu/src/vishnu/builder/LuceneWrapper.java	(revision 8289)
+++ trunk/greenstone3-extensions/vishnu/src/vishnu/builder/LuceneWrapper.java	(revision 8290)
@@ -64,32 +64,9 @@
     
     public void startIndexing() {
-
-	if( inputDir == null || outputDir == null ){
-	    usage();
-	    System.exit(0);
-	}
-
-	/* check if index dir exists */
-	File in = new File(inputDir);
-	if (!in.isDirectory()) {
-	    System.err.println("input directory ("+inputDir+") not a directory, exiting...");
-	    System.exit(0);
-	}
-
-	/**** check if output directory exists, if not create it ****/	
-        File f = new File(outputDir);
-        if( !f.exists() ){
-	    try {
-		f.mkdirs();
-	    } catch (Exception e) {
-		System.err.println("Couldn't create output directory "+outputDir);
-		System.err.println(e);
-		System.exit(0);
-	    }
-	}
+	initialize();
 	try {
 	    IndexWriter writer = new IndexWriter(outputDir, new StandardAnalyzer(), true);
 	    // this is a bit of a hack putting import here
-	    indexFiles(writer, in, "import/");
+	    indexFiles(writer, new File(inputDir), "import/");
 	    writer.optimize();
 	    writer.close();
Index: trunk/greenstone3-extensions/vishnu/src/vishnu/builder/MGWrapper.java
===================================================================
--- trunk/greenstone3-extensions/vishnu/src/vishnu/builder/MGWrapper.java	(revision 8289)
+++ trunk/greenstone3-extensions/vishnu/src/vishnu/builder/MGWrapper.java	(revision 8290)
@@ -64,33 +64,8 @@
     {
 
-	if( inputDir == null || outputDir == null ){
-	    usage();
-	    System.exit(0);
-	}
-
-
-	/* check if index dir exists */
-	File in = new File(inputDir);
-	if (!in.isDirectory()) {
-	    System.err.println("input directory ("+inputDir+") not a directory, exiting...");
-	    System.exit(0);
-	}
-	
-	/**** check if output directory exist, if not create it ****/
-
-	File f = new File(outputDir);
-        if( !f.exists() ){
-	    try {
-		f.mkdirs();
-	    } catch (Exception e) {
-		System.err.println("Couldn't create output directory "+outputDir);
-		System.err.println(e);
-		System.exit(0);
-	    }
-	}
-
+	initialize();
 	// new mg requires a .mg_getrc to work
 	// lets put it in the output dir
-	File rc_file = new File(f, ".mg_getrc");
+	File rc_file = new File(outputDir, ".mg_getrc");
 	if (!rc_file.exists()) {
 	    // if its there, assume it is correct
