public void read(InputElement xml, Object o) { try { JSPrincipalAssociation g = (JSPrincipalAssociation) o; g.setName(xml.getAttribute("name").toString()); g.setFromName(xml.getAttribute("fromName", "")); g.setFromType(xml.getAttribute("fromType", "")); g.setToName(xml.getAttribute("toName", "")); g.setToType(xml.getAttribute("toType", "")); } catch (Exception e) { e.printStackTrace(); } }
private JSPrincipalAssociation createJSPrincipalAssociation(String associationName, JetspeedPrincipal from, JetspeedPrincipal to) { JSPrincipalAssociation jsAssoc = new JSPrincipalAssociation(); jsAssoc.setName(associationName); jsAssoc.setFromType(from.getType().getName()); jsAssoc.setFromName(from.getName()); jsAssoc.setToType(to.getType().getName()); jsAssoc.setToName(to.getName()); return jsAssoc; }