Examples of XMLConfiguration


Examples of at.bestsolution.efxclipse.tooling.ui.preview.text.XMLConfiguration

          final AnnotationModel model = new AnnotationModel();
          VerticalRuler verticalRuler = new VerticalRuler(VERTICAL_RULER_WIDTH, new AnnotationAccess());
          int styles = SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
          SourceViewer sourceViewer = new SourceViewer(folder, verticalRuler, styles);
          sourceViewer.configure(new XMLConfiguration(new ColorManager()));
          sourceViewer.setEditable(false);
          sourceViewer.getTextWidget().setFont(JFaceResources.getTextFont());

          IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] { XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT });
          partitioner.connect(document);
View Full Code Here

Examples of com.anthonyeden.lib.config.XMLConfiguration

   */
  public void init() {

    File configurationFile = new File(WebappHelper.getContextRoot() + CONFIG_FILE);

    XMLConfiguration instConfigSection = null;
    try {
      instConfigSection = new XMLConfiguration(configurationFile);
    } catch (ConfigurationException ce) {
      throw new StartupException("Error loading institution portlet configuration file!", ce);
    }
    if (instConfigSection == null) { throw new StartupException("Error loading institution portlet configuration file!"); }

    institutions = new FastHashMap();
    for (Iterator iter = instConfigSection.getChildren("institution").iterator(); iter.hasNext();) {
      Configuration instConfigEntry = (Configuration) iter.next(); // the institutions config entry
      String shortName = instConfigEntry.getAttribute("shortname"); // short name of inst

      if (shortName == null) { throw new StartupException("Institution portlet startup: No shortname given for one entry!"); }
      try {
View Full Code Here

Examples of com.anthonyeden.lib.config.XMLConfiguration

  public void importGroups(BGContext context, File fGroupExportXML) {
    if (!fGroupExportXML.exists()) return;

    Configuration groupConfig = null;
    try {
      groupConfig = new XMLConfiguration(fGroupExportXML);
    } catch (ConfigurationException ce) {
      throw new OLATRuntimeException("Error importing group config.", ce);
    }
    if (!groupConfig.getName().equals(EXPORT_KEY_ROOT)) throw new AssertException("Invalid group export file. Root does not match.");
View Full Code Here

Examples of com.anthonyeden.lib.config.XMLConfiguration

      }
    }
  }

  private String readPatchesXml(File patchesNewest, List<Map> patches) {
    XMLConfiguration patchConfig = null;
    Map<String, String> m;
    try {
      patchConfig = new XMLConfiguration(patchesNewest);
      for (Iterator<Configuration> it = patchConfig.getChildren().iterator(); it.hasNext();) {
        Configuration aPatchConfig = it.next();
        m = new HashMap<String, String>();
        m.put("id", aPatchConfig.getAttribute("patch-id"));
        m.put("enabled", aPatchConfig.getAttribute("enabled"));
        m.put("jira", aPatchConfig.getAttribute("jira"));
        m.put("tag", aPatchConfig.getAttribute("tag"));
        m.put("title", aPatchConfig.getChildValue("description"));
        patches.add(m);
      }
      return patchConfig.getAttribute("basetag");
    } catch (ConfigurationException e) {
      m = new HashMap<String, String>();
      m.put("id", "Problems reading patches.xml.newest: "+e);
      m.put("enabled", "");
      m.put("jira", "");
View Full Code Here

Examples of com.anthonyeden.lib.config.XMLConfiguration

  /**
   * Read previousely exported Propertiesproperties
   */
  private void loadConfiguration() {
    try {
      repositoryProperties = new XMLConfiguration(new File(baseDirectory, PROPERTIES_FILE));
    } catch (ConfigurationException ce) {
      throw new OLATRuntimeException("Error importing repository entry properties.", ce);
    }
    if (!repositoryProperties.getName().equals(PROP_ROOT))
      throw new AssertException("Invalid repository entry properties export file. Root does not match.");
View Full Code Here

Examples of com.anthonyeden.lib.config.XMLConfiguration

        }
      } else {
        log.info("parsing configuration file now: "+configurationFile.getAbsolutePath());
      }
      try {
        configuration = new XMLConfiguration(configurationFile);
      } catch (ConfigurationException ce) {
        log.warn("Error loading config file: '" + CONFIG_FILE + "'.");
        abort(ce);
      }
 
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

        this.name = filename;
        if (!(new File(filename).exists())) {
            createNewFile(filename, ROOT_ELEMENT);
        }
        try {
            config = new XMLConfiguration(filename);
        } catch (ConfigurationException e) {
            createNewFile(filename, ROOT_ELEMENT);
            try {
                config = new XMLConfiguration(filename);
            } catch (ConfigurationException e1) {
                throw new ChaiDBException(ErrorCode.CONFIG_FILE_READ_ERROR, e);
            }
        }
        config.setEncoding("UTF-8");
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

  private void loadConfiguration(String configurationFile) throws ConfigurationException {
    //Properties from system properties
    CompositeConfiguration compositeConfig = new CompositeConfiguration();
    compositeConfig.addConfiguration(new SystemConfiguration());
    //Properties from XML file
    XMLConfiguration xmlConfig = null;
    if (configurationFile!=null) {
      xmlConfig = new XMLConfiguration(configurationFile);
    } else {
      final String filename = System.getProperty(UDDI_CONFIG_FILENAME_PROPERTY);
      if (filename != null) {
        xmlConfig = new XMLConfiguration(filename);
      } else {
        xmlConfig = new XMLConfiguration(DEFAULT_UDDI_CONFIG)
      }
    }
    log.info("Reading UDDI Client properties file " + xmlConfig.getBasePath());
    long refreshDelay = xmlConfig.getLong(Property.UDDI_RELOAD_DELAY, 1000l);
    log.debug("Setting refreshDelay to " + refreshDelay);
    FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
    fileChangedReloadingStrategy.setRefreshDelay(refreshDelay);
    xmlConfig.setReloadingStrategy(fileChangedReloadingStrategy);
    compositeConfig.addConfiguration(xmlConfig);
    //Making the new configuration globally accessible.
    config = compositeConfig;
    loadManager();
  }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

    XMLWriter x = new XMLWriter(w);
    try {
      x.write(el);
    } catch (IOException e) {
    }
    XMLConfiguration xmlConfig = new XMLConfiguration();
    try {
      xmlConfig.load(new StringReader(w.toString()));
    } catch (ConfigurationException e) {
      throw new JibeRuntimeException(e);
    }
    xmlConfig.setExpressionEngine(new XPathExpressionEngine());
    cc.setConfiguration(xmlConfig);
    return cc;
  }
View Full Code Here

Examples of org.apache.commons.configuration.XMLConfiguration

  private java.util.List<String> parseConfigFile() {
    java.util.List<String> values = new ArrayList();

    try {
      final XMLConfiguration initial = new XMLConfiguration(gui.getConfig().getProperty("genericconffile"));
      initial.setExpressionEngine(new XPathExpressionEngine());
     
      for (final HierarchicalConfiguration subconf : (java.util.List<HierarchicalConfiguration>)
          initial.configurationsAt("/generic/template")) {
        final String name = subconf.getString("name");
        if (name != null) values.add(name);
      }
    } catch (final ConfigurationException ex) {
      log.error("Exception", ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.