public void write(Object o, OutputElement xml) throws XMLStreamException { try { JSEntity g = (JSEntity) o; String s = g.getId(); if ((s != null) && (s.length() > 0)) xml.setAttribute("id", s); if ((g.entityPreferences != null) && (g.entityPreferences .size()>0)) xml.add(g.entityPreferences); } catch (Exception e) { e.printStackTrace(); } }
JSEntity exportEntityPref(PortletDefinition definition, String windowId, Map<String,Object> settings, Logger log) jsEntity = new JSEntity(); jsEntity.setId(windowId); JSEntityPreferences entityPreferences = new JSEntityPreferences(); Set<String> userNames = prefsProvider.getUserNames(definition, windowId); jsEntity.setEntityPreferences(entityPreferences);
private void importEntityPref(JSApplication app, JSPortlet portlet, JSEntity entity, PortletDefinition pd, Map<String,Object> settings, Logger log) JSEntityPreferences preferences = entity.getEntityPreferences(); if ((preferences == null) || (preferences.size() == 0)) return; prefsProvider.storePortletPreference(pd, entity.getId(), userName, portletPreference); prefsProvider.storePortletPreference(app.getName(), portlet.getName(), entity.getId(), userName, portletPreference);