private void fillInAssociationNames(Map<QName, DeltaSetTriple<ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>>>> squeezedAssociations) throws SchemaException { PrismPropertyDefinition<QName> nameDefinition = prismContext.getSchemaRegistry() .findContainerDefinitionByCompileTimeClass(ShadowAssociationType.class) .findPropertyDefinition(ShadowAssociationType.F_NAME); for (Entry<QName, DeltaSetTriple<ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>>>> entry : squeezedAssociations.entrySet()) { DeltaSetTriple<ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>>> deltaSetTriple = entry.getValue(); for (ItemValueWithOrigin<PrismContainerValue<ShadowAssociationType>,PrismContainerDefinition<ShadowAssociationType>> ivwo : deltaSetTriple.getAllValues()) { PrismContainerValue<ShadowAssociationType> value = ivwo.getItemValue(); if (value != null && value.findProperty(ShadowAssociationType.F_NAME) == null) { // just for safety PrismProperty<QName> nameProperty = value.createProperty(nameDefinition); nameProperty.setRealValue(entry.getKey()); } } } LOGGER.trace("Names for squeezed associations filled-in."); }
schemaContainerDelta.setValueToReplace(cval); PrismProperty<CachingMetadataType> cachingMetadataProperty = cval .createProperty(XmlSchemaType.F_CACHING_METADATA); cachingMetadataProperty.setRealValue(cachingMetadata); List<QName> objectClasses = ResourceTypeUtil.getSchemaGenerationConstraints(resource); if (objectClasses != null) { PrismProperty<SchemaGenerationConstraintsType> generationConstraints = cval .createProperty(XmlSchemaType.F_GENERATION_CONSTRAINTS); SchemaGenerationConstraintsType constraints = new SchemaGenerationConstraintsType(); constraints.getGenerateObjectClass().addAll(objectClasses); generationConstraints.setRealValue(constraints); PrismProperty<SchemaDefinitionType> definitionProperty = cval.createProperty(XmlSchemaType.F_DEFINITION); ObjectTypeUtil.setXsdSchemaDefinition(definitionProperty, xsdElement);
private ObjectDelta<UserType> createDeltaForFindItem(boolean containerReplace) throws SchemaException { ObjectDelta<UserType> userDelta = PrismTestUtil.getPrismContext().deltaFactory().object() .createModificationAddProperty(UserType.class, USER_FOO_OID, UserType.F_LOCALITY, "Caribbean"); userDelta.addModificationReplaceProperty(UserType.F_GIVEN_NAME, "Guybrush"); ContainerDelta<ActivationType> activationDelta = userDelta.createContainerModification(UserType.F_ACTIVATION); PrismContainerValue<ActivationType> activationCVal = getPrismContext().itemFactory().createContainerValue(); if (containerReplace) { activationDelta.addValueToReplace(activationCVal); } else { activationDelta.addValueToAdd(activationCVal); } PrismProperty<Boolean> enabledProperty = activationCVal.createProperty(ActivationType.F_ENABLED); enabledProperty.setRealValue(Boolean.TRUE); PrismProperty<XMLGregorianCalendar> validFromProperty = activationCVal.createProperty(ActivationType.F_VALID_FROM); validFromProperty.setRealValue(XmlTypeConverter.createXMLGregorianCalendar(20016, 5, 16, 19, 8, 33)); userDelta.addModification(activationDelta); return userDelta; }
PrismProperty<String> prop = anglicaAccount.asPrismObject().findContainer(ShadowType.F_ATTRIBUTES).getValue().createProperty( prismContext.definitionFactory().createPropertyDefinition(getOpenDjPrimaryIdentifierQName(), DOMUtil.XSD_STRING)); prop.setRealValue(entryUuid);