Package org.apache.xindice.core

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


      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


      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);
      }
      String metaxml = (String)message.get(META);
      MetaData meta = new MetaData();

      Document doc = DOMParser.toDocument( metaxml );
      meta.streamFromXML(doc.getDocumentElement());
      col.setCollectionMeta(meta);

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

         throws DBException, Exception {
      StringBuffer result = new StringBuffer();

      String path = parser.getPath();

      Collection col;
      if (!path.equals("")) {
         col = db.getCollection(parser.getPath());
      } else {
         col = db;
      }

      if (col == null) {
         result.append("Collection not found! " + parser.getPath());
         return result.toString();
      }

      String[] cols = col.listCollections();
      for (int i = 0; i < cols.length; i++) {
         result.append("<a href=\"" + contextPath + "?" +
            parser.getDatabase() + "/" + parser.getPath());
         result.append("/");
         result.append(cols[i]);
         result.append("\">");
         result.append(cols[i]);
         result.append("</a><br>");
      }

      try {
         String[] docs = col.listDocuments();
         for (int i = 0; i < docs.length; i++) {
            result.append("<a href=\"" + contextPath + "?" +
               parser.getDatabase() + "/" + parser.getPath());
            result.append("&");
            result.append(docs[i]);
View Full Code Here

      return result.toString();
   }

   protected String getDetailView(XPathPseudoParser parser)
         throws Exception {
      Collection col = this.db.getCollection(parser.getPath());

      String document = parser.getDocument();
      if (document == null) {
         return "";
      }

      Document doc = col.getDocument(document);
      if (doc == null) {
         return "Document '" + document + "' not found";
      }

      return "Document '" + document + "'<p>" + TextWriter.toString(doc);
View Full Code Here

* @version CVS $Revision: 1.5 $, $Date: 2003/08/07 20:13:23 $
*/
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

     *
     * @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();
        doc.appendChild(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();
        doc.appendChild(meta.streamToXML(doc, true));

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

        String id = (String) message.get(NAME);
        if ("".equals(id)) {
            id = null;
        }

        Collection col = getCollection((String) message.get(COLLECTION));
        if (obj instanceof byte[]) {
            id = col.insertBinary(id, (byte[])obj).toString();
        } else {
            Document doc = DOMParser.toDocument((String) obj);
            id = col.insertDocument(id, doc).toString();
        }

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

            throw new Exception(MISSING_COLLECTION_PARAM);
        }

        Hashtable result = new Hashtable();
        try {
            Collection col = getCollection((String) message.get(COLLECTION));
            Indexer idx = col.getIndexer((String) message.get(NAME));

            if (idx != null) {
                result.put(RESULT, "yes");
            } else {
                result.put(RESULT, "no");
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

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.