瀏覽代碼

add peoplesearch orgchart client config properties

Jason Rivard 7 年之前
父節點
當前提交
674ad236e8

+ 2 - 0
server/src/main/java/password/pwm/AppProperty.java

@@ -241,6 +241,8 @@ public enum AppProperty {
     PEOPLESEARCH_MAX_VALUE_VERIFYUSERDN             ("peoplesearch.values.verifyUserDN"),
     PEOPLESEARCH_VALUE_MAXCOUNT                     ("peoplesearch.values.maxCount"),
     PEOPLESEARCH_VIEW_DETAIL_LINKS                  ("peoplesearch.view.detail.links"),
+    PEOPLESEARCH_ORGCHART_ENABLE_CHILD_COUNT        ("peoplesearch.orgChart.enableChildCount"),
+    PEOPLESEARCH_ORGCHART_MAX_PARENTS               ("peoplesearch.orgChart.maxParents"),
     QUEUE_EMAIL_RETRY_TIMEOUT_MS                    ("queue.email.retryTimeoutMs"),
     QUEUE_EMAIL_MAX_COUNT                           ("queue.email.maxCount"),
     QUEUE_EMAIL_MAX_THREADS                         ("queue.email.maxThreads"),

+ 6 - 0
server/src/main/java/password/pwm/http/servlet/peoplesearch/PeopleSearchConfiguration.java

@@ -23,6 +23,7 @@
 package password.pwm.http.servlet.peoplesearch;
 
 import lombok.Getter;
+import password.pwm.AppProperty;
 import password.pwm.config.Configuration;
 import password.pwm.config.PwmSetting;
 
@@ -35,6 +36,8 @@ public class PeopleSearchConfiguration {
     private String orgChartParentAttr;
     private String orgChartChildAttr;
     private String orgChartAssistantAttr;
+    private boolean orgChartShowChildCount;
+    private int orgChartMaxParents;
 
     public static PeopleSearchConfiguration fromConfiguration(final Configuration configuration) {
         final PeopleSearchConfiguration config = new PeopleSearchConfiguration();
@@ -51,6 +54,9 @@ public class PeopleSearchConfiguration {
                 && config.orgChartChildAttr != null
                 && !config.orgChartChildAttr.isEmpty();
 
+        config.orgChartShowChildCount = Boolean.parseBoolean(configuration.readAppProperty(AppProperty.PEOPLESEARCH_ORGCHART_ENABLE_CHILD_COUNT));
+        config.orgChartMaxParents = Integer.parseInt(configuration.readAppProperty(AppProperty.PEOPLESEARCH_ORGCHART_MAX_PARENTS));
+
         return config;
     }
 }

+ 2 - 0
server/src/main/resources/password/pwm/AppProperty.properties

@@ -223,6 +223,8 @@ password.randomGenerator.jitter.count=50
 peoplesearch.values.verifyUserDN=true
 peoplesearch.values.maxCount=100
 peoplesearch.view.detail.links=
+peoplesearch.orgChart.enableChildCount=true
+peoplesearch.orgChart.maxParents=50
 queue.email.retryTimeoutMs=10000
 queue.email.maxCount=100000
 queue.email.maxThreads=0