use of org.apereo.portal.portlet.om.IPortletWindowId in project uPortal by Jasig.
the class LayoutRESTController method setAltMaxURL.
private void setAltMaxURL(HttpServletRequest request, NamedNodeMap attributes, IPortletDefinition def, LayoutPortlet portlet) {
final String alternativeMaximizedLink = def.getAlternativeMaximizedLink();
if (alternativeMaximizedLink != null) {
portlet.setUrl(alternativeMaximizedLink);
portlet.setAltMaxUrl(true);
} else {
// get the maximized URL for this portlet
final IPortalUrlBuilder portalUrlBuilder = urlProvider.getPortalUrlBuilderByLayoutNode(request, attributes.getNamedItem("ID").getNodeValue(), UrlType.RENDER);
final IPortletWindowId targetPortletWindowId = portalUrlBuilder.getTargetPortletWindowId();
if (targetPortletWindowId != null) {
final IPortletUrlBuilder portletUrlBuilder = portalUrlBuilder.getPortletUrlBuilder(targetPortletWindowId);
portletUrlBuilder.setWindowState(WindowState.MAXIMIZED);
}
portlet.setUrl(portalUrlBuilder.getUrlString());
portlet.setAltMaxUrl(false);
}
}
use of org.apereo.portal.portlet.om.IPortletWindowId in project uPortal by Jasig.
the class PortletWindowCache method storeIfAbsentWindow.
public T storeIfAbsentWindow(T window) {
final IPortletWindowId portletWindowId = window.getPortletWindowId();
// Check if the entity already exists (uses a read lock)
T existingWindow = this.getWindow(portletWindowId);
if (existingWindow != null) {
return existingWindow;
}
writeLock.lock();
try {
// Check again inside the write lock
existingWindow = this.windowsById.get(portletWindowId);
if (existingWindow != null) {
return existingWindow;
}
this.storeWindow(window);
} finally {
writeLock.unlock();
}
return window;
}
use of org.apereo.portal.portlet.om.IPortletWindowId in project uPortal by Jasig.
the class PortletWindowCache method storeWindow.
public void storeWindow(T window) {
writeLock.lock();
try {
final IPortletEntityId portletEntityId = window.getPortletEntityId();
final Set<T> windowSet = this.getWindowSet(portletEntityId, true);
windowSet.add(window);
final IPortletWindowId portletWindowId = window.getPortletWindowId();
this.windowsById.put(portletWindowId, window);
} finally {
writeLock.unlock();
}
}
use of org.apereo.portal.portlet.om.IPortletWindowId in project uPortal by Jasig.
the class PortletRequestParameterProcessor method processParameters.
/* (non-Javadoc)
* @see org.apereo.portal.url.processing.IRequestParameterProcessor#processParameters(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
@Override
public boolean processParameters(HttpServletRequest request, HttpServletResponse response) {
final IPortalRequestInfo portalRequestInfo = this.urlSyntaxProvider.getPortalRequestInfo(request);
final IPortletWindowId targetedPortletWindowId = portalRequestInfo.getTargetedPortletWindowId();
for (final IPortletRequestInfo portletRequestInfo : portalRequestInfo.getPortletRequestInfoMap().values()) {
final IPortletWindowId portletWindowId = portletRequestInfo.getPortletWindowId();
final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(request, targetedPortletWindowId);
final UrlType urlType = portalRequestInfo.getUrlType();
switch(urlType) {
case RENDER:
{
final Map<String, List<String>> portletParameters = portletRequestInfo.getPortletParameters();
portletWindow.setRenderParameters(ParameterMap.convertListMap(portletParameters));
// fall through, render uses state/mode info
}
case ACTION:
{
final WindowState windowState = portletRequestInfo.getWindowState();
if (windowState != null) {
portletWindow.setWindowState(windowState);
}
final PortletMode portletMode = portletRequestInfo.getPortletMode();
if (portletMode != null) {
portletWindow.setPortletMode(portletMode);
}
break;
}
default:
}
// Override the window state of the targeted portlet window based on the url state
if (portletWindowId.equals(targetedPortletWindowId)) {
final UrlState urlState = portalRequestInfo.getUrlState();
switch(urlState) {
case MAX:
{
portletWindow.setWindowState(WindowState.MAXIMIZED);
break;
}
case DETACHED:
{
portletWindow.setWindowState(IPortletRenderer.DETACHED);
break;
}
case EXCLUSIVE:
{
portletWindow.setWindowState(IPortletRenderer.EXCLUSIVE);
break;
}
default:
}
}
this.portletWindowRegistry.storePortletWindow(request, portletWindow);
}
return true;
}
use of org.apereo.portal.portlet.om.IPortletWindowId in project uPortal by Jasig.
the class PortletAdministrationHelper method configModeAction.
public boolean configModeAction(ExternalContext externalContext, String fname) throws IOException {
final ActionRequest actionRequest = (ActionRequest) externalContext.getNativeRequest();
final ActionResponse actionResponse = (ActionResponse) externalContext.getNativeResponse();
final IPortletWindowId portletWindowId = this.getDelegateWindowId(externalContext, fname);
if (portletWindowId == null) {
throw new IllegalStateException("Cannot execute configModeAciton without a delegate window ID in the session for key: " + RenderPortletTag.DEFAULT_SESSION_KEY_PREFIX + fname);
}
final PortletDelegationDispatcher requestDispatcher = this.portletDelegationLocator.getRequestDispatcher(actionRequest, portletWindowId);
final DelegationActionResponse delegationResponse = requestDispatcher.doAction(actionRequest, actionResponse);
final String redirectLocation = delegationResponse.getRedirectLocation();
final DelegateState delegateState = delegationResponse.getDelegateState();
if (redirectLocation != null || (delegationResponse.getPortletMode() != null && !IPortletRenderer.CONFIG.equals(delegationResponse.getPortletMode())) || !IPortletRenderer.CONFIG.equals(delegateState.getPortletMode())) {
// The portlet sent a redirect OR changed it's mode away from CONFIG, assume it is done
return true;
}
return false;
}
Aggregations