Index: /branches/paynter/java-client/Makefile
===================================================================
--- /branches/paynter/java-client/Makefile	(revision 2056)
+++ /branches/paynter/java-client/Makefile	(revision 2056)
@@ -0,0 +1,4 @@
+idltojava :
+	idlj -pkgPrefix gsdlInterface org.nzdl.corba corbaiface.idl
+	javac org/nzdl/corba/gsdlInterface/*.java
+#	setenv CLASSPATH /home/daven/research/corba/new/src:.
Index: /branches/paynter/java-client/corbaiface.idl
===================================================================
--- /branches/paynter/java-client/corbaiface.idl	(revision 2056)
+++ /branches/paynter/java-client/corbaiface.idl	(revision 2056)
@@ -0,0 +1,228 @@
+// basic elements for text
+
+module gsdlInterface {
+
+typedef sequence<unsigned short> usString;
+
+typedef sequence<string> stringSeq;
+
+struct corbatext_t
+{ 
+  usString text;
+  unsigned short encoding;
+  unsigned long  length;
+};
+
+typedef sequence<corbatext_t> corbatext_tarray;
+
+typedef corbatext_tarray corbatext_tset;
+
+struct corbatext_tmap
+{
+  corbatext_tarray names;
+  corbatext_tarray values;
+};
+
+// standard error values
+
+enum corbaComError
+{ corbaNoError, 
+  corbaAuthenticationFailure, 
+  corbaProtocolError, 
+  corbaConfigurationError, 
+  corbaSystemProblem
+};
+
+//
+// getColInfo response
+//
+
+struct corbaShortColInfo
+{
+  corbatext_t name;
+  corbatext_t host;
+  long        response;
+};
+
+struct corbaColInfoResponse
+{
+  corbaShortColInfo shoftInfo;
+  boolean           isPublic;
+  boolean           isBeta;
+  unsigned long     buildDate;
+  corbatext_tarray  ccsCols;        // Added 05/04/2000
+  corbatext_tarray  languages;
+  unsigned long     numDocs;
+  unsigned long     numWords;
+  unsigned long     numBytes;
+  corbatext_tmap    collectionMeta;
+  corbatext_tmap    format;
+  corbatext_tmap    building;
+  corbatext_t       httpdomain ;    // Added 27/07/2000
+  corbatext_t       httpprefix;     // Added 27/07/2000
+  corbatext_t       receptionist;
+};
+
+//
+// getDocument request
+//
+
+struct corbaDocRequest
+{ 
+  corbatext_t OID;
+  corbatext_t docType;
+  corbatext_t docFormat;
+};
+
+//
+// getDocument response
+//
+
+struct corbaDocResponse
+{ 
+  corbatext_t doc;
+};
+
+enum corbaFilterType
+{
+  booleanType,
+  integerType,
+  enumeratedType,
+  stringType
+};
+
+enum corbaFilterRepeatable
+{
+  onePerQuery,
+  onePerTerm,
+  nPerTerm
+};
+
+struct corbaFilterOption
+{
+  corbatext_t           name;
+  corbaFilterType       type;
+  corbaFilterRepeatable repeatable;
+  corbatext_t           defaultValue;
+  corbatext_tarray      validValues;
+};
+
+typedef sequence<corbaFilterOption> corbaFilterOptionList;
+
+struct corbaFilterOptionsResponse
+{
+  corbaFilterOptionList options;
+  corbatext_tarray      names;
+};
+
+//
+// structures for filter call
+//
+
+struct corbaOptionValue
+{
+  corbatext_t name;
+  corbatext_t value;
+};
+
+typedef sequence<corbaOptionValue> corbaOptionValue_array;
+
+struct corbaFilterRequest
+{ 
+  corbatext_t            filter;
+  corbaOptionValue_array filterOptions;
+  corbatext_tarray       docSet;
+  long                   filterResultOptions;
+  corbatext_t            requestParams;
+  corbatext_t            refParams;
+  corbatext_tset         fields;
+  boolean                getParents;
+};
+
+struct corbaTermInfo
+{
+  corbatext_t      term;
+  long             frequency;
+  corbatext_tarray matchTerms;
+};
+
+typedef sequence<corbaTermInfo> corbaTermInfo_array;
+
+struct corbaMetadataInfo
+{
+  corbatext_t      params;
+  boolean          isRef;
+  corbatext_tarray values;
+  long             id;
+  long             parentid; // dodge for avoiding pointers for the moment
+};
+
+typedef sequence<corbaMetadataInfo> corbaMetadataInfo_array;
+
+struct corbaMetadataInfo_map
+{ 
+  corbatext_tarray        names;
+  corbaMetadataInfo_array values;
+};
+
+typedef sequence<long> corbaDocFreq_array;
+
+struct corbaResultDocInfo
+{
+  corbatext_t             OID;
+  long                    resultNum;
+  long                    ranking;
+  long                    termsMatched;
+  long                    phraseMatched;
+  corbaDocFreq_array      docFreq;
+  corbaMetadataInfo_map   metadata;
+  corbatext_t             classifierMetadataType;    // Added 05/04/2000
+  long                    classifierMetadataOffset;  // Added 05/04/2000
+  corbaMetadataInfo_array metaparents;
+};
+
+typedef sequence<corbaResultDocInfo> corbaResultDocInfo_array;
+
+enum corbaIsApprox
+{
+  resultExact,
+  resultApprox,
+  resultMany
+};
+
+struct corbaFilterResponse
+{
+  long                     numDocs;
+  corbaIsApprox            isApprox;
+  corbaTermInfo_array      termInfo;
+  corbaResultDocInfo_array docInfo;
+};
+
+interface corbaiface
+{
+  boolean   initialise();
+  void      configure(in corbatext_t key, in corbatext_tarray cfgline);
+  void      collectionList(inout corbatext_tarray collist);
+  void      hasCollection(in corbatext_t corbaCollection, inout boolean has,
+		       inout corbaComError error);
+  boolean   ping(in corbatext_t collection, inout corbaComError error);
+  void      getDocument(in corbatext_t collection,
+			inout corbaDocRequest request, inout corbaDocResponse response,
+			inout corbaComError error);
+  void      getCollectInfo(in corbatext_t collection,
+			   inout corbaColInfoResponse response,
+			   inout corbaComError error);
+  void      getFilterInfo(in corbatext_t collection, 
+                          inout corbatext_tarray filterNames, 
+			  inout corbaComError error);
+  void      getFilterOptions(in corbatext_t collection,
+                             in corbatext_t option,
+                             inout corbaFilterOptionsResponse response,
+			     inout corbaComError error);
+  void      filter(in corbatext_t collection,
+		   in corbaFilterRequest request,
+                   inout corbaFilterResponse response,
+                   inout corbaComError error);
+};
+
+};
Index: /branches/paynter/java-client/org/nzdl/gsdl/SimpleClient.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/SimpleClient.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/SimpleClient.java	(revision 2056)
@@ -0,0 +1,115 @@
+
+
+import java.util.*;
+import java.text.*; // for date processing
+import javax.swing.tree.*;
+import org.nzdl.service.*;
+
+
+public class SimpleClient {
+
+  public static final void main( String [] args ) {
+
+    NzdlService nzdl = new NzdlServiceImpl( args );
+
+    if (args.length < 3) {
+      System.err.println("WARNING: missing command line arguments. using defualts:");
+      System.err.println("usage: java <javaoptions> SimpleClient <collect> <xxx> <query>");
+      System.err.println("       <javaoptions> = options to the JVM ");
+      System.err.println("       <collect>     = the greenstone collection to use   (demo)");
+      System.err.println("       <xxx>         = a currently unused option          (xxx)");
+      System.err.println("       <query>       = the query to use on the collection (the)");
+      args = new  String [3];
+      args[0] = "demo";
+      args[1] = "xxx";
+      args[2] = "the";
+    }
+    
+    // extract some highlevel information on the collections on the server
+    // independent of the command line arguments passed in
+		
+    Set collectionSet = nzdl.getCollectionSet(); // set of strings of collection titles
+    System.out.println("Number of collections on the server: " + collectionSet.size());
+		
+    Iterator collectionSetIterator = collectionSet.iterator();
+    while (collectionSetIterator.hasNext() ) {
+      String collectionName = (String)collectionSetIterator.next(); // object -> String
+      NzdlCollectionInfo collectionInfo = nzdl.getCollectionInfo( collectionName );
+      // this next line should work but doesn't
+      System.out.println("Collection: " + collectionInfo.getName());
+      // so we revert to using the original string from the collectionSet
+      System.out.println("Collection: " + collectionName);  
+      if (nzdl.hasCollection(collectionName) ) {
+	System.out.println("\t" + "hasCollection(" + collectionName + ")" + " is true");
+	if (nzdl.pingCollection(collectionName) ) {
+	  System.out.println("\t" + "pingCollection(" + collectionName + ")" + " is true");		
+	  // these next statements make use of the NzdlCollection API  		 
+	  System.out.println("\t" + "Public: " + collectionInfo.isPublic());
+	  System.out.println("\t" + "Beta: " + collectionInfo.isBeta());
+	  int buildDate = collectionInfo.getBuildDate();
+	  //process buildDate into something sensible
+	  System.out.println("\t" + "Build Date: " + buildDate);
+	  System.out.println("\t" + "No. of Documents: " + collectionInfo.getNumOfDocs());
+	  System.out.println("\t" + "No. of Words: " + collectionInfo.getNumOfWords());
+	  System.out.println("\t" + "No. of Bytes: " + collectionInfo.getNumOfBytes()); 
+	}
+	else {
+	  System.out.println("\t" + "pingCollection(" + collectionName + ")" + " is false");
+	}
+      }
+      else
+	{ System.out.println("\t" + "hasCollection(" + collectionName + ")" + " is false"); }
+    } 
+		
+		
+		
+		
+    String collName = args[0];
+    NzdlCollectionInfo collInfo = nzdl.getCollectionInfo( collName );
+   
+    System.out.println("Searching collection: " + collName);
+		
+    int numResults = collInfo.getNumOfDocs(); // what precisely is this number ?
+    System.out.println("Collection " + collName + " suggests to get results in chunks of " + numResults + " hits" );
+    String method = args[1];
+    System.out.println("Search method: " + method);
+    String queryTerm = args[2];
+    System.out.println("Query Term: " + queryTerm);
+    String metaTag = "Title";
+		
+    System.out.println("Searching in '" + metaTag + "' metadata");
+
+    NzdlQuery query = new NzdlQuery( queryTerm );
+    // return the first numResults that match
+    //query.setEndResults( 15 );
+    // "-1" means consider all the documents that match
+    query.setMaxDocs( -1 );
+
+    NzdlRequest request = new NzdlRequest( query );
+    NzdlResponse response = new NzdlResponse( );
+    System.out.println("getting document IDs ... ");
+    nzdl.service( collName, request, response );
+
+    NzdlResultSet results = response.getResultSet();
+    List docIDs = results.getDocumentIDs();
+    System.out.println("Number of documents returned: " + docIDs.size());
+
+    System.out.println("getting '" + metaTag + "' meta data of documents ... ");
+    Map metaData = nzdl.getMetaData( collName, docIDs, metaTag );
+
+    for (ListIterator i = docIDs.listIterator(); i.hasNext(); ) {
+      String id = (String) i.next();
+      Set meta = (Set) metaData.get( id );
+      System.out.println(meta.toString()); 
+      System.out.println("getting document contents ... ");
+      String documentContents = nzdl.getDocument(collName, id);
+      System.out.println("got document contents. ");
+      System.out.println(" *************** START DOC " + id + " ***************"); 
+      System.out.println(documentContents);
+      System.out.println(" *************** END DOC " + id + " ***************"); 
+    }
+    
+  
+  } //main
+
+} // class
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java	(revision 2056)
@@ -0,0 +1,55 @@
+
+package org.nzdl.service;
+
+/** gsdl corba stuff */
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.util.*;
+
+public class NzdlCollectionInfo extends Object {
+
+  /** */
+  private corbaColInfoResponse m_Info = null;
+
+  public NzdlCollectionInfo( corbaColInfoResponse _info ) {
+    m_Info = _info;
+  }
+
+  /** */
+  public String getName() {
+    return NzdlCorbaFactory.toString( m_Info.shoftInfo.name ) ;
+  }
+
+  public boolean isPublic() {
+    return m_Info.isPublic;
+  }
+
+  public boolean isBeta() {
+    return m_Info.isBeta;
+  }
+
+  public int getBuildDate() {
+    return m_Info.buildDate;
+  }
+
+  public int getNumOfDocs() {
+    return m_Info.numDocs;
+  }
+
+  public int getNumOfWords() {
+    return m_Info.numWords;
+  }
+
+  public int getNumOfBytes() {
+    return m_Info.numBytes;
+  }
+
+  /** */
+  public void print() {
+	/* daven@cs.waikato.ac.nz */
+	//System.out.println("Collection Information--------------");
+	//System.out.println("Collection Name = " + this.getName());
+	//System.out.println("Collection Name = " + m_info.getName());
+	
+  }
+
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQuery.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQuery.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQuery.java	(revision 2056)
@@ -0,0 +1,107 @@
+
+package org.nzdl.service;
+
+import java.util.*;
+
+import org.nzdl.util.NzdlConstants;
+
+public class NzdlQuery extends java.lang.Object {
+
+  /** */
+  private Map m_Options = null;
+
+  /** */
+
+  public NzdlQuery() {
+    m_Options = new HashMap();
+    setQueryTerm   ( NzdlConstants.DEFAULT_QUERY_TERM );
+    setQueryType   ( NzdlConstants.DEFAULT_QUERY_TYPE );
+    setCaseFolding ( NzdlConstants.DEFAULT_CASE_FOLDING );
+    setStemming    ( NzdlConstants.DEFAULT_STEMMING );
+    setStartResults( NzdlConstants.DEFAULT_START_RESULTS );
+    setEndResults  ( NzdlConstants.DEFAULT_END_RESULTS );
+    setMaxDocs     ( NzdlConstants.DEFAULT_MAX_DOCS );
+  }
+
+  public NzdlQuery( String _term ) {
+    m_Options = new HashMap();
+    setQueryTerm   ( _term );
+    setQueryType   ( NzdlConstants.DEFAULT_QUERY_TYPE );
+    setCaseFolding ( NzdlConstants.DEFAULT_CASE_FOLDING );
+    setStemming    ( NzdlConstants.DEFAULT_STEMMING );
+    setStartResults( NzdlConstants.DEFAULT_START_RESULTS );
+    setEndResults  ( NzdlConstants.DEFAULT_END_RESULTS );
+    setMaxDocs     ( NzdlConstants.DEFAULT_MAX_DOCS );
+  }
+
+  /** */
+
+  public void setQueryTerm(String _term) {
+    m_Options.put("Term", _term);
+  }
+
+  public void setQueryType(String _type) {
+    m_Options.put("QueryType", _type);
+  }
+
+  public void setCaseFolding(String _case) {
+    m_Options.put("CaseFold", _case);
+  }
+
+  public void setStemming(String _stem) {
+    m_Options.put("Stem", _stem);
+  }
+
+  public void setStartResults(int _start) {
+    m_Options.put("StartResults", new Integer(_start));
+  }
+
+  public void setEndResults(int _end) {
+    m_Options.put("EndResults", new Integer(_end));
+  }
+
+  public void setMaxDocs(int _max) {
+    m_Options.put("Maxdocs", new Integer(_max));
+  }
+
+  /** */
+
+  public String getQueryType() {
+    return (String)m_Options.get("QueryType");
+  }
+
+  public String getQueryTerm() {
+    return (String)m_Options.get("Term");
+  }
+
+  public String getCaseFolding() {
+    return (String)m_Options.get("CaseFold");
+  }
+
+  public String getStemming() {
+    return (String)m_Options.get("Stem");
+  }
+
+  public int getStartResults() {
+    return ((Integer) m_Options.get("StartResults")).intValue();
+  }
+
+  public int getEndResults() {
+    return ((Integer) m_Options.get("EndResults")).intValue();
+  }
+
+  public int getMaxDocs() {
+    return ((Integer) m_Options.get("Maxdocs")).intValue();
+  }
+
+  /** */
+
+  public Set queryKeySet() {
+    return m_Options.keySet();
+  }
+
+  public Collection queryValues() {
+    return m_Options.values();
+  }
+
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQueryHit.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQueryHit.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlQueryHit.java	(revision 2056)
@@ -0,0 +1,87 @@
+
+package org.nzdl.service;
+
+import java.util.*;
+
+public class NzdlQueryHit extends java.lang.Object {
+
+  private String m_docID = null;
+  private int    m_resultNum = -1;   // I don't actually know what it means !!!
+  private int    m_ranking = -1;
+  private int    m_numTermsMatched = -1;
+  private int    m_numPhrasesMatched = -1;
+  private int [] m_docFreqs = null; // I don't actually know what it means !!!
+  /*
+   * The key in the map will be the metaData Tag
+   * The value for the key will be a Set of strings
+   * Ex: key = "Author", value = {A. Mahoui, S. Franks}
+   */
+  private Map m_metaData = null;
+
+  /** */
+
+  public void setDocumentID( String _docID ) {
+    m_docID = _docID;
+  }
+
+  public void setRanking( int _ranking ) {
+    m_ranking = _ranking;
+  }
+
+  public void setResultNumber( int _resultNum ) {
+    m_resultNum = _resultNum;
+  }
+
+  public void setNumOfTermsMatched( int _numTermsMatched ) {
+    m_numTermsMatched = _numTermsMatched;
+  }
+
+  public void setNumOfPhrasesMatched( int _numPhrasesMatched ) {
+    m_numPhrasesMatched = _numPhrasesMatched;
+  }
+
+  public void setMetaData( Map _metaData ) {
+    m_metaData = _metaData;
+  }
+
+  /** */
+
+  public String getDocumentID() {
+    return m_docID;
+  }
+
+  public int getRanking() {
+    return m_ranking;
+  }
+
+  public int getResultNumber() {
+    return m_resultNum;
+  }
+
+  public int getNumOfTermsMatched() {
+    return m_numTermsMatched;
+  }
+
+  public int getNumOfPhrasesMatched() {
+    return m_numPhrasesMatched;
+  }
+
+  public Map getMetaData() {
+    return m_metaData;
+  }
+
+  /** returns a set of String objects */
+  public Set getMetaDataValues( String _metaTag ) {
+    return (Set) m_metaData.get( _metaTag );
+  }
+
+  /** returns a set of key (String) objects */
+  public Set getMetaDataTags() {
+    return m_metaData.keySet();
+  }
+
+  public Collection getMetaDataValues() {
+    return m_metaData.values();
+  }
+
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlRequest.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlRequest.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlRequest.java	(revision 2056)
@@ -0,0 +1,38 @@
+
+package org.nzdl.service;
+
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.util.*;
+import java.util.*;
+
+public class NzdlRequest extends java.lang.Object {
+
+  /** */
+
+  private corbaFilterRequest m_Filter = null;
+
+  /** */
+
+  public NzdlRequest( NzdlQuery _query ) {
+    m_Filter = NzdlCorbaFactory.createQueryFilterRequest( _query );
+  }
+
+  public NzdlRequest( String _docID ) {
+    m_Filter = NzdlCorbaFactory.createBrowseFilterRequest( _docID );
+  }
+
+  public NzdlRequest( String _docID, String _metaTag ) {
+    m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docID, _metaTag );
+  }
+
+  public NzdlRequest( List _docIDs, String _metaTag ) {
+    m_Filter = NzdlCorbaFactory.createMetaDataFilterRequest( _docIDs, _metaTag );
+  }
+
+  /** */
+
+  public corbaFilterRequest getFilter() {
+    return m_Filter;
+  }
+  
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResponse.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResponse.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResponse.java	(revision 2056)
@@ -0,0 +1,136 @@
+
+package org.nzdl.service;
+
+import java.util.*;
+
+import org.nzdl.service.*;
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.util.*;
+
+public class NzdlResponse extends java.lang.Object {
+
+  /** */
+
+  private corbaFilterResponseHolder m_responseHolder = null;
+  private corbaFilterResponse m_response = null;
+  private NzdlResultSet m_resultSet = null;
+  private Map m_frequencies = null;
+  private List m_queryTerms = null;
+
+  /** */
+
+  public NzdlResponse( ) {
+    m_responseHolder = NzdlCorbaFactory.createFilterResponseHolder();
+  }
+
+  public corbaFilterResponseHolder getHolder() {
+    return m_responseHolder;
+  }
+
+  public NzdlResultSet getResultSet() {
+    if ( m_resultSet == null ) {
+      parseResponse();
+    }
+    return m_resultSet;
+  }
+
+  /*
+    This is a short expansion of the content of a corbaFilterResponse object.
+    Some of the fields are not that clear to me (those with ?????). Therefore
+    I am ignoring some of them for the time being.
+
+    o Number of Documents
+    o Type of results
+    o Info on each of the search terms used:
+
+      o Term string
+      o Term frequency
+      o Matched terms ?????
+
+    o Info on each of the result docs returned:
+
+      o Document ID
+      o Result number ?????
+      o Number of terms matched in this document
+      o Number of phrases matched in this document
+      o Array of document frequencies ?????
+      o Info on the metadata:
+
+         o Array of the names of the meta tags
+         o Info on each of the meta data:
+
+           o Params string ?????
+           o Is the metadata a reference ?????
+           o Array of values
+	   o Id ?????
+	   o Parentid ?????
+  */
+
+  private void parseResponse () {
+    m_response = m_responseHolder.value;
+    m_resultSet = new NzdlResultSet();
+    m_resultSet.setNumOfDocs( m_response.numDocs );
+    m_resultSet.setResultType( m_response.isApprox.value() );
+    /** HAS SIDE EFFECT ! */
+    parseTermsInfo( m_response.termInfo );
+    /** HAS SIDE EFFECT ! */
+    parseDocsInfo( m_response.docInfo );
+  }
+
+  private void parseTermsInfo( corbaTermInfo [] _termsInfo ) {
+    String term = null;
+    m_frequencies = new HashMap();
+    m_queryTerms = new ArrayList();
+    for (int i=0; i<_termsInfo.length; i++) {
+      term = NzdlCorbaFactory.toString(_termsInfo[i].term);
+      m_queryTerms.add( term );
+      m_frequencies.put( term, new Integer(_termsInfo[i].frequency) );
+    }
+    m_resultSet.setQueryTerms( m_queryTerms );
+    m_resultSet.setTermFrequencies( m_frequencies );
+  }
+
+  private void parseDocsInfo( corbaResultDocInfo [] _docsInfo ) {
+    NzdlQueryHit queryHit = null;
+    //System.err.println("Size of DocsInfo: " + _docsInfo.length);
+    for (int i=0; i < _docsInfo.length; i++) {
+      queryHit = new NzdlQueryHit();
+      queryHit.setDocumentID( NzdlCorbaFactory.toString(_docsInfo[i].OID) );
+      queryHit.setResultNumber( _docsInfo[i].resultNum );
+      queryHit.setRanking( _docsInfo[i].ranking );
+      queryHit.setNumOfTermsMatched( _docsInfo[i].termsMatched );
+      queryHit.setNumOfPhrasesMatched( _docsInfo[i].phraseMatched );
+      /** TO DO: extract corbaDocFreq_array value */
+      queryHit.setMetaData( parseMetaData(_docsInfo[i].metadata) );
+      // add to the result set
+      m_resultSet.add( queryHit ) ;
+    }
+  }
+
+  private Map parseMetaData( corbaMetadataInfo_map _metaData ) {
+    /*
+     * The key in the map will be the metaData Tag
+     * The value for the key will be a Set of strings
+     * Ex: key = "Author", value = {A. Mahoui, S. Franks}
+     */
+    Map metaData = new HashMap();
+    // For each meta tag can be associated more than one value (example above)
+    Set metaTagValues = new HashSet();
+    corbaMetadataInfo c_metaDataInfo = null;
+
+    for (int i=0; i < _metaData.names.length; i++) {
+      // one meta data at a time please ...
+      c_metaDataInfo = _metaData.values[i];
+      // get the set of values associated with this meta tag ...
+      for (int j=0; j < c_metaDataInfo.values.length; j++) {
+	metaTagValues.add( NzdlCorbaFactory.toString(c_metaDataInfo.values[j]) );
+      }
+      // map the meta tag with its set of values ...
+      metaData.put( NzdlCorbaFactory.toString(_metaData.names[i]), metaTagValues);
+    }
+    return metaData;
+  }
+
+}
+
+
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResultSet.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResultSet.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlResultSet.java	(revision 2056)
@@ -0,0 +1,125 @@
+
+package org.nzdl.service;
+
+import java.util.*;
+
+public class NzdlResultSet extends java.lang.Object {
+
+  private List m_resultSet   = null;
+  private int m_numDocs     = -1;
+  private int m_resultType  = -1;
+  private List m_queryTerms  = null;
+  private List m_docIDs = null;
+  /** the key is the query term, the value its frequency */
+  private Map m_frequencies = null;
+  /** 
+   * the key is the docID, the value is the doc corresponding 
+   * meta data which is also a Map where the key is the meta tag
+   * and the value is a set of values for that tag
+   */
+  private Map m_docToMetaDataMap = null;
+
+  /** */
+  
+  public NzdlResultSet() {
+    m_resultSet = new ArrayList();
+    m_docToMetaDataMap = new HashMap();
+    m_docIDs = new ArrayList();
+  }
+
+  /** */
+
+  public void add( NzdlQueryHit _hit ) {
+    m_resultSet.add( _hit ) ;
+    String id = _hit.getDocumentID();
+    m_docIDs.add( id );
+    m_docToMetaDataMap.put( id, _hit.getMetaData() );
+  }
+
+  public void setNumOfDocs( int _num ) {
+    m_numDocs = _num;
+  }
+
+  public void setResultType( int _type ) {
+    m_resultType = _type;
+  }
+
+  public void setQueryTerms( List _terms ) {
+    m_queryTerms = _terms;
+  }
+
+//    public void setTermFrequency( String _term, int _freq ) {
+//      m_frequencies.put( _term, new Integer(_freq) );
+//    }
+
+  public void setTermFrequencies( Map _freqs ) {
+    m_frequencies = _freqs;
+  }
+
+  /** */
+
+  public int getNumOfDocs() {
+    return m_numDocs;
+  }
+
+  public int getResultType() {
+    return m_resultType;
+  }
+
+  public List getQueryTerms() {
+    return m_queryTerms;
+  }
+  
+  public Map getTermFrequencies() {
+    return m_frequencies;
+  }
+  
+//    public int getTermFrequency( String _term ) {
+//      return ((Integer)m_frequencies.get(_term)).intValue();
+//    }
+
+//    public List getDocumentIDs() {
+//      NzdlQueryHit hit = null;
+//      //Set docIDs = new HashSet();
+//      List docIDs = new ArrayList();
+//      for (ListIterator itr = m_resultSet.listIterator(); itr.hasNext(); ) {
+//        hit = (NzdlQueryHit) itr.next();
+//        docIDs.add( hit.getDocumentID() );
+//      }
+//      return docIDs;
+//    }
+
+    public List getDocumentIDs() {
+      return m_docIDs;
+    }
+
+//    public Set getMetaData( String _docID, String _metaTag ) {
+//      NzdlQueryHit hit = null;
+//      for (ListIterator itr = m_resultSet.listIterator(); itr.hasNext(); ) {
+//        hit = (NzdlQueryHit) itr.next();
+//        if ( _docID.equals( hit.getDocumentID() ) ) {
+//  	return hit.getMetaDataValues( _metaTag );
+//        }
+//      }
+//      return null;
+//    }
+
+  public Set getMetaData( String _docID, String _metaTag ) {
+    Map metaData = (Map) m_docToMetaDataMap.get( _docID );
+    return (Set) metaData.get( _metaTag );
+  }
+
+  public Map getMetaData( String _metaTag ) {
+    Map metaData = new HashMap();
+    for (ListIterator itr = m_resultSet.listIterator(); itr.hasNext(); ) {
+      NzdlQueryHit hit = (NzdlQueryHit) itr.next();
+      metaData.put( hit.getDocumentID(), hit.getMetaDataValues(_metaTag) );
+    }
+    return metaData;
+  }
+
+  public Map getAllMetaData( ) {
+    return m_docToMetaDataMap;
+  }
+
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlService.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlService.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlService.java	(revision 2056)
@@ -0,0 +1,38 @@
+
+package org.nzdl.service;
+
+import java.util.*;
+
+public interface NzdlService {
+
+  public void configure( String key, Set values );
+  public Set getCollectionSet( );
+  public boolean hasCollection( String collectionName );
+  public boolean pingCollection( String collectionName );
+  public NzdlCollectionInfo getCollectionInfo( String collectionName );
+  public Set getFilterSet( String collectionName );
+  public Set getMetaTagSet( String collectionName );
+  public String getDocument( String collectionName, String documentID );
+  public Set getMetaData( String collectionName, String documentID, String metaTag );
+  public Map getMetaData( String collectionName, List documentIDs, String metaTag );
+  public void service( String collectionName, NzdlRequest request, NzdlResponse response );
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlServiceImpl.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlServiceImpl.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/service/NzdlServiceImpl.java	(revision 2056)
@@ -0,0 +1,166 @@
+
+package org.nzdl.service;
+
+import java.io.*;
+import java.util.*;
+/** jdk 1.3 orb */
+import org.omg.CORBA.*;
+/** gsdl corba stuff */
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.util.*;
+
+public class NzdlServiceImpl extends java.lang.Object implements NzdlService {
+
+  private corbaiface m_nzdlServer = null;
+
+  public NzdlServiceImpl( String [] _args ) {
+    try {
+	System.err.println("before ORB.init");
+      // getting a reference to the remote NZDL server
+      org.omg.CORBA.ORB orb = ORB.init( _args, null );
+      System.err.println("after ORB.init - before IOR");
+      String ior = getIorKey();
+      System.err.println("ior = " + ior);
+	System.err.println("after IOR");
+	org.omg.CORBA.Object obj = orb.string_to_object(ior) ;
+      System.err.println("after org stringtoobject");
+	m_nzdlServer = corbaifaceHelper.narrow(obj);
+	System.err.println("after .narrow");
+      // basic setup
+      if (m_nzdlServer.initialise()) {
+	System.err.println("Nzdl init ... YES");
+      }
+      else {
+	System.err.println("Nzdl init ... NO");
+	System.err.println("Aborting service ...");
+	//System.exit(1);
+      }
+    } catch (Exception e) {
+      System.err.println("Error in service init:\n" + e) ;
+      System.err.println("Aborting service ...");
+      System.exit(1);
+    }
+    System.err.println("Service init ... YES");
+  }
+  
+  public void configure( String _key, Set _values ) {
+    m_nzdlServer.configure( NzdlCorbaFactory.toCorbaText( _key ),
+			    NzdlCorbaFactory.toCorbaTextArray( _values ));
+  }
+  
+  public Set getCollectionSet( ) {
+    corbatext_tarrayHolder c_collSet = NzdlCorbaFactory.createCorbaTextArrayHolder();
+    m_nzdlServer.collectionList(c_collSet);
+    Set collSet = new HashSet();
+    for (int i=0; i<c_collSet.value.length; i++) {
+      collSet.add( NzdlCorbaFactory.toString( c_collSet.value[i] ) );
+    }
+    return collSet ;
+  }
+  
+  public boolean hasCollection( String _name ) {
+    corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+    org.omg.CORBA.BooleanHolder c_has = new org.omg.CORBA.BooleanHolder();
+    m_nzdlServer.hasCollection( NzdlCorbaFactory.toCorbaText(_name), c_has, c_err );
+    if (c_err.value.value() != 0)
+      System.err.println("hasCollection error " + c_err.value.value());
+    return c_has.value;
+  }
+  
+  public boolean pingCollection( String _name ) {
+    corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+    boolean result  = m_nzdlServer.ping( NzdlCorbaFactory.toCorbaText(_name), c_err );
+    if (c_err.value.value() != 0)
+      System.err.println("pingCollection() error " + c_err.value.value());
+    return result;
+  }
+  
+  public NzdlCollectionInfo getCollectionInfo( String _name ) {
+    corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+    corbaColInfoResponseHolder c_info = NzdlCorbaFactory.createColInfoResponseHolder();
+    m_nzdlServer.getCollectInfo( NzdlCorbaFactory.toCorbaText(_name), c_info, c_err );
+    if (c_err.value.value() != 0)
+      System.err.println("getCollectionInfo() error " + c_err.value.value());
+    return new NzdlCollectionInfo( c_info.value );
+  }
+
+  public Set getFilterSet( String _name ) {
+    System.err.println("TO BE IMPLEMENTED !!!");
+    return null ;
+  }
+
+  public Set getMetaTagSet( String _name ) {
+    System.err.println("TO BE IMPLEMENTED: DON'T KNOW HOW YET !!!");
+    return null ;
+  }
+
+  public String getDocument( String _name, String _docID ) {
+    corbatext_t c_name = NzdlCorbaFactory.toCorbaText( _name );
+    corbaDocRequestHolder c_request = NzdlCorbaFactory.createDocRequestHolder( _docID );
+    corbaDocResponseHolder c_response = NzdlCorbaFactory.createDocResponseHolder( );
+    corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+    m_nzdlServer.getDocument( c_name, c_request, c_response, c_err );
+    if (c_err.value.value() != 0)
+      System.err.println("getDocument() error " + c_err.value.value());
+    return NzdlCorbaFactory.toString( c_response.value.doc );
+  }
+
+  public Set getMetaData( String _name, String _docID, String _metaTag ) {
+    NzdlRequest request  = new NzdlRequest( _docID, _metaTag );
+    NzdlResponse response = new NzdlResponse( );
+    service( _name, request, response );
+    NzdlResultSet resultSet = response.getResultSet();
+    /**
+     * Because a result set may contain several hits, we only return
+     * the set of metadata values of the specifed meta tag for the
+     * specified document ID.
+     */
+    return resultSet.getMetaData( _docID, _metaTag );
+  }
+
+  public Map getMetaData( String _name, List _docIDs, String _metaTag ) {
+    NzdlRequest request  = new NzdlRequest( _docIDs, _metaTag );
+    NzdlResponse response = new NzdlResponse( );
+    service( _name, request, response );
+    NzdlResultSet resultSet = response.getResultSet();
+    //return resultSet.getMetaData( _docID, _metaTag );
+    return resultSet.getMetaData( _metaTag );
+    //return resultSet.getAllMetaData( );
+  }
+
+  public void service( String _name, NzdlRequest _request, NzdlResponse _response ) {    
+    corbatext_t c_name = NzdlCorbaFactory.toCorbaText( _name );
+    corbaComErrorHolder c_err = NzdlCorbaFactory.createComErrorHolder();
+    m_nzdlServer.filter( c_name, _request.getFilter(), _response.getHolder(), c_err );
+    if (c_err.value.value() != 0)
+      System.err.println("service() error " + c_err.value.value());
+  }
+
+  private String getIorKey() {
+    String ior = null;
+    try  {
+      LineNumberReader input
+	= new LineNumberReader(new FileReader("/tmp/localcorba.objid"));
+      ior = input.readLine();
+    } 
+    catch (java.io.IOException e) { 
+      System.err.println("Error reading IOR key:\n" + e);
+      System.err.println("Aborting service...");
+      System.exit(1);
+    }
+    return ior;
+  }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
Index: /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlConstants.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlConstants.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlConstants.java	(revision 2056)
@@ -0,0 +1,41 @@
+
+package org.nzdl.util;
+
+
+public interface NzdlConstants {
+
+  String DEFAULT_QUERY_TERM   = "";
+  String DEFAULT_QUERY_TYPE   = "ranked";
+  String DEFAULT_CASE_FOLDING = "true";
+  String DEFAULT_STEMMING     = "false";
+
+  int    DEFAULT_START_RESULTS = 1;
+  int    DEFAULT_END_RESULTS   = 10;
+  int    DEFAULT_MAX_DOCS      = 200;
+
+/* these appear to have been generated by 
+the idlj compiler but not any more - so 
+they are are being placed here */
+
+public static final int FRtermFreq = 1;
+public static final int FRmatchterms = 2;
+public static final int FROID = 4 ;
+public static final int FRsubcol = 8;
+public static final int FRranking = 16;
+public static final int FRdocFreq = 32;
+public static final int FRmetadata = 64;
+public static final int FRfullTextBrowse = 128;
+
+/*
+#define FRtermFreq   1
+#define FRmatchTerms 2
+#define FROID        4
+#define FRsubCol     8
+#define FRranking    16
+#define FRdocFreq    32
+#define FRmetadata   64
+// used to indicate a full text browse query for mgpp
+#define FRfullTextBrowse  128
+*/
+
+}
Index: /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java
===================================================================
--- /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java	(revision 2056)
+++ /branches/paynter/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java	(revision 2056)
@@ -0,0 +1,251 @@
+
+package org.nzdl.util;
+
+import java.util.*;
+import org.nzdl.service.NzdlQuery;
+import org.nzdl.corba.gsdlInterface.*;
+import org.nzdl.util.NzdlConstants;
+
+public final class NzdlCorbaFactory {
+
+
+  private NzdlCorbaFactory() {}
+
+  public static corbatext_t toCorbaText(String _text) {
+    int len = _text.length();
+    short[] shorts = new short[len];
+    for (int i=0; i<len; i++) {
+      shorts[i] = (short)_text.charAt(i);
+    }
+    short encoding = 0;
+    corbatext_t corba_t = new corbatext_t(shorts, encoding, len);
+    return corba_t;
+  }
+
+  public static String toString(corbatext_t _text) {
+    //    System.out.println("NzdlCorbaFactory.toString() called length = " + _text.text.length +
+    //		       " ecnoding = " + _text.encoding +
+    //		       " reported length = " + _text.length);
+    StringBuffer text = new StringBuffer(1000);
+    for (int j=0; j<_text.text.length; j++) {
+      text.append((char)_text.text[j]);
+    }
+    return text.toString();
+  }
+
+  public static corbaComErrorHolder createComErrorHolder() {
+    corbaComErrorHolder err
+      = new corbaComErrorHolder( corbaComError.from_int(0) );    
+    return err;
+  }
+
+  public static corbatext_tarrayHolder createCorbaTextArrayHolder() {
+    corbatext_t [] array = {};
+    corbatext_tarrayHolder arrayHolder = new corbatext_tarrayHolder( array );
+    return arrayHolder;
+  }
+
+  public static corbatext_t []  toCorbaTextArray( Set _configLines ) {
+    Object [] lines = _configLines.toArray();
+    corbatext_t [] array = new corbatext_t[ lines.length ];
+    for (int i=0; i<lines.length; i++) {
+      array[i] = toCorbaText( (String)lines[i] );
+    }
+    return array;
+  }
+
+  public static corbaColInfoResponseHolder createColInfoResponseHolder() {
+    corbaShortColInfo shortInfo = new corbaShortColInfo();
+    shortInfo.name = toCorbaText("");
+    shortInfo.host = toCorbaText("");
+    corbaColInfoResponse response = new corbaColInfoResponse();
+    response.shoftInfo = shortInfo; // shoft !! typo in corba interface !!
+    response.isPublic  = false;
+    response.isBeta    = false;
+    response.buildDate = 0;
+    response.ccsCols   = new corbatext_t[0];
+    response.languages = new corbatext_t[0];
+    response.numDocs   = 0;
+    response.numWords  = 0;
+    response.numBytes  = 0;
+    response.collectionMeta = new corbatext_tmap(new corbatext_t[0],new corbatext_t[0]);
+    response.format         = new corbatext_tmap(new corbatext_t[0],new corbatext_t[0]);
+    response.building       = new corbatext_tmap(new corbatext_t[0],new corbatext_t[0]);
+    response.httpdomain   = toCorbaText("");
+    response.httpprefix   = toCorbaText("");
+    response.receptionist = toCorbaText("");
+    corbaColInfoResponseHolder responseHolder 
+      = new corbaColInfoResponseHolder(response);
+    return responseHolder;
+  }
+
+  public static corbaFilterRequest 
+    createQueryFilterRequest( String _term, String _type, int _numOfHits ) {
+    return createQueryFilterRequest( _term,
+				     _type,
+				     NzdlConstants.DEFAULT_CASE_FOLDING,
+				     NzdlConstants.DEFAULT_STEMMING,
+				     String.valueOf(NzdlConstants.DEFAULT_START_RESULTS),
+				     String.valueOf(_numOfHits),
+				     String.valueOf(NzdlConstants.DEFAULT_MAX_DOCS)
+				     );
+  }
+
+  public static corbaFilterRequest 
+    createQueryFilterRequest( NzdlQuery _query ) {
+    return createQueryFilterRequest( _query.getQueryTerm(),
+				     _query.getQueryType(),
+				     _query.getCaseFolding(),
+				     _query.getStemming(),
+				     String.valueOf(_query.getStartResults()),
+				     String.valueOf(_query.getEndResults()),
+				     String.valueOf(_query.getMaxDocs())
+				     );
+  }
+
+  public static corbaFilterRequest 
+    createQueryFilterRequest( String _term, String _type,     String _case, 
+			      String _stem, String _startHit, String _endHit, String _maxDocs ) {
+
+    corbaFilterRequest queryFilter = new corbaFilterRequest();
+    queryFilter.filter        = toCorbaText("QueryFilter");
+
+    queryFilter.filterOptions = new corbaOptionValue[8];
+    queryFilter.filterOptions[0] 
+      = new corbaOptionValue(toCorbaText("Term"),
+			     toCorbaText(_term));
+    queryFilter.filterOptions[1] 
+      = new corbaOptionValue(toCorbaText("QueryType"),
+			     toCorbaText(_type));
+    queryFilter.filterOptions[2] 
+      = new corbaOptionValue(toCorbaText("Casefold"),
+			     toCorbaText(_case));
+    queryFilter.filterOptions[3] 
+      = new corbaOptionValue(toCorbaText("Stem"),
+			     toCorbaText(_stem));
+    queryFilter.filterOptions[4] 
+      = new corbaOptionValue(toCorbaText("StartResults"),
+			     toCorbaText(_startHit));
+    queryFilter.filterOptions[5] 
+      = new corbaOptionValue(toCorbaText("EndResults"),
+			     toCorbaText(_endHit));
+    queryFilter.filterOptions[6] 
+      = new corbaOptionValue(toCorbaText("Maxdocs"),
+			     toCorbaText(_maxDocs));
+
+      queryFilter.filterOptions[7] 
+        = new corbaOptionValue(toCorbaText("MatchMode"),
+  			     toCorbaText("all"));
+
+    queryFilter.docSet        = new corbatext_t[0];
+    int resultOptions = NzdlConstants.FROID|NzdlConstants.FRtermFreq|NzdlConstants.FRranking;
+    queryFilter.filterResultOptions = resultOptions;
+    queryFilter.requestParams = toCorbaText("");
+    queryFilter.refParams     = toCorbaText("");
+    queryFilter.fields        = new corbatext_t[0];
+    queryFilter.getParents    = false;
+    return queryFilter;
+  }
+  
+  public static corbaFilterRequest createBrowseFilterRequest(String _docID, String _metaTag) {
+
+    corbaFilterRequest browseFilter = new corbaFilterRequest();
+    browseFilter.filter        = toCorbaText("BrowseFilter");
+
+    browseFilter.filterOptions = new corbaOptionValue[1];
+    browseFilter.filterOptions[0] 
+      = new corbaOptionValue(toCorbaText("ParentNode"),
+			     toCorbaText(_docID));
+
+    browseFilter.docSet        = new corbatext_t[0];
+    int resultOptions = NzdlConstants.FROID|NzdlConstants.FRmetadata;
+    browseFilter.filterResultOptions = resultOptions;
+    browseFilter.requestParams = toCorbaText("");
+    browseFilter.refParams     = toCorbaText("");
+    browseFilter.fields        = new corbatext_t[1];
+    browseFilter.fields[0]     = toCorbaText(_metaTag);
+    browseFilter.getParents    = false;
+    return browseFilter;
+  }
+
+  public static corbaFilterRequest createBrowseFilterRequest( String _docID ) {
+    corbaFilterRequest browseFilter = new corbaFilterRequest();
+    browseFilter.filter        = toCorbaText("BrowseFilter");
+    browseFilter.filterOptions = new corbaOptionValue[1];
+    browseFilter.filterOptions[0] 
+      = new corbaOptionValue(toCorbaText("ParentNode"),
+			     toCorbaText(_docID));
+    browseFilter.docSet        = new corbatext_t[0];
+    int resultOptions = NzdlConstants.FROID;
+    browseFilter.filterResultOptions = resultOptions;
+    browseFilter.requestParams = toCorbaText("");
+    browseFilter.refParams     = toCorbaText("");
+    browseFilter.fields        = new corbatext_t[0];
+    browseFilter.getParents    = false;
+    return browseFilter;
+  }
+
+  public static corbaFilterRequest createMetaDataFilterRequest( String _docID, String _metaTag ) {
+    corbaFilterRequest nullFilter = new corbaFilterRequest();
+    nullFilter.filter        = toCorbaText("NullFilter");
+    nullFilter.filterOptions = new corbaOptionValue[0];
+    nullFilter.docSet        = new corbatext_t[1];
+    nullFilter.docSet[0]     = toCorbaText(_docID);
+    int resultOptions = NzdlConstants.FRmetadata;
+    nullFilter.filterResultOptions = resultOptions;
+    nullFilter.requestParams = toCorbaText("");
+    nullFilter.refParams     = toCorbaText("");
+    nullFilter.fields        = new corbatext_t[1];
+    nullFilter.fields[0]     = toCorbaText(_metaTag);
+    nullFilter.getParents    = false;
+    return nullFilter;
+  }
+
+  public static corbaFilterRequest createMetaDataFilterRequest( List _docIDs, String _metaTag ) {
+    corbaFilterRequest nullFilter = new corbaFilterRequest();
+    nullFilter.filter = toCorbaText("NullFilter");
+    nullFilter.filterOptions = new corbaOptionValue[0];
+    // we will request the meta data for all documents in _docIDs set
+    nullFilter.docSet = new corbatext_t[_docIDs.size()];
+    int i=0;
+    for (ListIterator itr = _docIDs.listIterator(); itr.hasNext(); ) {
+      nullFilter.docSet[i] = toCorbaText( (String)itr.next() );
+      i++;
+    }
+    int resultOptions = NzdlConstants.FRmetadata;
+    nullFilter.filterResultOptions = resultOptions;
+    nullFilter.requestParams = toCorbaText("");
+    nullFilter.refParams     = toCorbaText("");
+    nullFilter.fields        = new corbatext_t[1];
+    // this is the meta (_metaTag) data we need
+    nullFilter.fields[0]     = toCorbaText(_metaTag);
+    nullFilter.getParents    = false;
+    return nullFilter;
+  }
+
+  public static corbaFilterResponseHolder createFilterResponseHolder() {
+    corbaFilterResponse responseFilter = new corbaFilterResponse();
+    responseFilter.numDocs = 0;
+    responseFilter.isApprox = corbaIsApprox.from_int(0);
+    responseFilter.termInfo = new corbaTermInfo[0];
+    responseFilter.docInfo = new corbaResultDocInfo[0];
+    return new corbaFilterResponseHolder(responseFilter);
+  }
+
+  public static corbaDocRequestHolder createDocRequestHolder( String _docID ) {
+    corbaDocRequest docRequest 
+      = new corbaDocRequest( toCorbaText( _docID ), toCorbaText(""), toCorbaText("") );
+    return new corbaDocRequestHolder(docRequest);
+  }
+
+  public static corbaDocResponseHolder createDocResponseHolder( ) {
+    corbaDocResponse docResponse = new corbaDocResponse( toCorbaText("") );
+    return new corbaDocResponseHolder( docResponse );
+  }
+
+}
+
+
+
+
+
