Package javax.portlet

Examples of javax.portlet.PortletException


                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

        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore));
        try {
            data.createKeyPair(alias, password, "RSA", Integer.parseInt(keySize), algorithm, Integer.parseInt(valid),
                    certCN, certOU, certO, certL, certST, certC);
        } catch (NumberFormatException e) {
            throw new PortletException(e);
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
        response.setRenderParameter("id", keystore);
        return VIEW_KEYSTORE+BEFORE_ACTION;
    }
View Full Code Here

        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + id));
        Certificate cert;
        try {
            cert = data.getCertificate(alias);
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
        String type = "Trusted Certificate";
        boolean keyLocked = true;
        String[] keys = data.getKeys();
        for(int i = 0; i < keys.length; ++i) {
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 />");
            throw new PortletException("Configuration not found", e);
        } catch (LifecycleException e) {
            // todo we have a much more detailed report now
            message(actionResponse, null, "Lifecycle operation failed<br /><br />");
            throw new PortletException("Exception", e);
        } catch (Exception e) {
            message(actionResponse, null, "Encountered an unhandled exception<br /><br />");
            throw new PortletException("Exception", e);
        }
    }
View Full Code Here

        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore));
        try {
            data.lockUse();
            response.setRenderParameter(INFO_MSG, "Availability of keystore '"+keystore+"' is locked.");
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
        return LIST_MODE+BEFORE_ACTION;
    }
View Full Code Here

        request.setAttribute("password", password);
        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + keystore));
        try {
            request.setAttribute("keys", data.getInstance().listPrivateKeys(password.toCharArray()));
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
    }
View Full Code Here

        }
        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + id));
        try {
            data.importTrustCert(certificate, alias);
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
        response.setRenderParameter("id", id);
        return VIEW_KEYSTORE+BEFORE_ACTION;
    }
View Full Code Here

                uninstallConfig(actionRequest);
                messageStatus = "Uninstalled application<br /><br />";
            } else {
                messageStatus = "Invalid value for changeState: " + action
                        + "<br /><br />";
                throw new PortletException("Invalid value for changeState: "
                        + action);
            }
        } catch (NoSuchConfigException e) {
            // ignore this for now
            messageStatus = "Configuration not found<br /><br />";
            throw new PortletException("Configuration not found", e);
        } catch (InvalidConfigException e) {
            messageStatus = "Configuration not found<br /><br />";
            throw new PortletException("Configuration not found", e);
        } catch (Exception e) {
            messageStatus = "Encountered an unhandled exception<br /><br />";
            throw new PortletException("Exception", e);
        }
    }
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.