Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/adminlte3-u…
Browse files Browse the repository at this point in the history
…pgrade
  • Loading branch information
1azyman committed Apr 26, 2022
2 parents d69e01e + 1213e3d commit 7cf70c6
Show file tree
Hide file tree
Showing 25 changed files with 408 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,10 @@ public static boolean isRecomputation(TaskType task) {
}

public static boolean isReport(TaskType task) {
return isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_TASK) || isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_EXPORT_CLASSIC_TASK) || isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_EXPORT_DISTRIBUTED_TASK);
return isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_TASK)
|| isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_EXPORT_CLASSIC_TASK)
|| isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_EXPORT_DISTRIBUTED_TASK)
|| isArchetypedTask(task, SystemObjectsType.ARCHETYPE_REPORT_IMPORT_CLASSIC_TASK);
}

public static boolean isImport(TaskType task) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

package com.evolveum.midpoint.gui.impl.page.admin.component;

import static com.evolveum.midpoint.prism.Referencable.getOid;

import static java.util.Collections.singletonList;

import java.io.InputStream;
Expand Down Expand Up @@ -70,6 +72,9 @@
import com.evolveum.midpoint.web.util.TaskOperationUtils;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class TaskOperationalButtonsPanel extends AssignmentHolderOperationalButtonsPanel<TaskType> {

private static final Trace LOGGER = TraceManager.getTrace(TaskOperationalButtonsPanel.class);
Expand Down Expand Up @@ -435,16 +440,34 @@ private ReportDataType getReportData() {

private String getReportDataOid() {
PrismObject<TaskType> task = getObjectType().asPrismObject();
PrismReference reportData = task.findReference(ItemPath.create(TaskType.F_EXTENSION, ReportConstants.REPORT_DATA_PROPERTY_NAME));
if (reportData == null || reportData.getRealValue() == null || reportData.getRealValue().getOid() == null) {
PrismProperty<String> reportOutputOid = task.findProperty(ItemPath.create(TaskType.F_EXTENSION, ReportConstants.REPORT_OUTPUT_OID_PROPERTY_NAME));
if (reportOutputOid == null) {
return null;
}
PrismReference reportData = task.findReference(
ItemPath.create(TaskType.F_EXTENSION, ReportConstants.REPORT_DATA_PROPERTY_NAME));
if (reportData != null && reportData.getRealValue() != null && reportData.getRealValue().getOid() != null) {
return reportData.getRealValue().getOid();
}
PrismProperty<String> reportOutputOid = task.findProperty(
ItemPath.create(TaskType.F_EXTENSION, ReportConstants.REPORT_OUTPUT_OID_PROPERTY_NAME));
if (reportOutputOid != null) {
return reportOutputOid.getRealValue();
}
return getReportDataOidFromImportActivity(task.asObjectable());
}

return reportData.getRealValue().getOid();
/** An approximate version for now: assumes that the report activity is the root one. */
private @Nullable String getReportDataOidFromImportActivity(@NotNull TaskType task) {
ActivityDefinitionType activity = task.getActivity();
if (activity == null) {
return null;
}
WorkDefinitionsType work = activity.getWork();
if (work == null) {
return null;
}
ClassicReportImportWorkDefinitionType reportImport = work.getReportImport();
if (reportImport == null) {
return null;
}
return getOid(reportImport.getReportDataRef());
}

private void createRefreshNowIconButton(RepeatingView repeatingView) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2015 Evolveum
~ Copyright (C) 2010-2022 Evolveum
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -41,11 +41,7 @@ <h3><div wicket:id="queryLabel"/></h3>
<h4>
<wicket:message key="PageRepositoryQuery.hibernateParameters"/>
</h4>
<p class="small" wicket:id="hibernateParametersNote"/>
<textarea wicket:id="parameters"></textarea>
<div class="form-group" style="margin-top: 15px">
<a class="btn btn-primary" wicket:id="executeHibernate"/>
</div>
</div>
</div>

Expand Down

0 comments on commit 7cf70c6

Please sign in to comment.