use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project nhin-d by DirectProject.
the class DirectDocumentUtils method makeSlot.
public static SlotType1 makeSlot(SlotType1Enum slotTypeEnum, String value) {
SlotType1 slot = new SlotType1();
ValueListType valueListType = new ValueListType();
List<String> vals = valueListType.getValue();
slot.setName(slotTypeEnum.getName());
slot.setValueList(valueListType);
vals.add(value);
return slot;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.
the class SlotWebConverter method getSlotGeoMap.
private Map<String, Object> getSlotGeoMap(SlotType1 slot) {
Map<String, Object> map = new HashMap<>();
if (!slot.isSetValueList()) {
return map;
}
ValueListType valueList = (ValueListType) slot.getValueList().getValue();
for (AnyValueType anyValue : valueList.getAnyValue()) {
anyValue.getContent().stream().filter(content -> content instanceof JAXBElement).forEach(content -> {
JAXBElement jaxbElement = (JAXBElement) content;
if (jaxbElement.getValue() instanceof PointType) {
Map<String, Object> pointMap = getPointMapFromPointType((PointType) jaxbElement.getValue());
if (MapUtils.isNotEmpty(pointMap)) {
Map<String, Object> valueMap = new HashMap<>();
valueMap.put(POINT_KEY, pointMap);
map.put(VALUE, valueMap);
}
}
});
}
return map;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.
the class SlotTypeConverter method getWrsValueList.
private Optional<net.opengis.cat.wrs.v_1_0_2.ValueListType> getWrsValueList(Map<String, Object> map) {
Optional<net.opengis.cat.wrs.v_1_0_2.ValueListType> optionalValueList = Optional.empty();
if (MapUtils.isEmpty(map) || !map.containsKey(VALUE)) {
return optionalValueList;
}
Map<String, Object> valueMap = (Map<String, Object>) map.get(VALUE);
if (valueMap.containsKey(POINT_KEY)) {
Optional<PointType> optionalPoint = getPoint((Map<String, Object>) valueMap.get(POINT_KEY));
if (optionalPoint.isPresent()) {
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createPoint(optionalPoint.get()));
net.opengis.cat.wrs.v_1_0_2.ValueListType valueList = WRS_FACTORY.createValueListType();
valueList.getAnyValue().add(anyValue);
if (!optionalValueList.isPresent()) {
optionalValueList = Optional.of(WRS_FACTORY.createValueListType());
}
optionalValueList.get().getAnyValue().add(anyValue);
}
} else if (valueMap.containsKey(ENVELOPE_KEY)) {
Optional<EnvelopeType> optionalEnvelope = getEnvelope((Map<String, Object>) valueMap.get(ENVELOPE_KEY));
if (optionalEnvelope.isPresent()) {
AnyValueType anyValue = WRS_FACTORY.createAnyValueType();
anyValue.getContent().add(GML_FACTORY.createEnvelope(optionalEnvelope.get()));
net.opengis.cat.wrs.v_1_0_2.ValueListType valueList = WRS_FACTORY.createValueListType();
valueList.getAnyValue().add(anyValue);
if (!optionalValueList.isPresent()) {
optionalValueList = Optional.of(WRS_FACTORY.createValueListType());
}
optionalValueList.get().getAnyValue().add(anyValue);
}
}
return optionalValueList;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.
the class SlotTypeHelper method create.
/**
* This is a convenience method to create a SlotType1 object with the List of values
*
* @param slotName the name of the slot, empty SlotType1 if null
* @param slotValues the value to set
* @param slotType the slot type of the slot
* @return
*/
public SlotType1 create(String slotName, List<String> slotValues, String slotType) {
SlotType1 slot = RIM_FACTORY.createSlotType1();
if (StringUtils.isNotBlank(slotName)) {
ValueListType valueList = RIM_FACTORY.createValueListType();
valueList.getValue().addAll(slotValues);
slot.setValueList(RIM_FACTORY.createValueList(valueList));
slot.setSlotType(slotType);
slot.setName(slotName);
}
return slot;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType in project ddf by codice.
the class SlotWebConverter method getSlotBoundsMap.
private Map<String, Object> getSlotBoundsMap(SlotType1 slot) {
Map<String, Object> map = new HashMap<>();
if (!slot.isSetValueList()) {
return map;
}
ValueListType valueList = (ValueListType) slot.getValueList().getValue();
for (AnyValueType anyValue : valueList.getAnyValue()) {
anyValue.getContent().stream().filter(content -> content instanceof JAXBElement).forEach(content -> {
JAXBElement jaxbElement = (JAXBElement) content;
if (jaxbElement.getValue() instanceof EnvelopeType) {
Map<String, Object> boundsMap = getBoundsMapFromEnvelopeType((EnvelopeType) jaxbElement.getValue());
if (MapUtils.isNotEmpty(boundsMap)) {
Map<String, Object> valueMap = new HashMap<>();
valueMap.put(ENVELOPE_KEY, boundsMap);
map.put(VALUE, valueMap);
}
}
});
}
return map;
}
Aggregations