Package de.innovationgate.wga.config

Examples of de.innovationgate.wga.config.WGAConfiguration$CachingOptionReader


  }

  private void updateDomainCombo(WGARuntime runtime) {
    if (runtime != null) {
      _domains.clear();
      WGAConfiguration config;
      try {
        config = runtime.retrieveWGAConfig(false);
        if (config != null) {
          Iterator<Domain> domains = config.getDomains().iterator();
          while (domains.hasNext()) {
            Domain domain = domains.next();
            _domains.put(domain.getName(), domain);
          }
        }
View Full Code Here


      }
     
     
      // check if contentstore already exists
      if (_selectedRuntime != null) {
        WGAConfiguration config = null;
        try {
          config = _selectedRuntime.retrieveWGAConfig(false);
        } catch (IncompatibleWGAConfigVersion e) {
        } catch (IOException e) {
        }
        if (config != null) {
          if (config.hasContentDatabase(getDatabaseKey())) {
            applyStatus("A database with key '" + getDatabaseKey() + "' already exists in the specified WGA runtime.", IStatus.ERROR);
            setPageComplete(false);
            return;
          }
        }
View Full Code Here

   * @throws IncompatibleWGAConfigVersion
   */

  public void unregisterDesign(String dbKey) throws IncompatibleWGAConfigVersion, IOException {
    if (getWGAConfigFile().exists()) {
      WGAConfiguration wgaConf = retrieveWGAConfig(false);
      List<ContentDatabase> contentDbs = wgaConf.getContentDatabases();
      ContentStore currentCS = wgaConf.getContentStore(dbKey);
      if (currentCS.getDesign().getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
        contentDbs.remove(currentCS);
        currentCS.setDesign(null);
        currentCS.setEnabled(false);
        contentDbs.add(currentCS);
View Full Code Here

      saveWGAConfig(wgaConf);
    }
  }

  public void changeDesignNameInContentStores(String designNameFrom, String designNameTo) throws IncompatibleWGAConfigVersion, IOException {
    WGAConfiguration wgaConf = retrieveWGAConfig(false);
    List<ContentDatabase> contentDbs = wgaConf.getContentDatabases();
    Iterator<ContentStore> css = getContentStoresWithDesign(wgaConf, designNameFrom).iterator();
    while (css.hasNext()) {
      ContentStore currentCS = css.next();
      if (currentCS.getDesign().getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
View Full Code Here

      if (design instanceof WGADesign) {
        container = ((WGADesign) design).getProject();
      } else {
        container = (IFolder) design;
      }
      WGAConfiguration wgaConfig = null;
      try {
        wgaConfig = retrieveWGAConfig(true);
      } catch (IncompatibleWGAConfigVersion e) {
        MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning",
            "Unable to register design in runtime. WGA Version seams to be incompatible. Please ensure you are using the latest version of WGADevelopmentStudio.");
        WGADesignerPlugin.getDefault().logError(e.getMessage(), e);
      } catch (IOException e) {
        throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create default wga configuration.", e));
      }

      if (wgaConfig != null) {
        if (dbkey == null) {
          dbkey = container.getName();
        }
        dbkey = dbkey.toLowerCase();
        if (title == null) {
          title = container.getName();
        }
        if (domain == null) {
          domain = wgaConfig.getDefaultDomain();
        }
        // check if db already exists
        boolean csExists = wgaConfig.hasContentDatabase(dbkey);
        if (csExists) {
          throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "A database with key '" + dbkey + "' already exists."));
        } else {
          int existingDbs = wgaConfig.getContentDatabases().size();
          ContentStore cs = wgaConfig.createContentStoreOnEmbeddedServer(dbkey, container.getName());
          cs.setDomain(domain.getUid());
          cs.setTitle(title);

          if (properties != null) {
            cs.setDefaultLanguage(properties.getProperty(DesignTemplate.PROP_DEFAULT_LANGUAGE, Locale.getDefault().getLanguage()));
          } else {
            cs.setDefaultLanguage(Locale.getDefault().getLanguage());
          }

          // if this is the first autocreated db - make it the default
          // db
          if (wgaConfig.getDefaultDatabase() == null && existingDbs == 0) {
            wgaConfig.setDefaultDatabase(cs.getKey());
          }
        }

        try {
          saveWGAConfig(wgaConfig);
View Full Code Here

    if (!wgaXML.exists()) {
      if (!createDefaultIfMissing) {
        return null;
      } else {
        // create default config
        WGAConfiguration config = WGAConfiguration.createDefaultConfig();
        // int segmentCount =
        // _wgaBase.getLocation().matchingFirstSegments(_luceneRoot.getLocation());
        // IPath relativeLucenePath =
        // _luceneRoot.getLocation().removeFirstSegments(segmentCount);
        // config.getLuceneManagerConfiguration().setPath(relativeLucenePath.toString());
        // config.getDesignConfiguration().getDesignSource(Constants.DESIGNCOL_FILESYSTEM).getOptions().put("path",
        // "../designs");
        Domain defaultDomain = config.getDefaultDomain();
        defaultDomain.setDefaultManager("managers");
        defaultDomain.createFileBasedAuthentication("auth.xml");

        config.getServerOptions().put(WGAConfiguration.SERVEROPTION_SERVER_NAME, getName());
        if (getRootURL() != null) {
          config.getServerOptions().put(WGAConfiguration.SERVEROPTION_ROOT_URL, getRootURL().toString());
        }

        // disable install wizard
        config.setRunWizard(false);
       
        saveWGAConfig(config);
        return config;
      }
    } else {

      synchronized (_wgaConfigLock) {
        FileInputStream wgaXMLStream = null;
        try {
          wgaXMLStream = new FileInputStream(wgaXML.getLocation().toFile());
          WGAConfiguration conf = WGAConfiguration.read(wgaXMLStream);
          return conf;
        } catch (Exception e) {
          IncompatibleWGAConfigVersion notConfigurable = new IncompatibleWGAConfigVersion("Unable to read wga configuration.", e);
          throw notConfigurable;
        } finally {
View Full Code Here

        configFile.setResourceAttributes(attributes);
      }

      // we might have to update root url bc. of distribution changes
      if (getRootURL() != null) {
        WGAConfiguration wgaConfig = retrieveWGAConfig(false);
        if (wgaConfig != null) {
          wgaConfig.getServerOptions().put(WGAConfiguration.SERVEROPTION_ROOT_URL, getRootURL().toString());
          saveWGAConfig(wgaConfig);
        }
      }
      configFileStream = new FileOutputStream(configFile.getLocation().toFile());
      WGARuntimeConfiguration.write(_config, configFileStream);
View Full Code Here

               
                // check domain
                taskStatus = _taskStatusMap.get(DOMAIN_TASK);                  
                try {
                    // retrieve local domain
                    WGAConfiguration localConfig = _runtime.retrieveWGAConfig(false);
                    ContentStore localCS = localConfig.getContentStore(_webApplication.toLowerCase());
                    String localDomainUID = localCS.getDomain();
                    Domain localDomain = localConfig.getDomain(localDomainUID);
                    boolean hasDomain = false;
                    for (Domain remoteDomain : _config.getDomains()) {
                        if (remoteDomain.getName().equals(localDomain.getName())) {
                            hasDomain = true;
                        }
View Full Code Here

        _dbServers = dbServers;
        _tblDatabaseServers.setInput(_dbServers);
        ExportWGAApplication wizard = (ExportWGAApplication)getWizard();
        if (_txtDatabaseName != null) {           
            try {
                WGAConfiguration config = wizard.getRuntime().retrieveWGAConfig(false);
                ContentStore cs = config.getContentStore(wizard.getWebApplication());
                String path = cs.getDatabaseOptions().get(ExportWGAApplication.CS_PATH_OPTION_NAME);
                if (path != null) {
                    _txtDatabaseName.setText(path);
                }
            }
View Full Code Here

                            }
                        });
                        monitor.worked(1);

                        monitor.setTaskName("configuring content store");
                        WGAConfiguration localConfig = _runtime.retrieveWGAConfig(false);
                        ContentStore cs = localConfig.getContentStore(_webApplication);
                        cs.getDatabaseOptions().put(CS_PATH_OPTION_NAME, _remoteDatabaseName);
                        cs.setDbServer(_remoteDatabaseServer.getUid());
                        cs.setImplClassName(_remoteDatabaseServer.getCreateableContentStoreImplemenations().get(0));
                        String remoteDomainUID = null;
                        if (cs.getDomain().equals("default")) {
                            remoteDomainUID = "default";
                        } else {
                            String localDomainName = localConfig.getDomain(cs.getDomain()).getName();
                            remoteDomainUID = getDomainUID(_remoteWGAConfiguration, localDomainName);
                        }
                        cs.setDomain(remoteDomainUID);                       
                        _remoteWGAConfiguration.add(cs);
                        monitor.worked(1);
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.config.WGAConfiguration$CachingOptionReader

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.