Examples of XmlObject


Examples of org.apache.xmlbeans.XmlObject

            "  <admin-object-module>testRoot</admin-object-module>" +
            "  <admin-object-link>l2</admin-object-link>" +
            "</message-destination>" +
            "</tmp>";
    public void testMessageDestinationsWithModule() throws Exception {
        XmlObject specDD = parse(SPECDD1);
        XmlObject plan = parse(PLAN2);
        adminObjectRefBuilder.initContext(specDD, plan, module);
        AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
        AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
        configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
        configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        Map map = parse(schema1);
        assertEquals(3, map.size());
    }

    private Map parse(File schema1) throws IOException, XmlException, DeploymentException, URISyntaxException {
        XmlObject xmlObject = XmlBeansUtil.parse(schema1.toURL(), getClass().getClassLoader());
        Collection errors = new ArrayList();
        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setErrorListener(errors);
        XmlObject[] schemas = new XmlObject[] {xmlObject};
        SchemaTypeLoader schemaTypeLoader = XmlBeans.loadXsd(new XmlObject[] {});
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

            // read in the entire specDD as a string, we need this for getDeploymentDescriptor
            // on the J2ee management object
            specDD = DeploymentUtil.readAll(specDDUrl);

            // we found web.xml, if it won't parse that's an error.
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
            check(webApp);
        } catch (XmlException e) {
            // Output the target path in the error to make it clearer to the user which webapp
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        contextRoot = contextRoot.trim();
        return contextRoot;
    }

    JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
        XmlObject rawPlan = null;
        try {
            // load the geronimo-web.xml from either the supplied plan or from the earFile
            try {
                if (plan instanceof XmlObject) {
                    rawPlan = (XmlObject) plan;
                } else {
                    if (plan != null) {
                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL(), getClass().getClassLoader());
                    } else {
                        URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                        try {
                            rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                        } catch (FileNotFoundException e) {
                            path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
                            try {
                                rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                            } catch (FileNotFoundException e1) {
                                log.warn("Web application " + targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
                            }
                        }
                    }
                }
            } catch (IOException e) {
                log.warn(e);
            }

            JettyWebAppType jettyWebApp;
            if (rawPlan != null) {
                XmlObject webPlan = new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
                        JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "jetty").convertToSpecificPlan(rawPlan);
                jettyWebApp = (JettyWebAppType) webPlan.changeType(JettyWebAppType.type);
                XmlBeansUtil.validateDD(jettyWebApp);
            } else {
                jettyWebApp = createDefaultPlan();
            }
            return jettyWebApp;
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

            // parse the document with cursor and add
            // the XmlObject to its lists
        XmlCursor cursor = ctDocument.getBody().newCursor();
            cursor.selectPath("./*");
            while (cursor.toNextSelection()) {
                XmlObject o = cursor.getObject();
                if (o instanceof CTP) {
                  XWPFParagraph p = new XWPFParagraph((CTP)o, this);
                  bodyElements.add(p);
                  paragraphs.add(p);
                }
View Full Code Here

Examples of org.apache.xmlbeans.XmlObject

        String localPart = "p";
        cursor.beginElement(localPart,uri);
        cursor.toParent();
        CTP p = (CTP)cursor.getObject();
        XWPFParagraph newP = new XWPFParagraph(p, this);
        XmlObject o = null;
        while(!(o instanceof CTP)&&(cursor.toPrevSibling())){
          o = cursor.getObject();
        }
        if((!(o instanceof CTP)) || (CTP)o == p){
          paragraphs.add(0, newP);
View Full Code Here

Examples of org.exoplatform.xml.object.XMLObject

   }

   public void testConvert() throws Exception
   {
      String projectdir = System.getProperty("basedir");
      XMLObject xmlobj = new XMLObject(new TestObject());
      String xml1 = new String(xmlobj.toByteArray("UTF-8"));
      FileOutputStream os = new FileOutputStream(projectdir + "/target/test-object-1.xml");
      os.write(xml1.getBytes());
      os.close();

      File file = new File(projectdir + "/target/test-object-1.xml");
      FileInputStream is = new FileInputStream(file);

      FileChannel fchan = is.getChannel();
      ByteBuffer buff = ByteBuffer.allocate((int)file.length());
      fchan.read(buff);
      buff.rewind();
      byte[] data = buff.array();
      buff.clear();
      fchan.close();
      is.close();

      TestObject tobject = (TestObject)XMLObject.getObject(new ByteArrayInputStream(data));
      assertTrue(tobject.nested.intarray.length == 10);
      os = new FileOutputStream(projectdir + "/target/test-object-2.xml");
      xmlobj = new XMLObject(tobject);
      String xml2 = new String(xmlobj.toByteArray("UTF-8"));
      os.write(xml2.getBytes());
      os.close();
      assertTrue(xml1.equals(xml2));
      is.close();
View Full Code Here

Examples of org.glassfish.admin.rest.utils.xml.XmlObject

    }

    @Override
    public String getContent(ActionReportResult proxy) {
        ActionReporter ar = (ActionReporter)proxy.getActionReport();
        XmlObject result = processReport(ar);
        return result.toString(getFormattingIndentLevel());
    }
View Full Code Here

Examples of org.mozilla.javascript.xml.XMLObject

    public static Object getObjectElem(Scriptable obj, Object elem,
                                       Context cx)
    {
        if (obj instanceof XMLObject) {
            XMLObject xmlObject = (XMLObject)obj;
            return xmlObject.ecmaGet(cx, elem);
        }

        Object result;

        String s = toStringIdOrIndex(cx, elem);
View Full Code Here

Examples of org.opensaml.xml.XMLObject

       
        AssertionWrapper assertion = new AssertionWrapper(token);
        List<Attribute> attributes = assertion.getSaml2().getAttributeStatements().get(0).getAttributes();
        assertEquals(attributes.size(), 1);
        assertEquals(attributes.get(0).getName(), CLAIM_STATIC_COMPANY.toString());
        XMLObject valueObj = attributes.get(0).getAttributeValues().get(0);
        assertEquals(valueObj.getDOM().getTextContent(), CLAIM_STATIC_COMPANY_VALUE);     
    }
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.