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 19, 2021
2 parents afec68b + f10c3c0 commit c1d6cde
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public PrismContainerValueWrapper<C> createValueWrapper(PrismContainerWrapper<C>
virtualContainerSpec = context.findVirtualContainerConfiguration(parent.getPath());
}
if (virtualContainerSpec != null) {
//override default expanded settings
if (virtualContainerSpec.isExpanded() != null) {
containerValueWrapper.setExpanded(virtualContainerSpec.isExpanded());
}
for (ItemWrapper<?, ?> child : children) {
if (childNotDefined(virtualContainerSpec, child)) {
continue;
Expand All @@ -84,6 +88,7 @@ public PrismContainerValueWrapper<C> createValueWrapper(PrismContainerWrapper<C>
} else {
containerValueWrapper.addItems(children);
}

containerValueWrapper.setVirtualContainerItems(context.getVirtualItemSpecification());
if (parent != null && context.getVirtualItemSpecification() != null) {
parent.setVirtual(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public PrismContainerValueWrapper<O> createValueWrapper(PrismContainerWrapper<O>

if (iw instanceof PrismContainerWrapper) {
((PrismContainerWrapper) iw).setIdentifier(virtualContainer.getIdentifier());
((PrismContainerWrapper<?>) iw).setExpanded(virtualContainer.isExpanded());
}
iw.setVisibleOverwrite(virtualContainer.getVisibility());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ private ContainerPanelConfigurationType findDefaultConfiguration() {
private ContainerPanelConfigurationType findDefaultConfiguration(List<ContainerPanelConfigurationType> configs) {
List<ContainerPanelConfigurationType> subConfigs = new ArrayList<>();
for (ContainerPanelConfigurationType config : configs) {
if (BooleanUtils.isTrue(config.isDefault()) && isApplicableForOperation(config)) {
if (BooleanUtils.isTrue(config.isDefault()) && isApplicableForOperation(config) && WebComponentUtil.getElementVisibility(config.getVisibility())) {
return config;
}
subConfigs.addAll(config.getPanel());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Evolveum and contributors
* 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.
Expand Down Expand Up @@ -1058,7 +1058,7 @@ private String getWhereClause(List<Edge> edges) {

private void dumpOrgClosureTypeTable(Session session, String tableName) {
NativeQuery<Object[]> q = session.createNativeQuery(
"select descendant_oid, ancestor_oid, val from " + tableName, Object[].class)
"select descendant_oid, ancestor_oid, val from " + tableName, Object[].class)
.addScalar("descendant_oid", StringType.INSTANCE)
.addScalar("ancestor_oid", StringType.INSTANCE)
.addScalar("val", IntegerType.INSTANCE);
Expand All @@ -1070,30 +1070,28 @@ private void dumpOrgClosureTypeTable(Session session, String tableName) {
}

private void initializeOracleTemporaryTable() {
Session session = baseHelper.getSessionFactory().openSession();
NativeQuery<?> qCheck = session.createNativeQuery(
"select table_name from user_tables"
+ " where table_name = upper('" + TEMP_DELTA_TABLE_NAME_FOR_ORACLE + "')");
if (qCheck.list().isEmpty()) {
LOGGER.info("Creating temporary table {}", TEMP_DELTA_TABLE_NAME_FOR_ORACLE);
session.beginTransaction();
NativeQuery<?> qCreate = session.createNativeQuery(
"CREATE GLOBAL TEMPORARY TABLE " + TEMP_DELTA_TABLE_NAME_FOR_ORACLE
+ " (descendant_oid VARCHAR2(36 CHAR), "
+ " ancestor_oid VARCHAR2(36 CHAR), "
+ " val NUMBER (10, 0), "
+ " PRIMARY KEY (descendant_oid, ancestor_oid)) "
+ " ON COMMIT DELETE ROWS");
try {
try (Session session = baseHelper.getSessionFactory().openSession()) {
NativeQuery<?> qCheck = session.createNativeQuery(
"select table_name from user_tables"
+ " where table_name = upper('" + TEMP_DELTA_TABLE_NAME_FOR_ORACLE + "')");
if (qCheck.list().isEmpty()) {
LOGGER.info("Creating temporary table {}", TEMP_DELTA_TABLE_NAME_FOR_ORACLE);
session.beginTransaction();
NativeQuery<?> qCreate = session.createNativeQuery(
"CREATE GLOBAL TEMPORARY TABLE " + TEMP_DELTA_TABLE_NAME_FOR_ORACLE
+ " (descendant_oid VARCHAR2(36 CHAR), "
+ " ancestor_oid VARCHAR2(36 CHAR), "
+ " val NUMBER (10, 0), "
+ " PRIMARY KEY (descendant_oid, ancestor_oid)) "
+ " ON COMMIT DELETE ROWS");
qCreate.executeUpdate();
session.getTransaction().commit();
} catch (RuntimeException e) {
String m = "Couldn't create temporary table " + TEMP_DELTA_TABLE_NAME_FOR_ORACLE + ". Please create the table manually.";
LoggingUtils.logException(LOGGER, m, e);
throw new SystemException(m, e);
}
} catch (RuntimeException e) {
String m = "Couldn't create temporary table " + TEMP_DELTA_TABLE_NAME_FOR_ORACLE + ". Please create the table manually.";
LoggingUtils.logException(LOGGER, m, e);
throw new SystemException(m, e);
}
session.close();
}

private List<ReferenceDelta> filterParentRefDeltas(Collection<? extends ItemDelta> modifications) {
Expand Down Expand Up @@ -1297,12 +1295,18 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

Edge edge = (Edge) o;

if (!ancestor.equals(edge.ancestor)) { return false; }
if (!ancestor.equals(edge.ancestor)) {
return false;
}
return descendant.equals(edge.descendant);
}

Expand Down

0 comments on commit c1d6cde

Please sign in to comment.