Package org.apache.geronimo.system.plugin

Examples of org.apache.geronimo.system.plugin.PluginRepositoryList


    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
        List list = new ArrayList();
        for (int i = 0; i < lists.length; i++) {
            PluginRepositoryList repo = lists[i];
            list.addAll(Arrays.asList(repo.getRepositories()));
        }
        String error = request.getParameter("repoError");
        if(error != null && !error.equals("")) {
            request.setAttribute("repoError", error);
        }
View Full Code Here


        }
        PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();

        // Check for duplicates
        for (int i = 0; i < lists.length; i++) {
            PluginRepositoryList test = lists[i];
            URL[] all = test.getRepositories();
            for (int j = 0; j < all.length; j++) {
                String existing = all[j].toString();
                if(!existing.endsWith("/")) {
                    existing = existing + "/";
                }
                if(repo.equals(existing)) {
                    response.setRenderParameter("repoError", "Already have an entry for repository "+repo);
                    return false;
                }
            }
        }

        // Verify the repository and add it if valid
        if(lists.length > 0) {
            URL url;
            try {
                url = new URL(repo);
            } catch (MalformedURLException e) {
                response.setRenderParameter("repoError", "Invalid repository URL "+repo);
                return false;
            }
            URL test = new URL(repo+"geronimo-plugins.xml");
            log.debug("Checking repository "+test);
            URLConnection urlConnection = test.openConnection();
            if(urlConnection instanceof HttpURLConnection) {
                HttpURLConnection con = (HttpURLConnection) urlConnection;
                try {
                    con.connect();
                } catch (ConnectException e) {
View Full Code Here

    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
        PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
        List list = new ArrayList();
        for (int i = 0; i < lists.length; i++) {
            PluginRepositoryList repo = lists[i];
            list.addAll(Arrays.asList(repo.getRepositories()));
        }
        ConfigurationData[] configs = PortletManager.getConfigurations(request, null, false);
        request.setAttribute("configurations", configs);
        request.setAttribute("repositories", list);
        String repository = request.getParameter("repository");
View Full Code Here

    public URL[] getRepositories() {
        List<URL> list = new ArrayList<URL>();
        Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
        for (AbstractName name : set) {
            PluginRepositoryList repo = (PluginRepositoryList) kernel.getProxyManager().createProxy(name,
                    PluginRepositoryList.class);
            list.addAll(repo.getRepositories());
            kernel.getProxyManager().destroyProxy(repo);
        }
        return list.toArray(new URL[list.size()]);
    }
View Full Code Here

    private URL getFirstPluginRepository(Kernel kernel) throws ServletException {
        Set installers = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
        if (installers.size() == 0) {
            throw new ServletException("Unable to install sample application; no plugin repository list found");
        }
        PluginRepositoryList repos = ((PluginRepositoryList) kernel.getProxyManager().createProxy((AbstractName) installers.iterator().next(),
                PluginRepositoryList.class));

        List<URL> urls = repos.getRepositories();
        if (urls.isEmpty()) {
            repos.refresh();
            urls = repos.getRepositories();
            if (urls.isEmpty()) {
                throw new ServletException("Unable to install sample applicatoin; unable to download repository list");
            }
        }
        return urls.get(0);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.system.plugin.PluginRepositoryList

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.