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 2013/07/24 11:28:36 UTC
svn commit: r1506463 - in /syncope/trunk:
common/src/main/java/org/apache/syncope/common/mod/
common/src/main/java/org/apache/syncope/common/report/
common/src/main/java/org/apache/syncope/common/to/
common/src/main/java/org/apache/syncope/common/types...
Author: ilgrosso
Date: Wed Jul 24 09:28:35 2013
New Revision: 1506463
URL: http://svn.apache.org/r1506463
Log:
[SYNCOPE-286] Completing Spring MVC removal, switching to JSON as default content type everywhere
Modified:
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/report/RoleReportletConf.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractTaskTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnBundleTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MappingTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AccountPolicySpec.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PasswordPolicySpec.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
syncope/trunk/console/src/main/resources/applicationContext.xml
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
syncope/trunk/core/src/test/resources/restClientContext.xml
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.mod;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashSet;
import java.util.Set;
@@ -36,14 +37,23 @@ import org.apache.syncope.common.Abstrac
public abstract class AbstractAttributableMod extends AbstractBaseBean {
private static final long serialVersionUID = 3241118574016303198L;
+
protected long id;
+
protected Set<AttributeMod> attributesToBeUpdated;
+
protected Set<String> attributesToBeRemoved;
+
protected Set<String> derivedAttributesToBeAdded;
+
protected Set<String> derivedAttributesToBeRemoved;
+
protected Set<AttributeMod> virtualAttributesToBeUpdated;
+
protected Set<String> virtualAttributesToBeRemoved;
+
protected Set<String> resourcesToBeAdded;
+
protected Set<String> resourcesToBeRemoved;
/**
@@ -92,6 +102,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "attributesToBeRemoved")
@XmlElement(name = "attribute")
+ @JsonProperty("attributesToBeRemoved")
public Set<String> getAttributesToBeRemoved() {
return attributesToBeRemoved;
}
@@ -124,6 +135,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "attributesToBeUpdated")
@XmlElement(name = "attributeMod")
+ @JsonProperty("attributesToBeUpdated")
public Set<AttributeMod> getAttributesToBeUpdated() {
return attributesToBeUpdated;
}
@@ -155,6 +167,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "derivedAttributesToBeAdded")
@XmlElement(name = "attributeName")
+ @JsonProperty("derivedAttributesToBeAdded")
public Set<String> getDerivedAttributesToBeAdded() {
return derivedAttributesToBeAdded;
}
@@ -174,6 +187,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "derivedAttributesToBeRemoved")
@XmlElement(name = "attribute")
+ @JsonProperty("derivedAttributesToBeRemoved")
public Set<String> getDerivedAttributesToBeRemoved() {
return derivedAttributesToBeRemoved;
}
@@ -185,6 +199,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "virtualAttributesToBeRemoved")
@XmlElement(name = "attribute")
+ @JsonProperty("virtualAttributesToBeRemoved")
public Set<String> getVirtualAttributesToBeRemoved() {
return virtualAttributesToBeRemoved;
}
@@ -214,8 +229,9 @@ public abstract class AbstractAttributab
return virtualAttributesToBeUpdated.remove(virtualAttributeToBeUpdated);
}
- @XmlElementWrapper(name = "derivedAttributesToBeUpdated")
+ @XmlElementWrapper(name = "virtualAttributesToBeUpdated")
@XmlElement(name = "attribute")
+ @JsonProperty("virtualAttributesToBeUpdated")
public Set<AttributeMod> getVirtualAttributesToBeUpdated() {
return virtualAttributesToBeUpdated;
}
@@ -235,6 +251,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "resourcesToBeAdded")
@XmlElement(name = "resource")
+ @JsonProperty("resourcesToBeAdded")
public Set<String> getResourcesToBeAdded() {
return resourcesToBeAdded;
}
@@ -253,6 +270,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "resourcesToBeRemoved")
@XmlElement(name = "resource")
+ @JsonProperty("resourcesToBeRemoved")
public Set<String> getResourcesToBeRemoved() {
return resourcesToBeRemoved;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.mod;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -66,6 +67,7 @@ public class AttributeMod extends Abstra
@XmlElementWrapper(name = "valuesToBeAdded")
@XmlElement(name = "value")
+ @JsonProperty("valuesToBeAdded")
public List<String> getValuesToBeAdded() {
return valuesToBeAdded;
}
@@ -84,6 +86,7 @@ public class AttributeMod extends Abstra
@XmlElementWrapper(name = "valuesToBeRemoved")
@XmlElement(name = "value")
+ @JsonProperty("valuesToBeRemoved")
public List<String> getValuesToBeRemoved() {
return valuesToBeRemoved;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.mod;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.Set;
@@ -55,6 +56,7 @@ public class MembershipMod extends Abstr
@XmlElementWrapper(name = "resourcesToBeAdded")
@XmlElement(name = "resource")
+ @JsonProperty("resourcesToBeAdded")
@Override
public Set<String> getResourcesToBeAdded() {
return Collections.emptySet();
@@ -62,6 +64,7 @@ public class MembershipMod extends Abstr
@XmlElementWrapper(name = "resourcesToBeRemoved")
@XmlElement(name = "resource")
+ @JsonProperty("resourcesToBeRemoved")
@Override
public Set<String> getResourcesToBeRemoved() {
return Collections.emptySet();
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.mod;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -112,8 +113,9 @@ public class RoleMod extends AbstractAtt
this.inheritVirtualAttributes = inheritVirtualAttributes;
}
- @XmlElement(name = "entitlement")
@XmlElementWrapper(name = "entitlements")
+ @XmlElement(name = "entitlement")
+ @JsonProperty("entitlements")
public List<String> getEntitlements() {
return entitlements;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.mod;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
@@ -68,6 +69,7 @@ public class UserMod extends AbstractAtt
@XmlElementWrapper(name = "membershipsToBeAdded")
@XmlElement(name = "membership")
+ @JsonProperty("membershipsToBeAdded")
public Set<MembershipMod> getMembershipsToBeAdded() {
return membershipsToBeAdded;
}
@@ -91,6 +93,7 @@ public class UserMod extends AbstractAtt
@XmlElementWrapper(name = "membershipsToBeRemoved")
@XmlElement(name = "membership")
+ @JsonProperty("membershipsToBeRemoved")
public Set<Long> getMembershipsToBeRemoved() {
return membershipsToBeRemoved;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/RoleReportletConf.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/RoleReportletConf.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/RoleReportletConf.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/RoleReportletConf.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.report;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -30,14 +31,14 @@ import org.apache.syncope.common.annotat
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.types.IntMappingType;
-@XmlRootElement(name = "RoleReportletConfiguration")
+@XmlRootElement(name = "roleReportletConf")
@XmlType
public class RoleReportletConf extends AbstractReportletConf {
private static final long serialVersionUID = -8488503068032439699L;
@XmlEnum
- @XmlType(name = "RoleReportletConfigurationFeature")
+ @XmlType(name = "roleReportletConfFeature")
public enum Feature {
id,
@@ -76,8 +77,9 @@ public class RoleReportletConf extends A
features = new ArrayList<Feature>();
}
- @XmlElementWrapper(name = "normalAttributes")
+ @XmlElementWrapper(name = "attributes")
@XmlElement(name = "attribute")
+ @JsonProperty("attributes")
public List<String> getAttrs() {
return attrs;
}
@@ -88,6 +90,7 @@ public class RoleReportletConf extends A
@XmlElementWrapper(name = "derivedAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("derivedAttributes")
public List<String> getDerAttrs() {
return derAttrs;
}
@@ -98,6 +101,7 @@ public class RoleReportletConf extends A
@XmlElementWrapper(name = "features")
@XmlElement(name = "feature")
+ @JsonProperty("features")
public List<Feature> getFeatures() {
return features;
}
@@ -116,6 +120,7 @@ public class RoleReportletConf extends A
@XmlElementWrapper(name = "virtualAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("virtualAttributes")
public List<String> getVirAttrs() {
return virAttrs;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.report;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -29,7 +30,7 @@ import javax.xml.bind.annotation.XmlType
import org.apache.syncope.common.types.TraceLevel;
-@XmlRootElement
+@XmlRootElement(name = "staticReportletConf")
@XmlType
public class StaticReportletConf extends AbstractReportletConf {
@@ -78,6 +79,7 @@ public class StaticReportletConf extends
@XmlElementWrapper(name = "listField")
@XmlElement(name = "field")
+ @JsonProperty("listField")
public List<String> getListField() {
return listField;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.report;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -31,12 +32,12 @@ import org.apache.syncope.common.annotat
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.types.IntMappingType;
-@XmlRootElement(name = "UserReportletConfiguration")
+@XmlRootElement(name = "userReportletConf")
@XmlType
public class UserReportletConf extends AbstractReportletConf {
@XmlEnum
- @XmlType(name = "UserReportletConfigurationFeature")
+ @XmlType(name = "userReportletConfFeature")
public enum Feature {
id,
@@ -81,8 +82,9 @@ public class UserReportletConf extends A
features = new ArrayList<Feature>();
}
- @XmlElementWrapper(name = "normalAttributes")
+ @XmlElementWrapper(name = "attributes")
@XmlElement(name = "attribute")
+ @JsonProperty("attributes")
public List<String> getAttrs() {
return attrs;
}
@@ -93,6 +95,7 @@ public class UserReportletConf extends A
@XmlElementWrapper(name = "derivedAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("derivedAttributes")
public List<String> getDerAttrs() {
return derAttrs;
}
@@ -103,6 +106,7 @@ public class UserReportletConf extends A
@XmlElementWrapper(name = "features")
@XmlElement(name = "feature")
+ @JsonProperty("features")
public List<Feature> getFeatures() {
return features;
}
@@ -121,6 +125,7 @@ public class UserReportletConf extends A
@XmlElementWrapper(name = "virtualAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("virtualAttributes")
public List<String> getVirAttrs() {
return virAttrs;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -106,12 +107,12 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "derivedAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("derivedAttributes")
public List<AttributeTO> getDerivedAttributes() {
return derivedAttributes;
}
public void setDerivedAttributes(final List<AttributeTO> derivedAttributes) {
-
this.derivedAttributes = derivedAttributes;
}
@@ -125,6 +126,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "virtualAttributes")
@XmlElement(name = "attribute")
+ @JsonProperty("virtualAttributes")
public List<AttributeTO> getVirtualAttributes() {
return virtualAttributes;
}
@@ -143,6 +145,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "resources")
@XmlElement(name = "resource")
+ @JsonProperty("resources")
public Set<String> getResources() {
return resources;
}
@@ -172,6 +175,7 @@ public abstract class AbstractAttributab
@XmlElementWrapper(name = "propagationStatuses")
@XmlElement(name = "propagationStatus")
+ @JsonProperty("propagationStatuses")
public List<PropagationStatusTO> getPropagationStatusTOs() {
return propagationStatusTOs;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractTaskTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractTaskTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractTaskTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractTaskTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
@@ -77,6 +78,7 @@ public abstract class AbstractTaskTO ext
@XmlElementWrapper(name = "excecutions")
@XmlElement(name = "excecution")
+ @JsonProperty("excecutions")
public List<TaskExecTO> getExecutions() {
return executions;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java Wed Jul 24 09:28:35 2013
@@ -18,10 +18,12 @@
*/
package org.apache.syncope.common.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;
@@ -95,8 +97,9 @@ public class AttributeTO extends Abstrac
/**
* @return attribute values as strings
*/
- //@XmlElementWrapper(name = "values")
+ @XmlElementWrapper(name = "values")
@XmlElement(name = "value")
+ @JsonProperty("values")
public List<String> getValues() {
return values;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnBundleTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnBundleTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnBundleTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnBundleTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -81,6 +82,7 @@ public class ConnBundleTO extends Abstra
@XmlElementWrapper(name = "properties")
@XmlElement(name = "connConfPropSchema")
+ @JsonProperty("properties")
public List<ConnConfPropSchema> getProperties() {
return properties;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -54,6 +55,7 @@ public class ConnObjectTO extends Abstra
@XmlElementWrapper(name = "attributes")
@XmlElement(name = "attribute")
+ @JsonProperty("attributes")
public List<AttributeTO> getAttributes() {
return attributes;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MappingTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MappingTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MappingTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MappingTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -114,6 +115,7 @@ public class MappingTO extends AbstractB
@SuppressWarnings("unchecked")
@XmlElementWrapper(name = "items")
@XmlElement(name = "item")
+ @JsonProperty("items")
public <T extends MappingItemTO> List<T> getItems() {
return (List<T>) items;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -66,6 +67,7 @@ public class MembershipTO extends Abstra
@Override
@XmlElementWrapper(name = "resources")
@XmlElement(name = "resource")
+ @JsonProperty("resources")
public Set<String> getResources() {
return Collections.<String>emptySet();
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -73,6 +74,7 @@ public class NotificationTO extends Abst
@XmlElementWrapper(name = "events")
@XmlElement(name = "event")
+ @JsonProperty("events")
public List<String> getEvents() {
return events;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
@@ -61,6 +62,7 @@ public class PropagationRequestTO extend
@XmlElementWrapper(name = "resources")
@XmlElement(name = "resource")
+ @JsonProperty("resources")
public Set<String> getResources() {
return resources;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -91,8 +92,9 @@ public class ReportTO extends AbstractBa
return this.reportletConfs.remove(reportlet);
}
- @XmlElementWrapper(name = "reportletConfigurations")
- @XmlElement(name="reportletconf")
+ @XmlElementWrapper(name = "reportletConfs")
+ @XmlElement(name = "reportletConf")
+ @JsonProperty("reportletConfs")
public List<AbstractReportletConf> getReportletConfs() {
return reportletConfs;
}
@@ -119,6 +121,7 @@ public class ReportTO extends AbstractBa
@XmlElementWrapper(name = "executions")
@XmlElement(name = "execution")
+ @JsonProperty("executions")
public List<ReportExecTO> getExecutions() {
return executions;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.to;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -141,6 +142,7 @@ public class RoleTO extends AbstractAttr
@XmlElementWrapper(name = "entitlements")
@XmlElement(name = "entitlement")
+ @JsonProperty("entitlements")
public List<String> getEntitlements() {
return entitlements;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
@@ -69,25 +70,26 @@ public class UserTO extends AbstractAttr
return password;
}
- public void setPassword(String password) {
+ public void setPassword(final String password) {
this.password = password;
}
- public boolean addMembership(MembershipTO membershipTO) {
+ public boolean addMembership(final MembershipTO membershipTO) {
return memberships.add(membershipTO);
}
- public boolean removeMembership(MembershipTO membershipTO) {
+ public boolean removeMembership(final MembershipTO membershipTO) {
return memberships.remove(membershipTO);
}
@XmlElementWrapper(name = "memberships")
@XmlElement(name = "membership")
+ @JsonProperty("memberships")
public List<MembershipTO> getMemberships() {
return memberships;
}
- public void setMemberships(List<MembershipTO> memberships) {
+ public void setMemberships(final List<MembershipTO> memberships) {
this.memberships = memberships;
}
@@ -112,7 +114,7 @@ public class UserTO extends AbstractAttr
return status;
}
- public void setStatus(String status) {
+ public void setStatus(final String status) {
this.status = status;
}
@@ -120,7 +122,7 @@ public class UserTO extends AbstractAttr
return token;
}
- public void setToken(String token) {
+ public void setToken(final String token) {
this.token = token;
}
@@ -130,7 +132,7 @@ public class UserTO extends AbstractAttr
: new Date(tokenExpireTime.getTime());
}
- public void setTokenExpireTime(Date tokenExpireTime) {
+ public void setTokenExpireTime(final Date tokenExpireTime) {
if (tokenExpireTime != null) {
this.tokenExpireTime = new Date(tokenExpireTime.getTime());
}
@@ -140,7 +142,7 @@ public class UserTO extends AbstractAttr
return username;
}
- public void setUsername(String username) {
+ public void setUsername(final String username) {
this.username = username;
}
@@ -160,19 +162,19 @@ public class UserTO extends AbstractAttr
return lastLoginDate;
}
- public void setChangePwdDate(Date changePwdDate) {
+ public void setChangePwdDate(final Date changePwdDate) {
this.changePwdDate = changePwdDate;
}
- public void setCreationDate(Date creationDate) {
+ public void setCreationDate(final Date creationDate) {
this.creationDate = creationDate;
}
- public void setFailedLogins(Integer failedLogins) {
+ public void setFailedLogins(final Integer failedLogins) {
this.failedLogins = failedLogins;
}
- public void setLastLoginDate(Date lastLoginDate) {
+ public void setLastLoginDate(final Date lastLoginDate) {
this.lastLoginDate = lastLoginDate;
}
@@ -181,7 +183,7 @@ public class UserTO extends AbstractAttr
return new ReflectionToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) {
@Override
- protected boolean accept(Field f) {
+ protected boolean accept(final Field f) {
return super.accept(f) && !f.getName().equals("password");
}
}.toString();
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java Wed Jul 24 09:28:35 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -116,6 +117,7 @@ public class WorkflowFormTO extends Abst
@XmlElementWrapper(name = "workflowFormProperties")
@XmlElement(name = "workflowFormProperty")
+ @JsonProperty("workflowFormProperties")
public List<WorkflowFormPropertyTO> getProperties() {
return properties;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AccountPolicySpec.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AccountPolicySpec.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AccountPolicySpec.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AccountPolicySpec.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.types;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
@@ -121,6 +122,7 @@ public class AccountPolicySpec extends A
@XmlElementWrapper(name = "prefixesNotPermitted")
@XmlElement(name = "prefix")
+ @JsonProperty("prefixesNotPermitted")
public List<String> getPrefixesNotPermitted() {
if (prefixesNotPermitted == null) {
prefixesNotPermitted = new ArrayList<String>();
@@ -134,6 +136,7 @@ public class AccountPolicySpec extends A
@XmlElementWrapper(name = "schemasNotPermitted")
@XmlElement(name = "schema")
+ @JsonProperty("schemasNotPermitted")
public List<String> getSchemasNotPermitted() {
if (schemasNotPermitted == null) {
schemasNotPermitted = new ArrayList<String>();
@@ -147,6 +150,7 @@ public class AccountPolicySpec extends A
@XmlElementWrapper(name = "suffixesNotPermitted")
@XmlElement(name = "suffix")
+ @JsonProperty("suffixesNotPermitted")
public List<String> getSuffixesNotPermitted() {
if (suffixesNotPermitted == null) {
suffixesNotPermitted = new ArrayList<String>();
@@ -160,6 +164,7 @@ public class AccountPolicySpec extends A
@XmlElementWrapper(name = "wordsNotPermitted")
@XmlElement(name = "word")
+ @JsonProperty("wordsNotPermitted")
public List<String> getWordsNotPermitted() {
if (wordsNotPermitted == null) {
wordsNotPermitted = new ArrayList<String>();
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PasswordPolicySpec.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PasswordPolicySpec.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PasswordPolicySpec.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PasswordPolicySpec.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.types;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -257,6 +258,7 @@ public class PasswordPolicySpec extends
@XmlElementWrapper(name = "prefixesNotPermitted")
@XmlElement(name = "prefix")
+ @JsonProperty("prefixesNotPermitted")
public List<String> getPrefixesNotPermitted() {
if (prefixesNotPermitted == null) {
prefixesNotPermitted = new ArrayList<String>();
@@ -270,6 +272,7 @@ public class PasswordPolicySpec extends
@XmlElementWrapper(name = "schemasNotPermitted")
@XmlElement(name = "schema")
+ @JsonProperty("schemasNotPermitted")
public List<String> getSchemasNotPermitted() {
if (schemasNotPermitted == null) {
schemasNotPermitted = new ArrayList<String>();
@@ -283,6 +286,7 @@ public class PasswordPolicySpec extends
@XmlElementWrapper(name = "suffixesNotPermitted")
@XmlElement(name = "suffix")
+ @JsonProperty("suffixesNotPermitted")
public List<String> getSuffixesNotPermitted() {
if (suffixesNotPermitted == null) {
suffixesNotPermitted = new ArrayList<String>();
@@ -304,6 +308,7 @@ public class PasswordPolicySpec extends
@XmlElementWrapper(name = "wordsNotPermitted")
@XmlElement(name = "word")
+ @JsonProperty("wordsNotPermitted")
public List<String> getWordsNotPermitted() {
if (wordsNotPermitted == null) {
wordsNotPermitted = new ArrayList<String>();
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncPolicySpec.java Wed Jul 24 09:28:35 2013
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.types;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
@@ -73,6 +74,7 @@ public class SyncPolicySpec extends Abst
@XmlElementWrapper(name = "userAltSearchSchemas")
@XmlElement(name = "userAltSearchSchema")
+ @JsonProperty("userAltSearchSchemas")
public List<String> getuAltSearchSchemas() {
return uAltSearchSchemas;
}
@@ -83,6 +85,7 @@ public class SyncPolicySpec extends Abst
@XmlElementWrapper(name = "roleAltSearchSchemas")
@XmlElement(name = "roleAltSearchSchema")
+ @JsonProperty("roleAltSearchSchemas")
public List<String> getrAltSearchSchemas() {
return rAltSearchSchemas;
}
Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java (original)
+++ syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java Wed Jul 24 09:28:35 2013
@@ -20,8 +20,10 @@ package org.apache.syncope.console;
import java.text.DateFormat;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import org.apache.syncope.client.rest.RestClientFactoryBean;
import org.apache.wicket.Session;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
@@ -51,6 +53,8 @@ public class SyncopeSession extends WebS
private final RestClientFactoryBean restClientFactory;
+ private final Map<Class<?>, Object> restServices = new HashMap<Class<?>, Object>();
+
public static SyncopeSession get() {
return (SyncopeSession) Session.get();
}
@@ -65,11 +69,15 @@ public class SyncopeSession extends WebS
}
public <T> T getService(final Class<T> service) {
- return restClientFactory.createServiceInstance(service, username, password);
+ return getService(service, this.username, this.password);
}
+ @SuppressWarnings("unchecked")
public <T> T getService(final Class<T> service, final String username, final String password) {
- return restClientFactory.createServiceInstance(service, username, password);
+ if (!restServices.containsKey(service)) {
+ restServices.put(service, restClientFactory.createServiceInstance(service, username, password));
+ }
+ return (T) restServices.get(service);
}
public String getUsername() {
Modified: syncope/trunk/console/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/resources/applicationContext.xml?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/console/src/main/resources/applicationContext.xml (original)
+++ syncope/trunk/console/src/main/resources/applicationContext.xml Wed Jul 24 09:28:35 2013
@@ -99,7 +99,7 @@ under the License.
<property name="address" value="${scheme}://${host}:${port}/${rootPath}"/>
<property name="threadSafe" value="true"/>
<property name="inheritHeaders" value="true"/>
- <property name="contentType" value="application/xml"/>
+ <property name="contentType" value="application/json"/>
<property name="features">
<list>
<cxf:logging/>
Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java (original)
+++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java Wed Jul 24 09:28:35 2013
@@ -24,9 +24,9 @@ import static org.junit.Assert.fail;
import java.util.UUID;
import javax.sql.DataSource;
-import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.http.HttpStatus;
@@ -78,9 +78,6 @@ public abstract class AbstractTest {
protected static final String ADMIN_PWD = "password";
- // JSON is not working completely, so let's stay with XML as default for the moment
- private static final String DEFAULT_CONTENT_TYPE = MediaType.APPLICATION_XML;
-
private static final String ENV_KEY_CONTENT_TYPE = "jaxrsContentType";
@Autowired
@@ -125,9 +122,10 @@ public abstract class AbstractTest {
@Before
public void setup() throws Exception {
final String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE);
- restClientFactory.setContentType((envContentType == null || envContentType.isEmpty())
- ? DEFAULT_CONTENT_TYPE
- : envContentType);
+ if (StringUtils.isNotBlank(envContentType)) {
+ restClientFactory.setContentType(envContentType);
+ }
+ LOG.info("Performing IT with content type {}", restClientFactory.getContentType());
userService = createServiceInstance(UserService.class);
userWorkflowService = createServiceInstance(UserWorkflowService.class);
Modified: syncope/trunk/core/src/test/resources/restClientContext.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/resources/restClientContext.xml?rev=1506463&r1=1506462&r2=1506463&view=diff
==============================================================================
--- syncope/trunk/core/src/test/resources/restClientContext.xml (original)
+++ syncope/trunk/core/src/test/resources/restClientContext.xml Wed Jul 24 09:28:35 2013
@@ -52,7 +52,7 @@ under the License.
<property name="address" value="http://localhost:9080/syncope/rest"/>
<property name="threadSafe" value="true"/>
<property name="inheritHeaders" value="true"/>
- <property name="contentType" value="application/xml"/>
+ <property name="contentType" value="application/json"/>
<property name="features">
<list>
<cxf:logging/>