Package org.apache.xindice.core

Examples of org.apache.xindice.core.Collection


        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

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

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

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

                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

        if (!message.containsKey(META)) {
            throw new Exception(MISSING_META_PARAM);
        }

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

        // Read and store sent meta data
        MetaData meta = new MetaData();
        Document doc = DOMParser.toDocument((String) message.get(META));
        meta.streamFromXML(doc.getDocumentElement());
        col.setCollectionMeta(meta);

        // Retreive stored meta data and sent back
        meta = col.getCollectionMeta();
        doc = new DocumentImpl();
        doc.appendChild(meta.streamToXML(doc, true));
        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
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);
        }

        // Read and store sent meta data
        MetaData meta = new MetaData();
        Document doc = DOMParser.toDocument((String) message.get(META));
        meta.streamFromXML(doc.getDocumentElement());
        col.setDocumentMeta(docname, meta);

        // Retreive stored meta data and sent back
        meta = col.getDocumentMeta(docname);
        doc = new DocumentImpl();
        meta.streamToXML(doc, true);
        result.put(RESULT, TextWriter.toString(doc));
        return result;
    }
View Full Code Here

            printInfo("Xindice Server: "+db.getCanonicalName());
            printInfo("");

            String[] cols = db.listCollections();
            for ( int i = 0; i < cols.length; i++ ) {
               Collection c = db.getCollection(cols[i]);
               printItem(c.getName(), c.getCanonicalName());
            }
            printEOF();
         }
         catch ( Exception e ) {
            org.apache.xindice.Debug.printStackTrace(e);
View Full Code Here

            printInfo("Collection: "+colName);
            printInfo("");

            if ( col.getParentCollection() != null ) {
               Collection c = col.getParentCollection();
               printItem("["+c.getName()+"]", c.getCanonicalName());
            }
            else
               printItem("["+db.getName()+"]", db.getCanonicalName());

            printSearch("[XPath Query]", col.getCanonicalName());
            String[] collections = col.listCollections();
            for ( int i = 0; i < collections.length; i++ ) {
               Collection c = col.getCollection(collections[i]);
               printItem(c.getName(), c.getCanonicalName());
            }
            if ( col.getFiler() != null ) {
               RecordSet recs = col.getFiler().getRecordSet();
               displayRecordSet(col, recs);
            }
View Full Code Here

    * @return The requested SymbolTable
    */
   public SymbolTable loadSymbols(Collection collection) throws DBException  {
      String name = getSymbolTableName(collection);

      Collection symCol = getCollection(SYMBOLS);

      SymbolTable symbols = (SymbolTable)symCol.getObject(name);
      if ( symbols == null ) {
         symbols = new SymbolTable();
         saveSymbols(collection, symbols);
      }
      return symbols;
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.