Package de.innovationgate.wga.config

Examples of de.innovationgate.wga.config.ContentStore


  public Map<String, IContainer> getConnectedDesignContainers() throws IncompatibleWGAConfigVersion, IOException {
    Map<String, IContainer> contentDesign = new HashMap<String, IContainer>();
    Iterator<ContentStore> itCS = retrieveWGAConfig(false).getContentStores().iterator();
    while (itCS.hasNext()) {
      ContentStore currentContentStore = itCS.next();
      Design currentDesign = currentContentStore.getDesign();
      if (currentDesign != null && currentDesign.getSource() != null && currentContentStore.isEnabled() && currentDesign.getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
        IFolder designFolder = getDesignRoot().getFolder(new Path(currentDesign.getName()));
        if (WGADesignStructureHelper.isDirlinkFolder(designFolder)) {
          contentDesign.put(currentContentStore.getKey(), (WGADesignStructureHelper.dirLinkFolderToContainer(designFolder)));
        } else {
          contentDesign.put(currentContentStore.getKey(), designFolder);
        }
      }
    }
    return contentDesign;
  }
View Full Code Here


    Iterator<ContentDatabase> contentDbs = wgaConf.getContentDatabases().iterator();

    while (contentDbs.hasNext()) {
      ContentDatabase currentDB = contentDbs.next();
      if (currentDB instanceof ContentStore) {
        ContentStore currentCS = (ContentStore) currentDB;
        if (currentCS.getDesign() != null && currentCS.getDesign().getName().equals(designName)) {
          css.add(currentCS);
        }
      }

    }
View Full Code Here

  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);
      }
      saveWGAConfig(wgaConf);
    }
  }
View Full Code Here

  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)) {

        contentDbs.remove(currentCS);
        currentCS.getDesign().setName(designNameTo);
        currentCS.setTitle(designNameTo);

        contentDbs.add(currentCS);

      }
    }
View Full Code Here

        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

                // 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

        _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);
                }
            }
            catch (IncompatibleWGAConfigVersion e) {
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);

                        monitor.setTaskName("updating remote server configuration");
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

          // determine designcontainer of selected tml warning
          IContainer designContainer = null;
          if (_warning.getDb() != null) {
              if (!_warning.getDb().startsWith("plugin-")) {
                  WGAConfiguration wgaConfiguration = runtime.retrieveWGAConfig(false);
                  ContentStore cs = wgaConfiguration.getContentStore(_warning.getDb());
                  if (cs != null && cs.getDesign() != null && cs.getDesign().getSource() != null && cs.getDesign().getSource().equals("fs-designs")) {
                      IFolder[] designFolders = runtime.getDesignsAsFolder(true);
                      for (IFolder designFolder : designFolders) {
                          if (designFolder.getName().equals(cs.getDesign().getName())) {
                              designContainer = designFolder;
                              break;
                          }
                      }
                  }
View Full Code Here

      }
     
      // iterate over contentstores and check design references
      Iterator<ContentStore> itCS = currentRuntime.retrieveWGAConfig(false).getContentStores().iterator();
      while (itCS.hasNext()) {
        ContentStore currentContentStore = itCS.next();
        Design currentDesign = currentContentStore.getDesign();

        if (currentDesign != null && currentDesign.getSource() != null && currentDesign.getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
          //IPath designPath = currentRuntime.getDesignRoot().getFullPath().append(currentDesign.getName());       

          if (container.getParent() != null && container.getParent().equals(currentRuntime.getDesignRoot()) && container.getName().equals(currentDesign.getName())) {
            ContentStoreRefactoringInfo info = new ContentStoreRefactoringInfo(container, arguments);
            info.setRuntime(currentRuntime);
            info.setContentStoreUID(currentContentStore.getUid());
            links.add(info);
          }
        }

      }
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.