Package javax.portlet

Examples of javax.portlet.PortletException


        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + id));
        try {
            String csr = data.generateCSR(alias);
            request.setAttribute("csr", csr);
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
    }
View Full Code Here


                }
            }
        }
        catch (Exception e)
        {
            throw new PortletException("Exception mapping request Params to Preferences: ", e);
        }
    }
View Full Code Here

                DatabaseDriver info = getDatabaseInfoFromDriver(request, data);
                if(info != null) {
                    data.rarPath = info.getRAR().toString();
                    data.urlPrototype = info.getURLPrototype();
                } else {
                    throw new PortletException("Don't recognize database driver "+data.driverClass+"!");
                }
            }
        } else {
            //todo: handle XA
        }
View Full Code Here

    private boolean processImportUpload(ActionRequest request, ActionResponse response) throws PortletException {
        String type = request.getParameter("importSource");
        response.setRenderParameter("importSource", type);
        if (!PortletFileUpload.isMultipartContent(request)) {
            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List items = uploader.parseRequest(request);
            for (Iterator i = items.iterator(); i.hasNext();) {
                FileItem item = (FileItem) i.next();
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
                    file.deleteOnExit();
                    log.debug("Writing database pool import file to "+file.getAbsolutePath());
                    item.write(file);
                    DatabaseConversionStatus status = processImport(file, type);
                    request.getPortletSession(true).setAttribute("ImportStatus", new ImportStatus(status));
                    return true;
                } else {
                    throw new PortletException("Not expecting any form fields");
                }
            }
        } catch(PortletException e) {
            throw e;
        } catch(Exception e) {
            throw new PortletException(e);
        }
        return false;
    }
View Full Code Here

        if(type.equals("JBoss 4")) {
            return JBoss4DatabaseConverter.convert(new FileReader(importFile));
        } else if(type.equals("WebLogic 8.1")) {
            return WebLogic81DatabaseConverter.convert(new FileReader(importFile));
        } else {
            throw new PortletException("Unknown import type '"+type+"'");
        }
    }
View Full Code Here

                DatabaseDriver info = getDatabaseInfoFromDriver(request, data);
                if (info != null) {
                    data.rarPath = info.getRAR().toString();
                    data.urlPrototype = info.getURLPrototype();
                } else {
                    throw new PortletException("Don't recognize database driver " + data.driverClass + "!");
                }
            }
        } else {
            //todo: handle XA
        }
View Full Code Here

    private boolean processImportUpload(ActionRequest request, ActionResponse response) throws PortletException {
        String type = request.getParameter("importSource");
        response.setRenderParameter("importSource", type);
        if (!PortletFileUpload.isMultipartContent(request)) {
            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List<FileItem> items = uploader.parseRequest(request);
            for (FileItem item : items) {
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
                    file.deleteOnExit();
                    log.debug("Writing database pool import file to " + file.getAbsolutePath());
                    item.write(file);
                    DatabaseConversionStatus status = processImport(file, type);
                    request.getPortletSession(true).setAttribute("ImportStatus", new ImportStatus(status));
                    return true;
                } else {
                    throw new PortletException("Not expecting any form fields");
                }
            }
        } catch (PortletException e) {
            throw e;
        } catch (Exception e) {
            throw new PortletException(e);
        }
        return false;
    }
View Full Code Here

        if (type.equals("JBoss 4")) {
            return JBoss4DatabaseConverter.convert(new FileReader(importFile));
        } else if (type.equals("WebLogic 8.1")) {
            return WebLogic81DatabaseConverter.convert(new FileReader(importFile));
        } else {
            throw new PortletException("Unknown import type '" + type + "'");
        }
    }
View Full Code Here

            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                message(actionResponse, lcresult, "Restarted application<br /><br />");
            } else {
                message(actionResponse, null, "Invalid value for changeState: " + action + "<br /><br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
        } catch (NoSuchConfigException e) {
            // ignore this for now
            message(actionResponse, null, "Configuration not found<br /><br />");
            log.error("Configuration not found", e);
View Full Code Here

            if(mode.equals("start")) {
                try {
                    //todo: this only goes into the "starting" state, doesn't make it to "running" -- what's up with that?
                    PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(brokerURI))).startRecursive();
                } catch (Exception e) {
                    throw new PortletException(e);
                }
            } else if(mode.equals("stop")) {
                try {
                    PortletManager.getManagedBean(actionRequest,  new AbstractName(URI.create(brokerURI))).stop();
                } catch (Exception e) {
                    throw new PortletException(e);
                }
            } else if(mode.equals("edit")) {
                //todo: is there anything to edit?
            } else if(mode.equals("delete")) {
                //todo: add a method to JMSManager to handle this
View Full Code Here

TOP

Related Classes of javax.portlet.PortletException

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.