Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Aug 12, 2022
2 parents bd33b2d + ab59eeb commit 187bdb4
Show file tree
Hide file tree
Showing 32 changed files with 344 additions and 194 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
5 changes: 5 additions & 0 deletions config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ CREATE INDEX m_focus_identity_itemsOriginal_idx ON m_focus_identity USING gin(it
CREATE INDEX m_focus_identity_itemsNormalized_idx ON m_focus_identity USING gin(itemsNormalized);
$aa$);

-- resource templates
call apply_change(10, $aa$
ALTER TABLE m_resource ADD template BOOLEAN;
$aa$);

-- SCHEMA-COMMIT 4.6: commit TODO

-- WRITE CHANGES ABOVE ^^
Expand Down
3 changes: 2 additions & 1 deletion config/sql/native-new/postgres-new.sql
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ CREATE TABLE m_resource (
operationalStateLastAvailabilityStatus AvailabilityStatusType,
connectorRefTargetOid UUID,
connectorRefTargetType ObjectType,
connectorRefRelationId INTEGER REFERENCES m_uri(id)
connectorRefRelationId INTEGER REFERENCES m_uri(id),
template BOOLEAN
)
INHERITS (m_assignment_holder);

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 187bdb4

Please sign in to comment.