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);