Search in sources :

Example 1 with RemoteReportParameterType

use of com.evolveum.midpoint.xml.ns._public.report.report_3.RemoteReportParameterType in project midpoint by Evolveum.

the class ReportWebService method getParamsMap.

private Map<QName, Object> getParamsMap(RemoteReportParametersType parametersType) throws SchemaException {
    prismContext.adopt(parametersType);
    Map<QName, Object> parametersMap = new HashMap<>();
    if (parametersType == null || parametersType.getRemoteParameter() == null || parametersType.getRemoteParameter().isEmpty()) {
        return parametersMap;
    }
    List<RemoteReportParameterType> items = parametersType.getRemoteParameter();
    for (RemoteReportParameterType item : items) {
        QName paramName = new QName(SchemaConstants.NS_REPORT, item.getParameterName());
        ReportParameterType param = item.getParameterValue();
        if (param == null) {
            parametersMap.put(paramName, null);
            continue;
        }
        if (param.getAny().size() == 1) {
            parametersMap.put(paramName, param.getAny().get(0));
        } else {
            parametersMap.put(paramName, param.getAny());
        }
    }
    return parametersMap;
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) RemoteReportParameterType(com.evolveum.midpoint.xml.ns._public.report.report_3.RemoteReportParameterType) ReportParameterType(com.evolveum.midpoint.xml.ns._public.common.common_3.ReportParameterType) RemoteReportParameterType(com.evolveum.midpoint.xml.ns._public.report.report_3.RemoteReportParameterType) PrismObject(com.evolveum.midpoint.prism.PrismObject)

Aggregations

PrismObject (com.evolveum.midpoint.prism.PrismObject)1 ReportParameterType (com.evolveum.midpoint.xml.ns._public.common.common_3.ReportParameterType)1 RemoteReportParameterType (com.evolveum.midpoint.xml.ns._public.report.report_3.RemoteReportParameterType)1 HashMap (java.util.HashMap)1 QName (javax.xml.namespace.QName)1