Package org.apache.jetspeed.request

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


   
    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

    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

   
    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

                }
            }

            session.setAttribute(PortalReservedParameters.PREFERED_LOCALE_ATTRIBUTE, preferedLocale,
                    PortletSession.APPLICATION_SCOPE);
            RequestContext requestContext = (RequestContext) request
                    .getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            requestContext.setLocale(preferedLocale);
            requestContext.setSessionAttribute(PortalReservedParameters.PREFERED_LOCALE_ATTRIBUTE, preferedLocale);
        }

        return;
    }
View Full Code Here

    @Override
    protected void doHeaders(RenderRequest request, RenderResponse response)
    {
        if (this.dojoJsRelativeUrl != null)
        {
            RequestContext requestContext = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
            String portalContextPath = requestContext.getRequest().getContextPath();
            DojoPortletHelper.enableDojo(response, portalContextPath + this.dojoJsRelativeUrl);
        }
        else
        {
            DojoPortletHelper.enableDojo(response, this.dojoJsUrl);
View Full Code Here

            enableOpenIDEntry = Boolean.parseBoolean(enableOpenIDEntryPref);
        }
        request.setAttribute(ENABLE_OPEN_ID_ENTRY_ATTR_NAME, Boolean.toString(enableOpenIDEntry));
       
        // access login errors in session from OpenIDRelayingPartyServlet
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        String errorCode = (String)requestContext.getSessionAttribute(OpenIDConstants.OPEN_ID_ERROR);
        if (errorCode != null)
        {
            request.setAttribute(OpenIDConstants.OPEN_ID_ERROR, errorCode);
        }
       
View Full Code Here

        {
            String action = actionRequest.getParameter(OpenIDConstants.OPEN_ID_REQUEST);
            if (action != null)
            {
                // redirect action to OpenIDRelayingPartyServlet
                RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
                String servletRedirect = requestContext.getRequest().getContextPath()+OPEN_ID_RELAYING_PARTY_SERVLET_MAPPING+"/"+action+"?"+OpenIDConstants.OPEN_ID_RETURN+"="+requestContext.getPortalURL().getBasePath();
               
                // perform action
                if (action.equals(OpenIDConstants.OPEN_ID_LOGIN_REQUEST))
                {
                    // access new user registration init parameters and preferences
                    // and save in session for consumption by the OpenIDRelayingPartyServlet
                    String logConfiguration = "none";
                    PortletPreferences prefs = actionRequest.getPreferences();
                    if (Boolean.parseBoolean(prefs.getValue(ENABLE_REGISTRATION_CONFIG_PREF_NAME, null)))
                    {
                        OpenIDRegistrationConfiguration registrationConfiguration = new OpenIDRegistrationConfiguration();
                        registrationConfiguration.setEnableRegistration(prefs.getValue(ENABLE_REGISTRATION_PREF_NAME, null));
                        registrationConfiguration.setUserTemplateDirectory(prefs.getValue(REGISTRATION_USER_TEMPLATE_PREF_NAME, null));
                        registrationConfiguration.setSubsiteRootFolder(prefs.getValue(REGISTRATION_SUBSITE_ROOT_PREF_NAME, null));
                        registrationConfiguration.setRoles(prefs.getValue(REGISTRATION_ROLES_PREF_NAME, null));
                        registrationConfiguration.setGroups(prefs.getValue(REGISTRATION_GROUPS_PREF_NAME, null));
                        registrationConfiguration.setProfilerRules(prefs.getValue(REGISTRATION_PROFILER_RULE_NAMES_PREF_NAME, null), prefs.getValue(REGISTRATION_PROFILER_RULE_VALUES_PREF_NAME, null));
                        registrationConfiguration.merge(initRegistrationConfiguration);
                        requestContext.setSessionAttribute(OpenIDConstants.OPEN_ID_REGISTRATION_CONFIGURATION, registrationConfiguration);
                        logConfiguration = "preferences";
                    }
                    else if (initRegistrationConfiguration != null)
                    {
                        requestContext.setSessionAttribute(OpenIDConstants.OPEN_ID_REGISTRATION_CONFIGURATION, initRegistrationConfiguration);
                        logConfiguration = "init params";
                    }

                    // login redirect to OpenIDRelayingPartyServlet
                    String discoveryParam = actionRequest.getParameter(OpenIDConstants.OPEN_ID_DISCOVERY);
View Full Code Here

     * @see org.apache.portals.applications.webcontent.portlet.IFrameGenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
     */
    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
    {
        // get current session OpenID login state
        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
        Subject sessionSubject = (Subject)requestContext.getSessionAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
        String sessionOpenIDProvider = (String)requestContext.getSessionAttribute(PortalReservedParameters.SESSION_OPEN_ID_PROVIDER);
        PortletPreferences prefs = request.getPreferences();
        String requiredOpenIDProvider = prefs.getValue(REQUIRED_OPEN_ID_PROVIDER_PREF_NAME, null);
        String requiredOpenIDProviderLabel = prefs.getValue(REQUIRED_OPEN_ID_PROVIDER_LABEL_PREF_NAME, null);

        // check against configured requirements
View Full Code Here

        {
            // TODO 2004-11-18: Hack around PLUTO-83 bug which fix should be availabe in 1.0.1-rc2
            //                  After the fix, the RequestContext should be retrieved from the RenderRequest
            //                  and the pluto depedency removed from this project project.xml
            HttpServletRequest req = (HttpServletRequest)((PortletRequestImpl)request).getRequest();
            RequestContext requestContext = (RequestContext)req.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            Integer passwordDaysValid = (Integer)requestContext.getAttribute(PasswordCredential.PASSWORD_CREDENTIAL_DAYS_VALID_REQUEST_ATTR_KEY);
           
            if ( passwordDaysValid != null )
            {
                ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jetspeed.portlets.security.resources.ChgPwdResources",request.getLocale());
                if ( passwordDaysValid.intValue() < 1 )
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.request.RequestContext

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.