public WindowState getMappedWindowState(WindowState state) { if (JetspeedActions.getStandardWindowStates().contains(state) ) { return state; } else if ( getSupportedWindowStates().contains(state) ) { return mappedCustomStates.get(state); } return null; }
public DefaultDecoratorActionsFactory() { ArrayList list = new ArrayList(JetspeedActions.getStandardPortletModes()); list.addAll(JetspeedActions.getStandardWindowStates()); supportedActions = Collections.unmodifiableList(list); }
public CustomDecoratorActionsFactory() { ArrayList list = new ArrayList(JetspeedActions.getStandardPortletModes()); list.add(JetspeedActions.ABOUT_MODE); list.add(JetspeedActions.CONFIG_MODE); list.add(JetspeedActions.EDIT_DEFAULTS_MODE); list.add(JetspeedActions.PRINT_MODE); list.addAll(JetspeedActions.getStandardWindowStates()); list.add(JetspeedActions.SOLO_STATE); supportedActions = Collections.unmodifiableList(list); list = new ArrayList(JetspeedActions.getStandardPortletModes()); list.add(JetspeedActions.PRINT_MODE); supportedSoloActions = Collections.unmodifiableList(list); }
public PrintSoloDecoratorActionsFactory() { ArrayList list = new ArrayList(JetspeedActions.getStandardPortletModes()); list.add(JetspeedActions.PRINT_MODE); list.addAll(JetspeedActions.getStandardWindowStates()); list.add(JetspeedActions.SOLO_STATE); supportedActions = Collections.unmodifiableList(list); list = new ArrayList(JetspeedActions.getStandardPortletModes()); list.add(JetspeedActions.PRINT_MODE); supportedSoloActions = Collections.unmodifiableList(list); }
public WindowState getCustomWindowState(WindowState state) { if (JetspeedActions.getStandardWindowStates().contains(state)) { return state; } else if (JetspeedActions.getExtendedWindowStates().contains(state)) { // make sure transient cache is setup getSupportedWindowStates(); return supportedCustomStates.get(state); } return null; }
public JetspeedNavigationalStateCodec(PortalContext portalContext) { ArrayList<PortletMode> modesList = new ArrayList<PortletMode>(); // ensure standard modes will be first in the portletModeNames array // this ensures those modes are never lost from a bookmarked url when new modes are added somewhere in the // middle modesList.addAll(JetspeedActions.getStandardPortletModes()); modesList.addAll(JetspeedActions.getExtendedPortletModes()); portletModes = modesList.toArray(new PortletMode[modesList.size()]); if (portletModes.length > keytable.length()) { throw new UnsupportedOperationException("Too many supported PortletModes found. Can only handle max: "+keytable.length()); } // ensure standard states will be first in the windowStateNames array // this ensures those states are never lost from a bookmarked url when new states are added somewhere in the // middle ArrayList<WindowState> statesList = new ArrayList<WindowState>(); statesList.addAll(JetspeedActions.getStandardWindowStates()); statesList.addAll(JetspeedActions.getExtendedWindowStates()); windowStates = statesList.toArray(new WindowState[statesList.size()]); if (windowStates.length > keytable.length()) { throw new UnsupportedOperationException("Too many supported WindowModes found. Can only handle max: "+keytable.length()); } }
this.validPortletModes.put(mode, mode); Iterator states = JetspeedActions.getStandardWindowStates().iterator(); while (states.hasNext())
private WindowState getRequestedWindowState(final RequestContext context) { String windowStateName = context.getRequestParameter(PortalReservedParameters.WINDOW_STATE); if (StringUtils.isBlank(windowStateName)) { return WindowState.NORMAL; } if (availableWindowStatesMap == null) { Map<String, WindowState> windowStatesMap = new HashMap<String, WindowState>(); for (WindowState windowState : JetspeedActions.getStandardWindowStates()) { windowStatesMap.put(windowState.toString(), windowState); } for (WindowState windowState : JetspeedActions.getExtendedWindowStates()) { windowStatesMap.put(windowState.toString(), windowState); } availableWindowStatesMap = windowStatesMap; } WindowState windowState = availableWindowStatesMap.get(windowStateName); return (windowState != null ? windowState : WindowState.NORMAL); } }
public WindowState getState(PortletWindow window) { WindowState state = getMappedState(window.getId().toString()); if (state != null && !JetspeedActions.getStandardWindowStates().contains(state)) { PortletApplication pa = window.getPortletDefinition().getApplication(); state = pa.getCustomWindowState(state); } return state; }
public List<WindowState> getSupportedWindowStates() { if ( supportedWindowStates == null ) { ArrayList<WindowState> list = new ArrayList<WindowState>(JetspeedActions.getStandardWindowStates()); supportedCustomStates = new HashMap<WindowState,WindowState>(); mappedCustomStates = new HashMap<WindowState,WindowState>(); for (CustomWindowState customState : getCustomWindowStates()) { if ( !list.contains(customState.getCustomState()) && JetspeedActions.getExtendedWindowStates().contains(customState.getMappedState()) ) { list.add(customState.getCustomState()); supportedCustomStates.put(customState.getMappedState(),customState.getCustomState()); mappedCustomStates.put(customState.getCustomState(),customState.getMappedState()); } } supportedWindowStates = Collections.unmodifiableList(list); } return supportedWindowStates; }
private Collection getSupportedStates() { RequestContext rc = Jetspeed.getCurrentRequestContext(); if (rc != null) { PortletWindow window = rc.getCurrentPortletWindow(); if (window != null) { return window.getPortletDefinition().getApplication().getSupportedWindowStates(); } } return JetspeedActions.getStandardWindowStates(); }
public String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId, boolean actionScopeRendered, String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters, PortletMode mode, WindowState state, PortalURL.URLType urlType) throws UnsupportedEncodingException { if (!window.isValid()) { throw new IllegalStateException("Cannot encode Navigational State for invalid window: "+window.getId()); } if ( mode != null || state != null ) { PortletApplication pa = null; if (mode != null && !JetspeedActions.getStandardPortletModes().contains(mode)) { pa = window.getPortletDefinition().getApplication(); mode = pa.getMappedPortletMode(mode); } if (state != null && !JetspeedActions.getStandardWindowStates().contains(state)) { if ( pa == null ) { pa = window.getPortletDefinition().getApplication(); } state = pa.getMappedWindowState(state); } } return codec.encode(requestStates, window, parameters, actionScopeId, actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters, mode, state, urlType, isNavigationalParameterStateFull(), isRenderParameterStateFull()); }
if (state != null && !JetspeedActions.getStandardWindowStates().contains(state))
if (!JetspeedActions.getStandardWindowStates().contains(windowState))