Package javax.portlet

Examples of javax.portlet.PortletException


    {
        super.init(config);
        sso = (SSOManager)getPortletContext().getAttribute(CommonPortletServices.CPS_SSO_COMPONENT);
        if (null == sso)
        {
            throw new PortletException("Failed to find the SSO Provider on portlet initialization");
        }
    }
View Full Code Here


    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        context = getPortletContext();
        sso = (SSOManager) context.getAttribute("cps:SSO");
        if (null == sso) { throw new PortletException("Failed to find SSO Provider on portlet initialization"); }
    }
View Full Code Here

    {
        super.init(config);
        PortletContext context = getPortletContext();
        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
        if (spacesService == null)
                throw new PortletException(
                        "Could not get instance of portal spaces service component");
        admin = (PortalAdministration) getPortletContext().getAttribute(
                CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
        if (null == admin) { throw new PortletException(
                "Failed to find the Portal Administration on portlet initialization"); }
        pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
        if (null == pageManager)
        {
            throw new PortletException("Failed to find the Page Manager on portlet initialization");
        }                      
    }
View Full Code Here

    public void init(PortletConfig config) throws PortletException
    {
        super.init(config);
        admin = (PortalAdministration) getPortletContext().getAttribute(
                CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
        if (null == admin) { throw new PortletException(
                "Failed to find the Portal Administration on portlet initialization"); }
        userManager = (UserManager) getPortletContext().getAttribute(
                CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
        if (null == userManager) { throw new PortletException(
                "Failed to find the User Manager on portlet initialization"); }

        this.returnUrlPath = config.getInitParameter(IP_RETURN_URL);
        this.redirectPath = config.getInitParameter(IP_REDIRECT_PATH);
        this.templateLocation = config.getInitParameter(IP_TEMPLATE_LOCATION);
        if (templateLocation == null)
        {
            templateLocation = "/WEB-INF/view/userreg/";
        }
        templateLocation = getPortletContext().getRealPath(templateLocation);
        this.templateName = config.getInitParameter(IP_TEMPLATE_NAME);
        if (templateName == null)
        {
            templateName = "forgottenPasswdEmail.vm";
        }
       
        ArrayList roots = new ArrayList(1);
        roots.add(templateLocation);

        try
        {
            templateLocator = new JetspeedTemplateLocator(roots, "email", getPortletContext().getRealPath("/"));
            templateLocator.start();
        }
        catch (FileNotFoundException e)
        {
            throw new PortletException("Could not start the template locator.", e);
        }

       
    }
View Full Code Here

        super.init(config);
        context = getPortletContext();
        sso = (SSOManager) context.getAttribute("cps:SSO");
        if (null == sso)
        {
           throw new PortletException("Failed to find SSO Provider on portlet initialization");
        }
       
    }
View Full Code Here

        PortletContext context = getPortletContext();
       
        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
        if (spacesService == null)
        {
            throw new PortletException("Could not get instance of portal spaces service component");
        }
       
        admin = (PortalAdministration) context.getAttribute(CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
        if (admin == null)
        {
            throw new PortletException("Failed to find the Portal Administration on portlet initialization");
        }
    }
View Full Code Here

                    home.setOwner(username);
                    spacesService.storeSpace(home);
                  }
                  catch (SpacesException e)
                  {
                    throw new PortletException(e);
                  }
                }
               
                SpaceBean userHome = new SpaceBean(home);
                userHome.setDescription(home.getDescription());
View Full Code Here

       
        pageManager = (PageManager) context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
       
        if (pageManager == null)
        {
            throw new PortletException("Could not get instance of pageManager component");
        }
       
        pageLayoutComponent = (PageLayoutComponent) context.getAttribute(CommonPortletServices.CPS_PAGE_LAYOUT_COMPONENT);
       
        if (pageLayoutComponent == null)
        {
            throw new PortletException("Could not get instance of pageLayoutComponent");
        }
    }
View Full Code Here

            {
                ContentFragment curFragment = (ContentFragment) request.getAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE);
               
                if (curFragment == null)
                {
                    throw new PortletException("Cannot retrieve current fragment from the request.");
                }
               
                List securityContraintRefList = null;
               
                try
                {
                    securityContraintRefList = this.pageManager.getPageSecurity().getSecurityConstraintsDefs();
                }
                catch (Exception e)
                {
                    throw new PortletException("Cannot find page security constraint definitions.", e);
                }
               
                if (securityContraintRefList != null)
                {
                    request.setAttribute("securityContraintRefList", securityContraintRefList);
View Full Code Here

           
            ContentFragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
            {
                throw new PortletException("Cannot find fragment: " + fragmentId);
            }
           
            SecurityConstraints constraints = new TransientSecurityConstraints(fragment.getSecurityConstraints());
            SecurityConstraint constraint = new TransientSecurityConstraint(fragment.newSecurityConstraint());
            String [] rolesArray = StringUtils.split(request.getParameter("roles"), DELIMITERS);
            String [] groupsArray = StringUtils.split(request.getParameter("groups"), DELIMITERS);
            String [] usersArray = StringUtils.split(request.getParameter("users"), DELIMITERS);
           
            if (!ArrayUtils.isEmpty(rolesArray))
            {
                constraint.setRoles(Arrays.asList(rolesArray));
            }
           
            if (!ArrayUtils.isEmpty(groupsArray))
            {
                constraint.setGroups(Arrays.asList(groupsArray));
            }
           
            if (!ArrayUtils.isEmpty(usersArray))
            {
                constraint.setUsers(Arrays.asList(usersArray));
            }
           
            String [] permissionArray = StringUtils.split(StringUtils.defaultString(request.getParameter("permissions")), DELIMITERS);
           
            if (!ArrayUtils.isEmpty(permissionArray))
            {
                constraint.setPermissions(Arrays.asList(permissionArray));
            }
           
            List<SecurityConstraint> constraintList = constraints.getSecurityConstraints();
           
            if (constraintList == null)
            {
                constraintList = new ArrayList<SecurityConstraint>();
            }
           
            constraintList.add(constraint);
            constraints.setSecurityConstraints(constraintList);
           
            pageLayoutComponent.updateSecurityConstraints(fragment, constraints);
        }
        catch (Exception e)
        {
            throw new PortletException("Failed to add security constraint.", 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.