public String getAsText() { StringBuilder buffer = new StringBuilder(); for (Iterator i = ((Collection) getValue()).iterator(); i.hasNext(); ) { PresentationItem item = (PresentationItem) i.next(); buffer.append( item.getDefinition().getId().getValue() + "." + item.getArtifactId().getValue()); } return buffer.toString(); }
public void setAsText(String text) throws IllegalArgumentException { if (text == null || text.length() == 0 || text.indexOf(".") == -1) { setValue(null); } else { String[] items = text.split(","); Collection presentationItems = new HashSet(); for (int i = 0; i < items.length; i++) { PresentationItem item = new PresentationItem(); String[] values = items[i].split("\\."); if (values.length != 2) continue; item.setDefinition( getPresentationManager() .getPresentationItemDefinition(getIdManager().getId(values[0]))); item.setArtifactId(getIdManager().getId(values[1])); presentationItems.add(item); } setValue(presentationItems); } }