You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by kw...@apache.org on 2002/11/10 20:22:19 UTC

cvs commit: xml-xindice/java/scratchpad/admin/src/org/apache/xindice/admin/commands ListCommand.java

kward       2002/11/10 11:22:19

  Modified:    java/scratchpad/admin/src/org/apache/xindice/admin/commands
                        ListCommand.java
  Log:
  Adding Ant build and shell script
  
  Revision  Changes    Path
  1.4       +16 -6     xml-xindice/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java
  
  Index: ListCommand.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/scratchpad/admin/src/org/apache/xindice/admin/commands/ListCommand.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListCommand.java	9 Nov 2002 06:19:24 -0000	1.3
  +++ ListCommand.java	10 Nov 2002 19:22:19 -0000	1.4
  @@ -60,9 +60,12 @@
    */
   
   import org.apache.xindice.admin.commandline.BaseCommand;
  +import org.apache.xindice.admin.commandline.CommandException;
  +
   import java.util.Hashtable;
   import java.util.Vector;
   import java.util.Date;
  +import java.util.Enumeration;
   
   /**
    * Command for listing collections and documents
  @@ -91,14 +94,21 @@
   
           Hashtable message = new Hashtable();
           message.put("message", rpcmessage);
  -        message.put("collection", "/db");
  +        message.put("collection", DB);
           Hashtable result = null;
           try {
               result = (Hashtable) run(message);
           } catch(Exception e) {
  -            prompt.out.println(e);
  +            //prompt.out.println(e);
  +            return;
           } finally {
  -            prompt.out.println("\t"+result.get("result"));
  +            Vector list = (Vector) result.get("result");
  +            Enumeration enum = list.elements();
  +            while ( enum.hasMoreElements() ) {
  +                prompt.out.println("\t" + enum.nextElement().toString());
  +            }
           }
  -	}
  -}
  +
  +    }
  +
  +}
  \ No newline at end of file