Java 类javax.portlet.PortalContext 实例源码

项目:portals-pluto    文件:PortletRequestImplTest.java   
protected void setUp( ) throws Exception
    {
        super.setUp();

        // Create mocks
        mockServices = mock( ContainerServices.class );
        mockCCPPProfileService = mock( CCPPProfileService.class );
        mockPortalContext = mock( PortalContext.class );
        mockPortletContext = mock( PortletContext.class );
        mockPortletURLProvider = mock(PortletURLProvider.class);
        mockContainer = mock( PortletContainerImpl.class,
                new Class[] { String.class, ContainerServices.class },
                new Object[] { "Mock Pluto Container", (ContainerServices) mockServices.proxy() } );
        window = (PortletWindow) mock( PortletWindow.class ).proxy();
        mockHttpServletRequest = mock( HttpServletRequest.class );
        mockPortletRequestContext = mock ( PortletRequestContext.class );
        mockPortletResponseContext = mock ( PortletRenderResponseContext.class );
        mock ( CacheControl.class );

        // Constructor expectations for RenderRequestImpl
//        mockContainer.expects( atLeastOnce() ).method( "getOptionalContainerServices" ).will( returnValue( mockOptionalServices.proxy() ) );
//        mockServices.expects( once() ).method( "getPortalContext" ).will( returnValue( mockPortalContext.proxy() ) );
    }
项目:spring4-understanding    文件:MockPortletRequest.java   
/**
 * Create a new MockPortletRequest.
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext) {
    this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
    this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
    this.responseContentTypes.add("text/html");
    this.locales.add(Locale.ENGLISH);
    this.attributes.put(LIFECYCLE_PHASE, getLifecyclePhase());
}
项目:spring4-understanding    文件:MockPortletRequest.java   
/**
 * Create a new MockPortletRequest.
 *
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext) {
    this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
    this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
    this.responseContentTypes.add("text/html");
    this.locales.add(Locale.ENGLISH);
    this.attributes.put(LIFECYCLE_PHASE, getLifecyclePhase());
}
项目:class-guard    文件:MockPortletRequest.java   
/**
 * Create a new MockPortletRequest.
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext) {
    this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
    this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
    this.responseContentTypes.add("text/html");
    this.locales.add(Locale.ENGLISH);
    this.attributes.put(LIFECYCLE_PHASE, getLifecyclePhase());
}
项目:class-guard    文件:MockPortletRequest.java   
/**
 * Create a new MockPortletRequest.
 *
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockPortletRequest(PortalContext portalContext, PortletContext portletContext) {
    this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
    this.portletContext = (portletContext != null ? portletContext : new MockPortletContext());
    this.responseContentTypes.add("text/html");
    this.locales.add(Locale.ENGLISH);
    this.attributes.put(LIFECYCLE_PHASE, getLifecyclePhase());
}
项目:portals-pluto    文件:PortalContextWrapper.java   
/**
 */
public PortalContextWrapper(PortalContext wrapped) {
   if (wrapped == null) {
      throw new java.lang.IllegalArgumentException("Object to wrap is null");
   }
   this.wrapped = wrapped;
}
项目:portals-pluto    文件:PortalContextWrapper.java   
/**
 * Sets the wrapped object.
 * 
 * @param wrapped   the wrapped object to set.
 * @throws java.lang.IllegalArgumentException   if the request is null.
 */
public void setWrapped(PortalContext wrapped) {
   if (wrapped == null) {
      throw new java.lang.IllegalArgumentException("Object to wrap is null");
   }
  this.wrapped = wrapped;
}
项目:portals-pluto    文件:ResourceRequestWrapperChecker.java   
@Override
public PortalContext getPortalContext() {
   String meth = "getPortalContext";
   Object[] args = {};
   PortalContext ret = pcntxt;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:PortletRequestWrapperChecker.java   
@Override
public PortalContext getPortalContext() {
   String meth = "getPortalContext";
   Object[] args = {};
   PortalContext ret = pcntxt;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:RenderRequestWrapperChecker.java   
@Override
public PortalContext getPortalContext() {
   String meth = "getPortalContext";
   Object[] args = {};
   PortalContext ret = pcntxt;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:ActionRequestWrapperChecker.java   
@Override
public PortalContext getPortalContext() {
   String meth = "getPortalContext";
   Object[] args = {};
   PortalContext ret = pcntxt;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:EventRequestWrapperChecker.java   
@Override
public PortalContext getPortalContext() {
   String meth = "getPortalContext";
   Object[] args = {};
   PortalContext ret = pcntxt;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
项目:portals-pluto    文件:PortalContextImpl.java   
/**
 * Default Constructor.
 * @param config
 */
public PortalContextImpl(DriverConfiguration config) {
    this.config = config;
    reset();

    // we now support render headers
    properties.put(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT, "true");
}
项目:portals-pluto    文件:PortalDriverServicesImpl.java   
/**
 * Constructor for just passing in the required services.
 * @param context
 * @param portletRequestContextService
 * @param eventCoordinationService
 * @param filterManagerService
 * @param portletURLListenerService
 */
public PortalDriverServicesImpl(PortalContext context,
        PortletRequestContextService portletRequestContextService,
        EventCoordinationService eventCoordinationService,
        FilterManagerService filterManagerService,
        PortletURLListenerService portletURLListenerService)  
{
    this(context, portletRequestContextService, eventCoordinationService, 
        filterManagerService, portletURLListenerService, null);
}
项目:portals-pluto    文件:PortalDriverServicesImpl.java   
/**
 * Constructor for passing in the required services and optional container services.
 * @param context
 * @param portletRequestContextService
 * @param eventCoordinationService
 * @param filterManagerService
 * @param portletURLListenerService
 * @param optionalServices Optional services (if this is null, default services are used)
 */
public PortalDriverServicesImpl(PortalContext context,
        PortletRequestContextService portletRequestContextService,
        EventCoordinationService eventCoordinationService,
        FilterManagerService filterManagerService,
        PortletURLListenerService portletURLListenerService,
        OptionalContainerServices optionalServices)  
{
    this(context, portletRequestContextService, eventCoordinationService,
         filterManagerService, portletURLListenerService, optionalServices, null, null, null);
}
项目:portals-pluto    文件:PortalDriverServicesImpl.java   
/**
 * Constructor for passing in the required services and optional container services.
 * @param context
 * @param portletRequestContextService
 * @param eventCoordinationService
 * @param filterManagerService
 * @param portletURLListenerService
 * @param optionalServices Optional services (if this is null, default services are used)
 */
public PortalDriverServicesImpl(PortalContext context,
        PortletRequestContextService portletRequestContextService,
        EventCoordinationService eventCoordinationService,
        FilterManagerService filterManagerService,
        PortletURLListenerService portletURLListenerService,
        OptionalContainerServices optionalServices,
        PortletContextService portletContextService,
        PortletRegistryService portletRegistryService,
        PortalAdministrationService portalAdministrationService)  
{    
    // set required first
    this.context = context;
    this.eventCoordinationService = eventCoordinationService;
    this.portletRequestContextService = portletRequestContextService;
    this.filterManagerService = filterManagerService;
    this.portletURLListenerService = portletURLListenerService;

    // now optional
    if ( optionalServices != null ) {
        ccppProfileService = optionalServices.getCCPPProfileService();
        portletPreferencesService = optionalServices.getPortletPreferencesService();
        portletInvokerService = optionalServices.getPortletInvokerService();
        portletEnvironmentService = optionalServices.getPortletEnvironmentService();
        userInfoService = optionalServices.getUserInfoService();
        namespaceMapper = optionalServices.getNamespaceMapper();
        rdService = optionalServices.getRequestDispatcherService();
    }

    // and finally driver
    this.portletContextService = portletContextService;
    this.portletRegistryService = portletRegistryService;
    this.portalAdministrationService = portalAdministrationService;

    createDefaultServicesIfNeeded();
}
项目:spring4-understanding    文件:AnnotationMethodHandlerAdapter.java   
@Override
protected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest)
        throws Exception {

    PortletRequest request = webRequest.getNativeRequest(PortletRequest.class);
    PortletResponse response = webRequest.getNativeResponse(PortletResponse.class);

    if (PortletRequest.class.isAssignableFrom(parameterType) ||
            MultipartRequest.class.isAssignableFrom(parameterType)) {
        Object nativeRequest = webRequest.getNativeRequest(parameterType);
        if (nativeRequest == null) {
            throw new IllegalStateException(
                    "Current request is not of type [" + parameterType.getName() + "]: " + request);
        }
        return nativeRequest;
    }
    else if (PortletResponse.class.isAssignableFrom(parameterType)) {
        Object nativeResponse = webRequest.getNativeResponse(parameterType);
        if (nativeResponse == null) {
            throw new IllegalStateException(
                    "Current response is not of type [" + parameterType.getName() + "]: " + response);
        }
        return nativeResponse;
    }
    else if (PortletSession.class.isAssignableFrom(parameterType)) {
        return request.getPortletSession();
    }
    else if (PortletPreferences.class.isAssignableFrom(parameterType)) {
        return request.getPreferences();
    }
    else if (PortletMode.class.isAssignableFrom(parameterType)) {
        return request.getPortletMode();
    }
    else if (WindowState.class.isAssignableFrom(parameterType)) {
        return request.getWindowState();
    }
    else if (PortalContext.class.isAssignableFrom(parameterType)) {
        return request.getPortalContext();
    }
    else if (Principal.class.isAssignableFrom(parameterType)) {
        return request.getUserPrincipal();
    }
    else if (Locale.class == parameterType) {
        return request.getLocale();
    }
    else if (InputStream.class.isAssignableFrom(parameterType)) {
        if (!(request instanceof ClientDataRequest)) {
            throw new IllegalStateException("InputStream can only get obtained for Action/ResourceRequest");
        }
        return ((ClientDataRequest) request).getPortletInputStream();
    }
    else if (Reader.class.isAssignableFrom(parameterType)) {
        if (!(request instanceof ClientDataRequest)) {
            throw new IllegalStateException("Reader can only get obtained for Action/ResourceRequest");
        }
        return ((ClientDataRequest) request).getReader();
    }
    else if (OutputStream.class.isAssignableFrom(parameterType)) {
        if (!(response instanceof MimeResponse)) {
            throw new IllegalStateException("OutputStream can only get obtained for Render/ResourceResponse");
        }
        return ((MimeResponse) response).getPortletOutputStream();
    }
    else if (Writer.class.isAssignableFrom(parameterType)) {
        if (!(response instanceof MimeResponse)) {
            throw new IllegalStateException("Writer can only get obtained for Render/ResourceResponse");
        }
        return ((MimeResponse) response).getWriter();
    }
    else if (Event.class == parameterType) {
        if (!(request instanceof EventRequest)) {
            throw new IllegalStateException("Event can only get obtained from EventRequest");
        }
        return ((EventRequest) request).getEvent();
    }
    return super.resolveStandardArgument(parameterType, webRequest);
}
项目:spring4-understanding    文件:MockPortletRequest.java   
@Override
public PortalContext getPortalContext() {
    return this.portalContext;
}
项目:spring4-understanding    文件:MockPortletRequest.java   
@Override
public PortalContext getPortalContext() {
    return this.portalContext;
}
项目:sakai    文件:SakaiPortletContainerServices.java   
public PortalContext getPortalContext()
{
    return portalContext;
}
项目:sakai    文件:SakaiPortletContainerServices.java   
public void setPortalContext(PortalContext portalContext)
{
    this.portalContext = portalContext;
}
项目:concourseconnect-community    文件:ContainerServicesImpl.java   
public PortalContext getPortalContext() {
  return context;
}
项目:class-guard    文件:AnnotationMethodHandlerAdapter.java   
@Override
protected Object resolveStandardArgument(Class<?> parameterType, NativeWebRequest webRequest)
        throws Exception {

    PortletRequest request = webRequest.getNativeRequest(PortletRequest.class);
    PortletResponse response = webRequest.getNativeResponse(PortletResponse.class);

    if (PortletRequest.class.isAssignableFrom(parameterType) ||
            MultipartRequest.class.isAssignableFrom(parameterType)) {
        Object nativeRequest = webRequest.getNativeRequest(parameterType);
        if (nativeRequest == null) {
            throw new IllegalStateException(
                    "Current request is not of type [" + parameterType.getName() + "]: " + request);
        }
        return nativeRequest;
    }
    else if (PortletResponse.class.isAssignableFrom(parameterType)) {
        Object nativeResponse = webRequest.getNativeResponse(parameterType);
        if (nativeResponse == null) {
            throw new IllegalStateException(
                    "Current response is not of type [" + parameterType.getName() + "]: " + response);
        }
        return nativeResponse;
    }
    else if (PortletSession.class.isAssignableFrom(parameterType)) {
        return request.getPortletSession();
    }
    else if (PortletPreferences.class.isAssignableFrom(parameterType)) {
        return request.getPreferences();
    }
    else if (PortletMode.class.isAssignableFrom(parameterType)) {
        return request.getPortletMode();
    }
    else if (WindowState.class.isAssignableFrom(parameterType)) {
        return request.getWindowState();
    }
    else if (PortalContext.class.isAssignableFrom(parameterType)) {
        return request.getPortalContext();
    }
    else if (Principal.class.isAssignableFrom(parameterType)) {
        return request.getUserPrincipal();
    }
    else if (Locale.class.equals(parameterType)) {
        return request.getLocale();
    }
    else if (InputStream.class.isAssignableFrom(parameterType)) {
        if (!(request instanceof ClientDataRequest)) {
            throw new IllegalStateException("InputStream can only get obtained for Action/ResourceRequest");
        }
        return ((ClientDataRequest) request).getPortletInputStream();
    }
    else if (Reader.class.isAssignableFrom(parameterType)) {
        if (!(request instanceof ClientDataRequest)) {
            throw new IllegalStateException("Reader can only get obtained for Action/ResourceRequest");
        }
        return ((ClientDataRequest) request).getReader();
    }
    else if (OutputStream.class.isAssignableFrom(parameterType)) {
        if (!(response instanceof MimeResponse)) {
            throw new IllegalStateException("OutputStream can only get obtained for Render/ResourceResponse");
        }
        return ((MimeResponse) response).getPortletOutputStream();
    }
    else if (Writer.class.isAssignableFrom(parameterType)) {
        if (!(response instanceof MimeResponse)) {
            throw new IllegalStateException("Writer can only get obtained for Render/ResourceResponse");
        }
        return ((MimeResponse) response).getWriter();
    }
    else if (Event.class.equals(parameterType)) {
        if (!(request instanceof EventRequest)) {
            throw new IllegalStateException("Event can only get obtained from EventRequest");
        }
        return ((EventRequest) request).getEvent();
    }
    return super.resolveStandardArgument(parameterType, webRequest);
}
项目:class-guard    文件:MockPortletRequest.java   
@Override
public PortalContext getPortalContext() {
    return this.portalContext;
}
项目:class-guard    文件:MockPortletRequest.java   
public PortalContext getPortalContext() {
    return this.portalContext;
}
项目:portals-pluto    文件:PortletRequestImpl.java   
@Override
public PortalContext getPortalContext() {
   return portalContext;
}
项目:portals-pluto    文件:PortletResponseImpl.java   
protected PortalContext getPortalContext()
{
    return getPortletContainer().getContainerServices().getPortalContext();
}
项目:portals-pluto    文件:MockPortletRequest.java   
@Override
public PortalContext getPortalContext() {
   return null;
}
项目:portals-pluto    文件:PlutoServices.java   
public PortalContext getPortalContext()
{
    return driverServices.getPortalContext();
}
项目:portals-pluto    文件:PortalDriverServicesImpl.java   
/**
 * @see org.apache.pluto.container.ContainerServices#getPortalContext()
 */
public PortalContext getPortalContext() 
{
    return context;
}
项目:sakai    文件:SakaiPortletContainerServices.java   
public PortalContext getPortalContext()
{
    return portalContext;
}
项目:sakai    文件:SakaiPortletContainerServices.java   
public void setPortalContext(PortalContext portalContext)
{
    this.portalContext = portalContext;
}
项目:GridSphere    文件:ApplicationPortletImpl.java   
public PortalContext getPortalContext() {
    return portalContext;
}
项目:spring4-understanding    文件:MockPortletURL.java   
/**
 * Create a new MockPortletURL for the given URL type.
 * @param portalContext the PortalContext defining the supported
 * PortletModes and WindowStates
 * @param urlType the URL type, for example "render" or "action"
 * @see #URL_TYPE_RENDER
 * @see #URL_TYPE_ACTION
 */
public MockPortletURL(PortalContext portalContext, String urlType) {
    Assert.notNull(portalContext, "PortalContext is required");
    this.portalContext = portalContext;
    this.urlType = urlType;
}
项目:spring4-understanding    文件:MockClientDataRequest.java   
/**
 * Create a new MockClientDataRequest.
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockClientDataRequest(PortalContext portalContext, PortletContext portletContext) {
    super(portalContext, portletContext);
}
项目:spring4-understanding    文件:MockResourceRequest.java   
/**
 * Create a new MockResourceRequest.
 * @param portalContext the PortalContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockResourceRequest(PortalContext portalContext, PortletContext portletContext) {
    super(portalContext, portletContext);
}
项目:spring4-understanding    文件:MockEventRequest.java   
/**
 * Create a new MockEventRequest.
 * @param event the event that this request wraps
 * @param portalContext the PortletContext that the request runs in
 * @param portletContext the PortletContext that the request runs in
 */
public MockEventRequest(Event event, PortalContext portalContext, PortletContext portletContext) {
    super(portalContext, portletContext);
    this.event = event;
}
项目:spring4-understanding    文件:MockPortletResponse.java   
/**
 * Create a new MockPortletResponse.
 * @param portalContext the PortalContext defining the supported
 * PortletModes and WindowStates
 */
public MockPortletResponse(PortalContext portalContext) {
    this.portalContext = (portalContext != null ? portalContext : new MockPortalContext());
}
项目:spring4-understanding    文件:MockPortletResponse.java   
/**
 * Return the PortalContext that this MockPortletResponse runs in,
 * defining the supported PortletModes and WindowStates.
 */
public PortalContext getPortalContext() {
    return this.portalContext;
}
项目:spring4-understanding    文件:MockRenderResponse.java   
/**
 * Create a new MockRenderResponse.
 * @param portalContext the PortalContext defining the supported
 * PortletModes and WindowStates
 */
public MockRenderResponse(PortalContext portalContext) {
    super(portalContext);
}