Repository: syncope
Updated Branches:
  refs/heads/master 84a1ae0d8 -> 3569a9e7a


Added more standard attributes to 'Available' list in Pull Policy Rule 
Configuration for Users and Groups


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/3569a9e7
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/3569a9e7
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/3569a9e7

Branch: refs/heads/master
Commit: 3569a9e7a1325817ce97dc94c8aeb8d81e4782e9
Parents: 84a1ae0
Author: skylark17 <[email protected]>
Authored: Thu Sep 21 11:37:05 2017 +0200
Committer: skylark17 <[email protected]>
Committed: Thu Sep 21 11:50:04 2017 +0200

----------------------------------------------------------------------
 .../console/policies/PolicySpecModalPanel.java  | 25 +++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/3569a9e7/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
index 19dd7ba..64fd5e7 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
@@ -41,7 +41,6 @@ import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
 import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.MultiPanel;
 import org.apache.syncope.common.lib.policy.PullPolicyTO;
-import org.apache.syncope.common.lib.to.EntityTO;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.common.lib.types.ConflictResolutionAction;
 import org.apache.syncope.common.lib.types.SchemaType;
@@ -270,15 +269,23 @@ public class PolicySpecModalPanel extends 
AbstractModalPanel<PullPolicyTO> {
 
         private static List<String> getPlainSchemas(final CorrelationRule 
rule) {
             final List<String> choices = StringUtils.isEmpty(rule.getAny())
-                    ? new ArrayList<>()
-                    : new SchemaRestClient().getSchemas(SchemaType.PLAIN,
-                            rule.getAny().equals(AnyTypeKind.USER.name())
-                            ? AnyTypeKind.USER
-                            : rule.getAny().equals(AnyTypeKind.GROUP.name())
-                            ? AnyTypeKind.GROUP
-                            : 
AnyTypeKind.ANY_OBJECT).stream().map(EntityTO::getKey).
-                            collect(Collectors.toList());
+                    ? new ArrayList<String>()
+                    : CollectionUtils.collect(
+                            new SchemaRestClient().getSchemas(SchemaType.PLAIN,
+                                    
rule.getAny().equals(AnyTypeKind.USER.name())
+                                    ? AnyTypeKind.USER
+                                    : 
rule.getAny().equals(AnyTypeKind.GROUP.name())
+                                    ? AnyTypeKind.GROUP
+                                    : AnyTypeKind.ANY_OBJECT), new 
Transformer<AbstractSchemaTO, String>() {
 
+                        @Override
+                        public String transform(final AbstractSchemaTO input) {
+                            return input.getKey();
+                        }
+                    }, new ArrayList<String>());
+            
+            choices.add("key");
+            choices.add(rule.getAny().equals(AnyTypeKind.USER.name()) ? 
"username" : "name");
             Collections.sort(choices);
             return choices;
         }

Reply via email to