boolean mergeRequestParameters = false;
boolean mergeRequestParametersBefore = false;
// get portlet *private* navigational params
privateParameters = new HashMap<String, String[]>();
NavigationalState ns = requestContext.getPortalURL().getNavigationalState();
mergeRequestParameters = ns.getPortletWindowOfAction() != null || ns.getPortletWindowOfResource() != null;
Map<String, String[]> paramMap = ns.getParameterMap(window);
if (paramMap != null && !paramMap.isEmpty())
{
privateParameters.putAll(paramMap);
}
Map<String, String[]> privateParamMap = getPrivateRenderParameterMap();
if (privateParamMap != null && !privateParamMap.isEmpty())
{
if (privateParameters.isEmpty())
{
privateParameters.putAll(privateParamMap);
}
else for (Map.Entry<String, String[]> entry : privateParamMap.entrySet())
{
String[] values = privateParameters.get(entry.getKey());
if (values == null)
{
privateParameters.put(entry.getKey(), entry.getValue());
}
else
{
String[] combined = new String[values.length+entry.getValue().length];
System.arraycopy(values,0,combined,0,values.length);
System.arraycopy(entry.getValue(),0,combined,values.length,entry.getValue().length);
privateParameters.put(entry.getKey(), combined);
}
}
}
PortletDefinition portletDef = window.getPortletDefinition();
GenericMetadata metaData = portletDef.getMetadata();
if (!mergeRequestParameters)
{
mergeRequestParameters =
getMetaDataBooleanValue(
metaData,
PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_WITH_PORTLET_PARAMETERS,
mergePortalParametersWithPortletParameters.booleanValue());
}
mergeRequestParametersBefore =
getMetaDataBooleanValue(
metaData,
PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_BEFORE_PORTLET_PARAMETERS,
mergePortalParametersBeforePortletParameters.booleanValue());
//get request params
if (mergeRequestParameters)
{
for (Map.Entry<String,String[]> entry : ns.getRequestParameterMap().entrySet())
{
String[] navValues = privateParameters.get(entry.getKey());
if (navValues == null)
{
privateParameters.put(entry.getKey(), entry.getValue());