Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jun 3, 2021
2 parents cdf41ba + 470f35f commit 27d89ba
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 329 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
/*
* Copyright (c) 2010-2019 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.
*/

package com.evolveum.midpoint.web.application;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.function.Consumer;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -62,6 +56,7 @@ public final class DescriptorLoader implements DebugDumpable {
"com.evolveum.midpoint.web.component.prism.show"
};

// All could be final, but then Checkstyle complains about lower-case, although these are not constants.
private static Map<String, DisplayableValue<String>[]> actions = new HashMap<>();
private static List<String> permitAllUrls = new ArrayList<>();
private static List<String> loginPages = new ArrayList<>();
Expand Down Expand Up @@ -94,18 +89,16 @@ public void loadData(MidPointApplication application) {
}
} catch (InstantiationException | IllegalAccessException e) {
LOGGER.error("Error scanning packages for pages: {}", e.getMessage(), e);
throw new SystemException("Error scanning packages for pages: "+e.getMessage(), e);
throw new SystemException("Error scanning packages for pages: " + e.getMessage(), e);
}



}

private void scanPackagesForPages(MidPointApplication application)
throws InstantiationException, IllegalAccessException {

for (String pac : PACKAGES_TO_SCAN) {
LOGGER.debug("Scanning package package {} for page annotations", pac);
LOGGER.debug("Scanning package {} for page annotations", pac);

Set<Class<?>> classes = ClassPathUtil.listClasses(pac);
for (Class<?> clazz : classes) {
Expand All @@ -126,7 +119,7 @@ private void scanPackagesForPages(MidPointApplication application)

private void loadActions(PageDescriptor descriptor) {

if(descriptor.loginPage()) {
if (descriptor.loginPage()) {
foreachUrl(descriptor, url -> loginPages.add(url));
}

Expand Down Expand Up @@ -154,13 +147,11 @@ private void loadActions(PageDescriptor descriptor) {

//add http://.../..#guiAll authorization only for displayable pages, not for pages used for development..
if (canAccess) {

// actions.add(new AuthorizationActionValue(AuthorizationConstants.AUTZ_GUI_ALL_LABEL, AuthorizationConstants.AUTZ_GUI_ALL_DESCRIPTION));
actions.add(new AuthorizationActionValue(AuthorizationConstants.AUTZ_GUI_ALL_URL,
AuthorizationConstants.AUTZ_GUI_ALL_LABEL, AuthorizationConstants.AUTZ_GUI_ALL_DESCRIPTION));
}

foreachUrl(descriptor, url -> this.actions.put(url, actions.toArray(new DisplayableValue[actions.size()])));
foreachUrl(descriptor, url -> DescriptorLoader.actions.put(url, actions.toArray(new DisplayableValue[actions.size()])));
}

private void foreachUrl(PageDescriptor descriptor, Consumer<String> urlConsumer) {
Expand Down
14 changes: 7 additions & 7 deletions gui/admin-gui/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2017 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 All @@ -10,7 +10,7 @@

<if condition='"true".equals(property("midpoint.logging.alt.enabled"))'>
<then>
<include resource="logback-alt.xml" />
<include resource="logback-alt.xml"/>
</then>
</if>

Expand Down Expand Up @@ -60,16 +60,16 @@
<logger name="org.hibernate.engine.jdbc.batch.internal.BatchingBatch" level="OFF"/>
<logger name="org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl" level="WARN"/>

<!-- MID-6512:
JAXPParser only logs configuration exception it - is causing (it proactivelly tries to
disable secure entity processing), but works fine even if exception is thrown.
<!-- MID-6512:
JAXPParser only logs configuration exception it is causing. It proactively tries to
disable secure entity processing, but works fine even if exception is thrown.
Behaviour is hardcoded, and can not be prevented, so we mute it off in logs to not cause
unnecessary concern.
-->
<logger name="com.sun.xml.xsom.parser.JAXPParser" level="OFF" />
<logger name="com.sun.xml.xsom.parser.JAXPParser" level="OFF"/>

<logger name="PROFILING" level="INFO"/>
<logger name="com.evolveum.midpoint" level="INFO" />
<logger name="com.evolveum.midpoint" level="INFO"/>
<logger name="com.evolveum.midpoint.web.util.MidPointProfilingServletFilter" level="TRACE">
<appender-ref ref="MIDPOINT_PROFILE_LOG"/>
</logger>
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 @@ -61,6 +61,13 @@ public static void configure(LoggingConfigurationType config, String version,
return;
}

if (java.util.Objects.equals(currentlyUsedVersion, version)) {
LOGGER.debug("Skipped logging configuration because the same version {}"
+ " is already configured", version);
res.recordNotApplicableIfUnknown();
return;
}

if (currentlyUsedVersion != null) {
LOGGER.info("Applying logging configuration (currently applied version: {}, new version: {})", currentlyUsedVersion, version);
} else {
Expand Down
265 changes: 0 additions & 265 deletions repo/repo-sqale/sql/pgnew-eav-vs-json.sql

This file was deleted.

0 comments on commit 27d89ba

Please sign in to comment.