Package org.apache.xindice.core

Examples of org.apache.xindice.core.Collection


      }

       Hashtable result = new Hashtable();
      try {

          Collection col = getCollection( (String) message.get(COLLECTION)
                                      + "/" + (String) message.get(NAME));
          col.dropCollection( col );
          result.put(RESULT, "yes");

      } catch (Exception e) {

          /* No such collection... */
 
View Full Code Here


      Hashtable result = new Hashtable();
      try {

          /* getCollection() throws an exception if collection doesnt exist */
          Collection col = getCollection( (String) message.get(COLLECTION) );
          result.put(RESULT, "yes");
      } catch (Exception e) {

          result.put(RESULT, "no");
      }
View Full Code Here

         index.setAttribute("pattern", (String) message.get(PATTERN));

         doc.appendChild(index);        
      }
     
      Collection col = getCollection( (String) message.get(COLLECTION) );
      Configuration config = new Configuration(doc.getDocumentElement(), false);    
      col.createIndexer( config );
     
      Hashtable result = new Hashtable();
      result.put(RESULT, (String) message.get(NAME));
      return result;
   }
View Full Code Here

      if(!message.containsKey(COLLECTION)) {
         throw new Exception(MISSING_COLLECTION_PARAM);
      }

      Collection col = getCollection( (String) message.get(COLLECTION) );

      Hashtable result = new Hashtable();
      result.put(RESULT, col.createNewOID().toString());
      return result;
   }
View Full Code Here

      if(!message.containsKey(DOCUMENT)) {
         throw new Exception(MISSING_DOCUMENT_PARAM);
      }

      Collection col = getCollection((String) message.get(COLLECTION));

      Document doc = DOMParser.toDocument((String) message.get(DOCUMENT));
      if ( doc == null ) {
         throw new Exception( "Unable to parse Document" );
      }

      String id = (String) message.get(NAME);
      col.setDocument( id, doc );

      Hashtable result = new Hashtable();
      result.put(RESULT, id);
      return result;
   }
View Full Code Here

      if(!message.containsKey(DOCUMENT)) {
         throw new Exception(MISSING_DOCUMENT_PARAM);
      }

      Collection col = getCollection((String) message.get(COLLECTION));

      Document doc = DOMParser.toDocument((String) message.get(DOCUMENT));
      if ( doc == null ) {
         throw new Exception( "Unable to parse Document" );
      }

      String id = (String) message.get(NAME);
      if ( id.equals( "" ) ) {
         id = col.insertDocument( doc ).toString();
      }
      else {
         col.insertDocument( id, doc );
      }
     
      Hashtable result = new Hashtable();
      result.put(RESULT, id);
      return result;
View Full Code Here

      if(!message.containsKey(NAME)) {
         throw new Exception(MISSING_NAME_PARAM);
      }

      Collection col = getCollection( (String) message.get(COLLECTION) );

      col.remove( (String) message.get(NAME) );
     
      Hashtable result = new Hashtable();
      result.put(RESULT, "yes");
      return result;
   }
View Full Code Here

      if(!message.containsKey(NAME)) {
         throw new Exception(MISSING_NAME_PARAM);
      }

      Collection col = getCollection( (String) message.get(COLLECTION) );

      col.dropIndexer( col.getIndexer((String) message.get(NAME)) );

      Hashtable result = new Hashtable();
      result.put(RESULT, "yes");
      return result;
   }
View Full Code Here

      if(!message.containsKey(COLLECTION)) {
         throw new Exception(MISSING_COLLECTION_PARAM);
      }

      Collection col = getCollection( (String) message.get(COLLECTION) );
      String[] cols = col.listCollections();

      Vector list = new Vector();
      for ( int i = 0; ( cols != null ) && ( i < cols.length ); i++ ) {
         list.addElement( cols[i] );
      }
View Full Code Here

      if(!message.containsKey(COLLECTION)) {
         throw new Exception(MISSING_COLLECTION_PARAM);
      }

      Collection col = getCollection( (String) message.get(COLLECTION) );

      Hashtable result = new Hashtable();

      result.put( RESULT, new Integer( (int) col.getDocumentCount() ) );
      return result;
   }
View Full Code Here

TOP

Related Classes of org.apache.xindice.core.Collection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.