Syncope-2_0_X-deploy - Build # 487 - Fixed

2017-07-18 Thread Apache Jenkins Server
The Apache Jenkins build system has built Syncope-2_0_X-deploy (build #487)

Status: Fixed

Check console output at https://builds.apache.org/job/Syncope-2_0_X-deploy/487/ 
to view the results.

Syncope-master-deploy - Build # 2379 - Fixed

2017-07-18 Thread Apache Jenkins Server
The Apache Jenkins build system has built Syncope-master-deploy (build #2379)

Status: Fixed

Check console output at 
https://builds.apache.org/job/Syncope-master-deploy/2379/ to view the results.

syncope git commit: Changed the admin password for the archetype as well

2017-07-18 Thread coheigea
Repository: syncope
Updated Branches:
  refs/heads/master 0913da283 -> 030defd12


Changed the admin password for the archetype as well


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

Branch: refs/heads/master
Commit: 030defd12e45d3c6bf203b8668f5be047801b941
Parents: 0913da2
Author: Colm O hEigeartaigh 
Authored: Tue Jul 18 17:52:04 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 17:52:04 2017 +0100

--
 archetype/src/main/resources/META-INF/maven/archetype-metadata.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/030defd1/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
--
diff --git a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml 
b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index f3ba98c..391cd25 100644
--- a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -25,7 +25,7 @@ under the License.
 
 
 
-5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
+
DE088591C00CC98B36F5ADAAF7DA2B004CF7F2FE7BBB45B766B6409876E2F3DB13C7905C6AA59464
 
   
   



syncope git commit: SYNCOPE-1165 - Switch the default password cipher algorithm from SHA1 to SSHA256

2017-07-18 Thread coheigea
Repository: syncope
Updated Branches:
  refs/heads/master 7ee0bf22c -> 0913da283


SYNCOPE-1165 - Switch the default password cipher algorithm from SHA1 to SSHA256


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

Branch: refs/heads/master
Commit: 0913da283a378fd87207b55b75b48266d3e98b18
Parents: 7ee0bf2
Author: Colm O hEigeartaigh 
Authored: Tue Jul 18 15:51:06 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 15:51:06 2017 +0100

--
 .../src/main/resources/domains/MasterContent.xml | 2 +-
 .../core/spring/security/DefaultCredentialChecker.java   | 3 ++-
 core/spring/src/main/resources/security.properties   | 2 +-
 .../apache/syncope/core/spring/security/EncryptorTest.java   | 8 
 pom.xml  | 2 +-
 5 files changed, 13 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/0913da28/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
--
diff --git a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml 
b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
index 9d42535..875647b 100644
--- a/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/main/resources/domains/MasterContent.xml
@@ -28,7 +28,7 @@ under the License.
   
   
+   attribute_id="56db89b9-119e-4923-a16e-f42823b90c66" 
stringValue="SSHA256"/>
 
   
 anonymousKey
 1abcdefghilmnopqrstuvz2!



[1/2] syncope git commit: [SYNCOPE-1164] Forgot to clean up0

2017-07-18 Thread ilgrosso
Repository: syncope
Updated Branches:
  refs/heads/2_0_X 852dec694 -> 3198ef575
  refs/heads/master 4214a3892 -> 7ee0bf22c


[SYNCOPE-1164] Forgot to clean up0


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

Branch: refs/heads/2_0_X
Commit: 3198ef575a5cefcdea4d97bce1028cad787fd070
Parents: 852dec6
Author: Francesco Chicchiriccò 
Authored: Tue Jul 18 15:30:54 2017 +0200
Committer: Francesco Chicchiriccò 
Committed: Tue Jul 18 15:30:54 2017 +0200

--
 .../syncope/client/console/status/ResourceStatusModal.java   | 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/3198ef57/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
--
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
index 960bd12..508217a 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
@@ -32,7 +32,6 @@ import 
org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 import 
org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.wicket.PageReference;
@@ -62,9 +61,6 @@ public class ResourceStatusModal extends 
StatusModal {
 }
 }, new ArrayList());
 Collections.sort(availableAnyTypes, new 
AnyTypeRestClient.AnyTypeKeyComparator());
-if (resource.getOrgUnit() != null) {
-availableAnyTypes.add(0, SyncopeConstants.REALM_ANYTYPE);
-}
 
 AjaxDropDownChoicePanel anyTypes =
 new AjaxDropDownChoicePanel<>("anyTypes", "anyTypes", 
typeModel, false);



[2/2] syncope git commit: [SYNCOPE-1164] Forgot to clean up0

2017-07-18 Thread ilgrosso
[SYNCOPE-1164] Forgot to clean up0


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

Branch: refs/heads/master
Commit: 7ee0bf22cb991b8ba5d4005579cf9a7225180f6a
Parents: 4214a38
Author: Francesco Chicchiriccò 
Authored: Tue Jul 18 15:30:54 2017 +0200
Committer: Francesco Chicchiriccò 
Committed: Tue Jul 18 15:33:36 2017 +0200

--
 .../syncope/client/console/status/ResourceStatusModal.java   | 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/7ee0bf22/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
--
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
index 960bd12..508217a 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/status/ResourceStatusModal.java
@@ -32,7 +32,6 @@ import 
org.apache.syncope.client.console.rest.AbstractAnyRestClient;
 import org.apache.syncope.client.console.rest.AnyTypeRestClient;
 import 
org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.wicket.PageReference;
@@ -62,9 +61,6 @@ public class ResourceStatusModal extends 
StatusModal {
 }
 }, new ArrayList());
 Collections.sort(availableAnyTypes, new 
AnyTypeRestClient.AnyTypeKeyComparator());
-if (resource.getOrgUnit() != null) {
-availableAnyTypes.add(0, SyncopeConstants.REALM_ANYTYPE);
-}
 
 AjaxDropDownChoicePanel anyTypes =
 new AjaxDropDownChoicePanel<>("anyTypes", "anyTypes", 
typeModel, false);



[1/2] syncope git commit: Filter security.properties for the spring tests as well

2017-07-18 Thread coheigea
Repository: syncope
Updated Branches:
  refs/heads/1_2_X 42b1b5f8d -> d4edbaa81


Filter security.properties for the spring tests as well


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

Branch: refs/heads/1_2_X
Commit: ea68755183514cacbb48b966c14baec71c5dbfef
Parents: 42b1b5f
Author: Colm O hEigeartaigh 
Authored: Mon Jul 17 19:15:53 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 13:03:21 2017 +0100

--
 .../java/org/apache/syncope/core/security/EncryptorTest.java  | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/ea687551/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
--
diff --git 
a/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java 
b/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
index 7d8fdb6..626416f 100644
--- a/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
+++ b/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.core.security;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -56,4 +57,10 @@ public class EncryptorTest {
 }
 }
 }
+
+@Test
+public void testDecodeDefaultAESKey() throws Exception {
+String password = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
+assertEquals("password", password);
+}
 }



[2/2] syncope git commit: SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random characters

2017-07-18 Thread coheigea
SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random 
characters


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

Branch: refs/heads/1_2_X
Commit: d4edbaa814bd50e0a7c8373c8624eb5e4b02763c
Parents: ea68755
Author: Colm O hEigeartaigh 
Authored: Tue Jul 18 11:02:40 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 13:21:13 2017 +0100

--
 .../java/org/apache/syncope/core/util/Encryptor.java| 11 +++
 .../org/apache/syncope/core/security/EncryptorTest.java | 12 ++--
 2 files changed, 17 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/d4edbaa8/core/src/main/java/org/apache/syncope/core/util/Encryptor.java
--
diff --git a/core/src/main/java/org/apache/syncope/core/util/Encryptor.java 
b/core/src/main/java/org/apache/syncope/core/util/Encryptor.java
index 270f2f8..2e8c111 100644
--- a/core/src/main/java/org/apache/syncope/core/util/Encryptor.java
+++ b/core/src/main/java/org/apache/syncope/core/util/Encryptor.java
@@ -172,11 +172,14 @@ public final class Encryptor {
 String actualKey = secretKey;
 if (actualKey.length() < 16) {
 StringBuilder actualKeyPadding = new StringBuilder(actualKey);
-for (int i = 0; i < 16 - actualKey.length(); i++) {
-actualKeyPadding.append('0');
-}
+int length = 16 - actualKey.length();
+String randomChars = 
SecureRandomUtil.generateRandomPassword(length);
+
+actualKeyPadding.append(randomChars);
 actualKey = actualKeyPadding.toString();
-LOG.debug("actualKey too short, adding some random characters");
+LOG.warn("The secret key is too short (< 16), adding some random 
characters. "
+ + "Passwords encrypted with AES and this key will not be 
recoverable "
+ + "as a result if the container is restarted.");
 }
 
 try {

http://git-wip-us.apache.org/repos/asf/syncope/blob/d4edbaa8/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
--
diff --git 
a/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java 
b/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
index 626416f..c7fed5c 100644
--- a/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
+++ b/core/src/test/java/org/apache/syncope/core/security/EncryptorTest.java
@@ -60,7 +60,15 @@ public class EncryptorTest {
 
 @Test
 public void testDecodeDefaultAESKey() throws Exception {
-String password = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
-assertEquals("password", password);
+String decPassword = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
+}
+
+@Test
+public void testSmallKey() throws Exception {
+Encryptor smallKeyEncryptor = Encryptor.getInstance("123");
+String encPassword = smallKeyEncryptor.encode(password, 
CipherAlgorithm.AES);
+String decPassword = smallKeyEncryptor.decode(encPassword, 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
 }
 }



Syncope-2_0_X - Build # 50 - Failure

2017-07-18 Thread Apache Jenkins Server
The Apache Jenkins build system has built Syncope-2_0_X (build #50)

Status: Failure

Check console output at https://builds.apache.org/job/Syncope-2_0_X/50/ to view 
the results.

Syncope-2_0_X - Build # 49 - Fixed

2017-07-18 Thread Apache Jenkins Server
The Apache Jenkins build system has built Syncope-2_0_X (build #49)

Status: Fixed

Check console output at https://builds.apache.org/job/Syncope-2_0_X/49/ to view 
the results.

syncope git commit: SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random characters

2017-07-18 Thread coheigea
Repository: syncope
Updated Branches:
  refs/heads/master eebca673e -> 4214a3892


SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random 
characters


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

Branch: refs/heads/master
Commit: 4214a38925ea07d6ab2a9d8bbf32fcd3fe0841d0
Parents: eebca67
Author: Colm O hEigeartaigh 
Authored: Tue Jul 18 11:02:40 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 11:36:21 2017 +0100

--
 .../apache/syncope/core/spring/security/Encryptor.java | 11 +++
 .../syncope/core/spring/security/EncryptorTest.java| 13 +++--
 2 files changed, 18 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/4214a389/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
--
diff --git 
a/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
 
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
index af64177..a97094a 100644
--- 
a/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
+++ 
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
@@ -154,11 +154,14 @@ public final class Encryptor {
 String actualKey = secretKey;
 if (actualKey.length() < 16) {
 StringBuilder actualKeyPadding = new StringBuilder(actualKey);
-for (int i = 0; i < 16 - actualKey.length(); i++) {
-actualKeyPadding.append('0');
-}
+int length = 16 - actualKey.length();
+String randomChars = 
SecureRandomUtils.generateRandomPassword(length);
+
+actualKeyPadding.append(randomChars);
 actualKey = actualKeyPadding.toString();
-LOG.debug("actualKey too short, adding some random characters");
+LOG.warn("The secret key is too short (< 16), adding some random 
characters. "
+ + "Passwords encrypted with AES and this key will not be 
recoverable "
+ + "as a result if the container is restarted.");
 }
 
 try {

http://git-wip-us.apache.org/repos/asf/syncope/blob/4214a389/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
--
diff --git 
a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
 
b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
index 98c3f16..064d970 100644
--- 
a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
+++ 
b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
@@ -61,7 +61,16 @@ public class EncryptorTest {
 
 @Test
 public void testDecodeDefaultAESKey() throws Exception {
-String password = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
-assertEquals("password", password);
+String decPassword = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
 }
+
+@Test
+public void testSmallKey() throws Exception {
+Encryptor smallKeyEncryptor = Encryptor.getInstance("123");
+String encPassword = smallKeyEncryptor.encode(password, 
CipherAlgorithm.AES);
+String decPassword = smallKeyEncryptor.decode(encPassword, 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
+}
+
 }



syncope git commit: SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random characters

2017-07-18 Thread coheigea
Repository: syncope
Updated Branches:
  refs/heads/2_0_X e21971bf5 -> 852dec694


SYNCOPE-1168 - Encryptor pads short secret keys with "0" instead of random 
characters


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

Branch: refs/heads/2_0_X
Commit: 852dec6946813ac4756b8868988e145316bd6f94
Parents: e21971b
Author: Colm O hEigeartaigh 
Authored: Tue Jul 18 11:02:40 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Tue Jul 18 12:02:32 2017 +0100

--
 .../apache/syncope/core/spring/security/Encryptor.java | 11 +++
 .../syncope/core/spring/security/EncryptorTest.java| 13 +++--
 2 files changed, 18 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/syncope/blob/852dec69/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
--
diff --git 
a/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
 
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
index af64177..a97094a 100644
--- 
a/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
+++ 
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/Encryptor.java
@@ -154,11 +154,14 @@ public final class Encryptor {
 String actualKey = secretKey;
 if (actualKey.length() < 16) {
 StringBuilder actualKeyPadding = new StringBuilder(actualKey);
-for (int i = 0; i < 16 - actualKey.length(); i++) {
-actualKeyPadding.append('0');
-}
+int length = 16 - actualKey.length();
+String randomChars = 
SecureRandomUtils.generateRandomPassword(length);
+
+actualKeyPadding.append(randomChars);
 actualKey = actualKeyPadding.toString();
-LOG.debug("actualKey too short, adding some random characters");
+LOG.warn("The secret key is too short (< 16), adding some random 
characters. "
+ + "Passwords encrypted with AES and this key will not be 
recoverable "
+ + "as a result if the container is restarted.");
 }
 
 try {

http://git-wip-us.apache.org/repos/asf/syncope/blob/852dec69/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
--
diff --git 
a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
 
b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
index 98c3f16..064d970 100644
--- 
a/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
+++ 
b/core/spring/src/test/java/org/apache/syncope/core/spring/security/EncryptorTest.java
@@ -61,7 +61,16 @@ public class EncryptorTest {
 
 @Test
 public void testDecodeDefaultAESKey() throws Exception {
-String password = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
-assertEquals("password", password);
+String decPassword = encryptor.decode("9Pav+xl+UyHt02H9ZBytiA==", 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
 }
+
+@Test
+public void testSmallKey() throws Exception {
+Encryptor smallKeyEncryptor = Encryptor.getInstance("123");
+String encPassword = smallKeyEncryptor.encode(password, 
CipherAlgorithm.AES);
+String decPassword = smallKeyEncryptor.decode(encPassword, 
CipherAlgorithm.AES);
+assertEquals(password, decPassword);
+}
+
 }



[07/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
--
diff --git 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
index 81f94b9..4209734 100644
--- 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
+++ 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
@@ -53,7 +53,7 @@ import 
org.apache.syncope.core.persistence.jpa.attrvalue.validation.EmailAddress
 import org.apache.syncope.core.persistence.jpa.dao.DefaultAccountRule;
 import org.apache.syncope.core.persistence.jpa.dao.DefaultPasswordRule;
 import org.apache.syncope.core.provisioning.java.DefaultLogicActions;
-import 
org.apache.syncope.core.provisioning.java.data.DefaultMappingItemTransformer;
+import org.apache.syncope.core.provisioning.java.data.DefaultItemTransformer;
 import 
org.apache.syncope.core.provisioning.java.propagation.DBPasswordPropagationActions;
 import 
org.apache.syncope.core.provisioning.java.propagation.LDAPMembershipPropagationActions;
 import 
org.apache.syncope.core.provisioning.java.propagation.LDAPPasswordPropagationActions;
@@ -99,9 +99,9 @@ public class ITImplementationLookup implements 
ImplementationLookup {
 put(Type.PASSWORD_RULE_CONF, classNames);
 
 classNames = new HashSet<>();
-classNames.add(PrefixMappingItemTransformer.class.getName());
-classNames.add(DefaultMappingItemTransformer.class.getName());
-put(Type.MAPPING_ITEM_TRANSFORMER, classNames);
+classNames.add(PrefixItemTransformer.class.getName());
+classNames.add(DefaultItemTransformer.class.getName());
+put(Type.ITEM_TRANSFORMER, classNames);
 
 classNames = new HashSet<>();
 classNames.add(TestSampleJobDelegate.class.getName());

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
--
diff --git 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
new file mode 100644
index 000..80a386e
--- /dev/null
+++ 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.fit.core.reference;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.to.EntityTO;
+import org.apache.syncope.core.persistence.api.entity.Entity;
+import org.apache.syncope.core.persistence.api.entity.PlainAttrValue;
+import org.apache.syncope.core.persistence.api.entity.resource.Item;
+import org.apache.syncope.core.provisioning.java.data.DefaultItemTransformer;
+
+public class PrefixItemTransformer extends DefaultItemTransformer {
+
+public static final String PREFIX = "PREFIX_";
+
+@Override
+public List beforePropagation(
+final Item item,
+final Entity entity,
+final List values) {
+
+if (values == null || values.isEmpty() || 
values.get(0).getStringValue() == null) {
+return super.beforePropagation(item, entity, values);
+} else {
+String value = values.get(0).getStringValue();
+values.get(0).setStringValue(PREFIX + value);
+
+return values;
+}
+}
+
+@Override
+public List beforePull(
+final Item item,
+final EntityTO entityTO,
+final List values) {
+
+if (values == null || values.isEmpty() || values.get(0) == null) {
+return super.beforePull(item, entityTO, 

[01/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
Repository: syncope
Updated Branches:
  refs/heads/2_0_X d540e511d -> e21971bf5
  refs/heads/master 3faef350f -> eebca673e


http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
--
diff --git 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
index 81f94b9..4209734 100644
--- 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
+++ 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
@@ -53,7 +53,7 @@ import 
org.apache.syncope.core.persistence.jpa.attrvalue.validation.EmailAddress
 import org.apache.syncope.core.persistence.jpa.dao.DefaultAccountRule;
 import org.apache.syncope.core.persistence.jpa.dao.DefaultPasswordRule;
 import org.apache.syncope.core.provisioning.java.DefaultLogicActions;
-import 
org.apache.syncope.core.provisioning.java.data.DefaultMappingItemTransformer;
+import org.apache.syncope.core.provisioning.java.data.DefaultItemTransformer;
 import 
org.apache.syncope.core.provisioning.java.propagation.DBPasswordPropagationActions;
 import 
org.apache.syncope.core.provisioning.java.propagation.LDAPMembershipPropagationActions;
 import 
org.apache.syncope.core.provisioning.java.propagation.LDAPPasswordPropagationActions;
@@ -99,9 +99,9 @@ public class ITImplementationLookup implements 
ImplementationLookup {
 put(Type.PASSWORD_RULE_CONF, classNames);
 
 classNames = new HashSet<>();
-classNames.add(PrefixMappingItemTransformer.class.getName());
-classNames.add(DefaultMappingItemTransformer.class.getName());
-put(Type.MAPPING_ITEM_TRANSFORMER, classNames);
+classNames.add(PrefixItemTransformer.class.getName());
+classNames.add(DefaultItemTransformer.class.getName());
+put(Type.ITEM_TRANSFORMER, classNames);
 
 classNames = new HashSet<>();
 classNames.add(TestSampleJobDelegate.class.getName());

http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
--
diff --git 
a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
new file mode 100644
index 000..80a386e
--- /dev/null
+++ 
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/PrefixItemTransformer.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.fit.core.reference;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.to.EntityTO;
+import org.apache.syncope.core.persistence.api.entity.Entity;
+import org.apache.syncope.core.persistence.api.entity.PlainAttrValue;
+import org.apache.syncope.core.persistence.api.entity.resource.Item;
+import org.apache.syncope.core.provisioning.java.data.DefaultItemTransformer;
+
+public class PrefixItemTransformer extends DefaultItemTransformer {
+
+public static final String PREFIX = "PREFIX_";
+
+@Override
+public List beforePropagation(
+final Item item,
+final Entity entity,
+final List values) {
+
+if (values == null || values.isEmpty() || 
values.get(0).getStringValue() == null) {
+return super.beforePropagation(item, entity, values);
+} else {
+String value = values.get(0).getStringValue();
+values.get(0).setStringValue(PREFIX + value);
+
+return values;
+}
+}
+
+@Override
+public List beforePull(
+final Item item,
+final EntityTO entityTO,
+final List values) {
+
+ 

[10/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
--
diff --git 
a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
new file mode 100644
index 000..6975b2c
--- /dev/null
+++ 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import java.util.List;
+
+public interface ItemContainerTO {
+
+void setConnObjectLink(String connObjectLink);
+
+boolean setConnObjectKeyItem(ItemTO connObjectKeyItem);
+
+boolean add(ItemTO item);
+
+List getItems();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
--
diff --git 
a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
new file mode 100644
index 000..603b4d3
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+
+@XmlRootElement(name = "item")
+@XmlType
+public class ItemTO extends AbstractBaseBean implements EntityTO {
+
+private static final long serialVersionUID = 2983498836767176862L;
+
+private String key;
+
+/**
+ * Attribute schema to be mapped. Consider that we can associate tha same 
attribute schema more than once, with
+ * different aliases, to different resource attributes.
+ */
+private String intAttrName;
+
+/**
+ * External resource's field to be mapped.
+ */
+private String extAttrName;
+
+/**
+ * Specify if the mapped target resource's field is the key.
+ */
+private boolean connObjectKey;
+
+/**
+ * Specify if the mapped target resource's field is the password.
+ */
+private boolean password;
+
+/**
+ * Specify if the mapped target resource's field is nullable.
+ */
+private String mandatoryCondition = "false";
+
+/**
+ * Mapping purposes.
+ */
+private MappingPurpose purpose;
+
+/**
+ * (Optional) JEXL expression to apply to values before propagation.
+ */
+private String propagationJEXLTransformer;
+
+/**
+ * (Optional) JEXL expression to apply to values before pull.
+ */
+private String pullJEXLTransformer;
+
+private final List transformerClassNames = new ArrayList<>();
+
+public boolean isConnObjectKey() {
+return connObjectKey;
+}
+
+public void setConnObjectKey(final boolean connObjectKey) {
+this.connObjectKey = connObjectKey;

[08/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
--
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
index fc711ca..c4be4e2 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
@@ -18,14 +18,10 @@
  */
 package org.apache.syncope.core.provisioning.java.pushpull;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.jexl3.JexlContext;
-import org.apache.commons.jexl3.MapContext;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.RealmTO;
@@ -47,14 +43,13 @@ import 
org.apache.syncope.core.persistence.api.entity.resource.OrgUnit;
 import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
 import org.apache.syncope.core.persistence.api.entity.task.PullTask;
 import 
org.apache.syncope.core.provisioning.api.propagation.PropagationException;
-import 
org.apache.syncope.core.provisioning.api.propagation.PropagationReporter;
 import 
org.apache.syncope.core.provisioning.api.pushpull.IgnoreProvisionException;
 import org.apache.syncope.core.provisioning.api.pushpull.ProvisioningReport;
 import org.apache.syncope.core.provisioning.api.pushpull.PullActions;
 import org.apache.syncope.core.provisioning.api.pushpull.SyncopePullExecutor;
 import 
org.apache.syncope.core.provisioning.api.pushpull.SyncopePullResultHandler;
-import org.apache.syncope.core.provisioning.java.jexl.JexlUtils;
-import org.identityconnectors.framework.common.objects.Attribute;
+import org.apache.syncope.core.provisioning.java.utils.ConnObjectUtils;
+import 
org.apache.syncope.core.spring.security.DelegatedAdministrationException;
 import org.identityconnectors.framework.common.objects.SyncDelta;
 import org.identityconnectors.framework.common.objects.SyncDeltaType;
 import org.quartz.JobExecutionException;
@@ -67,6 +62,12 @@ public class RealmPullResultHandlerImpl
 implements SyncopePullResultHandler {
 
 @Autowired
+private PullUtils pullUtils;
+
+@Autowired
+private ConnObjectUtils connObjectUtils;
+
+@Autowired
 private AnySearchDAO searchDAO;
 
 private SyncopePullExecutor executor;
@@ -125,24 +126,32 @@ public class RealmPullResultHandlerImpl
 }
 }
 
-private ProvisioningReport assign(final SyncDelta delta, final String 
name) throws JobExecutionException {
+private List assign(final SyncDelta delta, final 
OrgUnit orgUnit) throws JobExecutionException {
 if (!profile.getTask().isPerformCreate()) {
 LOG.debug("PullTask not configured for create");
-return null;
+finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 
Result.SUCCESS, null, null, delta);
+return Collections.emptyList();
 }
 
-RealmTO realmTO = new RealmTO();
-realmTO.setName(name);
+RealmTO realmTO = connObjectUtils.getRealmTO(delta.getObject(), 
profile.getTask(), orgUnit);
+if (realmTO.getFullPath() == null) {
+if (realmTO.getParent() == null) {
+
realmTO.setParent(profile.getTask().getDestinatioRealm().getFullPath());
+}
+
+realmTO.setFullPath(realmTO.getParent() + "/" + realmTO.getName());
+}
 realmTO.getResources().add(profile.getTask().getResource().getKey());
 
 ProvisioningReport result = new ProvisioningReport();
 result.setOperation(ResourceOperation.CREATE);
 result.setAnyType(REALM_TYPE);
 result.setStatus(ProvisioningReport.Status.SUCCESS);
-result.setName(profile.getTask().getDestinatioRealm().getFullPath() + 
"/" + name);
+result.setName(realmTO.getFullPath());
 
 if (profile.isDryRun()) {
 result.setKey(null);
+finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 
Result.SUCCESS, null, null, delta);
 } else {
 SyncDelta actionedDelta = delta;
 for (PullActions action : profile.getActions()) {
@@ -152,27 +161,36 @@ public class RealmPullResultHandlerImpl
 create(realmTO, actionedDelta, 
UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 

[12/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
[SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys


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

Branch: refs/heads/master
Commit: eebca673ec43f26c711c5e16495427800180570a
Parents: 3faef35
Author: Francesco Chicchiriccò 
Authored: Tue Jul 18 12:20:31 2017 +0200
Committer: Francesco Chicchiriccò 
Committed: Tue Jul 18 12:22:30 2017 +0200

--
 .../syncope/client/cli/commands/info/Info.java  |   2 +-
 .../resource/ResourceResultManager.java |   8 +-
 .../client/console/bulk/BulkContent.java|   6 +-
 .../console/commons/status/StatusBean.java  |  31 +-
 .../console/commons/status/StatusUtils.java |  38 +-
 .../client/console/panels/ConnObjects.java  |   9 +-
 .../client/console/panels/ListViewPanel.java|   4 +-
 .../panels/ProvisionAuxClassesPanel.java|  29 +-
 .../console/rest/AbstractAnyRestClient.java |   5 -
 .../client/console/rest/AnyTypeRestClient.java  |   7 +
 .../console/status/AnyStatusDirectoryPanel.java |   8 +-
 .../console/status/ChangePasswordModal.java |   4 +-
 .../status/ResourceStatusDirectoryPanel.java|   3 +-
 .../console/status/ResourceStatusModal.java |  28 +-
 .../html/form/ActionLinksTogglePanel.java   |   2 +-
 .../console/widgets/ItemTransformerWidget.java  |  83 +++
 .../console/widgets/JEXLTransformerWidget.java  |  20 +-
 .../widgets/MappingItemTransformerWidget.java   |  83 ---
 .../console/wizards/AbstractMappingPanel.java   |  64 +-
 .../client/console/wizards/any/StatusPanel.java |   8 +-
 .../console/wizards/any/UserWizardBuilder.java  |   2 +-
 .../resources/ItemTransformersTogglePanel.java  | 118 
 .../resources/JEXLTransformersTogglePanel.java  |   8 +-
 .../MappingItemTransformersTogglePanel.java | 121 
 .../resources/ProvisionWizardBuilder.java   | 102 +--
 .../wizards/resources/ResourceMappingPanel.java |  75 ++-
 .../wizards/resources/ResourceProvision.java| 151 +
 .../resources/ResourceProvisionPanel.java   | 247 ++-
 .../META-INF/resources/css/syncopeConsole.css   |   6 +-
 .../widgets/ItemTransformerWidget.properties|  18 +
 .../widgets/ItemTransformerWidget_it.properties |  18 +
 .../ItemTransformerWidget_pt_BR.properties  |  18 +
 .../widgets/ItemTransformerWidget_ru.properties |  19 +
 .../MappingItemTransformerWidget.properties |  18 -
 .../MappingItemTransformerWidget_it.properties  |  18 -
 ...appingItemTransformerWidget_pt_BR.properties |  18 -
 .../MappingItemTransformerWidget_ru.properties  |  19 -
 .../console/wizards/AbstractMappingPanel.html   |   2 +-
 .../resources/ItemTransformersTogglePanel.html  |  32 +
 .../ItemTransformersTogglePanel.properties  |  19 +
 .../ItemTransformersTogglePanel_it.properties   |  19 +
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 +
 .../ItemTransformersTogglePanel_ru.properties   |  20 +
 .../MappingItemTransformersTogglePanel.html |  32 -
 ...appingItemTransformersTogglePanel.properties |  19 -
 ...ingItemTransformersTogglePanel_it.properties |  19 -
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 -
 ...ingItemTransformersTogglePanel_ru.properties |  20 -
 .../resources/ResourceProvisionPanel.html   |   8 -
 .../resources/ResourceProvisionPanel.properties |   5 -
 .../ResourceProvisionPanel_it.properties|   5 -
 .../ResourceProvisionPanel_pt_BR.properties |   5 -
 .../ResourceProvisionPanel_ru.properties|   5 -
 .../syncope/common/lib/info/PlatformInfo.java   |  12 +-
 .../syncope/common/lib/to/ItemContainerTO.java  |  32 +
 .../apache/syncope/common/lib/to/ItemTO.java| 163 +
 .../syncope/common/lib/to/MappingItemTO.java| 163 -
 .../apache/syncope/common/lib/to/MappingTO.java |  28 +-
 .../apache/syncope/common/lib/to/OrgUnitTO.java |  62 +-
 .../syncope/core/logic/ResourceLogic.java   |  66 +-
 .../apache/syncope/core/logic/SyncopeLogic.java |   4 +-
 .../init/ClassPathScanImplementationLookup.java |  12 +-
 .../persistence/api/ImplementationLookup.java   |   2 +-
 .../core/persistence/api/dao/RealmDAO.java  |   2 +
 .../api/entity/LinkingMappingItem.java  |   2 +-
 .../persistence/api/entity/resource/Item.java   |  60 ++
 .../api/entity/resource/Mapping.java|   8 +-
 .../api/entity/resource/MappingItem.java|  40 +-
 .../api/entity/resource/OrgUnit.java|  12 +-
 .../api/entity/resource/OrgUnitItem.java|  26 +
 .../core/persistence/jpa/dao/JPARealmDAO.java   |  11 +
 .../jpa/entity/JPAEntityFactory.java|   4 +
 .../jpa/entity/resource/AbstractItem.java   | 176 +
 .../jpa/entity/resource/JPAMapping.java |   4 +-
 

[03/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
--
diff --git 
a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
 
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
index 9666804..b2907c4 100644
--- 
a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
+++ 
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.provisioning.api.pushpull;
 
 import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.EntityTO;
 import org.identityconnectors.framework.common.objects.SyncDelta;
 import org.quartz.JobExecutionException;
@@ -132,19 +131,18 @@ public interface PullActions extends ProvisioningActions {
  * The entity is updated upon pull in case of the matching rule
  * {@link org.apache.syncope.common.lib.types.MatchingRule#UPDATE} 
(default matching rule) is applied.
  *
- * @param  concrete any object
  * @param  any object modifications
  * @param profile profile of the pull being executed.
  * @param delta retrieved pull information
- * @param any any object
+ * @param entityTO entity
  * @param anyPatch modification
  * @return pull information used for logging and to be passed to the 
'after' method.
  * @throws JobExecutionException in case of generic failure.
  */
- SyncDelta beforeUpdate(
+ SyncDelta beforeUpdate(
 ProvisioningProfile profile,
 SyncDelta delta,
-M any,
+EntityTO entityTO,
 P anyPatch)
 throws JobExecutionException;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
--
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
index 38c895e..54ada98 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
@@ -23,55 +23,60 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AttrTO;
 import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.GroupableRelatableTO;
 import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.RealmTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
-import 
org.apache.syncope.core.provisioning.api.utils.policy.InvalidPasswordRuleConf;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyUtils;
-import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
-import org.apache.syncope.core.persistence.api.entity.EntityFactory;
-import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
-import org.apache.syncope.core.persistence.api.entity.PlainAttr;
-import org.apache.syncope.core.persistence.api.entity.PlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
-import org.apache.syncope.core.spring.security.Encryptor;
-import org.apache.syncope.core.spring.security.PasswordGenerator;
 import 
org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
 import 

[02/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
--
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
index fc711ca..c4be4e2 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/RealmPullResultHandlerImpl.java
@@ -18,14 +18,10 @@
  */
 package org.apache.syncope.core.provisioning.java.pushpull;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
-import org.apache.commons.jexl3.JexlContext;
-import org.apache.commons.jexl3.MapContext;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.RealmTO;
@@ -47,14 +43,13 @@ import 
org.apache.syncope.core.persistence.api.entity.resource.OrgUnit;
 import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
 import org.apache.syncope.core.persistence.api.entity.task.PullTask;
 import 
org.apache.syncope.core.provisioning.api.propagation.PropagationException;
-import 
org.apache.syncope.core.provisioning.api.propagation.PropagationReporter;
 import 
org.apache.syncope.core.provisioning.api.pushpull.IgnoreProvisionException;
 import org.apache.syncope.core.provisioning.api.pushpull.ProvisioningReport;
 import org.apache.syncope.core.provisioning.api.pushpull.PullActions;
 import org.apache.syncope.core.provisioning.api.pushpull.SyncopePullExecutor;
 import 
org.apache.syncope.core.provisioning.api.pushpull.SyncopePullResultHandler;
-import org.apache.syncope.core.provisioning.java.jexl.JexlUtils;
-import org.identityconnectors.framework.common.objects.Attribute;
+import org.apache.syncope.core.provisioning.java.utils.ConnObjectUtils;
+import 
org.apache.syncope.core.spring.security.DelegatedAdministrationException;
 import org.identityconnectors.framework.common.objects.SyncDelta;
 import org.identityconnectors.framework.common.objects.SyncDeltaType;
 import org.quartz.JobExecutionException;
@@ -67,6 +62,12 @@ public class RealmPullResultHandlerImpl
 implements SyncopePullResultHandler {
 
 @Autowired
+private PullUtils pullUtils;
+
+@Autowired
+private ConnObjectUtils connObjectUtils;
+
+@Autowired
 private AnySearchDAO searchDAO;
 
 private SyncopePullExecutor executor;
@@ -125,24 +126,32 @@ public class RealmPullResultHandlerImpl
 }
 }
 
-private ProvisioningReport assign(final SyncDelta delta, final String 
name) throws JobExecutionException {
+private List assign(final SyncDelta delta, final 
OrgUnit orgUnit) throws JobExecutionException {
 if (!profile.getTask().isPerformCreate()) {
 LOG.debug("PullTask not configured for create");
-return null;
+finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 
Result.SUCCESS, null, null, delta);
+return Collections.emptyList();
 }
 
-RealmTO realmTO = new RealmTO();
-realmTO.setName(name);
+RealmTO realmTO = connObjectUtils.getRealmTO(delta.getObject(), 
profile.getTask(), orgUnit);
+if (realmTO.getFullPath() == null) {
+if (realmTO.getParent() == null) {
+
realmTO.setParent(profile.getTask().getDestinatioRealm().getFullPath());
+}
+
+realmTO.setFullPath(realmTO.getParent() + "/" + realmTO.getName());
+}
 realmTO.getResources().add(profile.getTask().getResource().getKey());
 
 ProvisioningReport result = new ProvisioningReport();
 result.setOperation(ResourceOperation.CREATE);
 result.setAnyType(REALM_TYPE);
 result.setStatus(ProvisioningReport.Status.SUCCESS);
-result.setName(profile.getTask().getDestinatioRealm().getFullPath() + 
"/" + name);
+result.setName(realmTO.getFullPath());
 
 if (profile.isDryRun()) {
 result.setKey(null);
+finalize(UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 
Result.SUCCESS, null, null, delta);
 } else {
 SyncDelta actionedDelta = delta;
 for (PullActions action : profile.getActions()) {
@@ -152,27 +161,36 @@ public class RealmPullResultHandlerImpl
 create(realmTO, actionedDelta, 
UnmatchingRule.toEventName(UnmatchingRule.ASSIGN), 

[05/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
--
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
index 37abe22..e13d6bb 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
@@ -37,6 +37,7 @@ import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
 import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.MappingTO;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
@@ -52,7 +53,7 @@ import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.StringResourceModel;
 
-public class ProvisionWizardBuilder extends AjaxWizardBuilder {
+public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 3739399543837732640L;
 
@@ -76,13 +77,18 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 }
 }, currentlyAdded);
 
-return ListUtils.select(new AnyTypeRestClient().list(), new 
Predicate() {
+List result = ListUtils.select(new 
AnyTypeRestClient().list(), new Predicate() {
 
 @Override
 public boolean evaluate(final String key) {
 return !currentlyAdded.contains(key);
 }
 });
+if (resourceTO.getOrgUnit() == null) {
+result.add(0, SyncopeConstants.REALM_ANYTYPE);
+}
+
+return result;
 }
 };
 
@@ -93,7 +99,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = -1657800545799468278L;
 
-ObjectType(final ProvisionTO item) {
+ObjectType(final ResourceProvision item) {
 super(new ResourceModel("type.title", StringUtils.EMPTY),
 new ResourceModel("type.summary", StringUtils.EMPTY), new 
Model<>(item));
 
@@ -135,14 +141,23 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 /**
  * AuxClasses definition step.
  */
-private static final class AuxClasses extends WizardStep {
+private static final class AuxClasses extends WizardStep implements 
WizardModel.ICondition {
 
 private static final long serialVersionUID = 5315236191866427500L;
 
-AuxClasses(final ProvisionTO item) {
+private final ResourceProvision provision;
+
+AuxClasses(final ResourceProvision item) {
+this.provision = item;
+
 setTitleModel(new ResourceModel("auxClasses.title"));
 setSummaryModel(new StringResourceModel("auxClasses.summary", 
this, new Model<>(item)));
-add(new ProvisionAuxClassesPanel("auxClasses", item));
+add(new ProvisionAuxClassesPanel("auxClasses", 
item.getProvisionTO()));
+}
+
+@Override
+public boolean evaluate() {
+return provision.getProvisionTO() != null;
 }
 }
 
@@ -153,7 +168,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 3454904947720856253L;
 
-Mapping(final ProvisionTO item) {
+Mapping(final ResourceProvision item) {
 setTitleModel(Model.of("Mapping"));
 setSummaryModel(Model.of(StringUtils.EMPTY));
 }
@@ -166,7 +181,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 2359955465172450478L;
 
-ConnObjectLink(final ProvisionTO item) {
+ConnObjectLink(final ResourceProvision item) {
 super(new ResourceModel("link.title", StringUtils.EMPTY),
 new ResourceModel("link.summary", StringUtils.EMPTY));
 
@@ -175,7 +190,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 add(connObjectLinkContainer);
 
 boolean connObjectLinkEnabled = false;
-if (StringUtils.isNotBlank(item.getMapping().getConnObjectLink())) 
{
+if (StringUtils.isNotBlank(item.getConnObjectLink())) {
 connObjectLinkEnabled = 

[09/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
--
diff --git 
a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
 
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
index 9666804..b2907c4 100644
--- 
a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
+++ 
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.provisioning.api.pushpull;
 
 import org.apache.syncope.common.lib.patch.AnyPatch;
-import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.EntityTO;
 import org.identityconnectors.framework.common.objects.SyncDelta;
 import org.quartz.JobExecutionException;
@@ -132,19 +131,18 @@ public interface PullActions extends ProvisioningActions {
  * The entity is updated upon pull in case of the matching rule
  * {@link org.apache.syncope.common.lib.types.MatchingRule#UPDATE} 
(default matching rule) is applied.
  *
- * @param  concrete any object
  * @param  any object modifications
  * @param profile profile of the pull being executed.
  * @param delta retrieved pull information
- * @param any any object
+ * @param entityTO entity
  * @param anyPatch modification
  * @return pull information used for logging and to be passed to the 
'after' method.
  * @throws JobExecutionException in case of generic failure.
  */
- SyncDelta beforeUpdate(
+ SyncDelta beforeUpdate(
 ProvisioningProfile profile,
 SyncDelta delta,
-M any,
+EntityTO entityTO,
 P anyPatch)
 throws JobExecutionException;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
--
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
index 38c895e..54ada98 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java
@@ -23,55 +23,60 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.ListUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.tuple.ImmutablePair;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.common.lib.to.AnyObjectTO;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AttrTO;
 import org.apache.syncope.common.lib.to.GroupTO;
+import org.apache.syncope.common.lib.to.GroupableRelatableTO;
 import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.to.RealmTO;
 import org.apache.syncope.common.lib.to.UserTO;
 import org.apache.syncope.common.lib.types.AttrSchemaType;
-import 
org.apache.syncope.core.provisioning.api.utils.policy.InvalidPasswordRuleConf;
-import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
-import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.AnyUtils;
-import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
-import org.apache.syncope.core.persistence.api.entity.EntityFactory;
-import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
-import org.apache.syncope.core.persistence.api.entity.PlainAttr;
-import org.apache.syncope.core.persistence.api.entity.PlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue;
-import org.apache.syncope.core.persistence.api.entity.user.User;
-import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
-import org.apache.syncope.core.spring.security.Encryptor;
-import org.apache.syncope.core.spring.security.PasswordGenerator;
 import 
org.apache.syncope.core.persistence.api.attrvalue.validation.ParsingValidationException;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
 import 

[06/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
[SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys


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

Branch: refs/heads/2_0_X
Commit: e21971bf5abb8c9724c464b4ae402ffa2ceb1981
Parents: d540e51
Author: Francesco Chicchiriccò 
Authored: Tue Jul 18 12:20:31 2017 +0200
Committer: Francesco Chicchiriccò 
Committed: Tue Jul 18 12:20:37 2017 +0200

--
 .../syncope/client/cli/commands/info/Info.java  |   2 +-
 .../resource/ResourceResultManager.java |   8 +-
 .../client/console/bulk/BulkContent.java|   6 +-
 .../console/commons/status/StatusBean.java  |  31 +-
 .../console/commons/status/StatusUtils.java |  38 +-
 .../client/console/panels/ConnObjects.java  |   9 +-
 .../client/console/panels/ListViewPanel.java|   4 +-
 .../panels/ProvisionAuxClassesPanel.java|  29 +-
 .../console/rest/AbstractAnyRestClient.java |   5 -
 .../client/console/rest/AnyTypeRestClient.java  |   7 +
 .../console/status/AnyStatusDirectoryPanel.java |   8 +-
 .../console/status/ChangePasswordModal.java |   4 +-
 .../status/ResourceStatusDirectoryPanel.java|   3 +-
 .../console/status/ResourceStatusModal.java |  28 +-
 .../html/form/ActionLinksTogglePanel.java   |   2 +-
 .../console/widgets/ItemTransformerWidget.java  |  83 +++
 .../console/widgets/JEXLTransformerWidget.java  |  20 +-
 .../widgets/MappingItemTransformerWidget.java   |  83 ---
 .../console/wizards/AbstractMappingPanel.java   |  64 +-
 .../client/console/wizards/any/StatusPanel.java |   8 +-
 .../console/wizards/any/UserWizardBuilder.java  |   2 +-
 .../resources/ItemTransformersTogglePanel.java  | 118 
 .../resources/JEXLTransformersTogglePanel.java  |   8 +-
 .../MappingItemTransformersTogglePanel.java | 121 
 .../resources/ProvisionWizardBuilder.java   | 102 +--
 .../wizards/resources/ResourceMappingPanel.java |  75 ++-
 .../wizards/resources/ResourceProvision.java| 151 +
 .../resources/ResourceProvisionPanel.java   | 247 ++-
 .../META-INF/resources/css/syncopeConsole.css   |   6 +-
 .../widgets/ItemTransformerWidget.properties|  18 +
 .../widgets/ItemTransformerWidget_it.properties |  18 +
 .../ItemTransformerWidget_pt_BR.properties  |  18 +
 .../widgets/ItemTransformerWidget_ru.properties |  19 +
 .../MappingItemTransformerWidget.properties |  18 -
 .../MappingItemTransformerWidget_it.properties  |  18 -
 ...appingItemTransformerWidget_pt_BR.properties |  18 -
 .../MappingItemTransformerWidget_ru.properties  |  19 -
 .../console/wizards/AbstractMappingPanel.html   |   2 +-
 .../resources/ItemTransformersTogglePanel.html  |  32 +
 .../ItemTransformersTogglePanel.properties  |  19 +
 .../ItemTransformersTogglePanel_it.properties   |  19 +
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 +
 .../ItemTransformersTogglePanel_ru.properties   |  20 +
 .../MappingItemTransformersTogglePanel.html |  32 -
 ...appingItemTransformersTogglePanel.properties |  19 -
 ...ingItemTransformersTogglePanel_it.properties |  19 -
 ...ItemTransformersTogglePanel_pt_BR.properties |  19 -
 ...ingItemTransformersTogglePanel_ru.properties |  20 -
 .../resources/ResourceProvisionPanel.html   |   8 -
 .../resources/ResourceProvisionPanel.properties |   5 -
 .../ResourceProvisionPanel_it.properties|   5 -
 .../ResourceProvisionPanel_pt_BR.properties |   5 -
 .../ResourceProvisionPanel_ru.properties|   5 -
 .../syncope/common/lib/info/PlatformInfo.java   |  12 +-
 .../syncope/common/lib/to/ItemContainerTO.java  |  32 +
 .../apache/syncope/common/lib/to/ItemTO.java| 163 +
 .../syncope/common/lib/to/MappingItemTO.java| 163 -
 .../apache/syncope/common/lib/to/MappingTO.java |  28 +-
 .../apache/syncope/common/lib/to/OrgUnitTO.java |  62 +-
 .../syncope/core/logic/ResourceLogic.java   |  66 +-
 .../apache/syncope/core/logic/SyncopeLogic.java |   4 +-
 .../init/ClassPathScanImplementationLookup.java |  12 +-
 .../persistence/api/ImplementationLookup.java   |   2 +-
 .../core/persistence/api/dao/RealmDAO.java  |   2 +
 .../api/entity/LinkingMappingItem.java  |   2 +-
 .../persistence/api/entity/resource/Item.java   |  60 ++
 .../api/entity/resource/Mapping.java|   8 +-
 .../api/entity/resource/MappingItem.java|  40 +-
 .../api/entity/resource/OrgUnit.java|  12 +-
 .../api/entity/resource/OrgUnitItem.java|  26 +
 .../core/persistence/jpa/dao/JPARealmDAO.java   |  11 +
 .../jpa/entity/JPAEntityFactory.java|   4 +
 .../jpa/entity/resource/AbstractItem.java   | 176 +
 .../jpa/entity/resource/JPAMapping.java |   4 +-
 

[11/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/eebca673/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
--
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
index 37abe22..e13d6bb 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ProvisionWizardBuilder.java
@@ -37,6 +37,7 @@ import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
 import 
org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
 import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
 import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.to.MappingTO;
 import org.apache.syncope.common.lib.to.ProvisionTO;
 import org.apache.syncope.common.lib.to.ResourceTO;
@@ -52,7 +53,7 @@ import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.model.StringResourceModel;
 
-public class ProvisionWizardBuilder extends AjaxWizardBuilder {
+public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 3739399543837732640L;
 
@@ -76,13 +77,18 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 }
 }, currentlyAdded);
 
-return ListUtils.select(new AnyTypeRestClient().list(), new 
Predicate() {
+List result = ListUtils.select(new 
AnyTypeRestClient().list(), new Predicate() {
 
 @Override
 public boolean evaluate(final String key) {
 return !currentlyAdded.contains(key);
 }
 });
+if (resourceTO.getOrgUnit() == null) {
+result.add(0, SyncopeConstants.REALM_ANYTYPE);
+}
+
+return result;
 }
 };
 
@@ -93,7 +99,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = -1657800545799468278L;
 
-ObjectType(final ProvisionTO item) {
+ObjectType(final ResourceProvision item) {
 super(new ResourceModel("type.title", StringUtils.EMPTY),
 new ResourceModel("type.summary", StringUtils.EMPTY), new 
Model<>(item));
 
@@ -135,14 +141,23 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 /**
  * AuxClasses definition step.
  */
-private static final class AuxClasses extends WizardStep {
+private static final class AuxClasses extends WizardStep implements 
WizardModel.ICondition {
 
 private static final long serialVersionUID = 5315236191866427500L;
 
-AuxClasses(final ProvisionTO item) {
+private final ResourceProvision provision;
+
+AuxClasses(final ResourceProvision item) {
+this.provision = item;
+
 setTitleModel(new ResourceModel("auxClasses.title"));
 setSummaryModel(new StringResourceModel("auxClasses.summary", 
this, new Model<>(item)));
-add(new ProvisionAuxClassesPanel("auxClasses", item));
+add(new ProvisionAuxClassesPanel("auxClasses", 
item.getProvisionTO()));
+}
+
+@Override
+public boolean evaluate() {
+return provision.getProvisionTO() != null;
 }
 }
 
@@ -153,7 +168,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 3454904947720856253L;
 
-Mapping(final ProvisionTO item) {
+Mapping(final ResourceProvision item) {
 setTitleModel(Model.of("Mapping"));
 setSummaryModel(Model.of(StringUtils.EMPTY));
 }
@@ -166,7 +181,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 
 private static final long serialVersionUID = 2359955465172450478L;
 
-ConnObjectLink(final ProvisionTO item) {
+ConnObjectLink(final ResourceProvision item) {
 super(new ResourceModel("link.title", StringUtils.EMPTY),
 new ResourceModel("link.summary", StringUtils.EMPTY));
 
@@ -175,7 +190,7 @@ public class ProvisionWizardBuilder extends 
AjaxWizardBuilder {
 add(connObjectLinkContainer);
 
 boolean connObjectLinkEnabled = false;
-if (StringUtils.isNotBlank(item.getMapping().getConnObjectLink())) 
{
+if (StringUtils.isNotBlank(item.getConnObjectLink())) {
 connObjectLinkEnabled = 

[04/12] syncope git commit: [SYNCOPE-1164] Realm provisioning now features complete mapping, as Anys

2017-07-18 Thread ilgrosso
http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
--
diff --git 
a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
new file mode 100644
index 000..6975b2c
--- /dev/null
+++ 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainerTO.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import java.util.List;
+
+public interface ItemContainerTO {
+
+void setConnObjectLink(String connObjectLink);
+
+boolean setConnObjectKeyItem(ItemTO connObjectKeyItem);
+
+boolean add(ItemTO item);
+
+List getItems();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/e21971bf/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
--
diff --git 
a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java 
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
new file mode 100644
index 000..603b4d3
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ItemTO.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+
+@XmlRootElement(name = "item")
+@XmlType
+public class ItemTO extends AbstractBaseBean implements EntityTO {
+
+private static final long serialVersionUID = 2983498836767176862L;
+
+private String key;
+
+/**
+ * Attribute schema to be mapped. Consider that we can associate tha same 
attribute schema more than once, with
+ * different aliases, to different resource attributes.
+ */
+private String intAttrName;
+
+/**
+ * External resource's field to be mapped.
+ */
+private String extAttrName;
+
+/**
+ * Specify if the mapped target resource's field is the key.
+ */
+private boolean connObjectKey;
+
+/**
+ * Specify if the mapped target resource's field is the password.
+ */
+private boolean password;
+
+/**
+ * Specify if the mapped target resource's field is nullable.
+ */
+private String mandatoryCondition = "false";
+
+/**
+ * Mapping purposes.
+ */
+private MappingPurpose purpose;
+
+/**
+ * (Optional) JEXL expression to apply to values before propagation.
+ */
+private String propagationJEXLTransformer;
+
+/**
+ * (Optional) JEXL expression to apply to values before pull.
+ */
+private String pullJEXLTransformer;
+
+private final List transformerClassNames = new ArrayList<>();
+
+public boolean isConnObjectKey() {
+return connObjectKey;
+}
+
+public void setConnObjectKey(final boolean connObjectKey) {
+this.connObjectKey = connObjectKey;