Package org.apache.geronimo.xbeans.geronimo.web

Examples of org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument


        TomcatWebAppType tomcatWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, tomcatWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
        EnvironmentType environmentType = tomcatWebAppType.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();
        artifactType.setArtifactId("foo");

        GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
View Full Code Here


        TomcatWebAppType tomcatWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, tomcatWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
        EnvironmentType environmentType = tomcatWebAppType.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();
        artifactType.setArtifactId("foo");

        GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
View Full Code Here

        TomcatWebAppType tomcatWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, tomcatWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
        EnvironmentType environmentType = tomcatWebAppType.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();
        artifactType.setArtifactId("foo");

        GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
View Full Code Here

        TomcatWebAppType tomcatWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, tomcatWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
        EnvironmentType environmentType = tomcatWebAppType.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();
        artifactType.setArtifactId("foo");

        GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
View Full Code Here

            warConfig.getJndiRefsConfig().storeResourceRefs(warConfig.getWebApp());
            if (warConfig.getSecurity() != null) {
                warConfig.getWebApp().setSecurity(warConfig.getSecurity());
            }
           
            GerWebAppDocument webAppDocument = GerWebAppDocument.Factory.newInstance();
            webAppDocument.setWebApp(warConfig.getWebApp());

            // See http://xmlbeans.apache.org/docs/2.0.0/guide/conHandlingAny.html
            XmlCursor xsAnyCursor = webAppDocument.newCursor();
            xsAnyCursor.toNextToken();
            XmlCursor rootCursor = newModule.newCursor();
            rootCursor.toEndToken();
            xsAnyCursor.moveXml(rootCursor);
            xsAnyCursor.dispose();
View Full Code Here

        jndiRefsConfig.storeResourceRefs(getWebApp());
        if (securityConfig.getSecurity() != null) {
            getWebApp().setSecurity(securityConfig.getSecurity());
        }

        GerWebAppDocument webAppDocument = GerWebAppDocument.Factory.newInstance();
        webAppDocument.setWebApp(getWebApp());
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XmlOptions options = new XmlOptions();
        options.setSavePrettyPrint();
        options.setSavePrettyPrintIndent(4);
        options.setUseDefaultNamespace();
        webAppDocument.save(outputStream, options);
        outputStream.close();
        deploymentPlan = new String(outputStream.toByteArray(), "US-ASCII");
        return deploymentPlan;
    }
View Full Code Here

            try {
                if (plan instanceof XmlObject) {
                    XmlObject object = SchemaConversionUtils.getNestedObject((XmlObject) plan, "web-app");
                    jettyWebApp = TemporaryPlanAdapter.convertJettyElementToWeb(object);
                } else {
                    GerWebAppDocument jettyWebAppdoc = null;
                    if (plan != null) {
                        XmlObject object = SchemaConversionUtils.parse(((File) plan).toURL());
                        jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
                    } else {
                        URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                        try {
                            jettyWebAppdoc = GerWebAppDocument.Factory.parse(path);
                        } catch (FileNotFoundException e) {
                            path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
                            XmlObject object = SchemaConversionUtils.parse(path);
                            if(object != null) {
                                log.error("Incorrect deployment plan naming: found geronimo-jetty.xml, should be geronimo-web.xml");
                                jettyWebAppdoc = TemporaryPlanAdapter.convertJettyDocumentToWeb(object);
                            }
                        }
                    }
                    if (jettyWebAppdoc != null) {
                        jettyWebApp = jettyWebAppdoc.getWebApp();
                    }
                }
            } catch (IOException e) {
                log.warn(e);
            }
View Full Code Here

        moduleFile.close();
        assertEquals(1, jettyWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument jettyWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType jettyWebAppType = jettyWebAppDoc.addNewWebApp();
        jettyWebAppType.setConfigId("configId");
        jettyWebAppType.setParentId("parentId");
        jettyWebAppType.setContextPriorityClassloader(false);
        GerResourceRefType ref = jettyWebAppType.addNewResourceRef();
        ref.setRefName("ref");
View Full Code Here

        GerWebAppType jettyWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
        assertEquals(1, jettyWebApp.getResourceRefArray().length);
    }

    public void testConstructPlan() throws Exception {
        GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
        GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
        tomcatWebAppType.setConfigId("configId");
        tomcatWebAppType.setParentId("parentId");
        tomcatWebAppType.setContextPriorityClassloader(false);
        GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
        ref.setRefName("ref");
View Full Code Here

                if (plan instanceof XmlObject) {
                    tomcatWebApp = (GerWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
                            "web-app",
                            GerWebAppType.type);
                } else {
                    GerWebAppDocument tomcatWebAppdoc = null;
                    if (plan != null) {
                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse((File) plan);
                    } else {
                        URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                        tomcatWebAppdoc = GerWebAppDocument.Factory.parse(path);
                    }
                    if (tomcatWebAppdoc != null) {
                        tomcatWebApp = tomcatWebAppdoc.getWebApp();
                    }
                }
            } catch (IOException e) {
            }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument

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.