-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/upgrade-pro…
…cess
- Loading branch information
Showing
14 changed files
with
146 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ui/src/main/java/com/evolveum/midpoint/web/component/form/MultipartFormConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2023 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.component.form; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jakarta.annotation.PreDestroy; | ||
import com.evolveum.midpoint.repo.api.SystemConfigurationChangeDispatcher; | ||
import com.evolveum.midpoint.repo.api.SystemConfigurationChangeListener; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AdminGuiConfigurationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
|
||
@Component | ||
public class MultipartFormConfiguration implements SystemConfigurationChangeListener { | ||
|
||
|
||
@Autowired private SystemConfigurationChangeDispatcher systemConfigurationChangeDispatcher; | ||
|
||
private static final int DEFAULT_MAX_MULTIPART_COUNT = 100; | ||
private static Integer maxMultipartLimit = DEFAULT_MAX_MULTIPART_COUNT; | ||
|
||
@Override | ||
public void update(@Nullable SystemConfigurationType value) { | ||
if (value == null) { | ||
return; | ||
} | ||
AdminGuiConfigurationType adminGuiConfig = value.getAdminGuiConfiguration(); | ||
Integer configValue = null; | ||
if (adminGuiConfig != null) { | ||
configValue = adminGuiConfig.getFormMaxMultiparts(); | ||
} | ||
if (configValue != null && configValue > 0) { | ||
maxMultipartLimit = configValue; | ||
} else { | ||
maxMultipartLimit = DEFAULT_MAX_MULTIPART_COUNT; | ||
} | ||
} | ||
|
||
public static int getMaxMultipartsLimit() { | ||
return maxMultipartLimit != null ? maxMultipartLimit : DEFAULT_MAX_MULTIPART_COUNT; | ||
} | ||
|
||
@PostConstruct | ||
public void init() { | ||
systemConfigurationChangeDispatcher.registerListener(this); | ||
} | ||
|
||
@PreDestroy | ||
public void shutdown() { | ||
systemConfigurationChangeDispatcher.unregisterListener(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.