public void removePublicParameterValue(String name) { ParameterInfo parameterInfo = navigationInfo.getPublicParameter(name); // if (parameterInfo != null) { publicEntryRemovals.add(name); entries.remove(name); } }
public Map<String, String[]> getPublicWindowNavigationalState(ControllerContext controller, PageNavigationalState page, String windowId) { PortletInfo info = controller.getPortletInfo(windowId); // if (info != null) { ParameterMap publicNavigationalState = new ParameterMap(); for (ParameterInfo parameterInfo : info.getNavigation().getPublicParameters()) { String[] parameterValue = page.getPublicNavigationalState(parameterInfo.getName()); // if (parameterValue != null) { String parameterId = parameterInfo.getId(); // We clone the value here so we keep the internal state not potentially changed publicNavigationalState.put(parameterId, parameterValue.clone()); } } // return publicNavigationalState; } // return null; } }
protected static ParameterMap safeBuildPublicParameters(NavigationInfo navigationInfo, Map<String, String[]> publicNavigationalParameters) { if (publicNavigationalParameters != null) { // Clone the public navigational state with the copy mode ParameterMap publicParameters = ParameterMap.clone(publicNavigationalParameters); // Remove any parameter that would have been sent by the producer by mistake for (Iterator<String> i = publicParameters.keySet().iterator(); i.hasNext();) { String name = i.next(); if (navigationInfo.getPublicParameter(name) == null) { i.remove(); } } // return publicParameters; } else { return null; } }
private void internalPut(String name, String[] value, boolean cloneValue) { if (cloneValue) { value = value.clone(); } // Look if we have an entry already PortletParameter entry = entries.get(name); // if (entry == null) { ParameterInfo parameterInfo = navigationInfo.getPublicParameter(name); // PortletParameter.Scope scope = parameterInfo == null ? PortletParameter.Scope.PRIVATE : PortletParameter.Scope.PUBLIC; // if (scope == PortletParameter.Scope.PUBLIC) { publicEntryRemovals.remove(name); } // entries.put(name, new PortletParameter(scope, value)); } else { entries.put(name, new PortletParameter(entry.getScope(), value)); } }
public void updatePublicNavigationalState( ControllerContext controller, PageNavigationalState page, String portletWindowId, Map<String, String[]> update) { PortletInfo info = controller.getPortletInfo(portletWindowId); if (info != null) { NavigationInfo navigationInfo = info.getNavigation(); for (Map.Entry<String, String[]> entry : update.entrySet()) { String id = entry.getKey(); ParameterInfo parameterInfo = navigationInfo.getPublicParameter(id); if (parameterInfo != null) { QName name = parameterInfo.getName(); String[] value = entry.getValue(); if (value.length > 0) { page.setPublicNavigationalState(name, value); } else { page.removePublicNavigationalState(name); } } } } }