Examples of RequestContext


Examples of org.apache.jetspeed.request.RequestContext

                viewLink.setPopupSettings(new PopupSettings());
                infoForm.add(viewLink);
            }
            else
            {
                RequestContext context = (RequestContext) getPortletRequest().getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
                String basePath = context.getPortalURL().getBasePath().replace("portal", "configure");
                ExternalLink viewLink = new ExternalLink("view", new Model(basePath + getDocument().getPath()), new ResourceModel("common.view"))
                {
                    @Override
                    protected void onComponentTag(ComponentTag tag)
                    {
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

                      credential.setPassword(currPassword, newPassword);
                      manager.storePasswordCredential(credential);
                        audit.logUserActivity(userName, getIPAddress(actionRequest), AuditActivity.PASSWORD_CHANGE_SUCCESS, USER_ADMINISTRATION);

                        // update Subject in session to reflect the changed PasswordCredential
                        RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);                 
                        Subject subject = (Subject)requestContext.getSessionAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
                        Iterator<Object> iter = subject.getPrivateCredentials().iterator();
                        while (iter.hasNext())
                        {
                            Object o = iter.next();
                            if (o instanceof UserCredential)
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

        }
    }

    protected String getIPAddress(PortletRequest request)
    {
        RequestContext context = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        if (context == null)
            return "";
        return context.getRequest().getRemoteAddr();
    }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

    }
   
    @Override
    protected void doHeaders(RenderRequest request, RenderResponse response) {
        super.doHeaders(request, response);
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        Element headElem = response.createElement("script");
        headElem.setAttribute("language", "javascript");
        String scriptPath = rc.getRequest().getContextPath() + yuiScriptPath;
        headElem.setAttribute("id", HeaderPhaseSupportConstants.HEAD_ELEMENT_CONTRIBUTION_ELEMENT_ID_YUI_LIBRARY_INCLUDE);
        headElem.setAttribute("src", scriptPath);
        headElem.setAttribute("type", "text/javascript");
        response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, headElem);
    }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

       
        boolean hasEditAccess = false;
       
        try
        {
            RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
            ContentPage contentPage = requestContext.getPage();
            contentPage.checkAccess(JetspeedActions.EDIT);
            hasEditAccess = true;
        }
        catch(Exception ignore)
        {
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException,
    IOException
    {
        String theme =  actionRequest.getParameter("theme");
        String layout =  actionRequest.getParameter("layout");
        RequestContext requestContext = (RequestContext) actionRequest.getAttribute(RequestContext.REQUEST_PORTALENV);
       
        if (theme != null)
        {
            try
            {
                ContentPage page = requestContext.getPage();
                pageLayoutComponent.updateDefaultDecorator(page, theme, ContentFragment.LAYOUT);
                pageLayoutComponent.updateDefaultDecorator(page, theme, ContentFragment.LAYOUT);
                actionRequest.getPortletSession().removeAttribute("themes");
            }
            catch (Exception e)
            {
                log.error("Page has not been updated.", e);
            }           
        }
       
        if (layout != null)
        {
            try
            {
                ContentFragment layoutFragment = requestContext.getPage().getNonTemplateRootFragment();
                pageLayoutComponent.updateName(layoutFragment, layout);
                actionRequest.getPortletSession().removeAttribute("layouts");
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

   
    @Override
    protected void doHeaders(RenderRequest request, RenderResponse response)
    {
        super.doHeaders(request, response);
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        Element headElem = response.createElement("script");
        headElem.setAttribute("language", "javascript");
        String scriptPath = rc.getRequest().getContextPath() + yuiScriptPath;
        headElem.setAttribute("id", HeaderPhaseSupportConstants.HEAD_ELEMENT_CONTRIBUTION_ELEMENT_ID_YUI_LIBRARY_INCLUDE);
        headElem.setAttribute("src", scriptPath);
        headElem.setAttribute("type", "text/javascript");
        response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, headElem);
    }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

  }

  @Override
  protected void doHeaders(RenderRequest request, RenderResponse response) {
    super.doHeaders(request, response);
    RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
    addJavaScript(response, rc.getRequest().getContextPath() + yuiScriptPath,
        HeaderPhaseSupportConstants.HEAD_ELEMENT_CONTRIBUTION_ELEMENT_ID_YUI_LIBRARY_INCLUDE);

   
    addJavaScript(response, request.getContextPath() + "/javascript/yui2/yui2-jetspeed.js", null);
    addStyleLink(response, request.getContextPath() + "/css/yui2/yui2-jetspeed.css", null);
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

  public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {

    boolean hasEditAccess = false;

    try {
      RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
      ContentPage contentPage = requestContext.getPage();
      contentPage.checkAccess(JetspeedActions.EDIT);
      hasEditAccess = true;
    } catch (Exception ignore) {
    }
View Full Code Here

Examples of org.apache.jetspeed.request.RequestContext

        return false;
    }

    public static String getAbsoluteUrl(RenderRequest renderRequest, String relativePath)
    {
        RequestContext requestContext = (RequestContext) renderRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        HttpServletRequest request = requestContext.getRequest();
        StringBuffer path = new StringBuffer();
        if ( !requestContext.getPortalURL().isRelativeOnly() )
        {
            path.append(request.getScheme()).append("://").append(request.getServerName()).append(":").append(request.getServerPort());
        }
        return requestContext.getResponse().encodeURL(path.append(request.getContextPath()).append(request.getServletPath()).append(
                relativePath).toString());
    }
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.