Package org.apache.xindice.core

Examples of org.apache.xindice.core.Collection$ColContainer


            container = col.getContainer(name);
            document = container.getDocument();
            return DOCUMENT;

         case COLLECTION:
            Collection c = col.getCollection(name);
            if ( c != null ) {
               collection = c;
               String tmp = parseName("/(?");
               // If we have another name recurse to handle it.
               if (! tmp.equals("")) {
View Full Code Here


         Database db = Database.getDatabase( dbName );
         if ( db == null ) {
            throw new Exception( "Database " + dbName + " could not be found" );
         }
         Collection col = db.getCollection( colName );
         if ( col == null ) {
            throw new Exception( "Collection " + colName + " could not be found" );
         }

         return col;
View Full Code Here

         throw new Exception(MISSING_META_PARAM);
      }

      String collection = (String)message.get(COLLECTION);
      String docname = (String)message.get(NAME);
      Collection col = getCollection( collection );
      Hashtable result = new Hashtable();
      if( !col.isMetaEnabled() )
      {
         // meta information is not enabled !
         throw new Exception(MISSING_META_CONFIGURATION);
      }
      String metaxml = (String)message.get(META);
      MetaData meta = new MetaData();

      Document doc = DOMParser.toDocument( metaxml );

      meta.streamFromXML(doc.getDocumentElement());
      col.setDocumentMeta(docname,meta);

    MetaData ret_meta = col.getDocumentMeta(docname);
      Document ret_doc = new DocumentImpl();
      ret_meta.streamToXML(ret_doc, true);
       
      result.put( RESULT, TextWriter.toString( ret_doc ) );
      return result;
View Full Code Here

* @author <a href="mailto:james.bates@amplexor.com">James Bates</a>
*/
public class GetCollectionCount extends RPCDefaultMessage {  
  
   public Hashtable execute(Hashtable message) throws Exception {
      Collection col = getCollection( (String) message.get(COLLECTION) );

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

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

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

      Document doc = col.getDocument( (String) message.get(NAME) );
      if ( doc == null ) {
         throw new Exception( API_NAME + ": Document not found " +
                              (String) message.get(NAME) );
      }

      Hashtable result = new Hashtable();
      if (message.containsKey(COMPRESSED)) {
         try {
            symbolSerializer = new SymbolSerializer(col.getSymbols());
         }
         catch ( Exception e ) {
            // It's ok (in theory) for a Collection to have no symbol table
         }
View Full Code Here

  *
  * @param message the parameters passed to the xmlrpc method.
  * @return Hashtable containing the XML for the requested MetaData object.
    */
   public Hashtable execute(Hashtable message) throws Exception {
      Collection col = getCollection( (String) message.get(COLLECTION) );
      Hashtable result = new Hashtable();
      if( !col.isMetaEnabled() )
      {
         // meta information is not enabled !
         throw new Exception(MISSING_META_CONFIGURATION);
      }
      MetaData meta = col.getCollectionMeta();
      Document doc = new DocumentImpl();
      meta.streamToXML(doc, true);

      result.put( RESULT, TextWriter.toString( doc ) );
      return result;
View Full Code Here

  *
  * @param message the parameters passed to the xmlrpc method.
  * @return Hashtable containing the XML for the requested MetaData object.
    */   
   public Hashtable execute(Hashtable message) throws Exception {
      Collection col = getCollection( (String) message.get(COLLECTION) );
      Hashtable result = new Hashtable();
      if( !col.isMetaEnabled() )
      {
         // meta information is not enabled !
         throw new Exception(MISSING_META_CONFIGURATION);
      }

      if(!message.containsKey(NAME)) {
         throw new Exception(MISSING_NAME_PARAM);
      }
      String docname = (String)message.get(NAME);
      MetaData meta = col.getDocumentMeta(docname);
      Document doc = new DocumentImpl();
      meta.streamToXML(doc, true);

      result.put( RESULT, TextWriter.toString( doc ) );
      return result;
View Full Code Here

      Hashtable result = new Hashtable();

      // TODO: figure out what goes here. done.
      try {

          Collection col = getCollection( (String) message.get(COLLECTION) );
          Indexer idx = col.getIndexer((String) message.get(NAME));

          if (idx != null) {

              result.put(RESULT, "yes");
          } else {
View Full Code Here

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

      Collection col = getCollection( (String) message.get(COLLECTION) );
      String[] list = col.listIndexers();

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

      if(!message.containsKey(QUERY)) {
         throw new Exception(MISSING_QUERY_PARAM);
      }

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

      if (message.containsKey( NAME )) {

         ns = col.queryDocument( (String)message.get(TYPE), (String)message.get(QUERY), mapNamespaces( (Hashtable)message.get(NAMESPACES) ), (String)message.get(NAME) );

      } else {

         ns = col.queryCollection( (String)message.get(TYPE), (String)message.get(QUERY), mapNamespaces( (Hashtable)message.get(NAMESPACES) ) );
      }

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

TOP

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

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.