Examples of RequestContext


Examples of org.apache.jetspeed.request.RequestContext

        s.append(LoginConstants.PASSWORD);
        s.append("=");
        s.append(password);
        */
        //System.out.println("Redirect: " + s.toString());
        RequestContext rc = SecurityHelper.getRequestContext(actionRequest);
        HttpServletRequest request = rc.getRequest();
        HttpSession session = request.getSession(true);
        session.setAttribute(LoginConstants.USERNAME, username);
        session.setAttribute(LoginConstants.PASSWORD, password);
        actionResponse.sendRedirect(s.toString());
    }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

    }
   
    protected ContentPage getPage(RenderRequest request) throws Exception
    {
        String path = request.getParameter(JSPAGE);
        RequestContext requestContext = (RequestContext)
            request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);       
        return requestContext.locatePage(profiler, pageLayoutComponent, path);
    }   
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

    }

    public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException
    {   
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        Stack<BreadcrumbMenuItem> stack = new Stack<BreadcrumbMenuItem>();
        Node node = rc.getPage().getPageOrTemplate().getParent();
        while (node != null)
        {
            stack.push(new BreadcrumbMenuItem(node.getTitle(), admin.getPortalURL(request, response, node.getPath())));
            node = node.getParent();
        }
        List<BreadcrumbMenuItem> breadcrumbs = new LinkedList<BreadcrumbMenuItem>();
        while (!stack.empty())
        {
            breadcrumbs.add(stack.pop());
        }
        breadcrumbs.add(new BreadcrumbMenuItem(rc.getPage().getTitle(), admin.getPortalURL(request, response, rc.getPage().getPath())));
        request.setAttribute("breadcrumbs", breadcrumbs);
        try
        {
            super.doView(request, response);
        }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

        if (templateLocator == null)
        {
            return templateLocation + PATH_SEPARATOR + templateName;
        }

        RequestContext requestContext = (RequestContext) request
                .getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        Locale locale = request.getLocale();

        try
        {
            LocatorDescriptor locator = templateLocator.createLocatorDescriptor("email");
            locator.setName(templateName);
            locator.setMediaType(requestContext.getMediaType());
            locator.setLanguage(locale.getLanguage());
            locator.setCountry(locale.getCountry());
            TemplateDescriptor template = templateLocator.locateTemplate(locator);

            return template.getAppRelativePath();
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

          space = findSpaceByName(spaces, spaceName);
          changed = (space != null);
        }
       
        // check if this space matches the current portal page path.
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        String portalPagePath = rc.getPage().getPath();
        String portalPageFolderPath = StringUtils.substringBeforeLast(portalPagePath, Folder.PATH_SEPARATOR);
        boolean isRootSpace = StringUtils.isEmpty(portalPageFolderPath);
       
        if (isRootSpace)
        {
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

            LayoutBean fourColumns = new LayoutBean("FourColumn", "Four Columns", "FourColumns.jpg", "jetspeed-layouts::VelocityFourColumns");
            layouts.add(fourColumns);
            request.getPortletSession().setAttribute("layouts", layouts);
        }
       
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        ContentPage page = rc.getPage();
        ContentFragment layoutFragment = page.getNonTemplateRootFragment();
        String currentLayoutName = layoutFragment.getName();
       
        for (LayoutBean layout : layouts)
        {
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

   
    private void addSecurityConstraint(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        try
        {
            RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
            ContentPage page = requestContext.getPage();
            String fragmentId = request.getParameter("fragment");
           
            ContentFragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

   
    private void removeSecurityConstraint(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        try
        {
            RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
            ContentPage page = requestContext.getPage();
            String fragmentId = request.getParameter("fragment");
           
            ContentFragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

    private void updateSecurityConstraintRefs(ActionRequest request, ActionResponse response) throws PortletException, IOException
    {
        try
        {
            RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
            ContentPage page = requestContext.getPage();
            String fragmentId = request.getParameter("fragment");
           
            ContentFragment fragment = page.getFragmentById(fragmentId);
           
            if (fragment == null)
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

   
    protected void doPreview(RenderRequest request, RenderResponse response) throws PortletException, IOException
    {
        String previewImage = "";
       
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        PortletDefinition def = rc.getCurrentPortletWindow().getPortletDefinition();
        Collection<LocalizedField> colMetaData = null;
       
        if (def != null)
        {
            colMetaData = def.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_PREVIEW_IMAGE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.