Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Oct 5, 2021
2 parents 64fe6d1 + e48df82 commit 00ba8a9
Show file tree
Hide file tree
Showing 133 changed files with 1,152 additions and 1,988 deletions.
12 changes: 7 additions & 5 deletions config/sql/native-new/postgres-new-audit.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-- Copyright (C) 2010-2021 Evolveum and contributors
--
-- This work is dual-licensed under the Apache License 2.0
-- and European Union Public License. See LICENSE file for details.
--
/*
* Copyright (C) 2010-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

-- USAGE NOTES: You can apply this to the main repository schema.
-- For separate audit use this in a separate database.
--
Expand Down
6 changes: 1 addition & 5 deletions config/sql/native-new/postgres-new-quartz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
-- Copyright (C) 2010-2021 Evolveum and contributors
--
-- This work is dual-licensed under the Apache License 2.0
-- and European Union Public License. See LICENSE file for details.
--

-- Thanks to Patrick Lightbody for submitting this.

drop table if exists qrtz_fired_triggers;
Expand Down
4 changes: 0 additions & 4 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
* and European Union Public License. See LICENSE file for details.
*/

--
-- This work is dual-licensed under the Apache License 2.0
-- and European Union Public License. See LICENSE file for details.
--
-- @formatter:off because of terribly unreliable IDEA reformat for SQL

125 changes: 67 additions & 58 deletions config/sql/native-new/postgres-new.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,31 @@ protected void initLayout() {
ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<>(
ResourceDetailsTabPanel.this, createResourceConfigListModel());


List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = new ArrayList<>();
tableColumns.add(ColumnUtils.createPropertyColumn(
new ColumnTypeDto<>(
"ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart())));
tableColumns.add(new PropertyColumn<>(createStringResource("ShadowType.objectClass"),
"objectTypeDefinition.objectClass") {

@Override
public IModel<?> getDataModel(IModel<SelectableBeanImpl<ResourceType>> rowModel) {
IModel<QName> model = (IModel<QName>) super.getDataModel(rowModel);
if (model.getObject() != null) {
return () -> model.getObject().getLocalPart();
}
return model;
}
});


List<ColumnTypeDto<String>> columns = Arrays.asList(
new ColumnTypeDto<>("ShadowType.kind", "objectTypeDefinition.kind",
ShadowType.F_KIND.getLocalPart()),
new ColumnTypeDto<>("ShadowType.objectClass",
"objectTypeDefinition.objectClass.localPart",
ShadowType.F_OBJECT_CLASS.getLocalPart()),
new ColumnTypeDto<>("ShadowType.intent", "objectTypeDefinition.intent",
ShadowType.F_INTENT.getLocalPart()),
new ColumnTypeDto<>("ResourceType.isSync", "sync", null));

List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = ColumnUtils.createColumns(columns);
tableColumns.addAll(ColumnUtils.createColumns(columns));

PropertyColumn tasksColumn = new PropertyColumn(
PageBase.createStringResourceStatic(this, "ResourceType.tasks"), "definedTasks") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismObjectWrapper;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel;
import com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels;
import com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.statistics.*;
Expand Down Expand Up @@ -159,6 +158,7 @@ private String getStatistics() {
.append(EnvironmentalPerformanceInformation.format(statistics.getEnvironmentalPerformanceInformation()))
.append("\n");
}
sb.append(ActivityProgressAndStatisticsPrinter.print(task));
if (statistics.getCachingConfiguration() != null) {
sb.append(LINE);
sb.append("Caching configuration:\n\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,25 @@ public class ColumnUtils {
public static <T> List<IColumn<T, String>> createColumns(List<ColumnTypeDto<String>> columns) {
List<IColumn<T, String>> tableColumns = new ArrayList<>();
for (ColumnTypeDto<String> column : columns) {
PropertyColumn<T, String> tableColumn;
if (column.isSortable()) {
tableColumn = createPropertyColumn(column.getColumnName(), column.getSortableColumn(),
column.getColumnValue(), column.isMultivalue(), column.isTranslated());

} else {
if (column.isTranslated()) {
tableColumn = new PolyStringPropertyColumn<>(createStringResource(column.getColumnName()),
column.getColumnValue());
} else {
tableColumn = new PropertyColumn<>(createStringResource(column.getColumnName()),
column.getColumnValue());
}
}
tableColumns.add(tableColumn);

tableColumns.add(createPropertyColumn(column));
}
return tableColumns;
}

public static <T> PropertyColumn<T, String> createPropertyColumn(ColumnTypeDto<String> column) {
if (column.isSortable()) {
return createPropertyColumn(column.getColumnName(), column.getSortableColumn(),
column.getColumnValue(), column.isMultivalue(), column.isTranslated());
}
if (column.isTranslated()) {
return new PolyStringPropertyColumn<>(createStringResource(column.getColumnName()),
column.getColumnValue());
} else {
return new PropertyColumn<>(createStringResource(column.getColumnName()),
column.getColumnValue());
}
}

private static <T> PropertyColumn<T, String> createPropertyColumn(String name, String sortableProperty,
final String expression, final boolean multivalue, boolean translated) {
if (!multivalue && translated) {
Expand Down Expand Up @@ -141,7 +140,7 @@ public static <O extends ObjectType> List<IColumn<SelectableBean<O>, String>> ge
}
}

public static <O extends ObjectType> IColumn<SelectableBean<O>, String> createIconColumn(PageBase pageBase) {
public static <O extends ObjectType> IColumn<SelectableBean<O>, String> createIconColumn(PageBase pageBase) {

return new CompositedIconColumn<SelectableBean<O>>(createIconColumnHeaderModel()) {

Expand Down Expand Up @@ -388,8 +387,7 @@ public static <T extends ObjectType> List<IColumn<SelectableBean<T>, String>> ge

columns.addAll((Collection) getDefaultAbstractRoleColumns(false));


columns.add(new LinkColumn<>(createStringResource("ObjectType.parentOrgRef")){
columns.add(new LinkColumn<>(createStringResource("ObjectType.parentOrgRef")) {

@Override
public void populateItem(Item<ICellPopulator<SelectableBean<T>>> cellItem, String componentId, IModel<SelectableBean<T>> rowModel) {
Expand Down Expand Up @@ -430,7 +428,7 @@ public void onClick(IModel<SelectableBean<T>> rowModel) {
}
});

columns.add((IColumn)getAbstractRoleColumnForProjection());
columns.add((IColumn) getAbstractRoleColumnForProjection());
return columns;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ public String getNewValue() {

public List<SceneItemLineDto> computeLines() {
List<SceneItemLineDto> rv = new ArrayList<>();
int index = 0;
Collator collator = WebComponentUtil.getCollator();
if (!isDelta()) {
for (SceneItemValue itemValue : sceneItem.getNewValues()) {
rv.add(new SceneItemLineDto(this, null, itemValue, index++, false));
rv.add(new SceneItemLineDto(this, null, itemValue, false));
}
} else {
SceneDeltaItem deltaItem = (SceneDeltaItem) sceneItem;
for (SceneItemValue itemValue : deltaItem.getUnchangedValues()) {
rv.add(new SceneItemLineDto(this, null, itemValue, index++, false));
rv.add(new SceneItemLineDto(this, null, itemValue, false));
}
List<? extends SceneItemValue> deletedValues = deltaItem.getDeletedValues();
List<? extends SceneItemValue> addedValues = deltaItem.getAddedValues();
Expand All @@ -91,7 +90,7 @@ public List<SceneItemLineDto> computeLines() {
while (deletedValuesIter.hasNext() || addedValuesIter.hasNext()) {
SceneItemValue deletedValue = deletedValuesIter.hasNext() ? deletedValuesIter.next() : null;
SceneItemValue addedValue = addedValuesIter.hasNext() ? addedValuesIter.next() : null;
rv.add(new SceneItemLineDto(this, deletedValue, addedValue, index++, true));
rv.add(new SceneItemLineDto(this, deletedValue, addedValue, true));
}
}
Comparator<? super SceneItemLineDto> comparator =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public class SceneItemLineDto implements Serializable {
private final SceneItemDto sceneItemDto;
private final SceneItemValue sceneItemOldValue;
private final SceneItemValue sceneItemNewValue;
private final int index;
private final boolean isDelta;

public SceneItemLineDto(SceneItemDto sceneItemDto, SceneItemValue sceneItemOldValue, SceneItemValue sceneItemNewValue, int index, boolean isDelta) {
public SceneItemLineDto(SceneItemDto sceneItemDto, SceneItemValue sceneItemOldValue, SceneItemValue sceneItemNewValue, boolean isDelta) {
this.sceneItemDto = sceneItemDto;
this.sceneItemOldValue = sceneItemOldValue;
this.sceneItemNewValue = sceneItemNewValue;
this.index = index;
this.isDelta = isDelta;
}

Expand All @@ -52,7 +50,7 @@ public Integer getNumberOfLines() {
}

public boolean isFirst() {
return index == 0;
return sceneItemDto.getLines().indexOf(this) == 0;
}

public boolean isDelta() {
Expand Down Expand Up @@ -91,7 +89,6 @@ public boolean equals(Object o) {

SceneItemLineDto that = (SceneItemLineDto) o;

if (index != that.index) return false;
if (isDelta != that.isDelta) return false;
if (sceneItemOldValue != null ? !sceneItemOldValue.equals(that.sceneItemOldValue) : that.sceneItemOldValue != null)
return false;
Expand All @@ -104,7 +101,6 @@ public int hashCode() {
int result = 1;
result = 31 * result + (sceneItemOldValue != null ? sceneItemOldValue.hashCode() : 0);
result = 31 * result + (sceneItemNewValue != null ? sceneItemNewValue.hashCode() : 0);
result = 31 * result + index;
result = 31 * result + (isDelta ? 1 : 0);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,30 @@ protected void initLayout() {
ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<>(
ResourceDetailsTabPanel.this, new ListModel<>(resourceConfigList));

List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = new ArrayList<>();
tableColumns.add(ColumnUtils.createPropertyColumn(
new ColumnTypeDto<>(
"ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart())));
tableColumns.add(new PropertyColumn<>(createStringResource("ShadowType.objectClass"),
"objectTypeDefinition.objectClass") {

@Override
public IModel<?> getDataModel(IModel<SelectableBeanImpl<ResourceType>> rowModel) {
IModel<QName> model = (IModel<QName>) super.getDataModel(rowModel);
if (model.getObject() != null) {
return () -> model.getObject().getLocalPart();
}
return model;
}
});


List<ColumnTypeDto<String>> columns = Arrays.asList(
new ColumnTypeDto<>("ShadowType.kind", "objectTypeDefinition.kind",
ShadowType.F_KIND.getLocalPart()),
new ColumnTypeDto<>("ShadowType.objectClass",
"objectTypeDefinition.objectClass.localPart",
ShadowType.F_OBJECT_CLASS.getLocalPart()),
new ColumnTypeDto<>("ShadowType.intent", "objectTypeDefinition.intent",
ShadowType.F_INTENT.getLocalPart()),
new ColumnTypeDto<>("ResourceType.isSync", "sync", null));

List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = ColumnUtils.createColumns(columns);
tableColumns.addAll(ColumnUtils.createColumns(columns));

PropertyColumn tasksColumn = new PropertyColumn(
PageBase.createStringResourceStatic(this, "ResourceType.tasks"), "definedTasks") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
<attribute>
<c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:water</c:ref>
<limitations>
<ignore>true</ignore>
<processing>ignore</processing>
</limitations>
<outbound>
<expression>
Expand Down
2 changes: 1 addition & 1 deletion gui/admin-gui/src/test/resources/common/resource-dummy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<attribute>
<ref>ri:water</ref>
<limitations>
<ignore>true</ignore>
<processing>ignore</processing>
</limitations>
<outbound>
<!-- Make sure this mapping is really ignored -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,6 @@ public AttributeFetchStrategyType getPasswordFetchStrategy() {
return structuralObjectClassDefinition.getPasswordFetchStrategy();
}

@Override
@Deprecated // Remove in 4.4
public ObjectReferenceType getPasswordPolicy() {
return structuralObjectClassDefinition.getPasswordPolicy();
}

@Override
public ObjectReferenceType getSecurityPolicyRef() {
return structuralObjectClassDefinition.getSecurityPolicyRef();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,6 @@ public List<MappingType> getPasswordOutbound() {
return refinedObjectClassDefinition.getPasswordOutbound();
}

@Override
@Deprecated // Remove in 4.4
public ObjectReferenceType getPasswordPolicy() {
return refinedObjectClassDefinition.getPasswordPolicy();
}

@Override
public ObjectReferenceType getSecurityPolicyRef() {
return refinedObjectClassDefinition.getSecurityPolicyRef();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@ private static void applyLimitationsType(PropertyLimitations limitations, Proper
if (layerLimitationsType.getMaxOccurs() != null) {
limitations.setMaxOccurs(DefinitionUtil.parseMultiplicity(layerLimitationsType.getMaxOccurs()));
}
if (layerLimitationsType.isIgnore() != null) {
limitations.setProcessing(ItemProcessing.IGNORE);
}
if (layerLimitationsType.getProcessing() != null) {
limitations.setProcessing(MiscSchemaUtil.toItemProcessing(layerLimitationsType.getProcessing()));
}
Expand Down Expand Up @@ -552,9 +549,6 @@ static boolean isIgnored(ResourceAttributeDefinitionType attrDefType) throws Sch
if (limitationsType.getProcessing() != null) {
return limitationsType.getProcessing() == ItemProcessingType.IGNORE;
}
if (limitationsType.isIgnore() != null) {
return limitationsType.isIgnore();
}
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ default PrismObject<ShadowType> createBlankShadow(String tag) {

AttributeFetchStrategyType getPasswordFetchStrategy();

@Deprecated // Remove in 4.4
ObjectReferenceType getPasswordPolicy();

ObjectReferenceType getSecurityPolicyRef();

ResourceActivationDefinitionType getActivationSchemaHandling();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,6 @@ public ObjectReferenceType getSecurityPolicyRef() {
return schemaHandlingObjectTypeDefinitionType.getSecurityPolicyRef();
}

@Override
@Deprecated // Remove in 4.4
public ObjectReferenceType getPasswordPolicy() {
ResourcePasswordDefinitionType password = getPasswordDefinition();
if (password == null || password.getPasswordPolicyRef() == null) {
return null;
}
return password.getPasswordPolicyRef();
}

@Override
public ResourceActivationDefinitionType getActivationSchemaHandling() {
if (schemaHandlingObjectTypeDefinitionType == null) {
Expand Down

0 comments on commit 00ba8a9

Please sign in to comment.