@Override public BaseProperty newPropertyfromXML(Element ppcel) { if (!isMultiSelect()) { return super.newPropertyfromXML(ppcel); } @SuppressWarnings("unchecked") List<Element> elist = ppcel.elements("value"); BaseProperty lprop = newProperty(); if (lprop instanceof ListProperty) { List<String> llist = ((ListProperty) lprop).getList(); for (int i = 0; i < elist.size(); i++) { Element el = elist.get(i); llist.add(el.getText()); } } else { for (int i = 0; i < elist.size(); i++) { Element el = elist.get(i); ((StringProperty) lprop).setValue(el.getText()); } } return lprop; }
@Override public BaseProperty fromString(String value) { BaseProperty prop = newProperty(); if (isMultiSelect()) { ((ListProperty) prop).setList(getListFromString(value, getSeparators(), false)); } else { prop.setValue(value); } return prop; }
@Override public BaseProperty fromStringArray(String[] strings) { if (!isMultiSelect()) { return fromString(strings[0]); } BaseProperty prop = newProperty(); if (prop instanceof StringProperty) { return fromString(strings[0]); } List<String> list = new ArrayList<String>(); ((ListProperty) prop).setList(list); if (strings.length == 0) { return prop; } if ((strings.length == 1) && (getDisplayType().equals("input") || isMultiSelect())) { ((ListProperty) prop).setList(getListFromString(strings[0], getSeparators(), false)); return prop; } // If Multiselect and multiple results for (int i = 0; i < strings.length; i++) { String item = strings[i]; if (!item.trim().equals("")) { list.add(item); } } return prop; }
for (int i = 0; i < classes.length; i++) { String oldclass = classes[i]; if (!oldclass.equals(lc.newProperty().getClass().getName())) { Query q = session.createQuery("select p from " + oldclass + " as p, BaseObject as o" + " where o.className=? and p.id=o.id and p.name=?").setString(0, for (Iterator it = q.list().iterator(); it.hasNext();) { BaseProperty lp = (BaseProperty) it.next(); BaseProperty lp1 = lc.newProperty(); lp1.setId(lp.getId()); lp1.setName(lp.getName());