Search in sources :

Example 1 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class TestUtil method assertCreateTimestamp.

public static void assertCreateTimestamp(PrismObject<? extends ObjectType> object, XMLGregorianCalendar start, XMLGregorianCalendar end) {
    MetadataType metadata = object.asObjectable().getMetadata();
    assertNotNull("No metadata in " + object, metadata);
    assertBetween("createTimestamp in " + object, start, end, metadata.getCreateTimestamp());
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Example 2 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class OperationalDataManager method applyMetadataAdd.

public <T extends ObjectType, F extends ObjectType> void applyMetadataAdd(LensContext<F> context, PrismObject<T> objectToAdd, XMLGregorianCalendar now, Task task, OperationResult result) throws SchemaException {
    T objectType = objectToAdd.asObjectable();
    MetadataType metadataType = objectType.getMetadata();
    if (metadataType == null) {
        metadataType = new MetadataType();
        objectType.setMetadata(metadataType);
    }
    transplantRequestMetadata(context, metadataType);
    applyCreateMetadata(context, metadataType, now, task);
    if (workflowManager != null) {
        metadataType.getCreateApproverRef().addAll(workflowManager.getApprovedBy(task, result));
    }
    if (objectToAdd.canRepresent(FocusType.class)) {
        applyAssignmentMetadataObject((LensContext<? extends FocusType>) context, objectToAdd, now, task, result);
    }
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Example 3 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class OperationalDataManager method transplantRequestMetadata.

private <F extends ObjectType> void transplantRequestMetadata(LensContext<F> context, MetadataType metaData) {
    MetadataType requestMetadata = context.getRequestMetadata();
    if (requestMetadata == null) {
        return;
    }
    metaData.setRequestTimestamp(requestMetadata.getRequestTimestamp());
    metaData.setRequestorRef(requestMetadata.getRequestorRef());
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Example 4 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class OperationalDataManager method applyAssignmentValueMetadataAdd.

private <F extends FocusType> void applyAssignmentValueMetadataAdd(LensContext<F> context, PrismContainerValue<AssignmentType> assignmentContainerValue, String desc, XMLGregorianCalendar now, Task task, OperationResult result) throws SchemaException {
    AssignmentType assignmentType = assignmentContainerValue.asContainerable();
    MetadataType metadataType = assignmentType.getMetadata();
    if (metadataType == null) {
        metadataType = new MetadataType();
        assignmentType.setMetadata(metadataType);
    }
    transplantRequestMetadata(context, metadataType);
    ActivationType activationType = assignmentType.getActivation();
    ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(assignmentType.getLifecycleState(), activationType);
    if (activationType == null) {
        activationType = new ActivationType();
        assignmentType.setActivation(activationType);
    }
    activationType.setEffectiveStatus(effectiveStatus);
    applyCreateMetadata(context, metadataType, now, task);
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Adding operational data {} to assignment cval ({}):\nMETADATA:\n{}\nACTIVATION:\n{}", metadataType, desc, assignmentContainerValue.debugDump(1), activationType.asPrismContainerValue().debugDump(1));
    }
}
Also used : ActivationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType) ActivationStatusType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType) MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Example 5 with MetadataType

use of org.geotoolkit.ows.xml.v200.MetadataType in project midpoint by Evolveum.

the class OperationalDataManager method createCreateMetadata.

public <F extends ObjectType> MetadataType createCreateMetadata(LensContext<F> context, XMLGregorianCalendar now, Task task) {
    MetadataType metaData = new MetadataType();
    applyCreateMetadata(context, metaData, now, task);
    return metaData;
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Aggregations

MetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)30 ActivationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType)7 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)6 ConstructionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType)4 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)3 PrismContainerDefinition (com.evolveum.midpoint.prism.PrismContainerDefinition)2 PrismContext (com.evolveum.midpoint.prism.PrismContext)2 PrismReferenceDefinition (com.evolveum.midpoint.prism.PrismReferenceDefinition)2 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)2 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)2 List (java.util.List)2 Duration (javax.xml.datatype.Duration)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 MetadataType (org.openarchives.oai._2.MetadataType)2 Test (org.testng.annotations.Test)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 ContainerDelta (com.evolveum.midpoint.prism.delta.ContainerDelta)1 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)1