Search in sources :

Example 6 with MetadataType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.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 7 with MetadataType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.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 8 with MetadataType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.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)

Example 9 with MetadataType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType in project midpoint by Evolveum.

the class ProvisioningUtil method addPasswordMetadata.

public static void addPasswordMetadata(PasswordType p, XMLGregorianCalendar now, PrismObject<UserType> owner) {
    MetadataType metadata = p.getMetadata();
    if (metadata != null) {
        return;
    }
    // Supply some metadata if they are not present. However the
    // normal thing is that those metadata are provided by model
    metadata = new MetadataType();
    metadata.setCreateTimestamp(now);
    if (owner != null) {
        metadata.creatorRef(owner.getOid(), null);
    }
    p.setMetadata(metadata);
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)

Example 10 with MetadataType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType in project midpoint by Evolveum.

the class AbstractModelIntegrationTest method assertModifyMetadata.

protected <O extends ObjectType> void assertModifyMetadata(PrismObject<O> object, XMLGregorianCalendar start, XMLGregorianCalendar end) {
    MetadataType metadataType = object.asObjectable().getMetadata();
    PrismObject<UserType> defaultActor = getDefaultActor();
    assertMetadata(object.toString(), metadataType, false, false, start, end, defaultActor == null ? null : defaultActor.getOid(), DEFAULT_CHANNEL);
}
Also used : MetadataType(com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Aggregations

MetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)23 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)4 ActivationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType)4 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)3 PrismContext (com.evolveum.midpoint.prism.PrismContext)2 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 Test (org.testng.annotations.Test)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PrismContainerDefinition (com.evolveum.midpoint.prism.PrismContainerDefinition)1 PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 PrismReferenceDefinition (com.evolveum.midpoint.prism.PrismReferenceDefinition)1 ContainerDelta (com.evolveum.midpoint.prism.delta.ContainerDelta)1 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)1 RObject (com.evolveum.midpoint.repo.sql.data.common.RObject)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 DateLabelComponent (com.evolveum.midpoint.web.component.DateLabelComponent)1 MetadataPanel (com.evolveum.midpoint.web.component.assignment.MetadataPanel)1 CheckBoxHeaderColumn (com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn)1