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 Aug 14, 2022
2 parents a7801cf + 187bdb4 commit d3fa2c0
Show file tree
Hide file tree
Showing 90 changed files with 2,045 additions and 936 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ CREATE TABLE m_resource (
name_norm VARCHAR(255),
name_orig VARCHAR(255),
o16_lastAvailabilityStatus INTEGER,
template BOOLEAN,
oid VARCHAR(36) NOT NULL,
PRIMARY KEY (oid)
);
Expand Down Expand Up @@ -1207,6 +1208,6 @@ ALTER TABLE m_value_policy
ALTER TABLE m_message_template
ADD CONSTRAINT fk_message_template FOREIGN KEY (oid) REFERENCES m_object;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.5');
INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.6');

COMMIT;
16 changes: 0 additions & 16 deletions config/sql/generic-old/h2-upgrade-4.4-4.5.sql

This file was deleted.

5 changes: 5 additions & 0 deletions config/sql/generic-old/h2-upgrade-4.5-4.6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- resource templates/inheritance
ALTER TABLE m_resource ADD template BOOLEAN;

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.6' WHERE name = 'databaseSchemaVersion';
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ CREATE TABLE m_resource (
name_norm VARCHAR2(255 CHAR),
name_orig VARCHAR2(255 CHAR),
o16_lastAvailabilityStatus NUMBER(10, 0),
template NUMBER(1, 0),
oid VARCHAR2(36 CHAR) NOT NULL,
PRIMARY KEY (oid)
) INITRANS 30;
Expand Down Expand Up @@ -1236,7 +1237,7 @@ CREATE INDEX iTaskDependentOid ON M_TASK_DEPENDENT(TASK_OID) INITRANS 30;
CREATE UNIQUE INDEX uc_connector_type_version_host
ON m_connector (connectorType, connectorVersion, nvl(connectorHostRef_targetOid,0));

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.5');
INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.6');

--
-- A hint submitted by a user: Oracle DB MUST be created as "shared" and the
Expand Down
17 changes: 0 additions & 17 deletions config/sql/generic-old/oracle-upgrade-4.4-4.5.sql

This file was deleted.

6 changes: 6 additions & 0 deletions config/sql/generic-old/oracle-upgrade-4.5-4.6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- resource templates/inheritance
ALTER TABLE m_resource ADD template NUMBER(1, 0);

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.6' WHERE name = 'databaseSchemaVersion';
COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ CREATE TABLE m_resource (
name_norm VARCHAR(255),
name_orig VARCHAR(255),
o16_lastAvailabilityStatus INT4,
template BOOLEAN,
oid VARCHAR(36) NOT NULL,
PRIMARY KEY (oid)
);
Expand Down Expand Up @@ -1226,7 +1227,7 @@ CREATE INDEX iOrgOrgTypeOid ON M_ORG_ORG_TYPE(ORG_OID);
CREATE INDEX iServiceTypeOid ON M_SERVICE_TYPE(SERVICE_OID);
CREATE INDEX iTaskDependentOid ON M_TASK_DEPENDENT(TASK_OID);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.5');
INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.6');

-- Thanks to Patrick Lightbody for submitting this...
--
Expand Down
17 changes: 0 additions & 17 deletions config/sql/generic-old/postgresql-upgrade-4.4-4.5.sql

This file was deleted.

6 changes: 6 additions & 0 deletions config/sql/generic-old/postgresql-upgrade-4.5-4.6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- resource templates/inheritance
ALTER TABLE m_resource ADD template BOOLEAN;

-- WRITE CHANGES ABOVE ^^
UPDATE m_global_metadata SET value = '4.6' WHERE name = 'databaseSchemaVersion';
COMMIT;
3 changes: 2 additions & 1 deletion config/sql/generic-old/sqlserver-4.5-all.sql
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ CREATE TABLE m_resource (
name_norm NVARCHAR(255) COLLATE database_default,
name_orig NVARCHAR(255) COLLATE database_default,
o16_lastAvailabilityStatus INT,
template BIT,
oid NVARCHAR(36) COLLATE database_default NOT NULL,
PRIMARY KEY (oid)
);
Expand Down Expand Up @@ -1236,7 +1237,7 @@ CREATE UNIQUE INDEX uc_connector_type_version_host


BEGIN TRANSACTION
INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.5');
INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '4.6');
COMMIT;

--# thanks to George Papastamatopoulos for submitting this ... and Marko Lahma for
Expand Down
21 changes: 0 additions & 21 deletions config/sql/generic-old/sqlserver-upgrade-4.4-4.5.sql

This file was deleted.

10 changes: 10 additions & 0 deletions config/sql/generic-old/sqlserver-upgrade-4.5-4.6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Never mix DDL (CREATE/UPDATE/ALTER) with sp_rename and other functions, put GO in between + end.

-- resource templates/inheritance
ALTER TABLE m_resource ADD template BIT;

-- WRITE CHANGES ABOVE ^^
GO
UPDATE m_global_metadata SET value = '4.6' WHERE name = 'databaseSchemaVersion';

GO
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
import com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettings;
import com.evolveum.midpoint.model.api.*;
import com.evolveum.midpoint.model.api.authentication.CompiledGuiProfile;
import com.evolveum.midpoint.model.api.correlator.CorrelationService;
import com.evolveum.midpoint.model.api.correlation.CorrelationService;
import com.evolveum.midpoint.model.api.expr.MidpointFunctions;
import com.evolveum.midpoint.model.api.interaction.DashboardService;
import com.evolveum.midpoint.model.api.validator.ResourceValidator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.evolveum.midpoint.model.api.ModelInteractionService;
import com.evolveum.midpoint.model.api.ModelService;
import com.evolveum.midpoint.model.api.authentication.CompiledGuiProfile;
import com.evolveum.midpoint.model.api.correlator.CorrelationService;
import com.evolveum.midpoint.model.api.correlation.CorrelationService;
import com.evolveum.midpoint.model.api.interaction.DashboardService;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.PrismContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
import java.util.ArrayList;
import java.util.List;

import com.evolveum.midpoint.model.api.correlation.CorrelationCaseDescription;

import org.jetbrains.annotations.Nullable;

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.model.api.CorrelationProperty;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.cases.CorrelationCaseUtil;
Expand Down Expand Up @@ -60,7 +61,7 @@ class CorrelationContextDto implements Serializable {
*
* Correspond to rows in the correlation options table.
*/
private final List<CorrelationProperty> correlationProperties = new ArrayList<>();
private final List<CorrelationCaseDescription.CorrelationProperty> correlationProperties = new ArrayList<>();

CorrelationContextDto(CaseType aCase, PageBase pageBase, Task task, OperationResult result) throws CommonException {
load(aCase, pageBase, task, result);
Expand Down Expand Up @@ -128,7 +129,10 @@ private void createCorrelationPropertiesDefinitions(CaseType aCase, PageBase pag
throws CommonException {
correlationProperties.clear();
correlationProperties.addAll(
pageBase.getCorrelationService().getCorrelationProperties(aCase, task, result));
pageBase.getCorrelationService()
.describeCorrelationCase(aCase, null, task, result)
.getCorrelationProperties()
.values());
}

@Nullable CorrelationOptionDto getNewOwnerOption() {
Expand All @@ -147,7 +151,7 @@ public List<String> getOptionHeaders() {
return optionHeaders;
}

public List<CorrelationProperty> getCorrelationProperties() {
public List<CorrelationCaseDescription.CorrelationProperty> getCorrelationProperties() {
return correlationProperties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.model.api.CorrelationProperty;
import com.evolveum.midpoint.model.api.correlation.CorrelationCaseDescription;
import com.evolveum.midpoint.model.api.correlation.CorrelationCaseDescription.CorrelationProperty;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.schema.util.WorkItemId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import java.util.Set;
import java.util.stream.Collectors;

import com.evolveum.midpoint.model.api.correlation.CorrelationCaseDescription;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.model.api.CorrelationProperty;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismValue;
import com.evolveum.midpoint.prism.path.ItemPath;
Expand Down Expand Up @@ -69,16 +70,16 @@ public class CorrelationOptionDto implements Serializable {
/**
* Returns all real values matching given item path. The path should not contain container IDs.
*/
public CorrelationPropertyValues getPropertyValues(CorrelationProperty correlationProperty) {
CorrelationPropertyValues getPropertyValues(CorrelationCaseDescription.CorrelationProperty correlationProperty) {
try {
if (newOwner) {
return new CorrelationPropertyValues(
correlationProperty.getSourceRealStringValues(),
getValuesForPath(correlationProperty.getItemPath()),
Set.of());
} else {
return new CorrelationPropertyValues(
getValuesForPath(correlationProperty.getPrimaryTargetPath()),
getValuesForPath(correlationProperty.getSecondaryTargetPath()));
getValuesForPath(correlationProperty.getItemPath()),
getValuesForPath(correlationProperty.getSecondaryPath()));
}
} catch (Exception e) {
return new CorrelationPropertyValues(Set.of(e.getMessage()), Set.of());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public String getStepId() {

@Override
public IModel<String> getTitle() {
return () -> getString("PersonOfInterestPanel.title");
return createStringResource("PersonOfInterestPanel.title");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private String getDefaultRelationIcon(QName name) {
}

private Tile<QName> createTileForRelation(QName name) {
List<RelationDefinitionType> relations = getRelationConfiguration();
List<RelationDefinitionType> relations = getSystemRelations();

String icon = getDefaultRelationIcon(name);
String label = name.getLocalPart();
Expand Down Expand Up @@ -242,7 +242,7 @@ private void submitData() {
getModelObject().setRelation(selected.getValue());
}

private List<RelationDefinitionType> getRelationConfiguration() {
private List<RelationDefinitionType> getSystemRelations() {
SystemConfigurationType sys = MidPointApplication.get().getSystemConfigurationIfAvailable();
if (sys == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,15 +681,15 @@ public List<QName> getAvailableRelations(PageBase page) {
RelationSelectionType config = getRelationConfiguration(page);
relations = relations.stream()
// filter out non default relations if configuration doesn't allow other relations
.filter(q -> !(config != null && BooleanUtils.isFalse(config.isAllowOtherRelations()) && q.equals(defaultRelation)))
.filter(q -> BooleanUtils.isNotFalse(config.isAllowOtherRelations()) || defaultRelation == null || q.equals(defaultRelation))
.collect(Collectors.toList());

return relations;
}

private RelationSelectionType getRelationConfiguration(Page page) {
AccessRequestType config = getAccessRequestConfiguration(page);
return config != null ? config.getRelationSelection() : null;
return config != null ? config.getRelationSelection() : new RelationSelectionType();
}

public AccessRequestType getAccessRequestConfiguration(Page page) {
Expand Down

0 comments on commit d3fa2c0

Please sign in to comment.