List of usage examples for javax.xml.registry.infomodel ClassificationScheme getChildConceptCount
int getChildConceptCount() throws JAXRException;
From source file:it.cnr.icar.eric.client.ui.thin.components.model.RegistryObjectNode.java
public String getLabel() { String label = null;/* w w w .j a v a2 s . c o m*/ try { label = ((InternationalStringImpl) ro.getName()) .getClosestValue(FacesContext.getCurrentInstance().getViewRoot().getLocale()); if (label == null && ro instanceof Concept) { label = ((Concept) ro).getValue(); } if (label == null) { label = WebUIResourceBundle.getInstance().getString("message.noName", "No Name"); StringBuffer sb = new StringBuffer("("); sb.append(label).append(')'); label = sb.toString(); } if (ro instanceof ClassificationScheme || ro instanceof Concept) { StringBuffer sb = new StringBuffer(label); if (ro instanceof ClassificationScheme) { ClassificationScheme scheme = (ClassificationScheme) ro; sb.append(" (").append(scheme.getChildConceptCount()).append(')'); } else { Concept concept = (Concept) ro; sb.append(" (").append(concept.getChildConceptCount()).append(')'); } label = sb.toString(); } } catch (JAXRException ex) { log.error(ex); } return label; }
From source file:it.cnr.icar.eric.client.ui.thin.jsf.ClassSchemeGraphBean.java
public void loadChildNodesFromClassSchemes(Node parentNode) throws JAXRException { Collection<?> classSchemes = getClassSchemes(); parentNode.clearChildren();/* ww w . ja v a 2s . c o m*/ if (this.treeType != null && this.treeType.equals("ExtrinsicObject")) { parentNode.addChild(loadExtrinsicNodeFromClassScheme(classSchemes)); } else if (this.treeType != null && this.treeType.equals("ExternalIdentifier")) { Iterator<?> itr = classSchemes.iterator(); while (itr.hasNext()) { ClassificationScheme scheme = (ClassificationScheme) itr.next(); Node node = new RegistryObjectNode(scheme); node.setHasChild(scheme.getChildConceptCount() > 0); if (!node.hasChild()) { parentNode.addChild(node); } } } else { Iterator<?> itr = classSchemes.iterator(); while (itr.hasNext()) { ClassificationScheme scheme = (ClassificationScheme) itr.next(); Node node = new RegistryObjectNode(scheme); node.setHasChild(scheme.getChildConceptCount() > 0); parentNode.addChild(node); } } parentNode.sortChildren(); }
From source file:it.cnr.icar.eric.client.ui.thin.jsf.ClassSchemeGraphBean.java
public Node loadExtrinsicNodeFromClassScheme(Collection<?> classSchemes) throws JAXRException { Node node1 = null;/*from w w w. j a v a2 s . c om*/ Iterator<?> itr = classSchemes.iterator(); while (itr.hasNext()) { ClassificationScheme scheme = (ClassificationScheme) itr.next(); Node node = new RegistryObjectNode(scheme); if (node.getId().endsWith(CanonicalSchemes.CANONICAL_CLASSIFICATION_SCHEME_ID_ObjectType)) { node.setHasChild(scheme.getChildConceptCount() > 0); node1 = node; } } return node1; }