return jsPortlet;
}
JSEntity exportEntityPref(PortletDefinition definition, String windowId, Map settings, Logger log)
{
JSEntity jsEntity = null;
jsEntity = new JSEntity();
jsEntity.setId(windowId);
JSEntityPreferences entityPreferences = new JSEntityPreferences();
Set<String> userNames = prefsProvider.getUserNames(definition, windowId);
for (String userName : userNames)
{
Map<String, PortletPreference> userPreferences = prefsProvider.getUserPreferences(definition, windowId, userName);
JSEntityPreference userPreference = new JSEntityPreference();
userPreference.setPrincapalName(userName);
Iterator<String> preferences = userPreferences.keySet().iterator();
JSNVPElements v = new JSNVPElements("preference");
while (preferences.hasNext())
{
String pKey = preferences.next();
PortletPreference portletPreference = userPreferences.get(pKey);
JSNVPElement element = new JSNVPElement();
element.setKey(pKey);
element.setValues(portletPreference.getValues());
element.setReadOnly(portletPreference.isReadOnly());
v.add(element);
}
if (v.size() > 0)
{
userPreference.setPreferences(v);
entityPreferences.add(userPreference);
}
if (!entityPreferences.isEmpty())
{
log.debug("processed preferences for entity=" + windowId);
jsEntity.setEntityPreferences(entityPreferences);
}
}
return jsEntity;
}