Package javax.portlet

Examples of javax.portlet.PortletException


                        if (file != null) {
                            try {
                                item.write(file);
                            } catch (Exception e) {
                                throw new PortletException(e);
                            }
                        }
                        // This is not the file itself, but one of the form fields for the URI
                    } else {
                        String fieldName = item.getFieldName().trim();
                        if ("group".equals(fieldName)) {
                            group = item.getString().trim();
                        } else if ("artifact".equals(fieldName)) {
                            artifact = item.getString().trim();
                        } else if ("version".equals(fieldName)) {
                            version = item.getString().trim();
                        } else if ("fileType".equals(fieldName)) {
                            fileType = item.getString().trim();
                        }
                    }
                }


                repo.copyToRepository(file, new Artifact(group, artifact, version, fileType), new FileWriteMonitor() {
                    public void writeStarted(String fileDescription, int fileSize) {
                        log.info("Copying into repository " + fileDescription + "...");
                    }

                    public void writeProgress(int bytes) {
                    }

                    public void writeComplete(int bytes) {
                        log.info("Finished.");
                    }
                });
            } catch (FileUploadException e) {
                throw new PortletException(e);
            }
        } catch (PortletException e) {
            throw e;
        }
    }
View Full Code Here


            Collections.sort(list);

            request.setAttribute("org.apache.geronimo.console.repo.list", list);

        } catch (Exception e) {
            throw new PortletException(e);
        }

        normalView.include(request, response);
    }
View Full Code Here

                }
            }
         }
         catch (Exception e)
         {
             throw new PortletException("Failed to load spring configuration.", e);
         }  
                          
         // load validator
         synchronized (semaphore)
         {            
             if (validatorConfig != null && null == validations)
             {
                 InputStream is = null;
                
                 try
                 {
                     // TODO: support extensible user-defined validator resources
                     //is = this.getClass().getResourceAsStream("/org/apache/portals/bridges/velocity/validation/default-portlet-validation.xml");
                     is = config.getPortletContext().getResourceAsStream(validatorConfig);                   
                    
                     validations = new ValidatorResources(is);
                 }
                 catch (Exception e)
                 {
                     throw new PortletException("Failed to load validator configuration.", e);
                 }
                 finally
                 {
                     // Make sure we close the input stream.
                     if (is != null)
View Full Code Here

                return result;
            }
        }
        catch (ValidatorException e)
        {
            throw new PortletException("Error in processing validation: ", e);           
        }
       
        return result;       
    }
View Full Code Here

            if(alias != null) {
              KeystoreData data = (KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + id);
              try {
                    data.deleteEntry(alias);
                } catch (KeystoreException e) {
                    throw new PortletException(e);
                }
            }
        } // else we hope this is after a failure and the actionAfterView took care of it below!
        return getMode();
    }
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

        String pkcs7cert = request.getParameter("pkcs7cert");
        KeystoreData data = ((KeystoreData) request.getPortletSession(true).getAttribute(KEYSTORE_DATA_PREFIX + id));
        try {
            data.importPKCS7Certificate(alias, pkcs7cert);
        } catch (KeystoreException e) {
            throw new PortletException(e);
        }
        return CERTIFICATE_DETAILS+BEFORE_ACTION;
    }
View Full Code Here

            } else if(mode.equals("start")) {
                AbstractName connectorAbstractName = new AbstractName(URI.create(connectorURI));
                try {
                    PortletManager.getManagedBean(actionRequest, connectorAbstractName).startRecursive();
                } catch (Exception e) {
                    throw new PortletException(e);
                }
                actionResponse.setRenderParameter("mode", "list");
            } else if(mode.equals("stop")) {
                AbstractName connectorAbstractName = new AbstractName(URI.create(connectorURI));
                try {
                    PortletManager.getManagedBean(actionRequest, connectorAbstractName).stop();
                } catch (Exception e) {
                    throw new PortletException(e);
                }
                actionResponse.setRenderParameter("mode", "list");
            } else if(mode.equals("edit")) {
                actionResponse.setRenderParameter("connectorURI", connectorURI);
                actionResponse.setRenderParameter("brokerURI", brokerURI);
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

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.