Set<String> keys = new HashSet<String>(names);
try
{
PropertyMap properties;
org.gatein.pc.api.PortletContext jbpContext = WSRPUtils.convertToPortalPortletContext(portletContext);
RegistrationLocal.setRegistration(registration);
if (!keys.isEmpty())
{
properties = producer.getPortletInvoker().getProperties(jbpContext, keys);
}
else
{
properties = producer.getPortletInvoker().getProperties(jbpContext);
}
//todo: we need to check that the user can actually modify the properties
Portlet portlet = getPortletFrom(portletContext, registration);
PortletInfo info = portlet.getInfo();
PropertyList result = WSRPTypeFactory.createPropertyList();
int propertyNb = properties.size();
if (propertyNb > 0)
{
PreferenceInfo prefInfo;
String key;
List<String> values;
LocalizedString displayName;
for (Map.Entry<String, List<String>> entry : properties.entrySet())
{
key = entry.getKey();
values = entry.getValue();
prefInfo = info.getPreferences().getPreference(key);
displayName = prefInfo.getDisplayName();