Package org.apache.geronimo.deployment.xbeans

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


        LinkedHashSet parentId = EnvironmentBuilder.toArtifacts(new ArtifactType[] {});
        assertEquals(0, parentId.size());
    }

    public void testImportParent1() throws Exception {
        ArtifactType anImport = ArtifactType.Factory.newInstance();
        anImport.setGroupId("groupId");
        anImport.setType("type");
        anImport.setArtifactId("artifactId");
        anImport.setVersion("version");
        LinkedHashSet parentId = EnvironmentBuilder.toArtifacts(new ArtifactType[] {anImport});
        assertEquals(1, parentId.size());
        assertEquals(new Artifact("groupId", "artifactId", "version", "type"), parentId.iterator().next());
    }
View Full Code Here


        log.debug(webApp.toString());
    }

    private void addEnvironment(JettyWebAppType webApp) {
        EnvironmentType environmentType = webApp.addNewEnvironment();
        ArtifactType configId = environmentType.addNewModuleId();
        configId.setGroupId("g");
        configId.setArtifactId("a");
        configId.setVersion("1");
        configId.setType("car");
    }
View Full Code Here

    public void testConstructPlan() throws Exception {
        GerApplicationClientDocument appClientDoc = GerApplicationClientDocument.Factory.newInstance();
        GerApplicationClientType appClient = appClientDoc.addNewApplicationClient();
        EnvironmentType clientEnvironmentType = appClient.addNewClientEnvironment();
        ArtifactType clientId = clientEnvironmentType.addNewModuleId();
        clientId.setGroupId("group");
        clientId.setArtifactId("artifact");
        EnvironmentType serverEnvironmentType = appClient.addNewServerEnvironment();
        serverEnvironmentType.setModuleId(clientId);

        GerResourceRefType ref = appClient.addNewResourceRef();
        ref.setRefName("ref");
View Full Code Here

            }
            return str.toString();
        }

        public void save(EnvironmentType environment) {
            ArtifactType moduleId = environment.getModuleId();
            moduleId.setArtifactId(artifactId);

            if (moduleId.isSetGroupId()) {
                moduleId.unsetGroupId();
            }
            if (!isEmpty(groupId)) {
                moduleId.setGroupId(groupId);
            }

            if (moduleId.isSetVersion()) {
                moduleId.unsetVersion();
            }
            if (!isEmpty(version)) {
                moduleId.setVersion(version);
            }

            if (moduleId.isSetType()) {
                moduleId.unsetType();
            }
            if (!isEmpty(type)) {
                moduleId.setType(type);
            }

            if (environment.isSetHiddenClasses()) {
                environment.unsetHiddenClasses();
            }
View Full Code Here

            }
        }
    }

    public void parseEnvironment(Environment env) {
        ArtifactType moduleId = environment.addNewModuleId();
        Artifact configId = env.getConfigId();
        moduleId.setGroupId(configId.getGroupId());
        moduleId.setArtifactId(configId.getArtifactId());
        moduleId.setVersion(configId.getVersion().toString());
        moduleId.setType(configId.getType());
        //List<Dependency> deps = env.getDependencies();
        //for (int i = 0; i < deps.size(); i++) {
        //    String depString = deps.get(i).toString();
        //    dependenciesSet.add(depString.substring(6, depString.length() - 1));
        //}
View Full Code Here

        //    dependenciesSet.add(depString.substring(6, depString.length() - 1));
        //}
    }

    public void readEnvironmentData(PortletRequest request) {
        ArtifactType moduleId = environment.getModuleId();
        moduleId.setArtifactId(request.getParameter("artifactId"));
        moduleId.setGroupId(request.getParameter("groupId"));
        moduleId.setVersion(request.getParameter("version"));
        moduleId.setType(request.getParameter("type"));

        String hiddenClassesString = request.getParameter("hiddenClasses");
        if (!isEmpty(hiddenClassesString)) {
            String[] hiddenClasses = getNonEmptyStrings(hiddenClassesString.split(";"));
            if (hiddenClasses.length > 0) {
View Full Code Here

        public EnvironmentJson() {
        }

        public EnvironmentJson(EnvironmentType environment) {
            ArtifactType moduleId = environment.getModuleId();
            groupId = moduleId.getGroupId();
            artifactId = moduleId.getArtifactId();
            version = moduleId.getVersion();
            type = moduleId.getType();
            if (environment.isSetHiddenClasses()) {
                hiddenClasses = mergeStrings(environment.getHiddenClasses().getFilterArray());
            }
            if (environment.isSetNonOverridableClasses()) {
                nonOverridableClasses = mergeStrings(environment.getNonOverridableClasses().getFilterArray());
View Full Code Here

    private GerApplicationType createDefaultPlan(Application application, JarFile module) {
        // construct the empty geronimo-application.xml
        GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
        EnvironmentType environmentType = gerApplication.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();

        artifactType.setGroupId(Artifact.DEFAULT_GROUP_ID);

        // set the configId
        String id = application != null ? application.getId() : null;
        if (id == null) {
            File fileName = new File(module.getName());
            id = fileName.getName();
            if (id.endsWith(".ear")) {
                id = id.substring(0, id.length() - 4);
            }
            if (id.endsWith("/")) {
                id = id.substring(0, id.length() - 1);
            }
        }

        artifactType.setArtifactId(id);
        artifactType.setVersion("" + System.currentTimeMillis());
        artifactType.setType("car");
        return gerApplication;
    }
View Full Code Here

    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();
        ref.setRefName("ref");
        ref.setResourceLink("target");
View Full Code Here

            }
        }

        OpenejbGeronimoEjbJarType openejbEjbJar = OpenejbGeronimoEjbJarType.Factory.newInstance();
        EnvironmentType environmentType = openejbEjbJar.addNewEnvironment();
        ArtifactType artifactType = environmentType.addNewModuleId();
        artifactType.setArtifactId(id);
        return openejbEjbJar;
    }
View Full Code Here

TOP

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

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.