Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/search-refa…
Browse files Browse the repository at this point in the history
…ctoring

* origin/master: (131 commits)
  schema fixes around ArchetypeType.archetypeType (displayName, docs)
  SimulationResultManagerImpl: fixed NPE in update(value)
  AbstractLdapTest: fix of roundTsUp, code cleanup
  javadoc/comment/log fixes mentioning EvaluatedResourceObjectConstruction
  Replace searchShadowOwner with equivalent search
  added few comments related to model execute options - simulation
  code cleanup around AssignmentPathSegmentImpl and AssignmentCollector
  Added baseline of simulation result manager
  Updated Simulation Result mapping
  MID-8362 MID-8084 locale property added to MidPointPrincipal, now dashboards can be properly translated
  VirtualAssignmen(e)tSpecification class rename (typo correction)
  EvaluatedAssignment(Impl): cleanup, removed unused <> from EA interface
  MID-8283: add null as variable 'input' to objectCollectionView column expression when input is empty
  cleanup of groovy code in audit object collection
  MID-8295: fix for css style of user delegation panel
  MID-8293: fix of translation for header of virtual container
  MID-8294: fix for definition of background color for icon of dashboard widget
  MID-8334: fix for translation of serch property of extension item
  postgresql driver update to 42.3.8 (fixes PR#185)
  MID-8084 partial fix for dashboard widgets translation
  ...

# Conflicts:
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/ContainerableListPanel.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/component/search/SearchFactory.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/abstractrole/component/AbstractRoleMemberPanel.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/admin/resource/component/wizard/basic/ResourceTemplateProvider.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/impl/page/self/requestAccess/RoleCatalogPanel.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/configuration/PageRepositoryQuery.java
  • Loading branch information
katkav committed Dec 15, 2022
2 parents 2e26348 + cc62559 commit 3a10075
Show file tree
Hide file tree
Showing 600 changed files with 20,066 additions and 13,734 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ node_modules/

# IDEA files
/.idea/
/.run/
*.iml

# Eclipse files
Expand Down
15 changes: 9 additions & 6 deletions config/initial-objects/270-object-collection-audit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@
<expression>
<script>
<code>
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.report.impl.ReportUtils;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType;
import com.evolveum.midpoint.schema.DeltaConvertor
import com.evolveum.midpoint.report.impl.ReportUtils
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType

ret = new ArrayList();
def input = input as List&lt;ObjectDeltaOperationType&gt;

def ret = []
for (ObjectDeltaOperationType deltaType : input) {
delta = DeltaConvertor.createObjectDeltaOperation(deltaType, prismContext);
ret.add(ReportUtils.printDelta(delta));
delta = DeltaConvertor.createObjectDeltaOperation(deltaType, prismContext)
ret.add(ReportUtils.printDelta(delta))
}

return ret
</code>
</script>
Expand Down
4 changes: 4 additions & 0 deletions config/sql/native-new/postgres-new-upgrade-audit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ call apply_audit_change(2, $aa$
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'MESSAGE_TEMPLATE' AFTER 'LOOKUP_TABLE';
$aa$);

-- SCHEMA-COMMIT 4.6: commit 71f2df50

-- changes for 4.7

-- WRITE CHANGES ABOVE ^^
-- IMPORTANT: update apply_audit_change number at the end of postgres-new-audit.sql
-- to match the number used in the last change here!
104 changes: 103 additions & 1 deletion config/sql/native-new/postgres-new-upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,109 @@ call apply_change(11, $aa$
ALTER TABLE m_connector ADD available BOOLEAN;
$aa$);

-- SCHEMA-COMMIT 4.6: commit TODO
-- SCHEMA-COMMIT 4.5: commit c5f19c9e

-- No changes for audit schema in 4.6
-- SCHEMA-COMMIT 4.6: commit 71f2df50

-- changes for 4.7

-- Simulations
call apply_change(12, $aa$
ALTER TYPE ObjectType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT' AFTER 'SHADOW';
$aa);

call apply_change(13, $aa$
CREATE TABLE m_simulation_result (
oid UUID NOT NULL PRIMARY KEY REFERENCES m_object_oid(oid),
objectType ObjectType GENERATED ALWAYS AS ('SIMULATION_RESULT') STORED
CHECK (objectType = 'SIMULATION_RESULT'),
partitioned boolean
)
INHERITS (m_object);

CREATE TRIGGER m_simulation_result_oid_insert_tr BEFORE INSERT ON m_message_template
FOR EACH ROW EXECUTE FUNCTION insert_object_oid();
CREATE TRIGGER m_simulation_result_update_tr BEFORE UPDATE ON m_message_template
FOR EACH ROW EXECUTE FUNCTION before_update_object();
CREATE TRIGGER m_simulation_result_oid_delete_tr AFTER DELETE ON m_message_template
FOR EACH ROW EXECUTE FUNCTION delete_object_oid();

CREATE TYPE ObjectProcessingStateType AS ENUM ('UNMODIFIED', 'ADDED', 'MODIFIED', 'DELETED' );

ALTER TYPE ContainerType ADD VALUE IF NOT EXISTS 'SIMULATION_RESULT_PROCESSED_OBJECT' AFTER 'OPERATION_EXECUTION';

CREATE TABLE m_simulation_result_processed_object (
-- Default OID value is covered by INSERT triggers. No PK defined on abstract tables.
-- Owner does not have to be the direct parent of the container.
ownerOid UUID NOT NULL,
-- use like this on the concrete table:
-- ownerOid UUID NOT NULL REFERENCES m_object_oid(oid),

-- Container ID, unique in the scope of the whole object (owner).
-- While this provides it for sub-tables we will repeat this for clarity, it's part of PK.
cid BIGINT NOT NULL,
containerType ContainerType GENERATED ALWAYS AS ('SIMULATION_RESULT_PROCESSED_OBJECT') STORED
CHECK (containerType = 'SIMULATION_RESULT_PROCESSED_OBJECT'),
oid UUID NOT NULL,
objectType ObjectType,
nameOrig TEXT NOT NULL,
nameNorm TEXT NOT NULL,
state ObjectProcessingStateType,
metricIdentifiers TEXT[],
fullObject BYTEA,
objectBefore BYTEA,
objectAfter BYTEA,


PRIMARY KEY (ownerOid, cid)
) PARTITION BY LIST(ownerOid);

CREATE TABLE m_simulation_result_processed_object_default PARTITION OF m_simulation_result_processed_object DEFAULT;

CREATE OR REPLACE FUNCTION m_simulation_result_create_partition() RETURNS trigger AS
$BODY$
DECLARE
partition TEXT;
BEGIN
partition := 'm_simulation_result_processed_object_' || REPLACE(new.oid::text,'-','_');
IF new.partitioned AND NOT EXISTS(SELECT relname FROM pg_class WHERE relname=partition) THEN
RAISE NOTICE 'A partition has been created %',partition;
EXECUTE 'CREATE TABLE ' || partition || ' partition of ' || 'm_simulation_result_processed_object' || ' for values in (''' || new.oid|| ''');';
END IF;
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql;

CREATE TRIGGER m_simulation_result_create_partition AFTER INSERT ON m_simulation_result
FOR EACH ROW EXECUTE FUNCTION m_simulation_result_create_partition();



--- Trigger which deletes processed objects partition when whole simulation is deleted

CREATE OR REPLACE FUNCTION m_simulation_result_delete_partition() RETURNS trigger AS
$BODY$
DECLARE
partition TEXT;
BEGIN
partition := 'm_simulation_result_processed_object_' || REPLACE(OLD.oid::text,'-','_');
IF OLD.partitioned AND EXISTS(SELECT relname FROM pg_class WHERE relname=partition) THEN
RAISE NOTICE 'A partition has been deleted %',partition;
EXECUTE 'DROP TABLE IF EXISTS ' || partition || ';';
END IF;
RETURN OLD;
END;
$BODY$
LANGUAGE plpgsql;

CREATE TRIGGER baseline_delete_partition BEFORE DELETE ON m_simulation_result
FOR EACH ROW EXECUTE FUNCTION baseline_delete_partition();


$aa);


-- WRITE CHANGES ABOVE ^^
-- IMPORTANT: update apply_change number at the end of postgres-new.sql
Expand Down
7 changes: 0 additions & 7 deletions dist/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@
<outputFileNameMapping>ninja.jar</outputFileNameMapping>
<unpack>false</unpack>
</dependencySet>
<dependencySet>
<outputDirectory>bin</outputDirectory>
<includes>
<include>*:*:*:bin:*</include>
</includes>
<unpack>true</unpack>
</dependencySet>
<dependencySet>
<outputDirectory>doc/samples</outputDirectory>
<includes>
Expand Down

0 comments on commit 3a10075

Please sign in to comment.