Package de.innovationgate.wga.config

Examples of de.innovationgate.wga.config.ContentStore


  private static Change createRenameDesignReferenceChange(ContentStoreRefactoringInfo info) throws Exception {
   
 
    TextFileChange change = new TextFileChange("", info.getRuntime().getWGAConfigFile());   
    WGAConfiguration config = info.getRuntime().retrieveWGAConfig(false);
    ContentStore currentContentStore = (ContentStore)config.getByUid(info.getContentStoreUID());
   
   
    boolean configChanged = false;
    if(info.getArguments() instanceof RenameArguments){         
      currentContentStore.getDesign().setName(computeNewDesignReference(info));     
      configChanged=true;
    }else if(info.getArguments() instanceof MoveArguments){
      currentContentStore.setEnabled(false)
      configChanged=true;
    }else if(info.getArguments() instanceof DeleteArguments) {
      // check if wgaconfig will still exists after deletion is performed - otherwise we can skip any change here
      if (!info.getElement().getFullPath().isPrefixOf(info.getRuntime().getWGAConfigFile().getFullPath())) {
        currentContentStore.setEnabled(false);     
        configChanged=true;
     
    }   
   
   
View Full Code Here


            db.setTitle(title);
        }

        // Inject the default language if configured, else trigger determination
        if (config instanceof ContentStore) {
            ContentStore csConfig = (ContentStore) config;
            if (!WGUtils.isEmpty(csConfig.getDefaultLanguage())) {
                db.setDefaultLanguage(csConfig.getDefaultLanguage());
            }
            else {
                try {
                    db.determineDefaultLanguage();
                }
                catch (WGAPIException e) {
                    getLog().error("Exception determining default language for " + dbType + " " + db.getDbReference(), e);
                }
            }
        }
       
        // Set mandatory database attributes
        initializeDBAttributes(db, strKey, domainConfig.getName(), firstLevelDBOptions);
       
        // Inject domain authentication module
        if (domainConfig.getAuthModule() != null) {
            try {
                db.setAuthenticationModule(new DomainRedirectionAuthModule(this, domainConfig.getName()));
            }
            catch (WGIllegalArgumentException e) {
                String message = "Exception setting authentication module of " + dbType + " '" + strKey + "'";
                getLog().error(message, e);
                getLog().error("Cancelling connection of " + dbType + " '" + strKey + "' because the configured authentication could not be set");
                dbConnectionFailures.put(strKey, message);
                try {
                    db.close();
                }
                catch (Exception e2) {
                }
                return null;
            }
        }

        // Configure design provider, if neccessary
        if (config instanceof ContentStore) {
          ContentStore csConfig = (ContentStore) config;
          if (csConfig.getDesign() != null) {
            getDesignManager().applyDesign(db, csConfig)
          }
        }
       
        // Determine if ACL is empty
View Full Code Here

        // if not create dropRequest
        Iterator itIndexedDbKeys = _indexedDbs.keySet().iterator();
        while (itIndexedDbKeys.hasNext()) {
            String dbKey = (String) itIndexedDbKeys.next();
           
            ContentStore dbConfig = _core.getWgaConfiguration().getContentStore(dbKey);
            if (dbConfig == null) {
                // indexed db not found in config, remove db and drop from index
                removeDatabase(dbKey, true);
                // remove from indexed dbs, cannot be done in removeDatabase() because of current iteration over indexedDbKeys
                //itIndexedDbKeys.remove(); // now done in removeDatabase via copy-replace
            } else if ( !dbConfig.isEnabled() ) {
                    // if db was disabled, only remove from indexedDbs - do not drop index
                    //itIndexedDbKeys.remove();
                    removeDatabase(dbKey, false);
            }
        }       
View Full Code Here

     * @param dbKey DatabaseKey
     * @return LuceneConfiguration, null if not found
     */
    public LuceneConfiguration retrieveLuceneConfig(String dbKey) {      
        //Create Lucene Config
      ContentStore dbConfig = _core.getWgaConfiguration().getContentStore(dbKey);
      if (dbConfig != null) {
        de.innovationgate.wga.config.LuceneIndexConfiguration luceneIndexConfig = dbConfig.getLuceneIndexConfiguration();
        if (luceneIndexConfig != null) {
          LuceneConfiguration config = new LuceneConfiguration();
          config.setEnabled(luceneIndexConfig.isEnabled());
          List itemRules = LuceneIndexItemRule.getRules(luceneIndexConfig.getItemRules());
          List fileRules = LuceneIndexFileRule.getRules(luceneIndexConfig.getFileRules());
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.config.ContentStore

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.