Java Code Examples for javax.portlet.WindowState#NORMAL

The following examples show how to use javax.portlet.WindowState#NORMAL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PortletState.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public PortletState(String id)
{
	this.id = id;
	portletMode = PortletMode.VIEW;
	windowState = WindowState.NORMAL;
	parameters = new HashMap();
}
 
Example 2
Source File: ResourceRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 3
Source File: PortletRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 4
Source File: ActionResponseWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 5
Source File: EventResponseWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 6
Source File: RenderRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 7
Source File: ActionRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 8
Source File: EventRequestWrapperChecker.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public WindowState getWindowState() {
   String meth = "getWindowState";
   Object[] args = {};
   WindowState ret = WindowState.NORMAL;
   retVal = ret;
   checkArgs(meth, args);
   return ret;
}
 
Example 9
Source File: RelativePortalURLImpl.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the window state of the specified window.
 * 
 * @param windowId
 *           the window ID.
 * @return the window state. Default to NORMAL.
 */
public WindowState getWindowState(String windowId) {
   WindowState state = windowStates.get(windowId);
   if (state == null) {
      state = WindowState.NORMAL;
   }
   return state;
}
 
Example 10
Source File: PortletState.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public PortletState(String id)
{
	this.id = id;
	portletMode = PortletMode.VIEW;
	windowState = WindowState.NORMAL;
	parameters = new HashMap();
}
 
Example 11
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void portlet20DispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyPortlet20DispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			wac.registerBeanDefinition("controller2", new RootBeanDefinition(DetailsController.class));
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest(PortletMode.VIEW);
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockActionRequest actionRequest = new MockActionRequest("this");
	MockActionResponse actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value", response.getContentAsString());

	actionRequest = new MockActionRequest("that");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value2", response.getContentAsString());

	actionRequest = new MockActionRequest("else");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value3", response.getContentAsString());

	actionRequest = new MockActionRequest("error");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	request.setSession(actionRequest.getPortletSession());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("XXX", response.getContentAsString());

	MockEventRequest eventRequest = new MockEventRequest(new MockEvent("event1"));
	MockEventResponse eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value3", response.getContentAsString());

	eventRequest = new MockEventRequest(new MockEvent("event2"));
	eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value4", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.NORMAL);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockResourceRequest resourceRequest = new MockResourceRequest("resource1");
	MockResourceResponse resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myResource", resourceResponse.getContentAsString());

	resourceRequest = new MockResourceRequest("resource2");
	resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myDefaultResource", resourceResponse.getContentAsString());
}
 
Example 12
Source File: Portlet20AnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test
public void eventDispatchingController() throws Exception {
	DispatcherPortlet portlet = new DispatcherPortlet() {
		@Override
		protected ApplicationContext createPortletApplicationContext(ApplicationContext parent) throws BeansException {
			StaticPortletApplicationContext wac = new StaticPortletApplicationContext();
			wac.setPortletContext(new MockPortletContext());
			RootBeanDefinition bd = new RootBeanDefinition(MyPortlet20DispatchingController.class);
			bd.setScope(WebApplicationContext.SCOPE_REQUEST);
			wac.registerBeanDefinition("controller", bd);
			wac.registerBeanDefinition("controller2", new RootBeanDefinition(DetailsController.class));
			AnnotationConfigUtils.registerAnnotationConfigProcessors(wac);
			wac.refresh();
			return wac;
		}
	};
	portlet.init(new MockPortletConfig());

	MockRenderRequest request = new MockRenderRequest();
	MockRenderResponse response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockActionRequest actionRequest = new MockActionRequest("this");
	MockActionResponse actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	request.setSession(actionRequest.getPortletSession());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value", response.getContentAsString());

	actionRequest = new MockActionRequest();
	actionRequest.addParameter("action", "details");
	actionResponse = new MockActionResponse();
	portlet.processAction(actionRequest, actionResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(actionResponse.getRenderParameterMap());
	request.setSession(actionRequest.getPortletSession());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-details", response.getContentAsString());

	MockEventRequest eventRequest = new MockEventRequest(new MockEvent("event1"));
	eventRequest.setParameters(actionRequest.getParameterMap());
	MockEventResponse eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value3", response.getContentAsString());

	eventRequest = new MockEventRequest(new MockEvent("event3"));
	eventRequest.setParameters(actionRequest.getParameterMap());
	eventResponse = new MockEventResponse();
	portlet.processEvent(eventRequest, eventResponse);

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.MAXIMIZED);
	request.setParameters(eventResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myLargeView-value4", response.getContentAsString());

	request = new MockRenderRequest(PortletMode.VIEW, WindowState.NORMAL);
	request.setParameters(actionResponse.getRenderParameterMap());
	response = new MockRenderResponse();
	portlet.render(request, response);
	assertEquals("myView", response.getContentAsString());

	MockResourceRequest resourceRequest = new MockResourceRequest("resource1");
	MockResourceResponse resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myResource", resourceResponse.getContentAsString());

	resourceRequest = new MockResourceRequest("resource2");
	resourceResponse = new MockResourceResponse();
	portlet.serveResource(resourceRequest, resourceResponse);
	assertEquals("myDefaultResource", resourceResponse.getContentAsString());
}
 
Example 13
Source File: MockPortletRequest.java    From portals-pluto with Apache License 2.0 4 votes vote down vote up
@Override
public WindowState getWindowState() {
   return WindowState.NORMAL;
}