Skip to content

Commit

Permalink
Merge branch 'feature/simulations' of github.com:Evolveum/midpoint in…
Browse files Browse the repository at this point in the history
…to feature/simulations
  • Loading branch information
1azyman committed Jan 18, 2023
2 parents 8c09c65 + 65be15c commit 76d4558
Show file tree
Hide file tree
Showing 30 changed files with 890 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
import com.evolveum.midpoint.web.page.admin.PageAdmin;
import com.evolveum.midpoint.web.page.error.PageError404;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SimulationMetricValueType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AggregatedSimulationMetricValueType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SimulationResultType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TagType;

import static com.evolveum.midpoint.schema.util.AbstractSimulationMetricReferenceTypeUtil.getDisplayableIdentifier;

/**
* Created by Viliam Repan (lazyman).
*/
Expand Down Expand Up @@ -119,10 +121,10 @@ private void initLayout() {
// todo implement
IModel<List<SmallBoxData>> data = () -> {

List<SimulationMetricValueType> metrics = model.getObject().getMetric();
List<AggregatedSimulationMetricValueType> metrics = model.getObject().getMetric();
return metrics.stream().map(m -> {
SmallBoxData sbd = new SmallBoxData();
sbd.setDescription(m.getIdentifier());
sbd.setDescription(getDisplayableIdentifier(m.getRef()));
sbd.setTitle("" + m.getValue());
sbd.setSmallBoxCssClass("bg-info");
sbd.setLinkText("More info");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

package com.evolveum.midpoint.schema;

import com.evolveum.midpoint.xml.ns._public.common.common_3.ConfigurationSpecificationType;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
Expand Down Expand Up @@ -64,4 +68,9 @@ public boolean isProductionConfiguration() {
public String toString() {
return name; // temporary
}

public @NotNull ConfigurationSpecificationType toConfigurationSpecification() {
return new ConfigurationSpecificationType()
.productionConfiguration(productionConfiguration);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,5 @@ public class ExpressionConstants {
public static final String VAR_SYNCHRONIZATION_CONTEXT = "synchronizationContext";
public static final String VAR_CORRELATION_CONTEXT = "correlationContext";
public static final String VAR_CORRELATOR_STATE = "correlatorState";
public static final String VAR_PROCESSED_OBJECT = "processedObject";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2010-2023 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.schema.util;

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

import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractSimulationMetricReferenceType;

import org.jetbrains.annotations.NotNull;

public class AbstractSimulationMetricReferenceTypeUtil {

// TEMPORARY CODE, just to make prototype GUI code compile
public static String getDisplayableIdentifier(AbstractSimulationMetricReferenceType reference) {
String identifier = reference.getIdentifier();
if (identifier != null) {
return identifier;
} else {
return getOid(reference.getEventTagRef());
}
}

public static boolean isMetricIdentifier(@NotNull AbstractSimulationMetricReferenceType ref, String identifier) {
return identifier != null && identifier.equals(ref.getIdentifier());
}

public static boolean isEventTag(@NotNull AbstractSimulationMetricReferenceType ref, String oid) {
return oid != null && oid.equals(getOid(ref.getEventTagRef()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (C) 2010-2023 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.schema.util;

public class AggregatedSimulationMetricValueTypeUtil {

// TODO
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2010-2023 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.schema.util;

import com.evolveum.midpoint.xml.ns._public.common.common_3.ConfigurationSpecificationType;

import org.jetbrains.annotations.Nullable;

public class ConfigurationSpecificationTypeUtil {

public static boolean isProductionConfiguration(@Nullable ConfigurationSpecificationType configuration) {
return configuration == null
|| !Boolean.FALSE.equals(configuration.isProductionConfiguration());
}
}

0 comments on commit 76d4558

Please sign in to comment.