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 Sep 10, 2019
2 parents 1b544bb + effaa2c commit 3d002c3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Expand Up @@ -524,6 +524,7 @@ public enum Channel {
// TODO: move this to schema component
LIVE_SYNC(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI),
RECONCILIATION(SchemaConstants.CHANGE_CHANNEL_RECON_URI),
RECOMPUTATION(SchemaConstants.CHANGE_CHANNEL_RECOMPUTE_URI),
DISCOVERY(SchemaConstants.CHANGE_CHANNEL_DISCOVERY_URI),
WEB_SERVICE(SchemaConstants.CHANNEL_WEB_SERVICE_URI),
IMPORT(SchemaConstants.CHANNEL_OBJECT_IMPORT_URI),
Expand Down
Expand Up @@ -11,6 +11,7 @@
import com.evolveum.midpoint.gui.impl.registry.GuiComponentRegistryImpl;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import org.apache.catalina.Context;
import org.apache.catalina.Valve;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -22,6 +23,7 @@
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryCustomizer;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
Expand All @@ -36,6 +38,8 @@

import java.lang.management.ManagementFactory;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;

/**
* Created by Viliam Repan (lazyman).
Expand Down Expand Up @@ -138,6 +142,8 @@ public class ServerCustomization implements WebServerFactoryCustomizer<Configura

@Value("${server.servlet.session.timeout}")
private int sessionTimeout;
@Value("${server.tomcat.background-processor-delay:10}")
private int backgroundProcessorDelay;
@Value("${server.servlet.context-path}")
private String servletPath;

Expand Down Expand Up @@ -171,6 +177,17 @@ public void customize(ConfigurableServletWebServerFactory server) {
}

private void customizeTomcat(TomcatServletWebServerFactory tomcatFactory) {
// Set background-processor-delay property.
TomcatContextCustomizer contextCustomizer = new TomcatContextCustomizer() {
@Override
public void customize(Context context) {
context.setBackgroundProcessorDelay(backgroundProcessorDelay);
}
};
List<TomcatContextCustomizer> contextCustomizers = new ArrayList<TomcatContextCustomizer>();
contextCustomizers.add(contextCustomizer);
tomcatFactory.setTomcatContextCustomizers(contextCustomizers);

// Tomcat valve used to redirect root URL (/) to real application URL (/midpoint/).
// See comments in TomcatRootValve
Valve rootValve = new TomcatRootValve(servletPath);
Expand Down
Expand Up @@ -249,7 +249,9 @@ public static String getName(PrismContainerValueWrapper<AssignmentType> assignme
if (property != null && !property.getValues().isEmpty()) {
for (PrismPropertyValueWrapper<String> value : property.getValues()) {
ItemRealValueModel<String> name = new ItemRealValueModel<String>(Model.of(value));
sbName.append(name.getObject()).append("\n");
if (StringUtils.isNotEmpty(name.getObject())) {
sbName.append(name.getObject()).append("\n");
}
}
}
if (StringUtils.isNotEmpty(sbName.toString())){
Expand Down
Expand Up @@ -109,7 +109,7 @@ protected int countAssignments() {
PrismObject<AHT> focus = getObjectModel().getObject().getObject();
List<AssignmentType> assignments = focus.asObjectable().getAssignment();
for (AssignmentType assignment : assignments) {
if (!AssignmentsUtil.isPolicyRuleAssignment(assignment) && !AssignmentsUtil.isConsentAssignment(assignment)
if (!AssignmentsUtil.isConsentAssignment(assignment)
&& AssignmentsUtil.isAssignmentRelevant(assignment) && !AssignmentsUtil.isArchetypeAssignment(assignment)) {
rv++;
}
Expand Down

0 comments on commit 3d002c3

Please sign in to comment.