You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2014/09/15 14:23:22 UTC

svn commit: r1625013 - in /syncope/trunk: ./ core-upgrader/src/main/java/org/apache/syncope/upgrader/ core-upgrader/src/main/resources/ core/src/main/java/org/apache/syncope/core/persistence/beans/ src/site/xdoc/

Author: ilgrosso
Date: Mon Sep 15 12:23:21 2014
New Revision: 1625013

URL: http://svn.apache.org/r1625013
Log:
Merge from 1_2_X

Added:
    syncope/trunk/core-upgrader/src/main/resources/mysql-upgrade.sql
      - copied unchanged from r1625012, syncope/branches/1_2_X/core-upgrader/src/main/resources/mysql-upgrade.sql
    syncope/trunk/core-upgrader/src/main/resources/postgresql-upgrade.sql
      - copied unchanged from r1625012, syncope/branches/1_2_X/core-upgrader/src/main/resources/postgresql-upgrade.sql
Removed:
    syncope/trunk/core-upgrader/src/main/resources/syncope-1.1.X-1.2.X.sql
Modified:
    syncope/trunk/   (props changed)
    syncope/trunk/core-upgrader/src/main/java/org/apache/syncope/upgrader/ContentUpgrader.java
    syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java
    syncope/trunk/src/site/xdoc/release-process.xml

Propchange: syncope/trunk/
------------------------------------------------------------------------------
  Merged /syncope/branches/1_2_X:r1624990-1625012
  Merged /syncope/branches/1_1_X:r1623345-1624961

Modified: syncope/trunk/core-upgrader/src/main/java/org/apache/syncope/upgrader/ContentUpgrader.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core-upgrader/src/main/java/org/apache/syncope/upgrader/ContentUpgrader.java?rev=1625013&r1=1625012&r2=1625013&view=diff
==============================================================================
--- syncope/trunk/core-upgrader/src/main/java/org/apache/syncope/upgrader/ContentUpgrader.java (original)
+++ syncope/trunk/core-upgrader/src/main/java/org/apache/syncope/upgrader/ContentUpgrader.java Mon Sep 15 12:23:21 2014
@@ -593,7 +593,6 @@ public class ContentUpgrader implements 
             jdbcTemplate.update("ALTER TABLE RAttr DROP COLUMN schema_name;");
             jdbcTemplate.update("ALTER TABLE RDerAttr DROP COLUMN DERIVEDSCHEMA_NAME;");
             jdbcTemplate.update("ALTER TABLE RVirAttr DROP COLUMN VIRTUALSCHEMA_NAME;");
-
         } catch (DataAccessException ex) {
             LOG.error("Error accessing RAttr or RAttrTemplate table", ex);
         }
@@ -671,6 +670,7 @@ public class ContentUpgrader implements 
                 // add template to normal attributes
                 for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MAttr WHERE OWNER_ID = ?", Long.class,
                         membership.getId())) {
+                    
                     final MAttr mAttr = attrDAO.find(attrId, MAttr.class);
 
                     LOG.info("Adding template to membership normal attribute {}", mAttr);
@@ -685,6 +685,7 @@ public class ContentUpgrader implements 
                 // add template to derived attributes
                 for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MDerAttr WHERE OWNER_ID = ?", Long.class,
                         membership.getId())) {
+                    
                     final MDerAttr mDerAttr = derAttrDAO.find(attrId, MDerAttr.class);
 
                     LOG.info("Adding template to membership derived attribute {}", mDerAttr);
@@ -699,6 +700,7 @@ public class ContentUpgrader implements 
                 // add template to virtual attributes
                 for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MVirAttr WHERE OWNER_ID = ?", Long.class,
                         membership.getId())) {
+                    
                     final MVirAttr mVirAttr = virAttrDAO.find(attrId, MVirAttr.class);
 
                     LOG.info("Adding template to membership virtual attribute {}", mVirAttr);
@@ -725,12 +727,14 @@ public class ContentUpgrader implements 
 
     private <T extends AbstractAttrTemplate<K>, K extends AbstractSchema> T getTemplate(final Object obj,
             final String schemaName, final Class<T> reference) {
+
         T attrTemplate = null;
         for (Number number : attrTemplateDAO.findBySchemaName(schemaName, reference)) {
             final T attrTemplateTemp = attrTemplateDAO.find((Long) number, reference);
 
-            if (attrTemplateTemp.getOwner().equals(obj instanceof SyncopeRole ? (SyncopeRole) obj : ((Membership) obj).
-                    getSyncopeRole())) {
+            if (attrTemplateTemp.getOwner().equals(obj instanceof SyncopeRole
+                    ? (SyncopeRole) obj : ((Membership) obj).getSyncopeRole())) {
+
                 attrTemplate = attrTemplateTemp;
             }
         }

Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java?rev=1625013&r1=1625012&r2=1625013&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/ConnInstance.java Mon Sep 15 12:23:21 2014
@@ -34,6 +34,7 @@ import javax.persistence.FetchType;
 import javax.persistence.Id;
 import javax.persistence.Lob;
 import javax.persistence.OneToMany;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.common.types.ConnConfProperty;
 import org.apache.syncope.common.types.ConnectorCapability;
@@ -155,10 +156,15 @@ public class ConnInstance extends Abstra
     }
 
     public Set<ConnConfProperty> getConfiguration() {
-        return StringUtils.isBlank(jsonConf)
-                ? Collections.<ConnConfProperty>emptySet()
-                : new HashSet<ConnConfProperty>(
-                        Arrays.asList(POJOHelper.deserialize(jsonConf, ConnConfProperty[].class)));
+        Set<ConnConfProperty> configuration = Collections.<ConnConfProperty>emptySet();
+        if (!StringUtils.isBlank(jsonConf)) {
+            ConnConfProperty[] deserialized = POJOHelper.deserialize(jsonConf, ConnConfProperty[].class);
+            if (ArrayUtils.isNotEmpty(deserialized)) {
+                configuration = new HashSet<ConnConfProperty>(Arrays.asList(deserialized));
+            }
+        }
+
+        return configuration;
     }
 
     public void setConfiguration(final Set<ConnConfProperty> configuration) {

Modified: syncope/trunk/src/site/xdoc/release-process.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/src/site/xdoc/release-process.xml?rev=1625013&r1=1625012&r2=1625013&view=diff
==============================================================================
--- syncope/trunk/src/site/xdoc/release-process.xml (original)
+++ syncope/trunk/src/site/xdoc/release-process.xml Mon Sep 15 12:23:21 2014
@@ -469,8 +469,6 @@ svn mv -m "Moving the voted release arti
 https://dist.apache.org/repos/dist/dev/syncope/<version>
 https://dist.apache.org/repos/dist/release/syncope/<version>
 
-svn rm -m "Cleaning up older releases" https://dist.apache.org/repos/dist/dev/syncope/<version>
-
 svn co https://dist.apache.org/repos/dist/release/syncope syncope-dist-release
 cd syncope-dist-release
 svn rm <any older release artifact (if present)>