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.validWindowStates.put(state, state); states = JetspeedActions.getExtendedWindowStates().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 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; }