StringBuffer query = new StringBuffer("?");
boolean firstParam = true;
for (Iterator it = portalURL.getParameters().iterator();
it.hasNext(); ) {
PortalURLParameter param = (PortalURLParameter) it.next();
// Encode action params in the query appended at the end of the URL.
if (portalURL.getActionWindow() != null
&& portalURL.getActionWindow().equals(param.getWindowId())) {
for (int i = 0; i < param.getValues().length; i++) {
// FIX for PLUTO-247
if ( firstParam ) {
firstParam = false;
} else {
query.append("&");
}
query.append(encodeQueryParam(param.getName())).append("=")
.append(encodeQueryParam(param.getValues()[i]));
}
}
// Encode render params as a part of the URL.
else if (param.getValues() != null
&& param.getValues().length > 0) {
String valueString = encodeMultiValues(param.getValues());
if (valueString.length() > 0) {
buffer.append("/").append(
encodeControlParameter(RENDER_PARAM, param.getWindowId(),
param.getName()));
buffer.append("/").append(valueString);
}
}
}