Examples of DOMDocument


Examples of org.dom4j.dom.DOMDocument

      response.setHeader("Cache-Control", "no-cache");

      HttpSession session = request.getSession();
      final FullTestResult testResult = (FullTestResult) session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT);

      DOMDocument report = new DOMDocument();
      DOMElement testsuite = new DOMElement("testsuite");
      report.setRootElement(testsuite);

      if (testResult == null)
      {
         // No JUnit test results generated.
      }
View Full Code Here

Examples of org.dom4j.dom.DOMDocument

      response.setHeader("Cache-Control", "no-cache");

      HttpSession session = request.getSession();
      final FullTestResult testResult = (FullTestResult) session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT);

      DOMDocument report = new DOMDocument();
      DOMElement testsuite = new DOMElement("testsuite");
      report.setRootElement(testsuite);

      if (testResult == null)
      {
         // No JUnit test results generated.
      }
View Full Code Here

Examples of org.dom4j.dom.DOMDocument

    // Test case(s)
    // -------------------------------------------------------------------------
    public void testBug1148333() {
        DOMDocumentFactory factory = (DOMDocumentFactory) DOMDocumentFactory
                .getInstance();
        DOMDocument doc = (DOMDocument) factory.createDocument();
        Element el = doc.addElement("root");
        el.addNamespace("pref2", "uri2");

        DOMDocument clone = (DOMDocument) doc.cloneNode(true);
       
        assertNotSame(doc, clone);
        assertNodesEqual(doc, clone);
    }
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

        Class configBeanClass = getClassForFullName(defaultValue.getConfigBeanClassName());
        Method m = findSuitableCollectionGetter(parentClass, configBeanClass);
        if (m != null) {
            ConfigParser configParser = new ConfigParser(serviceLocator);
            // I don't use the GlassFish document here as I don't need persistence
            final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
                @Override
                public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom,
                                ConfigModel configModel) {
                    // by default, people get the translated view.
                    return new GlassFishConfigBean(serviceLocator, this, dom, configModel, xmlStreamReader);
                }
            };

            ConfigBeanProxy parent = getOwningObject(defaultValue.getLocation());
            ConfigurationPopulator populator = new ConfigurationPopulator(defaultValue.getXmlConfiguration(), doc, parent);
            populator.run(configParser);
            ConfigBeanProxy configBean = doc.getRoot().createProxy(configBeanClass);
            Collection col = (Collection) m.invoke(parent);
            return (T) getConfigBeanFromCollection(col, configBean, configBeanClass);

        }
        return null;
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

     */
    public <T extends ConfigBeanProxy> void parseAndSetConfigBean(List<ConfigBeanDefaultValue> values) {

        ConfigParser configParser = new ConfigParser(serviceLocator);
        // I don't use the GlassFish document here as I don't need persistence
        final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
            @Override
            public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom, ConfigModel configModel) {
                return new GlassFishConfigBean(serviceLocator, this, dom, configModel, xmlStreamReader);
            }
        };

        //TODO requires rework to put all the changes that a service may introduce into one transaction
        //the solution is to put the loop into the apply method...  But it would be some fine amount of work
        for (final ConfigBeanDefaultValue configBeanDefaultValue : values) {
            final ConfigBeanProxy parent = configModularityUtils.getOwningObject(configBeanDefaultValue.getLocation());
            if (parent == null) continue;
            ConfigurationPopulator populator = null;
            if (replaceSystemProperties)
                try {
                    populator = new ConfigurationPopulator(
                            configModularityUtils.replacePropertiesWithCurrentValue(
                                    configBeanDefaultValue.getXmlConfiguration(), configBeanDefaultValue)
                            , doc, parent);
                } catch (Exception e) {
                    LOG.log(Level.SEVERE, ConfigApiLoggerInfo.CFG_EXT_ADD_FAILED, e);
                }
            else {
                //Check that parent is not null!
                populator = new ConfigurationPopulator(configBeanDefaultValue.getXmlConfiguration(), doc, parent);
            }
            populator.run(configParser);
            synchronized (configModularityUtils) {
                boolean oldValue = configModularityUtils.isIgnorePersisting();
                try {
                    Class configBeanClass = configModularityUtils.getClassForFullName(configBeanDefaultValue.getConfigBeanClassName());
                    final ConfigBeanProxy pr = doc.getRoot().createProxy(configBeanClass);
                    configModularityUtils.setIgnorePersisting(true);
                    ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() {
                        public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure {
                            configModularityUtils.setConfigBean(pr, configBeanDefaultValue, param);
                            return param;
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

        Class configBeanClass = getClassForFullName(defaultValue.getConfigBeanClassName());
        Method m = findSuitableCollectionGetter(parentClass, configBeanClass);
        if (m != null) {
            ConfigParser configParser = new ConfigParser(serviceLocator);
            // I don't use the GlassFish document here as I don't need persistence
            final DomDocument doc = new DomDocument<GlassFishConfigBean>(serviceLocator) {
                @Override
                public Dom make(final ServiceLocator serviceLocator, XMLStreamReader xmlStreamReader, GlassFishConfigBean dom,
                                ConfigModel configModel) {
                    // by default, people get the translated view.
                    return new GlassFishConfigBean(serviceLocator, this, dom, configModel, xmlStreamReader);
                }
            };

            ConfigBeanProxy parent = getOwningObject(defaultValue.getLocation());
            ConfigurationPopulator populator = new ConfigurationPopulator(defaultValue.getXmlConfiguration(), doc, parent);
            populator.run(configParser);
            ConfigBeanProxy configBean = doc.getRoot().createProxy(configBeanClass);
            Collection col = (Collection) m.invoke(parent);
            return (T) getConfigBeanFromCollection(col, configBean, configBeanClass);

        }
        return null;
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

          + provider.getClass().getName() + "'");
        }
        continue;
    }
//System.out.println("Provider *"+provider+"* : url=*"+url+"*");
    DomDocument doc = parser.parse(url);

    // Get the New IntegrationPoints
    ConsoleConfig config = (ConsoleConfig) doc.getRoot().get();

    // Save the ClassLoader for later
//System.out.println("Storing: " + config.getId() + " : " + provider.getClass().getClassLoader());
    id = config.getId();
    moduleClassLoaderMap.put(id, provider.getClass().getClassLoader());
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

  List<URL> urls = null; // URLs to TOC files w/i each plugin module
  for (Map.Entry<String, List<URL>> entry : mapUrls.entrySet()) {
      id = entry.getKey();
      urls = entry.getValue();
      for (URL url : urls) {
    DomDocument doc = parser.parse(url);

    // Merge all the TOC's...
    TOC toc = (TOC) doc.getRoot().get();
    for (TOCItem item : toc.getTOCItems()) {
        insertTOCItem(mergedTOC.getTOCItems(), item, id + prefix);
    }
      }
  }
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

  List<URL> urls = null; // URLs to TOC files w/i each plugin module
  for (Map.Entry<String, List<URL>> entry : mapUrls.entrySet()) {
      id = entry.getKey();
      urls = entry.getValue();
      for (URL url : urls) {
    DomDocument doc = parser.parse(url);

    // Merge all the TOC's...
    Index index = (Index) doc.getRoot().get();
    for (IndexItem item : index.getIndexItems()) {
        insertIndexItem(mergedIndex.getIndexItems(), item, id + prefix);
    }
      }
  }
View Full Code Here

Examples of org.jvnet.hk2.config.DomDocument

  // Get our parser...
  ConfigParser parser = new ConfigParser(GuiUtil.getHabitat());
  String id = null;

  // Read the document...
  DomDocument doc = parser.parse(url);

  // Get the GadgetModule
  GadgetModule module = (GadgetModule) doc.getRoot().get();

  return module;
    }
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.