Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 6, 2021
2 parents e8cc0dc + af8b688 commit 626e0e3
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 53 deletions.
1 change: 1 addition & 0 deletions config/sql/native-new/postgres-new-audit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ DECLARE
dateTo TIMESTAMPTZ;
tableSuffix TEXT;
BEGIN
-- noinspection SqlUnused
FOR i IN 1..futureCount loop
dateTo := dateFrom + interval '1 month';
tableSuffix := to_char(dateFrom, 'YYYYMM');
Expand Down
9 changes: 0 additions & 9 deletions config/sql/native-new/postgres-new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,11 @@ CREATE TABLE m_shadow (
intent TEXT,
tag TEXT,
kind ShadowKindType,
attemptNumber INTEGER, -- TODO how is this mapped?
dead BOOLEAN,
exist BOOLEAN,
fullSynchronizationTimestamp TIMESTAMPTZ,
pendingOperationCount INTEGER NOT NULL,
primaryIdentifierValue TEXT,
-- status INTEGER, TODO how is this mapped? See RUtil.copyResultFromJAXB called from RTask and OperationResultMapper
synchronizationSituation SynchronizationSituationType,
synchronizationTimestamp TIMESTAMPTZ,
attributes JSONB
Expand Down Expand Up @@ -1575,10 +1573,6 @@ CREATE INDEX m_form_policySituation_idx ON m_form USING gin(policysituations gin
-- region Assignment/Inducement table
-- Represents AssignmentType, see https://wiki.evolveum.com/display/midPoint/Assignment
-- and also https://wiki.evolveum.com/display/midPoint/Assignment+vs+Inducement
-- TODO: partitioning, probably not by object type, it's not even... hash-something?
-- select assignmentowner, count(*) From m_assignment group by assignmentowner;
--1 45 (inducements)
--0 48756229
CREATE TABLE m_assignment (
ownerOid UUID NOT NULL REFERENCES m_object_oid(oid) ON DELETE CASCADE,
-- this is different from other containers, this is not generated, app must provide it
Expand All @@ -1595,9 +1589,6 @@ CREATE TABLE m_assignment (
tenantRefTargetOid UUID,
tenantRefTargetType ObjectType,
tenantRefRelationId INTEGER REFERENCES m_uri(id),
-- TODO what is this? see RAssignment.getExtension (both extId/Oid)
extId INTEGER,
extOid TEXT, -- is this UUID too?
policySituations INTEGER[], -- soft-references m_uri, add index per table
subtypes TEXT[], -- only EQ filter
ext JSONB,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ public boolean isVisible() {
@Override
protected void populateItem(final ListItem<OpResult> item) {
Panel subresult = new OperationResultPanel("subresult", item.getModel());
subresult.add(new VisibleBehaviour(() -> item.getModel() != null && item.getModelObject() != null));
subresult.setOutputMarkupId(true);
item.add(subresult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import com.evolveum.midpoint.web.component.form.DropDownFormGroup;
import com.evolveum.midpoint.web.component.input.ListMultipleChoicePanel;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.model.IModel;
Expand All @@ -43,8 +45,10 @@ public OperationResultPopupPanel(String id, IModel<OperationResult> model){
protected void onInitialize(){
super.onInitialize();

IModel<OpResult> opResultModel = createResultModel();
OperationResultPanel operationResultPanel = new OperationResultPanel(ID_OPERATION_RESULTS_PANEL,
createResultModel());
opResultModel);
operationResultPanel.add(new VisibleBehaviour(() -> opResultModel.getObject() != null));
operationResultPanel.setOutputMarkupId(true);
add(operationResultPanel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,12 @@ protected void postProcessResult(OperationResult result, Collection<ObjectDeltaO
super.postProcessResult(result, executedDeltas, target);
}

@Override
public void refresh(AjaxRequestTarget target, boolean soft) {
if (isEditObject()) {
((TaskSummaryPanel) getSummaryPanel()).getTaskInfoModel().reset();
}
super.refresh(target, soft) ;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.gui.api.component.result.OperationResultPopupPanel;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
Expand Down Expand Up @@ -85,22 +87,26 @@ public void onClick(Optional<AjaxRequestTarget> optionalTarget) {
return;
}
AjaxRequestTarget target = optionalTarget.get();
PrismObjectWrapper<TaskType> taskWrapper = TaskResultPanel.this.getObjectWrapper();
TaskType taskType = taskWrapper.getObject().asObjectable();
OperationResult opResult = OperationResult.createOperationResult(taskType.getResult());
OperationResultPopupPanel body = new OperationResultPopupPanel(
getPageBase().getMainPopupBodyId(),
new Model<>(opResult));
new Model<>(getTaskOperationResult()));
body.setOutputMarkupId(true);
getPageBase().showMainPopup(body, target);
}

};
showResult.add(new VisibleBehaviour(() -> getTaskOperationResult() != null));
showResult.setOutputMarkupId(true);
add(showResult);

}

private OperationResult getTaskOperationResult() {
PrismObjectWrapper<TaskType> taskWrapper = TaskResultPanel.this.getObjectWrapper();
TaskType taskType = taskWrapper.getObject().asObjectable();
return OperationResult.createOperationResult(taskType.getResult());
}

private List<OperationResult> createOperationResultList() {
PrismObject<TaskType> taskPrism = getObjectWrapper().getObject();
if (taskPrism == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

package com.evolveum.midpoint.web.component.message;

import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.feedback.FeedbackMessage;
Expand Down Expand Up @@ -55,14 +57,7 @@ protected void onAfterRender() {
super.onAfterRender();
}
};
panel.add(new VisibleEnableBehaviour() {

private static final long serialVersionUID = 1L;

public boolean isVisible() {
return !opResult.isAlreadyShown();
}
});
panel.add(new VisibleBehaviour(() -> opResult != null && !opResult.isAlreadyShown()));

panel.setOutputMarkupId(true);
item.add(panel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Page;
import org.apache.wicket.markup.html.WebMarkupContainer;
Expand Down Expand Up @@ -146,6 +148,7 @@ protected void populateItem(ListItem<ConnectorStruct> item) {
public void initResultsPanel(RepeatingView resultView, List<OpResult> opresults, Page parentPage) {
for (OpResult result : opresults) {
OperationResultPanel resultPanel = new OperationResultPanel(resultView.newChildId(), new Model<>(result));
resultPanel.add(new VisibleBehaviour(() -> result != null));
resultPanel.setOutputMarkupId(true);
resultView.add(resultPanel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.evolveum.midpoint.web.component.util.SelectableListDataProvider;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.SelectableBeanImpl;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
import org.apache.wicket.Component;
Expand Down Expand Up @@ -82,9 +83,11 @@ public void onClick(Optional<AjaxRequestTarget> optionalTarget) {
PrismObjectWrapper<TaskType> taskWrapper = TaskResultTabPanel.this.getModelObject();
TaskType taskType = taskWrapper.getObject().asObjectable();
OperationResult opResult = OperationResult.createOperationResult(taskType.getResult());
OpResult result = opResult != null ? OpResult.getOpResult(getPageBase(), opResult) : null;
OperationResultPanel body = new OperationResultPanel(
getPageBase().getMainPopupBodyId(),
new Model<>(OpResult.getOpResult(getPageBase(), opResult)));
new Model<>(result));
body.add(new VisibleBehaviour(() -> opResult != null));
body.setOutputMarkupId(true);
getPageBase().showMainPopup(body, target);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.List;

import com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel;
import com.evolveum.midpoint.gui.api.model.NonEmptyModel;
import com.evolveum.midpoint.schema.util.task.ActivityItemProcessingStatisticsUtil;

import com.evolveum.midpoint.schema.util.task.LegacyTaskInformation;
Expand Down Expand Up @@ -45,7 +44,7 @@ public class TaskSummaryPanel extends ObjectSummaryPanel<TaskType> {
private static final Trace LOGGER = TraceManager.getTrace(TaskSummaryPanel.class);

/** Keeps the pre-processed task information. */
@NotNull private final NonEmptyModel<TaskInformation> taskInformationModel;
@NotNull private final NonEmptyLoadableModel<TaskInformation> taskInformationModel;

public TaskSummaryPanel(String id, IModel<TaskType> model, @NotNull IModel<TaskType> rootTaskModel, PageBase parentPage) {
super(id, TaskType.class, model, parentPage);
Expand All @@ -57,17 +56,15 @@ public TaskSummaryPanel(String id, IModel<TaskType> model, @NotNull IModel<TaskT
this.taskInformationModel = createFallbackTaskInformationModel(model);
}

private NonEmptyModel<TaskInformation> createTaskInformationModel(@NotNull IModel<TaskType> taskModel,
private NonEmptyLoadableModel<TaskInformation> createTaskInformationModel(@NotNull IModel<TaskType> taskModel,
@NotNull IModel<TaskType> rootTaskModel) {
return NonEmptyLoadableModel.create(
() -> TaskInformation.createForTask(taskModel.getObject(), rootTaskModel.getObject()),
false);
() -> TaskInformation.createForTask(taskModel.getObject(), rootTaskModel.getObject()), false);
}

private NonEmptyModel<TaskInformation> createFallbackTaskInformationModel(@NotNull IModel<TaskType> model) {
private NonEmptyLoadableModel<TaskInformation> createFallbackTaskInformationModel(@NotNull IModel<TaskType> model) {
return NonEmptyLoadableModel.create(
() -> LegacyTaskInformation.fromLegacyTaskOrNoTask(model.getObject()),
false);
() -> LegacyTaskInformation.fromLegacyTaskOrNoTask(model.getObject()), false);
}

@Override
Expand Down Expand Up @@ -280,4 +277,8 @@ private String getLiveSyncToken(TaskType taskType) {
Object token = taskInformationModel.getObject().getLiveSyncToken();
return token != null ? token.toString() : null;
}

public NonEmptyLoadableModel<TaskInformation> getTaskInfoModel(){
return taskInformationModel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private void showResult(OperationResult result) {
//HACK TODO clenup and think about generic mechanism for this
CompiledObjectCollectionView objectCollectionView = getObjectCollectionView();
if (!isViewForObjectCollectionType(objectCollectionView, "00000000-0000-0000-0002-000000000007", ObjectCollectionType.COMPLEX_TYPE)) {
super.getNewObjectInfluencesList();
return super.getNewObjectInfluencesList();
}

List<CompiledObjectCollectionView> compiledObjectCollectionViews = getPageBase().getCompiledGuiProfile().findAllApplicableArchetypeViews(TaskType.COMPLEX_TYPE, OperationTypeType.ADD);
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
runs just under 900 tests, skips distribution and any common unit/IT tests (~1h50m):
mvn clean install -P extratest,-dist -Dsurefire.args="-Xmx8g" -Dfailsafe.args="-Xmx8g -Duser.language=en"
(Skipping of default tests is managed by "extratest" profile.)
WARNING!!! Overriding failsafe/surefire.args when using "sqale" profile (new repository)
effectively disables another improtant JVM argument for tests which must be added to mvn
command line explicitly: -Dtest.config.file=test-config-new-repo.xml
Extra test run for a single module, -D property matches the module in -pl:
mvn clean install -DskipConnTests=false -pl testing/conntest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class MAssignment extends MContainer {
public UUID tenantRefTargetOid;
public MObjectType tenantRefTargetType;
public Integer tenantRefRelationId;
public Integer extId;
public String extOid;
public Integer[] policySituations;
public String[] subtypes;
public Jsonb ext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ public class QAssignment<OR extends MObject> extends QContainer<MAssignment, OR>
ColumnMetadata.named("tenantRefTargetType").ofType(Types.OTHER);
public static final ColumnMetadata TENANT_REF_RELATION_ID =
ColumnMetadata.named("tenantRefRelationId").ofType(Types.INTEGER);
public static final ColumnMetadata EXT_ID =
ColumnMetadata.named("extId").ofType(Types.INTEGER);
// TODO UUID or not? our control or outside?
public static final ColumnMetadata EXT_OID =
ColumnMetadata.named("extOid").ofType(Types.VARCHAR);
public static final ColumnMetadata POLICY_SITUATIONS =
ColumnMetadata.named("policySituations").ofType(Types.ARRAY);
public static final ColumnMetadata SUBTYPES =
Expand Down Expand Up @@ -146,8 +141,6 @@ public class QAssignment<OR extends MObject> extends QContainer<MAssignment, OR>
createEnum("tenantRefTargetType", MObjectType.class, TENANT_REF_TARGET_TYPE);
public final NumberPath<Integer> tenantRefRelationId =
createInteger("tenantRefRelationId", TENANT_REF_RELATION_ID);
public final NumberPath<Integer> extId = createInteger("extId", EXT_ID);
public final StringPath extOid = createString("extOid", EXT_OID);
public final ArrayPath<Integer[], Integer> policySituations =
createArray("policySituations", Integer[].class, POLICY_SITUATIONS);
public final ArrayPath<String[], String> subtypes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ private QAssignmentMapping(
addItemMapping(F_POLICY_SITUATION, multiUriMapper(q -> q.policySituations));
addItemMapping(F_SUBTYPE, multiStringMapper(q -> q.subtypes));

// TODO no idea how extId/Oid works, see RAssignment.getExtension
addExtensionMapping(F_EXTENSION, MExtItemHolderType.EXTENSION, q -> q.ext);
addNestedMapping(F_CONSTRUCTION, ConstructionType.class)
.addRefMapping(ConstructionType.F_RESOURCE_REF,
Expand Down Expand Up @@ -198,8 +197,6 @@ public AssignmentType toSchemaObject(MAssignment row) {
.tenantRef(objectReference(row.tenantRefTargetOid,
row.tenantRefTargetType, row.tenantRefRelationId));

// TODO extId/extOid - if meaningful for new repo

// TODO ext... wouldn't serialized fullObject part of the assignment be better after all?

if (row.policySituations != null) {
Expand Down Expand Up @@ -291,9 +288,6 @@ public MAssignment insert(AssignmentType assignment, OR ownerRow, JdbcSession jd
t -> row.tenantRefTargetType = t,
r -> row.tenantRefRelationId = r);

// TODO no idea how to do this yet, somehow related to RAssignment.extension
// row.extId = assignment.getExtension()...id?;
// row.extOid =;
row.policySituations = processCacheableUris(assignment.getPolicySituation());
row.subtypes = stringsToArray(assignment.getSubtype());
row.ext = processExtensions(assignment.getExtension(), MExtItemHolderType.EXTENSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class MShadow extends MObject {
public String intent;
public String tag;
public ShadowKindType kind;
public Integer attemptNumber;
public Boolean dead;
public Boolean exist;
public Instant fullSynchronizationTimestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public class QShadow extends QObject<MShadow> {
ColumnMetadata.named("tag").ofType(Types.VARCHAR);
public static final ColumnMetadata KIND =
ColumnMetadata.named("kind").ofType(Types.OTHER);
public static final ColumnMetadata ATTEMPT_NUMBER =
ColumnMetadata.named("attemptNumber").ofType(Types.INTEGER);
public static final ColumnMetadata DEAD = ColumnMetadata.named("dead").ofType(Types.BOOLEAN);
public static final ColumnMetadata EXIST = ColumnMetadata.named("exist").ofType(Types.BOOLEAN);
public static final ColumnMetadata FULL_SYNCHRONIZATION_TIMESTAMP =
Expand Down Expand Up @@ -76,7 +74,6 @@ public class QShadow extends QObject<MShadow> {
public final StringPath intent = createString("intent", INTENT);
public final StringPath tag = createString("tag", TAG);
public final EnumPath<ShadowKindType> kind = createEnum("kind", ShadowKindType.class, KIND);
public final NumberPath<Integer> attemptNumber = createInteger("attemptNumber", ATTEMPT_NUMBER);
public final BooleanPath dead = createBoolean("dead", DEAD);
public final BooleanPath exist = createBoolean("exist", EXIST);
public final DateTimePath<Instant> fullSynchronizationTimestamp =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ private QShadowMapping(@NotNull SqaleRepoContext repositoryContext) {
addItemMapping(F_INTENT, stringMapper(q -> q.intent));
addItemMapping(F_TAG, stringMapper(q -> q.tag));
addItemMapping(F_KIND, enumMapper(q -> q.kind));
// TODO attemptNumber?
addItemMapping(F_DEAD, booleanMapper(q -> q.dead));
addItemMapping(F_EXISTS, booleanMapper(q -> q.exist));
addItemMapping(F_FULL_SYNCHRONIZATION_TIMESTAMP,
Expand Down Expand Up @@ -122,7 +121,6 @@ public MShadow newRowObject() {
row.intent = shadow.getIntent();
row.tag = shadow.getTag();
row.kind = shadow.getKind();
// row.attemptNumber = shadow.att; TODO not set in RShadow, probably just with deltas? Where does it come from?
row.dead = shadow.isDead();
row.exist = shadow.isExists();
row.fullSynchronizationTimestamp =
Expand Down

0 comments on commit 626e0e3

Please sign in to comment.