Examples of JetspeedRequestContext


Examples of org.apache.jetspeed.request.JetspeedRequestContext

            // been accessed, flush the cache and rebuild the map.
            currentRequest = getRequest();           
            portletParameters = new HashMap();

            // get portlet params
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                PortalURL url = context.getPortalURL();
                Iterator iter = url.getNavigationalState().getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
                    String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

    public Object getAttribute( String name )
    {
        Object value = super.getAttribute(name);
        if (name.equals(PortletRequest.USER_INFO))
        {
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            if (null != context)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationEntity portletAppEntity = portletWindow.getPortletEntity()
                        .getPortletApplicationEntity();
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
                    if (log.isDebugEnabled() && (null != value))
                        log.debug(PortletRequest.USER_INFO + " map size: " + ((Map) value).size());
                }
                else
                {
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        this._getHttpServletRequest().setAttribute(name, value);       
    }
   
    public Principal getUserPrincipal()
    {
        JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
        if (context != null)
        {
            Set principals = context.getSubject().getPrincipals();
            if (principals != null)
            {
                Iterator it = principals.iterator();
                if (it.hasNext())
                {
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        }

        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        RequestContext a_oRC = new JetspeedRequestContext(request, response,
                config, null);
       
        a_oRC.setSubject(new Subject());
       
        Page a_oPage = setupPage();
        ContentPage a_oContentPage = new ContentPageImpl(a_oPage);

        a_oRC.setPage(a_oContentPage);

        return a_oRC;
    }
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        request.setupAddParameter("name", defName);
        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        final RequestContext rc =
            new JetspeedRequestContext(request, response, config, null);
       
        Set principals = new HashSet();
        principals.add(new UserPrincipalImpl("admin"));
        principals.add(new RolePrincipalImpl("admin"));
        Subject subject = new Subject(true, principals, new HashSet(), new HashSet());
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

                }
            }

            // get portlet navigational params
            HashMap navParameters = new HashMap();
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                PortalURL url = context.getPortalURL();
                actionRequest = context.getActionWindow() != null;
                Iterator iter = url.getNavigationalState().getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
                    String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

    private Object getAttributeInternal( String name )
    {
        Object value = super.getAttribute(name);
        if (name.equals(PortletRequest.USER_INFO))
        {
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            if (null != context)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
                    if (log.isDebugEnabled() && (null != value))
                        log.debug(PortletRequest.USER_INFO + " map size: " + ((Map) value).size());
                }
                else
                {
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        }

        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        RequestContext a_oRC = new JetspeedRequestContext(request, response,
                config, null);

        Page a_oPage = setupPage();
        ContentPage a_oContentPage = new ContentPageImpl(a_oPage);

        a_oRC.setPage(a_oContentPage);

        return a_oRC;
    }
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

                }
            }

            // get portlet navigational params
            HashMap navParameters = new HashMap();
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                NavigationalState ns = context.getPortalURL().getNavigationalState();
                postAllowed = ns.getPortletWindowOfAction() != null || ns.getPortletWindowOfResource() != null;
                Iterator iter = ns.getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

    {
        Object value = super.getAttribute(name);
        if (name.equals(PortletRequest.USER_INFO))
        {
            value = null;
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            // USER_INFO only available (!=null) for authenticated user)
            if (null != context && getUserPrincipal() != null)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
                    if (log.isDebugEnabled() && (null != value))
                        log.debug(PortletRequest.USER_INFO + " map size: " + ((Map) value).size());
                }
                else
                {
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.