From 3667d06451b77e02a5d7bbc6ad47837c4909342b Mon Sep 17 00:00:00 2001 From: lskublik Date: Tue, 27 Apr 2021 17:38:50 +0200 Subject: [PATCH] rewrite jasper report from initial-objects to new object collection reports --- .../AutoCompleteReferencePanelFactory.java | 72 + .../search/ReferenceAutocomplete.java | 10 +- .../ReferenceValueSearchPopupPanel.java | 8 - .../web/page/admin/reports/PageReports.java | 2 +- .../component/RunReportPopupPanel.html | 19 +- .../component/RunReportPopupPanel.java | 99 +- .../initial-objects/080-report-audit.xml | 21 - .../090-report-audit-jasper.xml | 25 - .../initial-objects/090-report-audit.xml | 227 ++ .../100-report-reconciliation.xml | 197 +- .../initial-objects/110-report-user-list.xml | 165 +- .../130-report-certification-definitions.xml | 41 +- .../140-report-certification-campaigns.xml | 189 +- .../150-report-certification-cases.xml | 203 +- .../160-report-certification-decisions.xml | 183 +- ... => 251-object-collection-resource-up.xml} | 0 ... => 261-object-collection-task-active.xml} | 0 ...it.xml => 270-object-collection-audit.xml} | 0 ...ml => 271-object-collection-audit-24h.xml} | 0 ...72-object-collection-audit-errors-24h.xml} | 0 ...ct-collection-audit-modifications-24h.xml} | 0 ...-collection-certification-campaign-all.xml | 27 + ...l => 290-object-collection-shadow-all.xml} | 10 +- .../prism}/query/PagingConvertor.java | 4 +- .../public/common/common-certification-3.xsd | 2971 +++++++++-------- .../xml/ns/public/common/common-core-3.xsd | 15 + .../impl/controller/DashboardServiceImpl.java | 41 - .../ModelInteractionServiceImpl.java | 22 +- .../report/impl/ReportServiceImpl.java | 20 +- .../controller/fileformat/CsvController.java | 12 +- .../fileformat/FileFormatController.java | 45 +- .../controller/fileformat/HtmlController.java | 15 +- 32 files changed, 2876 insertions(+), 1767 deletions(-) create mode 100644 gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/panel/AutoCompleteReferencePanelFactory.java delete mode 100644 gui/admin-gui/src/main/resources/initial-objects/080-report-audit.xml delete mode 100644 gui/admin-gui/src/main/resources/initial-objects/090-report-audit-jasper.xml create mode 100644 gui/admin-gui/src/main/resources/initial-objects/090-report-audit.xml rename gui/admin-gui/src/main/resources/initial-objects/{280-object-collection-resource-up.xml => 251-object-collection-resource-up.xml} (100%) rename gui/admin-gui/src/main/resources/initial-objects/{270-object-collection-task-active.xml => 261-object-collection-task-active.xml} (100%) rename gui/admin-gui/src/main/resources/initial-objects/{284-object-collection-audit.xml => 270-object-collection-audit.xml} (100%) rename gui/admin-gui/src/main/resources/initial-objects/{285-object-collection-audit-24h.xml => 271-object-collection-audit-24h.xml} (100%) rename gui/admin-gui/src/main/resources/initial-objects/{290-object-collection-audit-errors-24h.xml => 272-object-collection-audit-errors-24h.xml} (100%) rename gui/admin-gui/src/main/resources/initial-objects/{300-object-collection-audit-modifications-24h.xml => 273-object-collection-audit-modifications-24h.xml} (100%) create mode 100644 gui/admin-gui/src/main/resources/initial-objects/280-object-collection-certification-campaign-all.xml rename gui/admin-gui/src/main/resources/initial-objects/{255-object-collection-certification-definition-all.xml => 290-object-collection-shadow-all.xml} (66%) rename infra/{prism-impl/src/main/java/com/evolveum/midpoint/prism/impl => prism-api/src/main/java/com/evolveum/midpoint/prism}/query/PagingConvertor.java (95%) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/panel/AutoCompleteReferencePanelFactory.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/panel/AutoCompleteReferencePanelFactory.java new file mode 100644 index 00000000000..71f5ca79373 --- /dev/null +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/factory/panel/AutoCompleteReferencePanelFactory.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2010-2020 Evolveum and contributors + * + * This work is dual-licensed under the Apache License 2.0 + * and European Union Public License. See LICENSE file for details. + */ +package com.evolveum.midpoint.gui.impl.factory.panel; + +import com.evolveum.midpoint.gui.api.component.autocomplete.AutoCompleteReferenceRenderer; +import com.evolveum.midpoint.gui.api.factory.GuiComponentFactory; +import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; +import com.evolveum.midpoint.gui.api.prism.wrapper.PrismReferenceWrapper; +import com.evolveum.midpoint.gui.api.registry.GuiComponentRegistry; +import com.evolveum.midpoint.gui.api.util.WebComponentUtil; +import com.evolveum.midpoint.gui.impl.prism.wrapper.PrismReferenceValueWrapperImpl; +import com.evolveum.midpoint.report.api.ReportConstants; +import com.evolveum.midpoint.util.QNameUtil; +import com.evolveum.midpoint.util.exception.SchemaException; +import com.evolveum.midpoint.util.logging.Trace; +import com.evolveum.midpoint.util.logging.TraceManager; +import com.evolveum.midpoint.web.component.data.LinkedReferencePanel; +import com.evolveum.midpoint.web.component.search.ReferenceAutocomplete; +import com.evolveum.midpoint.web.component.search.ReferenceValueSearchPopupPanel; +import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; + +import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; + +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.model.Model; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +/** + * @author lskublik + */ +@Component +public class AutoCompleteReferencePanelFactory + implements GuiComponentFactory> { + + private static final Trace LOGGER = TraceManager.getTrace(AutoCompleteReferencePanelFactory.class); + + @Autowired private GuiComponentRegistry registry; + + @PostConstruct + public void register() { + registry.addToRegistry(this); + } + + @Override + public Integer getOrder() { + return 100; + } + + @Override + public > boolean match(IW wrapper) { + return QNameUtil.match(ObjectReferenceType.COMPLEX_TYPE, wrapper.getTypeName()) && + ReportConstants.NS_EXTENSION.equals(wrapper.getNamespace()); + } + + @Override + public org.apache.wicket.Component createPanel(PrismReferencePanelContext panelCtx) { + ReferenceAutocomplete panel = new ReferenceAutocomplete(panelCtx.getComponentId(), panelCtx.getRealValueModel(), + new AutoCompleteReferenceRenderer(), + panelCtx.getPageBase()); + panel.setOutputMarkupId(true); + panel.add(AttributeAppender.append("style", "padding-top:5px")); //ugly hack to be aligned with prism-property-label + return panel; + } +} diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceAutocomplete.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceAutocomplete.java index 04ec0521258..a012bf3cd33 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceAutocomplete.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceAutocomplete.java @@ -11,6 +11,7 @@ import java.util.Iterator; import java.util.List; +import com.evolveum.midpoint.gui.api.util.WebComponentUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType; import org.apache.commons.lang3.StringUtils; @@ -36,14 +37,16 @@ /** * @author honchar */ -public abstract class ReferenceAutocomplete extends AutoCompleteTextPanel { +public class ReferenceAutocomplete extends AutoCompleteTextPanel { private static final long serialVersionUID = 1L; private final PageBase pageBase; + private final IModel model; public ReferenceAutocomplete(String id, final IModel model, IAutoCompleteRenderer renderer, PageBase pageBase) { super(id, model, ObjectReferenceType.class, renderer); this.pageBase = pageBase; + this.model = model; } @Override @@ -82,7 +85,10 @@ protected boolean isAllowedNotFoundObjectRef() { } protected Class getReferenceTargetObjectType(){ - return (Class) AbstractRoleType.class; + if (model.getObject().getType() == null) { + return (Class) ObjectType.class; + } + return (Class) WebComponentUtil.qnameToClass(pageBase.getPrismContext(), model.getObject().getType()); } protected int getMaxRowsCount() { diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceValueSearchPopupPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceValueSearchPopupPanel.java index e1367088571..f9ef3d8e9dd 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceValueSearchPopupPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/search/ReferenceValueSearchPopupPanel.java @@ -86,14 +86,6 @@ public void setObject(String object) { private static final long serialVersionUID = 1L; - @Override - protected Class getReferenceTargetObjectType() { - if (getModelObject().getType() == null) { - return (Class) ObjectType.class; - } - return (Class) WebComponentUtil.qnameToClass(getPageBase().getPrismContext(), getModelObject().getType()); - } - @Override protected boolean isAllowedNotFoundObjectRef() { return ReferenceValueSearchPopupPanel.this.isAllowedNotFoundObjectRef(); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/PageReports.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/PageReports.java index 6ae03cfaf61..8f8ff00970b 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/PageReports.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/PageReports.java @@ -290,7 +290,7 @@ private void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType protected void runReportPerformed(AjaxRequestTarget target, ReportType report) { - if(report.getObjectCollection() == null) { + if(report.getObjectCollection() == null || report.getObjectCollection().getParameter().isEmpty()) { runConfirmPerformed(target, report, null); return; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.html b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.html index b76fff0b1e0..9cfabf7b116 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.html +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.html @@ -10,25 +10,20 @@
-
-
-
+
+
+

-
-
- -
-
-
-
-
+
+
+

- +

diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.java index 780fba46824..af42566baf6 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/reports/component/RunReportPopupPanel.java @@ -96,53 +96,63 @@ protected void onInitialize() { } private void initParameters() { - PrismContainerDefinition paramContainerDef = getPrismContext().getSchemaRegistry().findContainerDefinitionByElementName(ReportConstants.REPORT_PARAMS_PROPERTY_NAME); + PrismContainerValue reportParamValue; + try { + PrismContainerDefinition paramContainerDef = getPrismContext().getSchemaRegistry() + .findContainerDefinitionByElementName(ReportConstants.REPORT_PARAMS_PROPERTY_NAME); + paramContainer = paramContainerDef.instantiate(); + + ReportParameterType reportParam = new ReportParameterType(); + reportParamValue = reportParam.asPrismContainerValue(); + reportParamValue.revive(getPrismContext()); + paramContainer.add(reportParamValue); + } catch (SchemaException e) { + LOGGER.error("Couldn't create container for report parameters"); + return; + } for (SearchFilterParameterType parameter : reportType.getObjectCollection().getParameter()) { - try { - paramContainer = paramContainerDef.instantiate(); - - ReportParameterType reportParam = new ReportParameterType(); - PrismContainerValue reportParamValue = reportParam.asPrismContainerValue(); - reportParamValue.revive(getPrismContext()); - paramContainer.add(reportParamValue); - - Class clazz = getPrismContext().getSchemaRegistry().determineClassForType(parameter.getType()); - QName type = getPrismContext().getSchemaRegistry().determineTypeForClass(clazz); - if (Containerable.class.isAssignableFrom(clazz)) { - LOGGER.error("Couldn't create container item for parameter " + parameter); - continue; - } - MutableItemDefinition def; - if (Referencable.class.isAssignableFrom(clazz)) { - def = getPrismContext().definitionFactory().createReferenceDefinition( - new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type); - ((MutablePrismReferenceDefinition)def).setTargetTypeName(parameter.getTargetType()); + Class clazz = getPrismContext().getSchemaRegistry().determineClassForType(parameter.getType()); + QName type = getPrismContext().getSchemaRegistry().determineTypeForClass(clazz); + if (Containerable.class.isAssignableFrom(clazz)) { + LOGGER.error("Couldn't create container item for parameter " + parameter); + continue; + } + MutableItemDefinition def; + if (Referencable.class.isAssignableFrom(clazz)) { + def = getPrismContext().definitionFactory().createReferenceDefinition( + new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type); + ((MutablePrismReferenceDefinition) def).setTargetTypeName(parameter.getTargetType()); + } else { + List values = WebComponentUtil.getAllowedValues(parameter, getPageBase()); + if (CollectionUtils.isNotEmpty(values)) { + def = (MutableItemDefinition) getPrismContext().definitionFactory().createPropertyDefinition( + new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type, values, null); } else { - List values = WebComponentUtil.getAllowedValues(parameter, getPageBase()); - if (CollectionUtils.isNotEmpty(values)) { - def = (MutableItemDefinition) getPrismContext().definitionFactory().createPropertyDefinition( - new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type, values, null); - } else { - def = getPrismContext().definitionFactory().createPropertyDefinition( - new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type); - } - } - def.setDynamic(true); - def.setRuntimeSchema(true); - def.setMaxOccurs(1); - def.setMinOccurs(0); - if (parameter.getDisplay() != null) { - String displayName = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getLabel()); - def.setDisplayName(displayName); - String help = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getHelp()); - def.setHelp(help); + def = getPrismContext().definitionFactory().createPropertyDefinition( + new QName(ReportConstants.NS_EXTENSION, parameter.getName()), type); } - if (parameter.getAllowedValuesLookupTable() != null) { - def.setValueEnumerationRef(parameter.getAllowedValuesLookupTable().asReferenceValue()); + } + def.setDynamic(true); + def.setRuntimeSchema(true); + def.setMaxOccurs(1); + def.setMinOccurs(0); + if (parameter.getDisplay() != null) { + String displayName = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getLabel()); + def.setDisplayName(displayName); + String help = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getHelp()); + def.setHelp(help); + } + if (parameter.getAllowedValuesLookupTable() != null) { + def.setValueEnumerationRef(parameter.getAllowedValuesLookupTable().asReferenceValue()); + } + try { + Item item = def.instantiate(); + if (item instanceof PrismReference){ + ObjectReferenceType ref = new ObjectReferenceType(); + ref.setType(parameter.getTargetType()); + item.add(ref.asReferenceValue()); } - - Item prop = def.instantiate(); - reportParamValue.add(prop); + reportParamValue.add(item); } catch (SchemaException e) { LOGGER.error("Couldn't create item for parameter " + parameter); @@ -349,7 +359,8 @@ private void runConfirmPerformed(AjaxRequestTarget target) { PrismContainer parameterContainer = paramContainer.clone(); List itemForRemoving = new ArrayList<>(); parameterContainer.getValue().getItems().forEach((item) -> { - if (item.isEmpty() || item.getRealValue() == null){ + if (item.isEmpty() || item.getRealValue() == null + || (item instanceof PrismReference && ((PrismReference) item).getRealValue() != null && ((PrismReference) item).getRealValue().getOid() == null)) { itemForRemoving.add(item); } }); diff --git a/gui/admin-gui/src/main/resources/initial-objects/080-report-audit.xml b/gui/admin-gui/src/main/resources/initial-objects/080-report-audit.xml deleted file mode 100644 index 42194b59555..00000000000 --- a/gui/admin-gui/src/main/resources/initial-objects/080-report-audit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - All audit records report - Report made from all audit records. - - - - - - - - - diff --git a/gui/admin-gui/src/main/resources/initial-objects/090-report-audit-jasper.xml b/gui/admin-gui/src/main/resources/initial-objects/090-report-audit-jasper.xml deleted file mode 100644 index 5ec1a4d1e28..00000000000 --- a/gui/admin-gui/src/main/resources/initial-objects/090-report-audit-jasper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - Audit logs report (Jasper) - Report made from audit records. - - true - - PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IURPQ1RZUEUgamFzcGVyVGVtcGxhdGUNCiAgUFVCTElDICItLy9KYXNwZXJSZXBvcnRzLy9EVEQgVGVtcGxhdGUvL0VOIg0KICAiaHR0cDovL2phc3BlcnJlcG9ydHMuc291cmNlZm9yZ2UubmV0L2R0ZHMvamFzcGVydGVtcGxhdGUuZHRkIj4NCjxqYXNwZXJUZW1wbGF0ZT4NCiAgICAgICAgCTxzdHlsZSBmb250TmFtZT0iRGVqYVZ1IFNhbnMiIGZvbnRTaXplPSIxMCIgaEFsaWduPSJMZWZ0IiBpc0RlZmF1bHQ9InRydWUiIGlzUGRmRW1iZWRkZWQ9InRydWUiIA0KCQkJCSAgIG5hbWU9IkJhc2UiIHBkZkVuY29kaW5nPSJJZGVudGl0eS1IIiBwZGZGb250TmFtZT0iRGVqYVZ1U2Fucy50dGYiIHZBbGlnbj0iTWlkZGxlIj4NCgkJCTwvc3R5bGU+DQoJCQk8c3R5bGUgYmFja2NvbG9yPSIjMjY3OTk0IiBmb250U2l6ZT0iMjYiIGZvcmVjb2xvcj0iI0ZGRkZGRiIgaXNEZWZhdWx0PSJmYWxzZSINCiAgICAgICAgICAgICAgICAgICBtb2RlPSJPcGFxdWUiIG5hbWU9IlRpdGxlIiBzdHlsZT0iQmFzZSIvPiANCgkJCTxzdHlsZSBmb250U2l6ZT0iMTIiIGZvcmVjb2xvcj0iIzAwMDAwMCIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iUGFnZSBoZWFkZXIiDQogICAgICAgICAgICAgICAgICAgc3R5bGU9IkJhc2UiLz4NCgkJCTxzdHlsZSBiYWNrY29sb3I9IiMzMzMzMzMiIGZvbnRTaXplPSIxMiIgZm9yZWNvbG9yPSIjRkZGRkZGIiBoQWxpZ249IkNlbnRlciINCiAgICAgICAgICAgICAgICAgICBpc0RlZmF1bHQ9ImZhbHNlIiBtb2RlPSJPcGFxdWUiIG5hbWU9IkNvbHVtbiBoZWFkZXIiIHN0eWxlPSJCYXNlIi8+DQoJCQk8c3R5bGUgaXNCb2xkPSJmYWxzZSIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iRGV0YWlsIiBzdHlsZT0iQmFzZSIvPg0KICAgICAgICAgICAgPHN0eWxlIGlzQm9sZD0iZmFsc2UiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IkNvZGUiIHN0eWxlPSJCYXNlIiBmb250U2l6ZT0iOSIvPg0KCQkJPHN0eWxlIGZvbnRTaXplPSI5IiBmb3JlY29sb3I9IiMwMDAwMDAiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IlBhZ2UgZm9vdGVyIg0KICAgICAgICAgICAgICAgICAgIHN0eWxlPSJCYXNlIi8+DQoJCTwvamFzcGVyVGVtcGxhdGU+ - html - JRSwapFileVirtualizer - 300 - 10000 - 300000 - - - prismReference - - diff --git a/gui/admin-gui/src/main/resources/initial-objects/090-report-audit.xml b/gui/admin-gui/src/main/resources/initial-objects/090-report-audit.xml new file mode 100644 index 00000000000..1704e9025ea --- /dev/null +++ b/gui/admin-gui/src/main/resources/initial-objects/090-report-audit.xml @@ -0,0 +1,227 @@ + + + + + All audit records report + Report made from all audit records. + + + + + + + + + + + + targetRef + + filterAll + + + + + initiatorRef + + filterAll + + + + + outcome + + filterAll + + + + + eventType + + filterAll + + + + + eventStage + + filterAll + + + + + timestamp + + filterAll + + + + + timestamp + + filterAll + + + + + + + + outcome + OperationResultStatusType + + + + + + eventType + AuditEventTypeType + + + + + + eventStage + AuditEventStageType + + + + + + from + dateTime + + + + + + to + dateTime + + + + + + target + c:ObjectReferenceType + + + + + + initiator + c:ObjectReferenceType + + + + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/100-report-reconciliation.xml b/gui/admin-gui/src/main/resources/initial-objects/100-report-reconciliation.xml index 32f521d5f4d..b8d07a40ded 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/100-report-reconciliation.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/100-report-reconciliation.xml @@ -1,22 +1,189 @@ - - Reconciliation report (Jasper) - Reconciliation report for selected resource. - - true - - PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IURPQ1RZUEUgamFzcGVyVGVtcGxhdGUNCiAgUFVCTElDICItLy9KYXNwZXJSZXBvcnRzLy9EVEQgVGVtcGxhdGUvL0VOIg0KICAiaHR0cDovL2phc3BlcnJlcG9ydHMuc291cmNlZm9yZ2UubmV0L2R0ZHMvamFzcGVydGVtcGxhdGUuZHRkIj4NCjxqYXNwZXJUZW1wbGF0ZT4NCiAgICAgICAgCTxzdHlsZSBmb250TmFtZT0iRGVqYVZ1IFNhbnMiIGZvbnRTaXplPSIxMCIgaEFsaWduPSJMZWZ0IiBpc0RlZmF1bHQ9InRydWUiIGlzUGRmRW1iZWRkZWQ9InRydWUiIA0KCQkJCSAgIG5hbWU9IkJhc2UiIHBkZkVuY29kaW5nPSJJZGVudGl0eS1IIiBwZGZGb250TmFtZT0iRGVqYVZ1U2Fucy50dGYiIHZBbGlnbj0iTWlkZGxlIj4NCgkJCTwvc3R5bGU+DQoJCQk8c3R5bGUgYmFja2NvbG9yPSIjMjY3OTk0IiBmb250U2l6ZT0iMjYiIGZvcmVjb2xvcj0iI0ZGRkZGRiIgaXNEZWZhdWx0PSJmYWxzZSINCiAgICAgICAgICAgICAgICAgICBtb2RlPSJPcGFxdWUiIG5hbWU9IlRpdGxlIiBzdHlsZT0iQmFzZSIvPiANCgkJCTxzdHlsZSBmb250U2l6ZT0iMTIiIGZvcmVjb2xvcj0iIzAwMDAwMCIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iUGFnZSBoZWFkZXIiDQogICAgICAgICAgICAgICAgICAgc3R5bGU9IkJhc2UiLz4NCgkJCTxzdHlsZSBiYWNrY29sb3I9IiMzMzMzMzMiIGZvbnRTaXplPSIxMiIgZm9yZWNvbG9yPSIjRkZGRkZGIiBoQWxpZ249IkNlbnRlciINCiAgICAgICAgICAgICAgICAgICBpc0RlZmF1bHQ9ImZhbHNlIiBtb2RlPSJPcGFxdWUiIG5hbWU9IkNvbHVtbiBoZWFkZXIiIHN0eWxlPSJCYXNlIi8+DQoJCQk8c3R5bGUgaXNCb2xkPSJmYWxzZSIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iRGV0YWlsIiBzdHlsZT0iQmFzZSIvPg0KICAgICAgICAgICAgPHN0eWxlIGlzQm9sZD0iZmFsc2UiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IkNvZGUiIHN0eWxlPSJCYXNlIiBmb250U2l6ZT0iOSIvPg0KCQkJPHN0eWxlIGZvbnRTaXplPSI5IiBmb3JlY29sb3I9IiMwMDAwMDAiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IlBhZ2UgZm9vdGVyIg0KICAgICAgICAgICAgICAgICAgIHN0eWxlPSJCYXNlIi8+DQoJCTwvamFzcGVyVGVtcGxhdGU+ - pdf - JRSwapFileVirtualizer - 300 - 10000 - 300000 - + + + Reconciliation report + Reconciliation report for selected resource. + + + + + + + + + + + + resourceRef + + filterAll + + + + + synchronizationSituation + + filterAll + + + + + objectClass + + filterAll + + + + + kind + + filterAll + + + + + intent + + filterAll + + + + + + + + intent + string + + + + + + objectClass + string + + + + + + kind + ShadowKindType + + + + + + situation + SynchronizationSituationType + + + + + + resource + c:ObjectReferenceType + c:ResourceType + + + + + + ShadowType + + nameColumn + name + + + situationColumn + synchronizationSituation + nameColumn + + + synchTimestampColumn + synchronizationTimestamp + situationColumn + + + resourceColumn + resourceRef + synchTimestampColumn + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/110-report-user-list.xml b/gui/admin-gui/src/main/resources/initial-objects/110-report-user-list.xml index e1e6395cf7a..c73e31f96ad 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/110-report-user-list.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/110-report-user-list.xml @@ -1,21 +1,160 @@ - - Users in MidPoint (Jasper) + + + Users in MidPoint Users listed in MidPoint. - - - PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8IURPQ1RZUEUgamFzcGVyVGVtcGxhdGUNCiAgUFVCTElDICItLy9KYXNwZXJSZXBvcnRzLy9EVEQgVGVtcGxhdGUvL0VOIg0KICAiaHR0cDovL2phc3BlcnJlcG9ydHMuc291cmNlZm9yZ2UubmV0L2R0ZHMvamFzcGVydGVtcGxhdGUuZHRkIj4NCjxqYXNwZXJUZW1wbGF0ZT4NCiAgICAgICAgCTxzdHlsZSBmb250TmFtZT0iRGVqYVZ1IFNhbnMiIGZvbnRTaXplPSIxMCIgaEFsaWduPSJMZWZ0IiBpc0RlZmF1bHQ9InRydWUiIGlzUGRmRW1iZWRkZWQ9InRydWUiIA0KCQkJCSAgIG5hbWU9IkJhc2UiIHBkZkVuY29kaW5nPSJJZGVudGl0eS1IIiBwZGZGb250TmFtZT0iRGVqYVZ1U2Fucy50dGYiIHZBbGlnbj0iTWlkZGxlIj4NCgkJCTwvc3R5bGU+DQoJCQk8c3R5bGUgYmFja2NvbG9yPSIjMjY3OTk0IiBmb250U2l6ZT0iMjYiIGZvcmVjb2xvcj0iI0ZGRkZGRiIgaXNEZWZhdWx0PSJmYWxzZSINCiAgICAgICAgICAgICAgICAgICBtb2RlPSJPcGFxdWUiIG5hbWU9IlRpdGxlIiBzdHlsZT0iQmFzZSIvPiANCgkJCTxzdHlsZSBmb250U2l6ZT0iMTIiIGZvcmVjb2xvcj0iIzAwMDAwMCIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iUGFnZSBoZWFkZXIiDQogICAgICAgICAgICAgICAgICAgc3R5bGU9IkJhc2UiLz4NCgkJCTxzdHlsZSBiYWNrY29sb3I9IiMzMzMzMzMiIGZvbnRTaXplPSIxMiIgZm9yZWNvbG9yPSIjRkZGRkZGIiBoQWxpZ249IkNlbnRlciINCiAgICAgICAgICAgICAgICAgICBpc0RlZmF1bHQ9ImZhbHNlIiBtb2RlPSJPcGFxdWUiIG5hbWU9IkNvbHVtbiBoZWFkZXIiIHN0eWxlPSJCYXNlIi8+DQoJCQk8c3R5bGUgaXNCb2xkPSJmYWxzZSIgaXNEZWZhdWx0PSJmYWxzZSIgbmFtZT0iRGV0YWlsIiBzdHlsZT0iQmFzZSIvPg0KICAgICAgICAgICAgPHN0eWxlIGlzQm9sZD0iZmFsc2UiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IkNvZGUiIHN0eWxlPSJCYXNlIiBmb250U2l6ZT0iOSIvPg0KCQkJPHN0eWxlIGZvbnRTaXplPSI5IiBmb3JlY29sb3I9IiMwMDAwMDAiIGlzRGVmYXVsdD0iZmFsc2UiIG5hbWU9IlBhZ2UgZm9vdGVyIg0KICAgICAgICAgICAgICAgICAgIHN0eWxlPSJCYXNlIi8+DQoJCTwvamFzcGVyVGVtcGxhdGU+ - pdf - JRSwapFileVirtualizer - 300 - 10000 - 300000 - + + + + + + + + + activation/administrativeStatus + + filterAll + + + + + assignment/targetRef + + filterAll + + + + + assignment/targetRef + + filterAll + + + + + assignment/construction/resourceRef + + filterAll + + + + + + + + activation + ActivationStatusType + + + + + + organization + c:ObjectReferenceType + c:OrgType + + + + + + role + c:ObjectReferenceType + c:RoleType + + + + + + resource + c:ObjectReferenceType + c:ResourceType + + + + + + UserType + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/130-report-certification-definitions.xml b/gui/admin-gui/src/main/resources/initial-objects/130-report-certification-definitions.xml index 9795729d665..ae05a788aa2 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/130-report-certification-definitions.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/130-report-certification-definitions.xml @@ -7,6 +7,7 @@ --> Certification definitions report All certification definitions with basic information on related campaigns. @@ -15,15 +16,14 @@ - + + + nameColumn name - - - ownerColumn @@ -43,21 +43,12 @@ + number openCampaignsColumn @@ -74,7 +65,6 @@ oid = object.getOid(); numberOfCampaigns = 0; - campaigns = midpoint.searchObjects(AccessCertificationCampaignType.class, prismContext.queryFor(AccessCertificationCampaignType.class).build(), null); for (AccessCertificationCampaignType campaign : campaigns) { if (oid.equals(campaign.getDefinitionRef().getOid())) { AccessCertificationCampaignStateType state = campaign.getState(); @@ -89,6 +79,7 @@ + number lastStartedColumn @@ -126,6 +117,24 @@ AccessCertificationDefinitionType + + ascending + name + + + campaigns + AccessCertificationCampaignType + + + + true diff --git a/gui/admin-gui/src/main/resources/initial-objects/140-report-certification-campaigns.xml b/gui/admin-gui/src/main/resources/initial-objects/140-report-certification-campaigns.xml index 78b2853c93e..c34d4949e8f 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/140-report-certification-campaigns.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/140-report-certification-campaigns.xml @@ -7,19 +7,180 @@ --> - Certification campaigns report (Jasper) - All certification campaigns along with their state. - - true - - html - JRSwapFileVirtualizer - 300 - 10000 - 300000 - - - prismReference - + Certification campaigns report + All certification campaigns along with their state. + + + + + + + + + state + + filterAll + + + + + state + inReviewStage + + + state + reviewStageDone + + + state + inRemediation + + + + + + + + + + nameColumn + name + + + + + + ownerColumn + ownerRef + + + + nameColumn + + + startTimestampColumn + startTimestamp + + + + ownerColumn + + + + + + + + endTimestampColumn + endTimestamp + + + + startTimestampColumn + + + + + + + + casesColumn + case + + + + endTimestampColumn + number + + + stateColumn + state + + + + casesColumn + + + stageNumberColumn + stageNumber + + + + stateColumn + + + stageCasesColumn + stageNumberColumn + + + + + + + + + + + percentageCompleteColumn + stageCasesColumn + + + + + + + + + + AccessCertificationCampaignType + + true + + ascending + name + + + alsoClosedCampaigns + boolean + + + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/150-report-certification-cases.xml b/gui/admin-gui/src/main/resources/initial-objects/150-report-certification-cases.xml index b0f6c1478a5..edd13c50f19 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/150-report-certification-cases.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/150-report-certification-cases.xml @@ -6,19 +6,194 @@ ~ and European Union Public License. See LICENSE file for details. --> - Certification cases report (Jasper) - Cases within a given certification campaign. - - true - - html - JRSwapFileVirtualizer - 300 - 10000 - 300000 - - - prismReference - + Certification cases report + Cases within a given certification campaign. + + + + + ../name + + filterAll + + + + + + + + objectColumn + objectRef + + + + + + + + + + + targetColumn + targetRef + + + + objectColumn + + + + + + + + reviewersColumn + + + + targetColumn + + + + + + + + lastReviewedOnColumn + + + + reviewersColumn + + + + + + + + reviewedByColumn + + + + lastReviewedOnColumn + + + + + + + + iterationColumn + iteration + + + + reviewedByColumn + + + inStageNumberColumn + stageNumber + + + + iterationColumn + + + outcomeColumn + outcome + + + + inStageNumberColumn + + + commentsColumn + + + + outcomeColumn + + + + + + + + remediedTimestampColumn + remediedTimestamp + + + + commentsColumn + + AccessCertificationCaseType + + + objectRef/@/name + + + campaignName + c:ObjectReferenceType + c:AccessCertificationCampaignType + + + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/160-report-certification-decisions.xml b/gui/admin-gui/src/main/resources/initial-objects/160-report-certification-decisions.xml index 86cb0f2e414..0b58b51e360 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/160-report-certification-decisions.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/160-report-certification-decisions.xml @@ -6,19 +6,176 @@ ~ and European Union Public License. See LICENSE file for details. --> - Certification decisions report (Jasper) + Certification decisions report Decisions of individual reviewers for a certification campaign as a whole or for a given campaign stage. - - true - - html - JRSwapFileVirtualizer - 300 - 10000 - 300000 - - - prismReference - + + + + + ../name + + filterAll + + + + + + + + + + + objectColumn + objectRef + + + + + + + + + + + targetColumn + targetRef + + + + objectColumn + + + + + + + + workItemColumn + workItem + + + + targetColumn + + + + + + + c:AccessCertificationCaseType + + + objectRef/@/name + + + campaignName + c:ObjectReferenceType + c:AccessCertificationCampaignType + + + + + + stageNumber + string + + + + + + iteration + string + + + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/280-object-collection-resource-up.xml b/gui/admin-gui/src/main/resources/initial-objects/251-object-collection-resource-up.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/280-object-collection-resource-up.xml rename to gui/admin-gui/src/main/resources/initial-objects/251-object-collection-resource-up.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/270-object-collection-task-active.xml b/gui/admin-gui/src/main/resources/initial-objects/261-object-collection-task-active.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/270-object-collection-task-active.xml rename to gui/admin-gui/src/main/resources/initial-objects/261-object-collection-task-active.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/284-object-collection-audit.xml b/gui/admin-gui/src/main/resources/initial-objects/270-object-collection-audit.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/284-object-collection-audit.xml rename to gui/admin-gui/src/main/resources/initial-objects/270-object-collection-audit.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/285-object-collection-audit-24h.xml b/gui/admin-gui/src/main/resources/initial-objects/271-object-collection-audit-24h.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/285-object-collection-audit-24h.xml rename to gui/admin-gui/src/main/resources/initial-objects/271-object-collection-audit-24h.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/290-object-collection-audit-errors-24h.xml b/gui/admin-gui/src/main/resources/initial-objects/272-object-collection-audit-errors-24h.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/290-object-collection-audit-errors-24h.xml rename to gui/admin-gui/src/main/resources/initial-objects/272-object-collection-audit-errors-24h.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/300-object-collection-audit-modifications-24h.xml b/gui/admin-gui/src/main/resources/initial-objects/273-object-collection-audit-modifications-24h.xml similarity index 100% rename from gui/admin-gui/src/main/resources/initial-objects/300-object-collection-audit-modifications-24h.xml rename to gui/admin-gui/src/main/resources/initial-objects/273-object-collection-audit-modifications-24h.xml diff --git a/gui/admin-gui/src/main/resources/initial-objects/280-object-collection-certification-campaign-all.xml b/gui/admin-gui/src/main/resources/initial-objects/280-object-collection-certification-campaign-all.xml new file mode 100644 index 00000000000..a92f8c21f25 --- /dev/null +++ b/gui/admin-gui/src/main/resources/initial-objects/280-object-collection-certification-campaign-all.xml @@ -0,0 +1,27 @@ + + + + + All certification campaigns + AccessCertificationCampaignType + + + + + + + diff --git a/gui/admin-gui/src/main/resources/initial-objects/255-object-collection-certification-definition-all.xml b/gui/admin-gui/src/main/resources/initial-objects/290-object-collection-shadow-all.xml similarity index 66% rename from gui/admin-gui/src/main/resources/initial-objects/255-object-collection-certification-definition-all.xml rename to gui/admin-gui/src/main/resources/initial-objects/290-object-collection-shadow-all.xml index 330c41f246c..5dff0c4992b 100644 --- a/gui/admin-gui/src/main/resources/initial-objects/255-object-collection-certification-definition-all.xml +++ b/gui/admin-gui/src/main/resources/initial-objects/290-object-collection-shadow-all.xml @@ -1,6 +1,6 @@ - - - - - - TODO - - - - - - - - - - - - - - - - Definition of an access certification - a template for - a set of access certification campaigns. - - - - - - - - - The certification handler that should take care of certification campaigns - created according to this definition. - - - - - - - Specifies the standard scope of certifications of this type. (In the future it can be overridden - in specific certification campaign.) - - - - - - - The user that owns certification campaigns based on this definition. - - - tns:UserType - - - - - - - How the identified cases have to be resolved? - - - - - - - Configuration of the manual or automatic reiteration. - - - 3.9 - - - - - - - Definition of individual stages (reviewers, duration, ...). - - - - - - - Strategy used to compute review outcome for a given case, based on results of individual stages, - along with instructions when a case review advances from a stage to next one. - - - - - - - Denotes "ad hoc" certification campaign, i.e. one that is started by policy rules, not explicitly by a user. - - - 3.6 - - - - - - - ID that was used to auto-generate campaign name last time (null if none so far). - - - - - - - When the last campaign of this type was started (in its first iteration)? - - - - - - - When the last campaign of this type was closed? Deletion is not recorded in this attribute. - - - - - - - - - - - - - - - - - - - - - Access certification definition augmented with report-related information - (e.g. number of campaigns). - - EXPERIMENTAL. It is to be seen if this form is OK. - - - - - - - - - - - - - - - - - Access certification definition. - - - - - - - - - - - - - Definition of an access certification campaign stage. - - - - - - - - - - Stages are numbered from 1 onwards. - - - - - - - Stage name. - - - - - - - Stage description. - - - - - - - - How long should the stage last? - - - - - - - How to round the deadline (if at all)? The default is to 23:59:59 of the computed day. - - - - - - - How long before the end of stage should notifications be sent? - (Multiple values can be put here.) - - - - - - - Send notifications only to people that have not decided yet. - - - - - - - TODO - - - - - - - How to determine outcome of the approval process (e.g. if multiple reviewers are present)? - Default is oneAcceptAccepts. - - - - - - - What is the outcome if no reviewers are available? (This is not the same situation as if some reviewers were computed but none of them responded!) - - - - - - - What decisions stop the case from advancing to the next stage? - If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined at the campaign level) is used. - - - - - - - What decisions make the case to advance to the next stage? - If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined at the campaign level) is used. - - - - - - - What actions are to be applied to work items when given timer(s) occur. - EXPERIMENTAL - - - 3.6 - - - - - - - - - - - Specifies how to select reviewers for a campaign stage. - - - - - - - - - - User-readable name of this reviewer specification. (In case it is necessary.) - - - - - - - Description of this reviewer specification. - - - - - - - - Indicates that target object (Org, Role, Resource) owner(s) should be used as reviewer(s). - - - - - - - Indicates that target object (Org, Role, Resource) approver(s) should be used as reviewer(s). - - - - - - - Indicates that object (Org, Role) owner(s) should be used as reviewer(s). - - - - - - - Indicates that object (Org, Role) approver(s) should be used as reviewer(s). - - - - - - - Indicates that the object's managers should be used. The interpretation depends on what kind - of object there is. - - For a user, the managers of all organizations to which he/she belongs, are taken. - For an org, its managers are taken. - (For the future: For a role, if it has a parentOrgRef, managers of these are taken. If it has - none, no reviewers are contributed by this option.) - - - - - - - The most general way of specifying the reviewer. Inputs for such expressions are: - - certificationCase (current certification case), - - campaign (certification campaign object), - - reviewerSpecification (current reviewer specification). - Output is a collection of parent-less reviewer references (of type ObjectReferenceType). - - - - - - - If no reviewer(s) are computed by other means, this/these should be used. - - - tns:FocusType - - - - - - - These reviewers are always used. - - - tns:FocusType - - - - - - - - - - - Definition of an access certification campaign. - - - - - - - - - Specifies the definition for this certification campaign. - (It is optional, as there are also ad-hoc certifications with no pre-existing definition.) - - - tns:AccessCertificationDefinitionType - - - - - - - Specifies the owner of this certification campaign. - - - tns:UserType - - - - - - - The certification handler that should take care of this campaign. - - - - - - - Specifies the scope of this campaign. - - - - - - - How the identified cases have to be resolved? - - - - - - - Configuration of the manual or automatic reiteration. - - - 3.9 - - - - - - - Definition of individual stages. - - - - - - - Strategy used to compute review outcome for a given case, based on results of individual stages, - along with instructions when a case review advances from a stage to next one. - - - - - - - When this campaign has to start (or has started). - - - - - - - When this campaign has finished. - - - - - - - Which iteration this campaign is in. 1 means the regular (first) run; - 2 means first repetition, etc. - - - 3.9 - - - - - - - In which state is the current campaign. - - - - - - - The stage this campaign is in. - 0 means it has not started yet. - X in 1..N (where N is the number of defined stages) means that stage X is being carried out. - Y greater than N means the campaign has been already finished. - - - - - - - Stages for this campaign (already finished, current, or planned). - - - - - - - Certification cases for this campaign. - - - - - - - - - - - - - Information about a stage of a campaign. - - - - - - - - - - Which iteration this stage is part of. 1 means the first (i.e. regular) run. - - - 3.9 - - - - - - - TODO - - - - - - - Stage name. - - - - - - - Stage description. - - - - - - - - When this stage has started. - - - - - - - When this stage has to finish. - - - - - - - When this stage has actually finished. - - - - - - - The escalation level is currently the same for open all cases and their open work items in the stage. - (This might change in the future.) - - - - - - - - - - - Specifies the scope of an access certification campaign. - - - - - - - - - - User-readable name of this scope definition. (In case it is necessary.) - - - - - - - Description of this scope definition. - - - - - - - - - - - - - - - The most common way of specifying scope - providing type+search filter to select "base" objects - and then some means of deriving certification cases from them. - - - - - - - - - Type of objects to be selected for certification. - - - - - - - Filter to find objects for certification. - By default, all objects of a given type will be selected. - - - - - - - Expression that selects items that are to be included in the certification. - Exact use of this expression depends on the certification handler. - E.g. user assignment handler could call this expression individually with each assignment - to determine which assignments should be included and which should not. - - - - - - - Expression that produces certification cases. This can be any expression, whose input is an object - that has passed the search filter specified above, and its output is a list of certification cases. - An example: a groovy expression, creating certification cases by selecting user's - "risky" assignments (e.g. assignments to a roles of a given type/types). Another example - can be the computation of all assignments (direct and indirect ones), and selecting among these. - NOT IMPLEMENTED YET - - - - - - - - - - - - - Scope for assignment-related reviews. - - - - - - - - - - - - Should assignments be included in the certification? - - - - - - - Should inducements be included in the certification? - - - - - - - Should assignments/inducements of roles be included in the certification? - - - - - - - Should assignments/inducements of orgs be included in the certification? - - - - - - - Should assignments/inducements of resources be included in the certification? - - - - - - - Should assignments/inducements of services be included in the certification? - - - - - - - Should assignments/inducements of users (e.g. deputy relations) be included in the certification? - - - - - - - Should we approve only assignments/inducements that are currently enabled? - (I.e. with administrativeStatus either null or ENABLED) - - - - - - - Relation(s) which are to be considered. Value of q:any means "any relation". - If no relation is present, org:default (i.e. null) is assumed. - - - - - - - - - - - - - An item that has to be certified, viewed in the scope of a given certification campaign. - - - - - - - - - - Object (e.g. a user) that is being touched by this case. - - - tns:ObjectType - - - - - - - Quite an abstract parameter - describing the object of the certification case (e.g. a role, a resource, ...). - Used for selecting relevant cases for approvals. - - - tns:ObjectType - - - - - - - For parameterized certification items (e.g. assignments): a tenant parameter, if applicable. - See discussion on tenantRef in AssignmentType. - - - tns:OrgType - - - - - - - For parameterized certification items (e.g. assignments): an org parameter, if applicable. - See discussion on orgRef in AssignmentType. - - - tns:OrgType - - - - - - - If the target is assigned with activation information (e.g. validFrom/validTo/administrativeStatus) - here is the information copied. Note that other activation information (e.g. effectiveStatus) are - _not_ updated here and probably should be ignored. - - - - - - - - The number of current stage in which this case is. - E.g. currentOutcome relates to the currentStage. - Case is "enabled" for a current campaign stage if and only if case.currentStage == campaign.stageNumber. - - When opening a campaign stage, case's currentStage either advances (if it is transferred to stage being opened) - or stays at the existing value (if it is not). It then indicates the last stage this case - was reviewed in. - - - - - - - Iteration this case takes part of. Case is "enabled" for a current campaign stage if and only if - case.iteration == campaign.iteration (beware of null comparison). - - - - - - - Work items for this stage. Some might be completed. Work items are not deleted. - - - 3.6 - - - - - - - When was this certification case requested to be reviewed? - (Can be found in certification.stage.start but we need to - sort according to this value.) - - - - - - - When should this certification case be reviewed? - (Can be found in certification.stage.end but we need to - sort according to this value.) - - - - - - - Currently valid outcome, relevant to the current stage. It is recomputed on each reviewer's - response based on defined algorithms. If the case is not transferred into the next stage, - the value of this item stays as it is. - - - - - - - The outcome, taking into account all closed stages plus current stage (if any). - - - - - - - When was the review process for this case finished (for the current iteration)? - This value is cleared for cases entering the next iteration. - - - 3.9 - - - - - - - When was this certification case was remedied? - If null, this means that either remediation was not required - (either because the decision was "accept" or "abstain" or - because remediation mode was set to "none"). - - - - - - - Events that occurred during lifetime of this case. - - - - - - - - - - - - - - - - - - - - - - - - - A work item for a certification case. - - - - 3.6 - - - - - - - - - When the decision was made or changed. - - - - - - - Which iteration this work item is part of. 1 means the first (i.e. regular) run. - - - 3.9 - - - - - - - - - - - - - - - - - - - - - Assignment that is being considered. - - - - - - - Indicates if the above assignment is an assignment or (in case of roles) an inducement. - - - - - - - - - - - - - An enumeration that defines possible reviewers' responses. - - - - - - - A.k.a. maintain, confirm, certify, approve, OK - the situation was approved and can be left - as it is. It is possible to enter a date when the approval will expire. Until this time - the item will be considered approved and will not be shown in the certification list - for the given certifier. (We have to decide how to implement this feature. The most simple - but not entirely correct solution is to set "validTo" date for a given assignment. But it - wouldn't work e.g. for indirect assignments.) - - - - - - - - - - A.k.a. reject, remove, "not OK" - the situation is unacceptable and has to be eliminated - or disabled. E.g. the assignment has to be removed or disabled. - - - - - - - - - - A.k.a. update - situation is not acceptable; however, simple elimination/disabling is not - necessary or not appropriate - someone has to look at this and try to find another solution. - - - - - - - - - - A.k.a. abstain - responsible person says he/she is not able to decide. - - - - - - - - - - Responsible person delegates the decision to someone else. - DEPRECATED - - - - - - - - - - No response was provided by the given reviewer. - (This state can be used e.g. to facilitate querying by state.) - - SHOULD NOT BE USED FOR INDIVIDUAL RESPONSES. (A null value should be used instead.) - But it's OK to use this for stage/case outcome. - - - - - - - - - - - - - - - Strategy used to compute review outcome for a given case, based on results of individual stages. - Default is oneDenyDenies. - - - - - - - What decisions stop the case from advancing to the next stage? - If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined by the outcomeStrategy) is used. - - - - - - - What decisions make the case to advance to the next stage? - If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined by the outcomeStrategy) is used. - - - - - - - - - - An enumeration that defines possible strategies for case outcome (approval) computation - currently both at the stage and campaign level. - (In the future, these uses might be split.) - - - - - - - If at least one reviewer approves, the result is "APPROVED" regardless of the other votes. - - - - - - - - - - If at least one reviewer denies (either via revoke or reduce), the result is "NOT APPROVED". - However, for the case to be approved, at least approval must be present. - - - - - - - - - - Approved if none of the reviewers denies (either via revoke or reduce). - So e.g. if nobody says anything, the case is approved. - - - - - - - - - - All reviewers must approve, i.e. no revoke, reduce, noResponse is acceptable. - - - - - - - - - - - - - TODO - - - - - - - - - - TODO - - - - - - - What (final) outcomes cause actual remediation (e.g. deletion of an assignment) if automated remediation is configured? - The default is "revoke". But more can be specified here, e.g. noResponse. - - - - - - - - - - - TODO - - - - 3.9 - - - - - - - How long after campaign is closed should automatic reiteration start? - The default is that reiteration starts only manually. - - - - - - - How many iterations are allowed for automatic start? After reaching the specified number of iterations - (irrespective of how they were started) automatic reiteration mechanism will be disabled for this - campaign. - - - - - - - How many iterations are allowed in total? After reaching the specified number of iterations - no new iterations can be opened. - - - - - - - - - - - An enumeration that defines possible styles for certification case remediation. - - - - - - - Resolution of revoked cases is fully automated. - - - - - - - - - - Non-conformant cases are only to be reported. - - - - - - - - - - - - - An enumeration that defines possible states of a certification campaign. - - - - - - - Campaign was created, but its first stage has not been started yet. - Current stage number is 0. - - - - - - - - - - Review is being carried out, in a given stage. - Current stage number is between 1 and N (number of stages). - - - - - - - - - - A given review stage was done. Next stage nor remediation (if any) has not started yet. - Current stage number indicates the number of stage that has been recently done. - - - - - - - - - - The last stage was closed, remediation (either automated or manual) is in progress. - - - - - - - - - - Review and possibly remediation is over. The campaign is closed. - - - - - - - - - - - - - - - Statistics give a set of access certification cases. - - - - - tns:markedAsDelegate - 4.0 - removed - - - - - - - - - - - - - - - - - - - - TODO - - - - - - - - - - - - - Configuration for access certification. - - - - - - - - - - What response types are available to reviewers? Empty list means all responses. - TODO should we configure also names of the responses? (probably no) - - - AccessCertificationConfigurationType.availableResponse - - - - - - - Instructions how to format reviewers comments before storing them into metadata. - EXPERIMENTAL - - - true - 3.7.1 - AccessCertificationConfigurationType.reviewerCommentsFormatting - - - - - - - - + + + + + + + + + TODO + + + + + + + + + + + + + + + + Definition of an access certification - a template for + a set of access certification campaigns. + + + + + + + + + The certification handler that should take care of certification campaigns + created according to this definition. + + + + + + + Specifies the standard scope of certifications of this type. (In the future it can be overridden + in specific certification campaign.) + + + + + + + The user that owns certification campaigns based on this definition. + + + tns:UserType + + + + + + + How the identified cases have to be resolved? + + + + + + + Configuration of the manual or automatic reiteration. + + + 3.9 + + + + + + + Definition of individual stages (reviewers, duration, ...). + + + + + + + Strategy used to compute review outcome for a given case, based on results of individual stages, + along with instructions when a case review advances from a stage to next one. + + + + + + + Denotes "ad hoc" certification campaign, i.e. one that is started by policy rules, not explicitly by a user. + + + 3.6 + + + + + + + ID that was used to auto-generate campaign name last time (null if none so far). + + + + + + + When the last campaign of this type was started (in its first iteration)? + + + + + + + When the last campaign of this type was closed? Deletion is not recorded in this attribute. + + + + + + + + + + + + + + + + + + + + + Access certification definition augmented with report-related information + (e.g. number of campaigns). + + EXPERIMENTAL. It is to be seen if this form is OK. + + + + + + + + + + + + + + + + + Access certification definition. + + + + + + + + + + + + + Definition of an access certification campaign stage. + + + + + + + + + + Stages are numbered from 1 onwards. + + + + + + + Stage name. + + + + + + + Stage description. + + + + + + + + How long should the stage last? + + + + + + + How to round the deadline (if at all)? The default is to 23:59:59 of the computed day. + + + + + + + How long before the end of stage should notifications be sent? + (Multiple values can be put here.) + + + + + + + Send notifications only to people that have not decided yet. + + + + + + + TODO + + + + + + + How to determine outcome of the approval process (e.g. if multiple reviewers are present)? + Default is oneAcceptAccepts. + + + + + + + What is the outcome if no reviewers are available? (This is not the same situation as if some reviewers were computed but none of them responded!) + + + + + + + What decisions stop the case from advancing to the next stage? + If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined at the campaign level) is used. + + + + + + + What decisions make the case to advance to the next stage? + If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined at the campaign level) is used. + + + + + + + What actions are to be applied to work items when given timer(s) occur. + EXPERIMENTAL + + + 3.6 + + + + + + + + + + + Specifies how to select reviewers for a campaign stage. + + + + + + + + + + User-readable name of this reviewer specification. (In case it is necessary.) + + + + + + + Description of this reviewer specification. + + + + + + + + Indicates that target object (Org, Role, Resource) owner(s) should be used as reviewer(s). + + + + + + + Indicates that target object (Org, Role, Resource) approver(s) should be used as reviewer(s). + + + + + + + Indicates that object (Org, Role) owner(s) should be used as reviewer(s). + + + + + + + Indicates that object (Org, Role) approver(s) should be used as reviewer(s). + + + + + + + Indicates that the object's managers should be used. The interpretation depends on what kind + of object there is. + + For a user, the managers of all organizations to which he/she belongs, are taken. + For an org, its managers are taken. + (For the future: For a role, if it has a parentOrgRef, managers of these are taken. If it has + none, no reviewers are contributed by this option.) + + + + + + + The most general way of specifying the reviewer. Inputs for such expressions are: + - certificationCase (current certification case), + - campaign (certification campaign object), + - reviewerSpecification (current reviewer specification). + Output is a collection of parent-less reviewer references (of type ObjectReferenceType). + + + + + + + If no reviewer(s) are computed by other means, this/these should be used. + + + tns:FocusType + + + + + + + These reviewers are always used. + + + tns:FocusType + + + + + + + + + + + Definition of an access certification campaign. + + + + + + + + + Specifies the definition for this certification campaign. + (It is optional, as there are also ad-hoc certifications with no pre-existing definition.) + + + tns:AccessCertificationDefinitionType + + + + + + + Specifies the owner of this certification campaign. + + + tns:UserType + + + + + + + The certification handler that should take care of this campaign. + + + + + + + Specifies the scope of this campaign. + + + + + + + How the identified cases have to be resolved? + + + + + + + Configuration of the manual or automatic reiteration. + + + 3.9 + + + + + + + Definition of individual stages. + + + + + + + Strategy used to compute review outcome for a given case, based on results of individual stages, + along with instructions when a case review advances from a stage to next one. + + + + + + + When this campaign has to start (or has started). + + + + + + + When this campaign has finished. + + + + + + + Which iteration this campaign is in. 1 means the regular (first) run; + 2 means first repetition, etc. + + + 3.9 + + + + + + + In which state is the current campaign. + + + + + + + The stage this campaign is in. + 0 means it has not started yet. + X in 1..N (where N is the number of defined stages) means that stage X is being carried out. + Y greater than N means the campaign has been already finished. + + + + + + + Stages for this campaign (already finished, current, or planned). + + + + + + + Certification cases for this campaign. + + + + + + + + + + + + + Information about a stage of a campaign. + + + + + + + + + + Which iteration this stage is part of. 1 means the first (i.e. regular) run. + + + 3.9 + + + + + + + TODO + + + + + + + Stage name. + + + + + + + Stage description. + + + + + + + + When this stage has started. + + + + + + + When this stage has to finish. + + + + + + + When this stage has actually finished. + + + + + + + The escalation level is currently the same for open all cases and their open work items in the stage. + (This might change in the future.) + + + + + + + + + + + Specifies the scope of an access certification campaign. + + + + + + + + + + User-readable name of this scope definition. (In case it is necessary.) + + + + + + + Description of this scope definition. + + + + + + + + + + + + + + + The most common way of specifying scope - providing type+search filter to select "base" objects + and then some means of deriving certification cases from them. + + + + + + + + + Type of objects to be selected for certification. + + + + + + + Filter to find objects for certification. + By default, all objects of a given type will be selected. + + + + + + + Expression that selects items that are to be included in the certification. + Exact use of this expression depends on the certification handler. + E.g. user assignment handler could call this expression individually with each assignment + to determine which assignments should be included and which should not. + + + + + + + Expression that produces certification cases. This can be any expression, whose input is an object + that has passed the search filter specified above, and its output is a list of certification cases. + An example: a groovy expression, creating certification cases by selecting user's + "risky" assignments (e.g. assignments to a roles of a given type/types). Another example + can be the computation of all assignments (direct and indirect ones), and selecting among these. + NOT IMPLEMENTED YET + + + + + + + + + + + + + Scope for assignment-related reviews. + + + + + + + + + + + + Should assignments be included in the certification? + + + + + + + Should inducements be included in the certification? + + + + + + + Should assignments/inducements of roles be included in the certification? + + + + + + + Should assignments/inducements of orgs be included in the certification? + + + + + + + Should assignments/inducements of resources be included in the certification? + + + + + + + Should assignments/inducements of services be included in the certification? + + + + + + + Should assignments/inducements of users (e.g. deputy relations) be included in the certification? + + + + + + + Should we approve only assignments/inducements that are currently enabled? + (I.e. with administrativeStatus either null or ENABLED) + + + + + + + Relation(s) which are to be considered. Value of q:any means "any relation". + If no relation is present, org:default (i.e. null) is assumed. + + + + + + + + + + + + + An item that has to be certified, viewed in the scope of a given certification campaign. + + + + + + + + + + Object (e.g. a user) that is being touched by this case. + + + tns:ObjectType + + + + + + + Quite an abstract parameter - describing the object of the certification case (e.g. a role, a resource, ...). + Used for selecting relevant cases for approvals. + + + tns:ObjectType + + + + + + + For parameterized certification items (e.g. assignments): a tenant parameter, if applicable. + See discussion on tenantRef in AssignmentType. + + + tns:OrgType + + + + + + + For parameterized certification items (e.g. assignments): an org parameter, if applicable. + See discussion on orgRef in AssignmentType. + + + tns:OrgType + + + + + + + If the target is assigned with activation information (e.g. validFrom/validTo/administrativeStatus) + here is the information copied. Note that other activation information (e.g. effectiveStatus) are + _not_ updated here and probably should be ignored. + + + + + + + + The number of current stage in which this case is. + E.g. currentOutcome relates to the currentStage. + Case is "enabled" for a current campaign stage if and only if case.currentStage == campaign.stageNumber. + + When opening a campaign stage, case's currentStage either advances (if it is transferred to stage being opened) + or stays at the existing value (if it is not). It then indicates the last stage this case + was reviewed in. + + + + + + + Iteration this case takes part of. Case is "enabled" for a current campaign stage if and only if + case.iteration == campaign.iteration (beware of null comparison). + + + + + + + Work items for this stage. Some might be completed. Work items are not deleted. + + + 3.6 + + + + + + + When was this certification case requested to be reviewed? + (Can be found in certification.stage.start but we need to + sort according to this value.) + + + + + + + When should this certification case be reviewed? + (Can be found in certification.stage.end but we need to + sort according to this value.) + + + + + + + Currently valid outcome, relevant to the current stage. It is recomputed on each reviewer's + response based on defined algorithms. If the case is not transferred into the next stage, + the value of this item stays as it is. + + + + + + + The outcome, taking into account all closed stages plus current stage (if any). + + + + + + + When was the review process for this case finished (for the current iteration)? + This value is cleared for cases entering the next iteration. + + + 3.9 + + + + + + + When was this certification case was remedied? + If null, this means that either remediation was not required + (either because the decision was "accept" or "abstain" or + because remediation mode was set to "none"). + + + + + + + Events that occurred during lifetime of this case. + + + + + + + + + + + + + + + + + + + + + + + + + + A work item for a certification case. + + + + 3.6 + + + + + + + + + When the decision was made or changed. + + + + + + + Which iteration this work item is part of. 1 means the first (i.e. regular) run. + + + 3.9 + + + + + + + + + + + + + + + + + + + + + Assignment that is being considered. + + + + + + + Indicates if the above assignment is an assignment or (in case of roles) an inducement. + + + + + + + + + + + + + An enumeration that defines possible reviewers' responses. + + + + + + + A.k.a. maintain, confirm, certify, approve, OK - the situation was approved and can be left + as it is. It is possible to enter a date when the approval will expire. Until this time + the item will be considered approved and will not be shown in the certification list + for the given certifier. (We have to decide how to implement this feature. The most simple + but not entirely correct solution is to set "validTo" date for a given assignment. But it + wouldn't work e.g. for indirect assignments.) + + + + + + + + + + A.k.a. reject, remove, "not OK" - the situation is unacceptable and has to be eliminated + or disabled. E.g. the assignment has to be removed or disabled. + + + + + + + + + + A.k.a. update - situation is not acceptable; however, simple elimination/disabling is not + necessary or not appropriate - someone has to look at this and try to find another solution. + + + + + + + + + + A.k.a. abstain - responsible person says he/she is not able to decide. + + + + + + + + + + Responsible person delegates the decision to someone else. + DEPRECATED + + + + + + + + + + No response was provided by the given reviewer. + (This state can be used e.g. to facilitate querying by state.) + + SHOULD NOT BE USED FOR INDIVIDUAL RESPONSES. (A null value should be used instead.) + But it's OK to use this for stage/case outcome. + + + + + + + + + + + + + + + Strategy used to compute review outcome for a given case, based on results of individual stages. + Default is oneDenyDenies. + + + + + + + What decisions stop the case from advancing to the next stage? + If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined by the outcomeStrategy) is used. + + + + + + + What decisions make the case to advance to the next stage? + If neither stopReviewOn nor advanceToNextStageOn is used, a default (defined by the outcomeStrategy) is used. + + + + + + + + + + An enumeration that defines possible strategies for case outcome (approval) computation - currently both at the stage and campaign level. + (In the future, these uses might be split.) + + + + + + + If at least one reviewer approves, the result is "APPROVED" regardless of the other votes. + + + + + + + + + + If at least one reviewer denies (either via revoke or reduce), the result is "NOT APPROVED". + However, for the case to be approved, at least approval must be present. + + + + + + + + + + Approved if none of the reviewers denies (either via revoke or reduce). + So e.g. if nobody says anything, the case is approved. + + + + + + + + + + All reviewers must approve, i.e. no revoke, reduce, noResponse is acceptable. + + + + + + + + + + + + + TODO + + + + + + + + + + TODO + + + + + + + What (final) outcomes cause actual remediation (e.g. deletion of an assignment) if automated remediation is configured? + The default is "revoke". But more can be specified here, e.g. noResponse. + + + + + + + + + + + TODO + + + + 3.9 + + + + + + + How long after campaign is closed should automatic reiteration start? + The default is that reiteration starts only manually. + + + + + + + How many iterations are allowed for automatic start? After reaching the specified number of iterations + (irrespective of how they were started) automatic reiteration mechanism will be disabled for this + campaign. + + + + + + + How many iterations are allowed in total? After reaching the specified number of iterations + no new iterations can be opened. + + + + + + + + + + + An enumeration that defines possible styles for certification case remediation. + + + + + + + Resolution of revoked cases is fully automated. + + + + + + + + + + Non-conformant cases are only to be reported. + + + + + + + + + + + + + An enumeration that defines possible states of a certification campaign. + + + + + + + Campaign was created, but its first stage has not been started yet. + Current stage number is 0. + + + + + + + + + + Review is being carried out, in a given stage. + Current stage number is between 1 and N (number of stages). + + + + + + + + + + A given review stage was done. Next stage nor remediation (if any) has not started yet. + Current stage number indicates the number of stage that has been recently done. + + + + + + + + + + The last stage was closed, remediation (either automated or manual) is in progress. + + + + + + + + + + Review and possibly remediation is over. The campaign is closed. + + + + + + + + + + + + + + + Statistics give a set of access certification cases. + + + + + tns:markedAsDelegate + 4.0 + removed + + + + + + + + + + + + + + + + + + + + TODO + + + + + + + + + + + + + Configuration for access certification. + + + + + + + + + + What response types are available to reviewers? Empty list means all responses. + TODO should we configure also names of the responses? (probably no) + + + AccessCertificationConfigurationType.availableResponse + + + + + + + Instructions how to format reviewers comments before storing them into metadata. + EXPERIMENTAL + + + true + 3.7.1 + AccessCertificationConfigurationType.reviewerCommentsFormatting + + + + + + + + diff --git a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd index ea78952ee2a..34cfc42d56b 100755 --- a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd @@ -12867,6 +12867,9 @@ It does not provide any further details. More details can be found in the "synchronizationSituationDescription" property. + + ShadowType.synchronizationTimestamp + @@ -25616,6 +25619,18 @@ + + + + Paging for query. + + + true + 4.4 + ObjectCollectionReportEngineConfigurationType.paging + + + diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/DashboardServiceImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/DashboardServiceImpl.java index de0786664de..270d5333a3b 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/DashboardServiceImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/DashboardServiceImpl.java @@ -490,47 +490,6 @@ private void evaluateVariation(DashboardWidgetType widget, VariablesMap variable } } -// @Override -// public void searchObjectFromCollection(CollectionRefSpecificationType collectionConfig, AuditResultHandler handler, -// ObjectPaging paging, Task task, OperationResult result, boolean recordProgress) -// throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { -// -// if (collectionConfig.getCollectionRef() != null && collectionConfig.getFilter() != null) { -// LOGGER.error("CollectionRefSpecificationType contains CollectionRef and Filter, please define only one"); -// throw new IllegalArgumentException("CollectionRefSpecificationType contains CollectionRef and Filter, please define only one"); -// } -// CompiledObjectCollectionView compiledCollection = modelInteractionService.compileObjectCollectionView( -// collectionConfig, AuditEventRecordType.class, task, task.getResult()); -// -// VariablesMap variables = new VariablesMap(); -// ObjectFilter filter = ExpressionUtil.evaluateFilterExpressions(compiledCollection.getFilter(), variables, MiscSchemaUtil.getExpressionProfile(), -// expressionFactory, prismContext, "collection filter", task, result); -// if (filter == null) { -// LOGGER.error("Couldn't find filter"); -// throw new ConfigurationException("Couldn't find filter"); -// } -// -// ObjectQuery query = prismContext.queryFactory().createQuery(); -// query.setFilter(filter); -// query.setPaging(paging); -// ObjectCollectionType collection = null; -// if (collectionConfig.getCollectionRef() != null) { -// ObjectReferenceType ref = collectionConfig.getCollectionRef(); -// Class refType = prismContext.getSchemaRegistry().determineClassForType(ref.getType()); -// collection = (ObjectCollectionType) modelService -// .getObject(refType, ref.getOid(), null, task, result).asObjectable(); -// } -// @NotNull Collection> options = combineAuditOption(collectionConfig, collection, task, result); -// if (recordProgress) { -// long count = auditService.countObjects(query, options, result); -// task.setExpectedTotal(count); -// } -// @NotNull SearchResultList auditRecords = auditService.searchObjects(query, options, result); -// auditRecords.forEach(audit -> { -// handler.handle(audit); -// }); -// } - @Override public ObjectCollectionType getObjectCollectionType(DashboardWidgetType widget, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java index e44ff85d73b..e21555e87fe 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java @@ -1989,23 +1989,33 @@ public void searchObjectFromCollection(CollectionRefSpecificationType collection long count; if (AuditEventRecordType.class.equals(type)) { count = auditService.countObjects(query, options, result); + } else if (Containerable.class.isAssignableFrom(type)) { + count = modelService.countContainers(type, query, options, task, result); } else { count = modelService.countObjects((Class) type, query, options, task, result); } + task.setExpectedTotal(count); } if (AuditEventRecordType.class.equals(type)) { @NotNull SearchResultList auditRecords = auditService.searchObjects(query, options, result); - for (AuditEventRecordType auditRecord : auditRecords){ - PrismContainerValue prismValue = auditRecord.asPrismContainerValue(); - prismValue.setPrismContext(prismContext); - PrismContainer container = prismValue.asSingleValuedContainer(AuditEventRecordType.COMPLEX_TYPE); - handler.test(container); - } + processContainerByHandler(auditRecords, handler); + } else if (Containerable.class.isAssignableFrom(type)) { + SearchResultList containers = modelService.searchContainers(type, query, options, task, result); + processContainerByHandler(containers, handler); } else { ResultHandler resultHandler = (value, operationResult) -> handler.test((PrismContainer)value); modelService.searchObjectsIterative((Class) type, query, resultHandler, options, task, result); } } + private void processContainerByHandler(SearchResultList containers, Predicate handler) throws SchemaException { + for (Containerable container : containers){ + PrismContainerValue prismValue = container.asPrismContainerValue(); + prismValue.setPrismContext(prismContext); + PrismContainer prismContainer = prismValue.asSingleValuedContainer(prismValue.getTypeName()); + handler.test(prismContainer); + } + } + } diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportServiceImpl.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportServiceImpl.java index b28c9c4e011..9f17ea1fab2 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportServiceImpl.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/ReportServiceImpl.java @@ -26,6 +26,8 @@ import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType; +import com.evolveum.prism.xml.ns._public.types_3.RawType; + import org.apache.commons.lang.StringUtils; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -483,13 +485,21 @@ public VariablesMap getParameters(Task task) { PrismContainerValue reportParamsValues = reportParams.getValue(); Collection> items = reportParamsValues.getItems(); for (Item item : items) { - PrismProperty pp = (PrismProperty) item; - String paramName = pp.getPath().lastName().getLocalPart(); + String paramName = item.getPath().lastName().getLocalPart(); Object value = null; - if (!pp.getRealValues().isEmpty()) { - value = pp.getRealValues().iterator().next(); + if (!item.getRealValues().isEmpty()) { + value = item.getRealValues().iterator().next(); + } + if (item.getRealValue() instanceof RawType){ + try { + ObjectReferenceType parsedRealValue = ((RawType) item.getRealValue()).getParsedRealValue(ObjectReferenceType.class); + variables.put(paramName, new TypedValue(parsedRealValue, ObjectReferenceType.class)); + } catch (SchemaException e) { + LOGGER.error("Couldn't parse ObjectReferenceType from raw type. " + item.getRealValue()); + } + } else { + variables.put(paramName, new TypedValue(value, item.getRealValue().getClass())); } - variables.put(paramName, new TypedValue(value, ((PrismProperty) item).getValueClass())); } } return variables; diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/CsvController.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/CsvController.java index c7a9f180301..a83c4846980 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/CsvController.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/CsvController.java @@ -6,16 +6,16 @@ */ package com.evolveum.midpoint.report.impl.controller.fileformat; -import com.evolveum.midpoint.audit.api.AuditResultHandler; import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView; import com.evolveum.midpoint.model.api.interaction.DashboardWidget; import com.evolveum.midpoint.model.common.util.DefaultColumnUtils; import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.path.ItemPath; +import com.evolveum.midpoint.prism.query.ObjectPaging; import com.evolveum.midpoint.prism.query.ObjectQuery; +import com.evolveum.midpoint.prism.query.PagingConvertor; import com.evolveum.midpoint.report.impl.ReportServiceImpl; import com.evolveum.midpoint.schema.GetOperationOptions; -import com.evolveum.midpoint.schema.ResultHandler; import com.evolveum.midpoint.schema.SearchResultList; import com.evolveum.midpoint.schema.SelectorOptions; import com.evolveum.midpoint.schema.expression.TypedValue; @@ -27,7 +27,6 @@ import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.util.logging.Trace; import com.evolveum.midpoint.util.logging.TraceManager; -import com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import com.evolveum.prism.xml.ns._public.types_3.ItemPathType; @@ -135,7 +134,8 @@ public byte[] processCollection(String nameOfReport, ObjectCollectionReportEngin CompiledObjectCollectionView compiledCollection = createCompiledView(collectionConfig, collection); return createTableBox(collectionRefSpecification, compiledCollection, - collectionConfig.getCondition(), collectionConfig.getSubreport(), task, result); + collectionConfig.getCondition(), collectionConfig.getSubreport(), + PagingConvertor.createObjectPaging(collectionConfig.getPaging(), getReportService().getPrismContext()), result, task); } private CompiledObjectCollectionView createCompiledView(ObjectCollectionReportEngineConfigurationType collectionConfig, boolean useDefaultView, Task task, OperationResult result) @@ -185,7 +185,7 @@ private CompiledObjectCollectionView createCompiledView(ObjectCollectionReportEn } private byte[] createTableBox(CollectionRefSpecificationType collection, CompiledObjectCollectionView compiledCollection, ExpressionType condition, - List subreports, Task task, OperationResult result) + List subreports, ObjectPaging paging, OperationResult result, Task task) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException { Class type = resolveType(collection, compiledCollection); @@ -235,7 +235,7 @@ private byte[] createTableBox(CollectionRefSpecificationType collection, Compile return true; }; searchObjectFromCollection(collection, compiledCollection.getContainerType(), handler, - options, null, task, result, true); + options, paging, task, result, true); CSVFormat csvFormat = createCsvFormat(); if (Boolean.TRUE.equals(isHeader())) { diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/FileFormatController.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/FileFormatController.java index 21843d4d2b7..2bb9c4224ea 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/FileFormatController.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/FileFormatController.java @@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableSet; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView; @@ -151,8 +152,20 @@ protected String getRealValueAsString(GuiObjectColumnType column, PrismContainer } if (expression != null) { Object value = evaluateExportExpression(expression, valueObject, task, result); - if (value instanceof List) { - return processListOfRealValues((List) value); + if (value instanceof Collection) { + if (DisplayValueType.NUMBER.equals(column.getDisplayValue())) { + return String.valueOf(((Collection) value).size()); + } + return processListOfRealValues((Collection) value); + } + if (DisplayValueType.NUMBER.equals(column.getDisplayValue())) { + if (value == null) { + return "0"; + } + if (value instanceof PrismValue && ((PrismValue)value).getRealValue() instanceof Collection){ + return String.valueOf(((Collection) ((PrismValue)value).getRealValue()).size()); + } + return "1"; } return processListOfRealValues(Collections.singletonList(value)); } @@ -249,12 +262,13 @@ private Object evaluateExportExpression(ExpressionType expression, Item valueObj private Object evaluateExportExpression(ExpressionType expression, Object valueObject, Task task, OperationResult result) { checkVariables(task); - if (!variables.containsKey(ExpressionConstants.VAR_OBJECT)) { - if (valueObject == null) { - variables.put(ExpressionConstants.VAR_OBJECT, null, Object.class); - } else { - variables.put(ExpressionConstants.VAR_OBJECT, valueObject, valueObject.getClass()); - } + if (variables.containsKey(ExpressionConstants.VAR_OBJECT)) { + variables.remove(ExpressionConstants.VAR_OBJECT); + } + if (valueObject == null) { + variables.put(ExpressionConstants.VAR_OBJECT, null, Object.class); + } else { + variables.put(ExpressionConstants.VAR_OBJECT, valueObject, valueObject.getClass()); } Object values = null; try { @@ -311,12 +325,16 @@ protected String getColumnLabel(GuiObjectColumnType column, PrismContainerDefini } else { String name = column.getName(); + String displayName = null; if (path != null) { ItemDefinition def = objectDefinition.findItemDefinition(path); if (def == null) { throw new IllegalArgumentException("Could'n find item for path " + path); } - String displayName = def.getDisplayName(); + displayName = def.getDisplayName(); + + } + if (StringUtils.isNotEmpty(displayName)) { label = getMessage(displayName); } else { label = name; @@ -445,15 +463,18 @@ protected void evaluateSubreportParameters(List subrepor } protected void cleanUpVariables() { - variables.clear(); - variables = null; + if (variables != null) { + variables.clear(); + variables = null; + } } protected void initializationParameters(List parametersType, Task task) { VariablesMap variables = getReportService().getParameters(task); for (SearchFilterParameterType parameter : parametersType) { if (!variables.containsKey(parameter.getName())) { - variables.put(parameter.getName(), null, String.class); + Class clazz = getReportService().getPrismContext().getSchemaRegistry().determineClassForType(parameter.getType()); + variables.put(parameter.getName(), null, clazz); } } parameters = variables; diff --git a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/HtmlController.java b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/HtmlController.java index 073e6375a70..e412547e27a 100644 --- a/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/HtmlController.java +++ b/model/report-impl/src/main/java/com/evolveum/midpoint/report/impl/controller/fileformat/HtmlController.java @@ -12,17 +12,19 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Consumer; import java.util.function.Predicate; import javax.xml.namespace.QName; import com.evolveum.midpoint.prism.Containerable; import com.evolveum.midpoint.prism.PrismContainer; import com.evolveum.midpoint.prism.PrismContainerDefinition; -import com.evolveum.midpoint.report.api.ReportConstants; +import com.evolveum.midpoint.prism.query.ObjectPaging; +import com.evolveum.midpoint.prism.query.PagingConvertor; import com.evolveum.midpoint.schema.expression.VariablesMap; import com.evolveum.midpoint.task.api.RunningTask; +import com.evolveum.prism.xml.ns._public.query_3.PagingType; + import j2html.TagCreator; import j2html.tags.ContainerTag; import org.apache.commons.io.IOUtils; @@ -140,7 +142,7 @@ public byte[] processDashboard(DashboardReportEngineConfigurationType dashboardC // break; case OBJECT_COLLECTION: tableBox = createTableBox(widgetData.getLabel(), collectionRefSpecification, compiledCollection, - null, Collections.emptyList(), task, result, false); + null, Collections.emptyList(), null, result, false, task); break; } if (tableBox != null) { @@ -226,7 +228,8 @@ public byte[] processCollection(String nameOfReport, ObjectCollectionReportEngin } ContainerTag tableBox = createTableBox(label, collectionRefSpecification, compiledCollection, - collectionConfig.getCondition(), collectionConfig.getSubreport(), task, result, true); + collectionConfig.getCondition(), collectionConfig.getSubreport(), + PagingConvertor.createObjectPaging(collectionConfig.getPaging(), getReportService().getPrismContext()), result, true, task); body.append(tableBox.render()); @@ -258,7 +261,7 @@ private ContainerTag createTableBox(ContainerTag table, String nameOfTable, int } private ContainerTag createTableBox(String tableLabel, CollectionRefSpecificationType collection, @NotNull CompiledObjectCollectionView compiledCollection, - ExpressionType condition, List subreports, Task task, OperationResult result, boolean recordProgress) throws ObjectNotFoundException, SchemaException, CommunicationException, + ExpressionType condition, List subreports, ObjectPaging paging, OperationResult result, boolean recordProgress, Task task) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { long startMillis = getReportService().getClock().currentTimeMillis(); Class type = resolveType(collection, compiledCollection); @@ -326,7 +329,7 @@ private ContainerTag createTableBox(String tableLabel, CollectionRefSpecificatio return true; }; searchObjectFromCollection(collection, compiledCollection.getContainerType(), handler, options, - null, task, result, recordProgress); + paging, task, result, recordProgress); if (tBody.getNumChildren() == 0 && !recordProgress) { return null; }