Package org.apache.geronimo.deployment.xbeans

Examples of org.apache.geronimo.deployment.xbeans.ModuleDocument


        }
    }

    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console.realm");
        String artifactId = data.getName();
        if(artifactId.indexOf('/') != -1) {
View Full Code Here


        }
    }

    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console.realm");
        String artifactId = data.getName();
        if(artifactId.indexOf('/') != -1) {
View Full Code Here

        }
    }

    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console");
        configId.setArtifactId("realm-"+data.getName());
        configId.setVersion("1.0");
View Full Code Here

        referenceCollection.add(javaBeanXmlAttributeBuilder);
        Naming naming = new Jsr77Naming();
        new ServiceConfigBuilder(parentEnvironment, null, referenceCollection, null, naming);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final URL plan1 = cl.getResource("services/plan1.xml");
        ModuleDocument doc = ModuleDocument.Factory.parse(plan1);
        ModuleType plan = doc.getModule();
        File outFile = File.createTempFile("foo", "bar");
        outFile.delete();
        if (!outFile.mkdirs()) {
            fail("could not create temp dir");
        }
View Full Code Here

                    return null;
                }
            } finally {
                cursor.dispose();
            }
            ModuleDocument moduleDoc;
            if (xmlObject instanceof ModuleDocument) {
                moduleDoc = (ModuleDocument) xmlObject;
            } else {
                moduleDoc = (ModuleDocument) xmlObject.changeType(ModuleDocument.type);
            }
            Collection errors = new ArrayList();
            if (!moduleDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
                throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + moduleDoc.toString());
            }
            // If there's no artifact ID and we won't be able to figure one out later, use the plan file name.  Bit of a hack.
            if(jarFile == null && (moduleDoc.getModule().getEnvironment() == null ||
                        moduleDoc.getModule().getEnvironment().getModuleId() == null ||
                        moduleDoc.getModule().getEnvironment().getModuleId().getArtifactId() == null)) {
                if(moduleDoc.getModule().getEnvironment() == null) {
                    moduleDoc.getModule().addNewEnvironment();
                }
                if(moduleDoc.getModule().getEnvironment().getModuleId() == null) {
                    moduleDoc.getModule().getEnvironment().addNewModuleId();
                }
                String name = planFile.getName();
                int pos = name.lastIndexOf('.');
                if(pos > -1) {
                    name = name.substring(0, pos);
                }
                moduleDoc.getModule().getEnvironment().getModuleId().setArtifactId(name);
            }
            return moduleDoc.getModule();
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse xml in plan", e);
        } catch (IOException e) {
            throw new DeploymentException("no plan at " + planFile, e);
        }
View Full Code Here

        }
    }

    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console.realm");
        String artifactId = data.getName();
        if(artifactId.indexOf('/') != -1) {
View Full Code Here

        Naming naming = new Jsr77Naming();
        NamespaceDrivenBuilder gbeanBuilder = new GBeanBuilder(referenceCollection, null);
//        ConfigurationBuilder serviceBuilder = new ServiceConfigBuilder(parentEnvironment, null, Collections.singleton(gbeanBuilder), naming);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final URL plan1 = cl.getResource("services/plan1.xml");
        ModuleDocument doc = ModuleDocument.Factory.parse(plan1);
        ModuleType plan = doc.getModule();
        File outFile = File.createTempFile("foo", "bar");
        outFile.delete();
        if (!outFile.mkdirs()) {
            fail("could not create temp dir");
        }
View Full Code Here

                    return null;
                }
            } finally {
                cursor.dispose();
            }
            ModuleDocument moduleDoc;
            if (xmlObject instanceof ModuleDocument) {
                moduleDoc = (ModuleDocument) xmlObject;
            } else {
                moduleDoc = (ModuleDocument) xmlObject.changeType(ModuleDocument.type);
            }
            XmlBeansUtil.validateDD(moduleDoc);
            // If there's no artifact ID and we won't be able to figure one out later, use the plan file name.  Bit of a hack.
            if(jarFile == null && (moduleDoc.getModule().getEnvironment() == null ||
                        moduleDoc.getModule().getEnvironment().getModuleId() == null ||
                        moduleDoc.getModule().getEnvironment().getModuleId().getArtifactId() == null)) {
                if(moduleDoc.getModule().getEnvironment() == null) {
                    moduleDoc.getModule().addNewEnvironment();
                }
                if(moduleDoc.getModule().getEnvironment().getModuleId() == null) {
                    moduleDoc.getModule().getEnvironment().addNewModuleId();
                }
                String name = planFile.getName();
                int pos = name.lastIndexOf('.');
                if(pos > -1) {
                    name = name.substring(0, pos);
                }
                moduleDoc.getModule().getEnvironment().getModuleId().setArtifactId(name);
            }
            return moduleDoc.getModule();
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse xml in plan", e);
        } catch (IOException e) {
            throw new DeploymentException("no plan at " + planFile, e);
        }
View Full Code Here

        return artifactId;
    }
   
    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console.realm");
        String artifactId = getArtifactId(data.getName());
       
View Full Code Here

        return artifactId;
    }
   
    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ModuleDocument doc = ModuleDocument.Factory.newInstance();
        ModuleType root = doc.addNewModule();
        EnvironmentType environment = root.addNewEnvironment();
        ArtifactType configId = environment.addNewModuleId();
        configId.setGroupId("console.realm");
        String artifactId = getArtifactId(data.getName());
       
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.xbeans.ModuleDocument

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.