Package org.apache.xindice.util

Examples of org.apache.xindice.util.Configuration


   }
  
   public void setConfig(Configuration config) throws XindiceException {
      this.config = config;

      Configuration colConfig = config.getChild(COLLECTIONS);
      if ( colConfig != null ) {
         colConfig.processChildren(COLLECTION,
            new ConfigurationCallback() {
               public void process(Configuration cfg) throws XindiceException {
                  // check for an existing Collection by name and, if found, skip creating a new Collection
                  // else, create a new child Collection, configure it an add it
                  // if the Collection already exists in our collections list,
View Full Code Here


      else {
         final String name = collection.getName();
         boolean dropped = collection.drop();
         if ( dropped ) {
            collections.remove(name);
            Configuration colConfig = config.getChild(COLLECTIONS);
            colConfig.processChildren(COLLECTION,
               new ConfigurationCallback() {
                  public void process(Configuration cfg) {
                     try {
                        if ( cfg.getAttribute(NAME).equals(name) )
                           cfg.delete();
View Full Code Here

            throw new DBException(FaultCodes.COL_CANNOT_CREATE, "No name specified");
        
         if ( getCollection(n) != null )
            throw new DBException(FaultCodes.COL_DUPLICATE_COLLECTION, "Duplicate Collection '"+n+"'");

         Configuration colConfig = this.config.getChild(COLLECTIONS, true);
         colConfig.add(cfg);
        
         collection.setConfig(cfg);
         collection.create();
         collections.put(n, collection);
         if (log.isInfoEnabled()) {
View Full Code Here

       + "   </collections>"
       + "</collection>";

        try {
            Document metaDoc = DOMParser.toDocument(MetaCol);
            Configuration metaCfg = new Configuration(metaDoc, false);
            setConfig(metaCfg);
        }
        catch ( Exception e ) {
      if (log.isFatalEnabled()) {
                log.fatal("FATAL ERROR: Generating System Collection '"+METACOL+"'", e);
View Full Code Here

                "</collection>";

                try
                {
                    Document cfgDoc = DOMParser.toDocument(cfgText);
                    Configuration cfg = new Configuration(cfgDoc, false);
                    childcol = current.createCollection(segment, cfg);
                }
                catch( DBException de )
                {
                    throw de;
View Full Code Here

    * getCollection method is called.
    */
   public DatabaseImpl()
         throws FileNotFoundException,
         XindiceException {
      Configuration config;

      String configFile = System.getProperty(Xindice.PROP_XINDICE_CONFIGURATION);
      if (configFile != null && !configFile.equals("")) {
         if (log.isInfoEnabled()) {
            log.info("Specified configuration file: '" + configFile + "'");
         }
         FileInputStream configXMLFile = new FileInputStream(new File(configFile));

         config = new Configuration(DOMParser.toDocument(configXMLFile), false);
      }
      else {
         if (log.isInfoEnabled()) {
            log.info("No configuration file specified, going with the default configuration");
         }
         config = new Configuration(DOMParser.toDocument(Xindice.DEFAULT_CONFIGURATION), false);
      }

      config = config.getChild("root-collection", false);

      /* First try to find an existing Database by name.  If it doesn't exist,
       * we create one and in both cases we configure them with the current
       * configuration */
      String dbname = config.getAttribute(Database.NAME);

      this.db = Database.getDatabase(dbname);
      if (this.db == null) {
         this.db = new Database();
      }
View Full Code Here

   /* see superclass for documentation */
     public org.xmldb.api.base.Collection createCollection(String name, Document configuration) throws XMLDBException {
        checkOpen();
        try {
           Configuration config = new Configuration(configuration.getDocumentElement(), false);
           col.createCollection( name, config );

           return getChildCollection(name);
        }
        catch (Exception e) {        
View Full Code Here

   /* see superclass for documentation */
     public void createIndexer(Document configuration) throws XMLDBException {
        checkOpen();
        try {
           col.createIndexer(new Configuration(configuration, false));
        }
        catch (Exception e) {
           throw FaultCodes.createXMLDBException(e);
        }
     }
View Full Code Here

         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

                     break;
               }
               if ( type != null )
                  e.setAttribute("type", type);

               idxMgr.create(new Configuration(e));
            }
         }
         catch ( Exception e ) {
            if (log.isDebugEnabled()) {
               log.debug("No message", e);
View Full Code Here

TOP

Related Classes of org.apache.xindice.util.Configuration

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.