Package org.apache.geronimo.system.plugin.model

Examples of org.apache.geronimo.system.plugin.model.PluginType


                plugin.setPlugin(metadata);
                plugin.setPluginArtifact(artifact);

                if (validate) {
                    // determine if the plugin is installable
                    PluginType holder = PluginInstallerGBean.copy(metadata, artifact);
                    try {
                        plugin.setInstallable(pluginInstaller.validatePlugin(holder));
                    } catch (Exception e) {
                        plugin.setInstallable(false);
                    }
View Full Code Here


    }

    protected PluginListType getPluginsFromIds(String[] configIds, PluginListType list) throws PortletException {
        PluginListType installList = new PluginListType();
        for (String configId : configIds) {
            PluginType plugin = null;
            for (PluginType metadata : list.getPlugin()) {
                for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
                    if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
                        plugin = PluginInstallerGBean.copy(metadata, testInstance);
                        installList.getPlugin().add(plugin);
View Full Code Here

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        String configId = request.getParameter("configId");
        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
        Artifact newArtifact = Artifact.create(configId)
        PluginType metadata = pluginInstaller.getPluginMetadata(newArtifact)
        PluginArtifactType instance = metadata.getPluginArtifact().get(0);
        request.setAttribute("configId", PluginInstallerGBean.toArtifact(instance.getModuleId()).toString());
        request.setAttribute("name", metadata.getName());
        request.setAttribute("repository", combine(instance.getSourceRepository()));
        request.setAttribute("category", metadata.getCategory());
        request.setAttribute("url", metadata.getUrl());
        request.setAttribute("author", metadata.getAuthor());
        request.setAttribute("description", metadata.getDescription());
        List<LicenseType> licenses = metadata.getLicense();
        if (licenses != null && licenses.size() > 0) {
            request.setAttribute("license", licenses.get(0).getValue());
            if (licenses.get(0).isOsiApproved()) {
                request.setAttribute("licenseOSI", "true");
            }
View Full Code Here

    }

    public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
        String configId = request.getParameter("configId");
        PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
        PluginType metadata = pluginInstaller.getPluginMetadata(Artifact.create(configId));
        PluginArtifactType instance = metadata.getPluginArtifact().get(0);

        String name = request.getParameter("name");
        metadata.setName(name);
        metadata.setCategory(request.getParameter("category"));
        metadata.setUrl(request.getParameter("url"));
        metadata.setAuthor(request.getParameter("author"));
        metadata.setDescription(request.getParameter("description"));
        String licenseString = request.getParameter("license");
        String osi = request.getParameter("licenseOSI");
        List<LicenseType> licenses = metadata.getLicense();
        if (!licenses.isEmpty()) {
            licenses.remove(0);
        }
        if (licenseString != null && !licenseString.trim().equals("")) {
            LicenseType license = new LicenseType();
View Full Code Here

    public void newServerInstance(String serverName) throws Exception {
        try {
            PluginListType pluginList = new PluginListType();
            for (String artifactString : defaultPlugins) {
                Artifact artifact = Artifact.create(artifactString);
                PluginType plugin = getPlugin(artifact);
                pluginList.getPlugin().add(plugin);
            }
            Artifact query = Artifact.createPartial("///");
            for (PersistentConfigurationList persistentConfigurationList : persistentConfigurationLists) {
                for (Artifact installed : persistentConfigurationList.getListedConfigurations(query)) {
                    PluginType plugin = getPlugin(installed);
                    pluginList.getPlugin().add(plugin);
                }
            }

            Kernel kernel = new BasicKernel("assembly", bundleContext);
View Full Code Here

            t.printStackTrace();
        }
    }

    public PluginType getPlugin(Artifact sourceArtifact) {
        PluginType plugin = new PluginType();
        PluginArtifactType pluginArtifact = new PluginArtifactType();
        ArtifactType artifact = new ArtifactType();
        artifact.setGroupId(sourceArtifact.getGroupId());
        artifact.setArtifactId(sourceArtifact.getArtifactId());
        artifact.setVersion(sourceArtifact.getVersion().toString());
        artifact.setType(sourceArtifact.getType());
        pluginArtifact.setModuleId(artifact);
        plugin.getPluginArtifact().add(pluginArtifact);
        return plugin;
    }
View Full Code Here

        for (Repository listableRepository : repos) {
            if (listableRepository instanceof ListableRepository) {
                SortedSet<Artifact> artifacts = ((ListableRepository) listableRepository).list();
                for (Artifact artifact : artifacts) {
                    File location = listableRepository.getLocation(artifact);
                    PluginType data = extractPluginMetadata(location);
                    if (data != null) {
                        PluginType key = PluginInstallerGBean.toKey(data);
                        PluginType existing = pluginMap.get(key);
                        if (existing == null) {
                            pluginMap.put(key, data);
                        } else {
                            existing.getPluginArtifact().addAll(data.getPluginArtifact());
                        }
                    }
                }
            }
        }
View Full Code Here

        Kernel kernel = KernelRegistry.getSingleKernel();
        PluginInstaller installer = getPluginInstaller(kernel);
        String moduleIdName = getInitParameter("moduleId");
        moduleIdName = moduleIdName.replaceAll("SERVER", getServerType());
        URL repo = getFirstPluginRepository(kernel);
        PluginType target = new PluginType();
        target.setName("Sample Application");
        target.setCategory("Samples");
        target.setDescription("A sample application");
        PluginArtifactType instance = new PluginArtifactType();
        target.getPluginArtifact().add(instance);
        instance.getDependency().add(PluginInstallerGBean.toDependencyType(new Dependency(Artifact.create(moduleIdName), ImportType.ALL), true));
        PluginListType list = new PluginListType();
        list.getPlugin().add(target);
//        list.getDefaultRepository().add(repo.toString());
        //todo this is surely wrong
View Full Code Here

            throw new DeploymentException("Unable to create configuration for deployment: dependencies: " + resolvedParentIds, e);
        }
    }

    private void createPluginMetadata() throws IOException, JAXBException, XMLStreamException {
        PluginType pluginType = getPluginMetadata();
        File metaInf = new File(getConfigurationDir(), "META-INF");
        metaInf.mkdirs();
        OutputStream out = new FileOutputStream(new File(metaInf, "geronimo-plugin.xml"));
        try {
            PluginXmlUtil.writePluginMetadata(pluginType, out);
View Full Code Here

            out.close();
        }
    }

    public PluginType getPluginMetadata() {
        PluginType pluginType = new PluginType();
        pluginType.setName("Temporary Plugin metadata for deployment");
        PluginArtifactType instance = new PluginArtifactType();
        instance.setModuleId(ArtifactType.newArtifactType(environment.getConfigId()));
        List<DependencyType> dependenciees = instance.getDependency();
        for (Dependency dependency: environment.getDependencies()) {
            dependenciees.add(DependencyType.newDependencyType(dependency));
        }
        pluginType.getPluginArtifact().add(instance);
        return pluginType;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.system.plugin.model.PluginType

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.