svn commit: r1627742 - in /syncope/branches/1_2_X: ./ common/src/main/java/org/apache/syncope/common/util/ console/src/main/java/org/apache/syncope/console/commons/ console/src/main/java/org/apache/sy

2014-09-26 Thread ilgrosso
Author: ilgrosso
Date: Fri Sep 26 10:50:37 2014
New Revision: 1627742

URL: http://svn.apache.org/r1627742
Log:
[SYNCOPE-135] Handling of the whole password reset process now available via 
admin console

Added:

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/ConfirmPasswordResetModalPage.java
  - copied, changed from r1627044, 
syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/ConfirmPasswordResetModalPage.html
   (with props)

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/ConfirmPasswordResetModalPage.properties
   (with props)

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/ConfirmPasswordResetModalPage_it.properties
   (with props)

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/ConfirmPasswordResetModalPage_pt_BR.properties
   (with props)
Modified:

syncope/branches/1_2_X/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/commons/Constants.java

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/Login.java

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/RequestPasswordResetModalPage.java

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/ResultStatusModalPage.java

syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/pages/panels/SecurityQuestionPanel.java

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/Login.html

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/RequestPasswordResetModalPage.properties

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/RequestPasswordResetModalPage_it.properties

syncope/branches/1_2_X/console/src/main/resources/org/apache/syncope/console/pages/RequestPasswordResetModalPage_pt_BR.properties

syncope/branches/1_2_X/console/src/test/java/org/apache/syncope/console/ConfigurationTestITCase.java

syncope/branches/1_2_X/core/src/main/java/org/apache/syncope/core/rest/data/UserDataBinder.java

syncope/branches/1_2_X/core/src/main/java/org/apache/syncope/core/workflow/user/activiti/ActivitiUserWorkflowAdapter.java

syncope/branches/1_2_X/core/src/main/resources/mailTemplates/requestPasswordReset.html.vm

syncope/branches/1_2_X/core/src/main/resources/mailTemplates/requestPasswordReset.txt.vm
syncope/branches/1_2_X/pom.xml

Modified: 
syncope/branches/1_2_X/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_2_X/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java?rev=1627742r1=1627741r2=1627742view=diff
==
--- 
syncope/branches/1_2_X/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java
 (original)
+++ 
syncope/branches/1_2_X/common/src/main/java/org/apache/syncope/common/util/AttributableOperations.java
 Fri Sep 26 10:50:37 2014
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import org.apache.commons.lang3.SerializationUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.mod.AbstractAttributableMod;
 import org.apache.syncope.common.mod.AbstractSubjectMod;
 import org.apache.syncope.common.mod.AttributeMod;
@@ -236,8 +237,15 @@ public final class AttributableOperation
 }
 
 // 3. security question / answer
-result.setSecurityQuestion(updated.getSecurityQuestion());
-result.setSecurityAnswer(updated.getSecurityAnswer());
+if (updated.getSecurityQuestion() == null) {
+result.setSecurityQuestion(null);
+result.setSecurityAnswer(null);
+} else if 
(!updated.getSecurityQuestion().equals(original.getSecurityQuestion())
+|| StringUtils.isNotBlank(updated.getSecurityAnswer())) {
+
+result.setSecurityQuestion(updated.getSecurityQuestion());
+result.setSecurityAnswer(updated.getSecurityAnswer());
+}
 
 // 4. memberships
 MapLong, MembershipTO updatedMembs = updated.getMembershipMap();

Modified: 
syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/commons/Constants.java
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_2_X/console/src/main/java/org/apache/syncope/console/commons/Constants.java?rev=1627742r1=1627741r2=1627742view=diff
==
--- 

svn commit: r1627813 - in /syncope/branches/1_2_X/installer/src/main: java/org/apache/syncope/installer/processes/ java/org/apache/syncope/installer/utilities/ java/org/apache/syncope/installer/valida

2014-09-26 Thread andreapatricelli
Author: andreapatricelli
Date: Fri Sep 26 15:49:40 2014
New Revision: 1627813

URL: http://svn.apache.org/r1627813
Log:
[SYNCOPE-529] provided proxy feature to installer

Modified:

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/utilities/DriverLoader.java

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java

syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java

syncope/branches/1_2_X/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
syncope/branches/1_2_X/installer/src/main/resources/izpack/install.xml

syncope/branches/1_2_X/installer/src/main/resources/izpack/userInputLang.xml_eng

syncope/branches/1_2_X/installer/src/main/resources/izpack/userInputLang.xml_ita
syncope/branches/1_2_X/installer/src/main/resources/izpack/userInputSpec.xml

Modified: 
syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
URL: 
http://svn.apache.org/viewvc/syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java?rev=1627813r1=1627812r2=1627813view=diff
==
--- 
syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
 (original)
+++ 
syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
 Fri Sep 26 15:49:40 2014
@@ -21,14 +21,17 @@ package org.apache.syncope.installer.pro
 import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
 import org.apache.syncope.installer.files.Pom;
 import org.apache.syncope.installer.utilities.InstallLog;
 import org.apache.syncope.installer.utilities.MavenUtils;
+import org.xml.sax.SAXException;
 
 public class ArchetypeProcess {
 
 public void run(final AbstractUIProcessHandler handler, final String[] 
args) {
-
 final String installPath = args[0];
 final String mavenDir = args[1];
 final String groupId = args[2];
@@ -40,21 +43,61 @@ public class ArchetypeProcess {
 final String bundlesDirectory = args[8];
 final String syncopeVersion = args[9];
 final String syncopeAdminPassword = args[10];
+final boolean isProxyEnabled = Boolean.valueOf(args[11]);
+final String proxyHost = args[12];
+final String proxyPort = args[13];
+final String proxyUser = args[14];
+final String proxyPwd = args[15];
+final boolean mavenProxyAutoconf = Boolean.valueOf(args[16]);
 
 final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
 fileSystemUtils.createDirectory(installPath);
 InstallLog.initialize(installPath, handler);
-
 final MavenUtils mavenUtils = new MavenUtils(mavenDir, handler);
+File customMavenProxySettings = null;
+try {
+if (isProxyEnabled  mavenProxyAutoconf) {
+customMavenProxySettings = 
MavenUtils.createSettingsWithProxy(installPath, proxyHost, proxyPort,
+proxyUser, proxyPwd);
+}
+} catch (IOException ex) {
+final StringBuilder messageError = new StringBuilder(
+I/O error during creation of Maven custom settings.xml);
+final String emittedError = messageError.toString();
+handler.emitError(emittedError, emittedError);
+InstallLog.getInstance().error(messageError.append(ex.getMessage() 
== null ?  : ex.getMessage()).
+toString());
+} catch (ParserConfigurationException ex) {
+final StringBuilder messageError = new StringBuilder(
+Parser configuration error during creation of Maven 
custom settings.xml);
+final String emittedError = messageError.toString();
+handler.emitError(emittedError, emittedError);
+InstallLog.getInstance().error(messageError.append(ex.getMessage() 
== null ?  : ex.getMessage()).
+toString());
+} catch (TransformerException ex) {
+final StringBuilder messageError = new StringBuilder(
+Transformer error during creation of Maven custom 
settings.xml);
+final String emittedError = 

svn commit: r1627815 - in /syncope/trunk: ./ installer/src/main/java/org/apache/syncope/installer/processes/ installer/src/main/java/org/apache/syncope/installer/utilities/ installer/src/main/java/org

2014-09-26 Thread andreapatricelli
Author: andreapatricelli
Date: Fri Sep 26 15:53:10 2014
New Revision: 1627815

URL: http://svn.apache.org/r1627815
Log:
[SYNCOPE-529] merge from branch 1_2_X

Modified:
syncope/trunk/   (props changed)

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/DriverLoader.java

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java

syncope/trunk/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java
syncope/trunk/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
syncope/trunk/installer/src/main/resources/izpack/install.xml
syncope/trunk/installer/src/main/resources/izpack/userInputLang.xml_eng
syncope/trunk/installer/src/main/resources/izpack/userInputLang.xml_ita
syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml

Propchange: syncope/trunk/
--
  Merged /syncope/branches/1_2_X:r1627743-1627814

Modified: 
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
URL: 
http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java?rev=1627815r1=1627814r2=1627815view=diff
==
--- 
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
 (original)
+++ 
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
 Fri Sep 26 15:53:10 2014
@@ -21,14 +21,17 @@ package org.apache.syncope.installer.pro
 import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
+import java.io.IOException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
 import org.apache.syncope.installer.files.Pom;
 import org.apache.syncope.installer.utilities.InstallLog;
 import org.apache.syncope.installer.utilities.MavenUtils;
+import org.xml.sax.SAXException;
 
 public class ArchetypeProcess {
 
 public void run(final AbstractUIProcessHandler handler, final String[] 
args) {
-
 final String installPath = args[0];
 final String mavenDir = args[1];
 final String groupId = args[2];
@@ -40,21 +43,61 @@ public class ArchetypeProcess {
 final String bundlesDirectory = args[8];
 final String syncopeVersion = args[9];
 final String syncopeAdminPassword = args[10];
+final boolean isProxyEnabled = Boolean.valueOf(args[11]);
+final String proxyHost = args[12];
+final String proxyPort = args[13];
+final String proxyUser = args[14];
+final String proxyPwd = args[15];
+final boolean mavenProxyAutoconf = Boolean.valueOf(args[16]);
 
 final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
 fileSystemUtils.createDirectory(installPath);
 InstallLog.initialize(installPath, handler);
-
 final MavenUtils mavenUtils = new MavenUtils(mavenDir, handler);
+File customMavenProxySettings = null;
+try {
+if (isProxyEnabled  mavenProxyAutoconf) {
+customMavenProxySettings = 
MavenUtils.createSettingsWithProxy(installPath, proxyHost, proxyPort,
+proxyUser, proxyPwd);
+}
+} catch (IOException ex) {
+final StringBuilder messageError = new StringBuilder(
+I/O error during creation of Maven custom settings.xml);
+final String emittedError = messageError.toString();
+handler.emitError(emittedError, emittedError);
+InstallLog.getInstance().error(messageError.append(ex.getMessage() 
== null ?  : ex.getMessage()).
+toString());
+} catch (ParserConfigurationException ex) {
+final StringBuilder messageError = new StringBuilder(
+Parser configuration error during creation of Maven 
custom settings.xml);
+final String emittedError = messageError.toString();
+handler.emitError(emittedError, emittedError);
+InstallLog.getInstance().error(messageError.append(ex.getMessage() 
== null ?  : ex.getMessage()).
+toString());
+} catch (TransformerException ex) {
+final StringBuilder messageError = new StringBuilder(
+Transformer error during creation of Maven custom 
settings.xml);
+final