{
try
{
String portletName =
rundata.getParameters().getString(PORTLET_NAME);
PortletEntry portletEntry =
(PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
if (portletEntry != null)
{
String[] parameters =
rundata.getParameters().getStrings("update_parameter_name");
if (parameters != null && parameters.length > 0)
{
for (int i = 0; i < parameters.length; i++)
{
String parameterName = parameters[i];
String parameterValue =
rundata.getParameters().getString(
parameterName + ".parameter_value");
String description =
rundata.getParameters().getString(
parameterName + ".description");
String title =
rundata.getParameters().getString(
parameterName + ".title");
String securityRole =
rundata.getParameters().getString(
parameterName + ".security_role");
String securityRef =
rundata.getParameters().getString(
parameterName + ".security_ref");
boolean isHidden =
rundata.getParameters().getBoolean(
parameterName + ".is_hidden",
false);
boolean isCachedOnName =
rundata.getParameters().getBoolean(
parameterName + ".cached_on_name",
false);
boolean isCachedOnValue =
rundata.getParameters().getBoolean(
parameterName + ".cached_on_value",
false);
BaseCachedParameter parameter =
new BaseCachedParameter();
parameter.setName(parameterName);
parameter.setValue(parameterValue);
parameter.setHidden(isHidden);
parameter.setCachedOnName(isCachedOnName);
parameter.setCachedOnValue(isCachedOnValue);
parameter.setDescription(description);
parameter.setTitle(title);
if (securityRole != null && securityRole.length() > 0)
{
BaseSecurity paramSecurity = new BaseSecurity();
paramSecurity.setRole(securityRole);
parameter.setSecurity(paramSecurity);
}
if (securityRef != null && securityRef.length() > 0)
{
BaseSecurityReference paramSecurityRef =
new BaseSecurityReference();
paramSecurityRef.setParent(securityRef);
parameter.setSecurityRef(paramSecurityRef);
}
portletEntry.addParameter(parameter);
}
Registry.addEntry(Registry.PORTLET, portletEntry);
clearUserData(rundata);
}