Search in sources :

Example 11 with ValueListType

use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.

the class FederationAdmin method updateDateFields.

private void updateDateFields(RegistryPackageType rpt) {
    ExtrinsicObjectType nodeInfo = null;
    for (JAXBElement identifiable : rpt.getRegistryObjectList().getIdentifiable()) {
        RegistryObjectType registryObject = (RegistryObjectType) identifiable.getValue();
        if (registryObject instanceof ExtrinsicObjectType && RegistryConstants.REGISTRY_NODE_OBJECT_TYPE.equals(registryObject.getObjectType())) {
            nodeInfo = (ExtrinsicObjectType) registryObject;
            break;
        }
    }
    if (nodeInfo != null) {
        boolean liveDateFound = false;
        boolean lastUpdatedFound = false;
        OffsetDateTime now = OffsetDateTime.now(ZoneId.of(ZoneOffset.UTC.toString()));
        String rightNow = now.toString();
        for (SlotType1 slot : nodeInfo.getSlot()) {
            if (slot.getName().equals(RegistryConstants.XML_LIVE_DATE_NAME)) {
                liveDateFound = true;
            } else if (slot.getName().equals(RegistryConstants.XML_LAST_UPDATED_NAME)) {
                ValueListType valueList = EbrimConstants.RIM_FACTORY.createValueListType();
                valueList.getValue().add(rightNow);
                slot.setValueList(EbrimConstants.RIM_FACTORY.createValueList(valueList));
                lastUpdatedFound = true;
            }
        }
        if (!liveDateFound) {
            SlotType1 liveDate = slotHelper.create(RegistryConstants.XML_LIVE_DATE_NAME, rightNow, DATE_TIME);
            nodeInfo.getSlot().add(liveDate);
        }
        if (!lastUpdatedFound) {
            SlotType1 lastUpdated = slotHelper.create(RegistryConstants.XML_LAST_UPDATED_NAME, rightNow, DATE_TIME);
            nodeInfo.getSlot().add(lastUpdated);
        }
    }
}
Also used : SlotType1(oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1) OffsetDateTime(java.time.OffsetDateTime) ValueListType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ValueListType) ExtrinsicObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType) JAXBElement(javax.xml.bind.JAXBElement) RegistryObjectType(oasis.names.tc.ebxml_regrep.xsd.rim._3.RegistryObjectType)

Example 12 with ValueListType

use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project midpoint by Evolveum.

the class ExecuteScriptUtil method createInput.

public static ValueListType createInput(Collection<? extends PrismValue> values) {
    ValueListType input = new ValueListType();
    values.forEach(o -> input.getValue().add(o));
    return input;
}
Also used : ValueListType(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType)

Example 13 with ValueListType

use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project midpoint by Evolveum.

the class SynchronousScriptExecutor method addInputIfNeeded.

private ExecuteScriptType addInputIfNeeded(ExecuteScriptType specifiedExecuteScriptBean, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException {
    if (specifiedExecuteScriptBean.getInput() == null) {
        FullDataBasedObjectSet objectSet = new FullDataBasedObjectSet(actx, result);
        objectSet.collect();
        ValueListType input = createInputCloned(objectSet.asObjectValues());
        return implantInput(specifiedExecuteScriptBean, input);
    } else {
        return specifiedExecuteScriptBean;
    }
}
Also used : ValueListType(com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType)

Aggregations

SlotType1 (oasis.names.tc.ebxml_regrep.xsd.rim._3.SlotType1)8 ValueListType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ValueListType)6 ValueListType (com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType)4 AnyValueType (net.opengis.cat.wrs.v_1_0_2.AnyValueType)4 PointType (net.opengis.gml.v_3_1_1.PointType)4 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 JAXBElement (javax.xml.bind.JAXBElement)3 ValueListType (net.opengis.cat.wrs.v_1_0_2.ValueListType)3 DirectPositionType (net.opengis.gml.v_3_1_1.DirectPositionType)3 EnvelopeType (net.opengis.gml.v_3_1_1.EnvelopeType)3 HashMap (java.util.HashMap)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 ExtrinsicObjectType (oasis.names.tc.ebxml_regrep.xsd.rim._3.ExtrinsicObjectType)2 MapUtils (org.apache.commons.collections.MapUtils)2 StringUtils (org.apache.commons.lang.StringUtils)2 RegistryConstants (org.codice.ddf.registry.common.RegistryConstants)2 SlotTypeHelper (org.codice.ddf.registry.schemabindings.helper.SlotTypeHelper)2 WebMapHelper (org.codice.ddf.registry.schemabindings.helper.WebMapHelper)2