public ObjectTemplateType mapping(ObjectTemplateMappingType value) { getMapping().add(value); return this; }
public List<ObjectTemplateMappingType> createMappingList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_MAPPING); return getMapping(); }
private void collectMappings(List<FocalMappingSpec> mappings, ObjectTemplateType objectTemplateType) { for (ObjectTemplateMappingType mapping: objectTemplateType.getMapping()) { mappings.add(new FocalMappingSpec(mapping, objectTemplateType)); } for (ObjectTemplateItemDefinitionType templateItemDefType: objectTemplateType.getItem()) { for (ObjectTemplateMappingType mapping: templateItemDefType.getMapping()) { setMappingTarget(mapping, templateItemDefType.getRef()); mappings.add(new FocalMappingSpec(mapping, objectTemplateType)); } } }
private void assertObjectTemplateInternals(PrismObject<ObjectTemplateType> object, QName elementName) throws SchemaException { int assignmentValuesFound = 0; for (ObjectTemplateMappingType mappingType : object.asObjectable().getMapping()) { if (mappingType.getExpression() != null) { if (mappingType.getTarget() != null && mappingType.getTarget().getPath() != null && UserType.F_ASSIGNMENT.equivalent(mappingType.getTarget().getPath().getItemPath())) { ItemDefinition assignmentDef = getPrismContext().getSchemaRegistry() .findObjectDefinitionByCompileTimeClass(UserType.class) .findItemDefinition(UserType.F_ASSIGNMENT); for (JAXBElement evaluator : mappingType.getExpression().getExpressionEvaluator()) { if (evaluator.getValue() instanceof RawType) { RawType rawType = (RawType) evaluator.getValue(); System.out.println("\nraw assignment:\n" + rawType); Item assignment = rawType.getParsedItem(assignmentDef); System.out.println("\nassignment:\n" + assignment.debugDump()); assignmentValuesFound++; } } } } } assertEquals("wrong # of assignment values found in mapping", 2, assignmentValuesFound); }