public PdcClassification build() { ClassificationPlan pdc = aClassificationPlan(); List<ClassifyPosition> positions = new ArrayList<ClassifyPosition>(); List<ClassifyValue> positionValues = new ArrayList<ClassifyValue>(); List<Value> values = pdc.getValuesOfAxisByName("Pays"); Value value = findTerm("Grenoble", values); ClassifyValue classifyValue = new ClassifyValue(toValueId(value.getAxisId()), toValue(value.getFullPath())); classifyValue.setFullPath(pdc.getPathInTreeOfValue(value)); positionValues.add(classifyValue); values = pdc.getValuesOfAxisByName("Période"); value = findTerm("Moyen-Age", values); classifyValue = new ClassifyValue(toValueId(value.getAxisId()), toValue(value.getFullPath())); classifyValue.setFullPath(pdc.getPathInTreeOfValue(value)); positionValues.add(classifyValue); positions.add(new ClassifyPosition(positionValues)); positionValues = new ArrayList<ClassifyValue>(); values = pdc.getValuesOfAxisByName("Religion"); value = findTerm("Christianisme", values); classifyValue = new ClassifyValue(toValueId(value.getAxisId()), toValue(value.getFullPath())); classifyValue.setFullPath(pdc.getPathInTreeOfValue(value)); positionValues.add(classifyValue); positions.add(new ClassifyPosition(positionValues)); PdcClassification classification = aClassificationFromPositions(positions).inComponentInstance(getComponentId()); if (getContentId() != null) { classification = classification.ofContent(getContentId()); } else if (getNodeId() != null) { classification = classification.forNode(getNodeId()); } return classification; }
public PdcClassification buildWithNoSynonyms() { ClassificationPlan pdc = aClassificationPlan(); List<ClassifyPosition> positions = new ArrayList<ClassifyPosition>(); List<ClassifyValue> positionValues = new ArrayList<ClassifyValue>(); List<Value> values = pdc.getValuesOfAxisByName("Technologie"); Value value = values.get(0); ClassifyValue classifyValue = new ClassifyValue(toValueId(value.getAxisId()), toValue(value.getFullPath())); classifyValue.setFullPath(pdc.getPathInTreeOfValue(value)); positionValues.add(classifyValue); positions.add(new ClassifyPosition(positionValues)); return aClassificationFromPositions(positions) .ofContent(contentId) .inComponentInstance(componentId); }