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 2016/03/24 17:09:51 UTC
[1/7] syncope git commit: More robust handling of few edge cases
Repository: syncope
Updated Branches:
refs/heads/master c2af45e21 -> 18e9a4907
More robust handling of few edge cases
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5c730909
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5c730909
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5c730909
Branch: refs/heads/master
Commit: 5c7309096e656549bcf39c4beb9156ed3eb9a5d0
Parents: c2af45e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Mar 22 17:38:23 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Mar 22 17:38:23 2016 +0100
----------------------------------------------------------------------
.../core/logic/report/ReconciliationReportlet.java | 14 +++++++-------
.../java/propagation/PropagationManagerImpl.java | 11 +++++++++--
2 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/5c730909/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
index 37d69d7..a1c86c6 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/report/ReconciliationReportlet.java
@@ -272,24 +272,24 @@ public class ReconciliationReportlet extends AbstractReportlet {
for (final ExternalResource resource : anyUtils.getAllResources(any)) {
Provision provision = resource.getProvision(any.getType());
MappingItem connObjectKeyItem = MappingManagerImpl.getConnObjectKeyItem(provision);
- if (provision != null && connObjectKeyItem != null) {
- // 1. build connObjectKeyValue
- final String connObjectKeyValue = mappingManager.getConnObjectKeyValue(any, provision);
-
- // 2. read from the underlying connector
+ final String connObjectKeyValue = connObjectKeyItem == null
+ ? StringUtils.EMPTY
+ : mappingManager.getConnObjectKeyValue(any, provision);
+ if (provision != null && connObjectKeyItem != null && StringUtils.isNotBlank(connObjectKeyValue)) {
+ // 1. read from the underlying connector
Connector connector = connFactory.getConnector(resource);
ConnectorObject connectorObject = connector.getObject(provision.getObjectClass(),
new Uid(connObjectKeyValue),
MappingManagerImpl.buildOperationOptions(provision.getMapping().getItems().iterator()));
if (connectorObject == null) {
- // 3. not found on resource?
+ // 2. not found on resource?
LOG.error("Object {} with class {} not found on resource {}",
connObjectKeyValue, provision.getObjectClass(), resource);
missing.add(new Missing(resource.getKey(), connObjectKeyValue));
} else {
- // 4. found but misaligned?
+ // 3. found but misaligned?
Pair<String, Set<Attribute>> preparedAttrs =
mappingManager.prepareAttrs(any, null, false, null, provision);
preparedAttrs.getRight().add(AttributeBuilder.build(
http://git-wip-us.apache.org/repos/asf/syncope/blob/5c730909/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
index 5f66a2f..1aedfa4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
@@ -262,11 +262,18 @@ public class PropagationManagerImpl implements PropagationManager {
final Collection<AttrTO> vAttrs,
final Collection<String> noPropResourceNames) {
- if (noPropResourceNames != null) {
+ if (noPropResourceNames != null && propByRes != null) {
propByRes.removeAll(noPropResourceNames);
}
- return createTasks(any, password, changePwd, enable, false, propByRes, vAttrs);
+ return createTasks(
+ any,
+ password,
+ changePwd,
+ enable,
+ false,
+ propByRes == null ? new PropagationByResource() : propByRes,
+ vAttrs);
}
@Override
[4/7] syncope git commit: Upgrading Angular and related
Posted by il...@apache.org.
Upgrading Angular and related
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/dd15ebd9
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/dd15ebd9
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/dd15ebd9
Branch: refs/heads/master
Commit: dd15ebd90e01c4bd9a76b57d599fa70604a0c90a
Parents: 0b4c4c8
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Mar 23 11:15:07 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Mar 23 11:15:07 2016 +0100
----------------------------------------------------------------------
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/dd15ebd9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2d1d604..e821302 100644
--- a/pom.xml
+++ b/pom.xml
@@ -393,9 +393,9 @@ under the License.
<wicket-bootstrap.version>0.10.6</wicket-bootstrap.version>
<wicket-chartjs.version>7.0.1</wicket-chartjs.version>
- <angular.version>1.5.1</angular.version>
+ <angular.version>1.5.2</angular.version>
<angular-ui-router.version>0.2.18</angular-ui-router.version>
- <angular-ui-bootstrap.version>1.2.1</angular-ui-bootstrap.version>
+ <angular-ui-bootstrap.version>1.2.5</angular-ui-bootstrap.version>
<angular-ui-select.version>0.14.8</angular-ui-select.version>
<angular-treasure-overlay-spinner.version>1.1.0</angular-treasure-overlay-spinner.version>
<ng-password-strength.version>0.2.1</ng-password-strength.version>
[6/7] syncope git commit: Upgrading jQuery and codemirror
Posted by il...@apache.org.
Upgrading jQuery and codemirror
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/23a391ea
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/23a391ea
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/23a391ea
Branch: refs/heads/master
Commit: 23a391ea7e981a915fab6be42d8ba3d892add056
Parents: 371ad7b
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Mar 24 15:02:24 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Mar 24 15:02:24 2016 +0100
----------------------------------------------------------------------
.../rest/api/service/AnyObjectService.java | 2 +-
.../common/rest/api/service/AnyService.java | 44 ++++++++++----------
.../rest/api/service/AnyTypeClassService.java | 8 ++--
.../common/rest/api/service/AnyTypeService.java | 8 ++--
.../rest/api/service/ConfigurationService.java | 8 ++--
.../rest/api/service/ConnectorService.java | 22 +++++-----
.../common/rest/api/service/DomainService.java | 8 ++--
.../common/rest/api/service/GroupService.java | 4 +-
.../common/rest/api/service/JAXRSService.java | 4 --
.../common/rest/api/service/LoggerService.java | 8 ++--
.../rest/api/service/MailTemplateService.java | 6 +--
.../rest/api/service/NotificationService.java | 10 ++---
.../common/rest/api/service/PolicyService.java | 8 ++--
.../common/rest/api/service/RealmService.java | 8 ++--
.../api/service/RelationshipTypeService.java | 8 ++--
.../common/rest/api/service/ReportService.java | 16 +++----
.../rest/api/service/ReportTemplateService.java | 6 +--
.../rest/api/service/ResourceService.java | 26 ++++++------
.../common/rest/api/service/RoleService.java | 8 ++--
.../common/rest/api/service/SchemaService.java | 8 ++--
.../api/service/SecurityQuestionService.java | 12 +++---
.../common/rest/api/service/SyncopeService.java | 6 +--
.../common/rest/api/service/TaskService.java | 20 ++++-----
.../rest/api/service/UserSelfService.java | 18 ++++----
.../common/rest/api/service/UserService.java | 10 ++---
.../rest/api/service/UserWorkflowService.java | 14 +++----
.../rest/api/service/WorkflowService.java | 4 +-
.../rest/api/service/CamelRouteService.java | 8 ++--
pom.xml | 4 +-
29 files changed, 156 insertions(+), 160 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java
index 5599ed1..eaa6439 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java
@@ -44,7 +44,7 @@ public interface AnyObjectService extends AnyService<AnyObjectTO, AnyObjectPatch
* @return paged list of existing any objects matching the given query, for the given type
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedResult<AnyObjectTO> list(@NotNull @MatrixParam("type") String type, @BeanParam AnyListQuery listQuery);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
index ec46d19..c0b520c 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java
@@ -54,7 +54,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@GET
@Path("{key}/{schemaType}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Set<AttrTO> read(@NotNull @PathParam("key") Long key, @NotNull @PathParam("schemaType") SchemaType schemaType);
/**
@@ -67,7 +67,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@GET
@Path("{key}/{schemaType}/{schema}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
AttrTO read(
@NotNull @PathParam("key") Long key,
@NotNull @PathParam("schemaType") SchemaType schemaType,
@@ -81,7 +81,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
TO read(@NotNull @PathParam("key") Long key);
/**
@@ -92,7 +92,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@GET
@Path("search")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedResult<TO> search(@BeanParam AnySearchQuery searchQuery);
/**
@@ -103,8 +103,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
* object itself enriched with propagation status information - ProvisioningResult as Entity
*/
@POST
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull TO anyTO);
/**
@@ -116,8 +116,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@PATCH
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(@NotNull P anyPatch);
/**
@@ -130,8 +130,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@PUT
@Path("{key}/{schemaType}/{schema}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(
@NotNull @PathParam("key") Long key,
@NotNull @PathParam("schemaType") SchemaType schemaType,
@@ -146,8 +146,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@PUT
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(@NotNull TO anyTO);
/**
@@ -159,8 +159,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@DELETE
@Path("{key}/{schemaType}/{schema}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void delete(
@NotNull @PathParam("key") Long key,
@NotNull @PathParam("schemaType") SchemaType schemaType,
@@ -175,8 +175,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@DELETE
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response delete(@NotNull @PathParam("key") Long key);
/**
@@ -187,8 +187,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@POST
@Path("{key}/deassociate/{action}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response deassociate(@NotNull DeassociationPatch patch);
/**
@@ -199,8 +199,8 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@POST
@Path("{key}/associate/{action}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response associate(@NotNull AssociationPatch patch);
/**
@@ -211,7 +211,7 @@ public interface AnyService<TO extends AnyTO, P extends AnyPatch> extends JAXRSS
*/
@POST
@Path("bulk")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
index 729511d..3a91e4a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java
@@ -44,7 +44,7 @@ public interface AnyTypeClassService extends JAXRSService {
* @return list of all anyTypeClasss.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<AnyTypeClassTO> list();
/**
@@ -55,7 +55,7 @@ public interface AnyTypeClassService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
AnyTypeClassTO read(@NotNull @PathParam("key") String key);
/**
@@ -65,7 +65,7 @@ public interface AnyTypeClassService extends JAXRSService {
* @return Response object featuring Location header of created anyTypeClass
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull AnyTypeClassTO anyTypeClassTO);
/**
@@ -75,7 +75,7 @@ public interface AnyTypeClassService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull AnyTypeClassTO anyTypeClassTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
index 5cfe997..aa639e8 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java
@@ -44,7 +44,7 @@ public interface AnyTypeService extends JAXRSService {
* @return list of all anyTypes.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<AnyTypeTO> list();
/**
@@ -55,7 +55,7 @@ public interface AnyTypeService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
AnyTypeTO read(@NotNull @PathParam("key") String key);
/**
@@ -65,7 +65,7 @@ public interface AnyTypeService extends JAXRSService {
* @return Response object featuring Location header of created anyType
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull AnyTypeTO anyTypeTO);
/**
@@ -75,7 +75,7 @@ public interface AnyTypeService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull AnyTypeTO anyTypeTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
index 09d290d..41466e2 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
@@ -52,7 +52,7 @@ public interface ConfigurationService extends JAXRSService {
* @return all configuration parameters
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<AttrTO> list();
/**
@@ -63,7 +63,7 @@ public interface ConfigurationService extends JAXRSService {
*/
@GET
@Path("{schema}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
AttrTO get(@NotNull @PathParam("schema") String schema);
/**
@@ -73,7 +73,7 @@ public interface ConfigurationService extends JAXRSService {
*/
@PUT
@Path("{schema}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void set(@NotNull AttrTO value);
/**
@@ -83,6 +83,6 @@ public interface ConfigurationService extends JAXRSService {
*/
@DELETE
@Path("{schema}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void delete(@NotNull @PathParam("schema") String schema);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
index ad76af3..50778a8 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
@@ -52,7 +52,7 @@ public interface ConnectorService extends JAXRSService {
*/
@GET
@Path("bundles")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ConnBundleTO> getBundles(@QueryParam("lang") String lang);
/**
@@ -67,8 +67,8 @@ public interface ConnectorService extends JAXRSService {
*/
@POST
@Path("{key}/supportedObjectClasses")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ConnIdObjectClassTO> buildObjectClassInfo(
@NotNull ConnInstanceTO connInstanceTO,
@QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
@@ -83,7 +83,7 @@ public interface ConnectorService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ConnInstanceTO read(@NotNull @PathParam("key") Long key, @QueryParam("lang") String lang);
/**
@@ -96,7 +96,7 @@ public interface ConnectorService extends JAXRSService {
*/
@GET
@Path("byResource/{resourceName}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ConnInstanceTO readByResource(
@NotNull @PathParam("resourceName") String resourceName, @QueryParam("lang") String lang);
@@ -108,7 +108,7 @@ public interface ConnectorService extends JAXRSService {
* @return list of all connector instances with property keys in the matching language
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ConnInstanceTO> list(@QueryParam("lang") String lang);
/**
@@ -118,7 +118,7 @@ public interface ConnectorService extends JAXRSService {
* @return Response object featuring Location header of created connector instance
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull ConnInstanceTO connInstanceTO);
/**
@@ -128,7 +128,7 @@ public interface ConnectorService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull ConnInstanceTO connInstanceTO);
/**
@@ -147,7 +147,7 @@ public interface ConnectorService extends JAXRSService {
*/
@POST
@Path("check")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void check(@NotNull ConnInstanceTO connInstanceTO);
/**
@@ -165,7 +165,7 @@ public interface ConnectorService extends JAXRSService {
*/
@POST
@Path("bulk")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
index e9309ae..3443ff6 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DomainService.java
@@ -44,7 +44,7 @@ public interface DomainService extends JAXRSService {
* @return list of all domains.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<DomainTO> list();
/**
@@ -55,7 +55,7 @@ public interface DomainService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
DomainTO read(@NotNull @PathParam("key") String key);
/**
@@ -65,7 +65,7 @@ public interface DomainService extends JAXRSService {
* @return Response object featuring Location header of created domain
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull DomainTO domainTO);
/**
@@ -75,7 +75,7 @@ public interface DomainService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull DomainTO domainTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
index 9d5308c..4193771 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java
@@ -43,7 +43,7 @@ public interface GroupService extends AnyService<GroupTO, GroupPatch> {
*/
@GET
@Path("own")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<GroupTO> own();
/**
@@ -53,6 +53,6 @@ public interface GroupService extends AnyService<GroupTO, GroupPatch> {
* @return paged list of existing groups matching the given query
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedResult<GroupTO> list(@BeanParam AnyListQuery listQuery);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
index 0b3a735..806053f 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
@@ -18,12 +18,8 @@
*/
package org.apache.syncope.common.rest.api.service;
-import javax.ws.rs.core.MediaType;
-
public interface JAXRSService {
- String APPLICATION_XML = MediaType.APPLICATION_XML + ";qs=0.9";
-
String PARAM_FIQL = "fiql";
String PARAM_PAGE = "page";
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
index f6c9f39..0879b60 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
@@ -46,7 +46,7 @@ public interface LoggerService extends JAXRSService {
*/
@GET
@Path("events")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<EventCategoryTO> events();
/**
@@ -58,7 +58,7 @@ public interface LoggerService extends JAXRSService {
*/
@GET
@Path("{type}/{name}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
LoggerTO read(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") final String name);
/**
@@ -69,7 +69,7 @@ public interface LoggerService extends JAXRSService {
*/
@GET
@Path("{type}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<LoggerTO> list(@NotNull @PathParam("type") LoggerType type);
/**
@@ -80,7 +80,7 @@ public interface LoggerService extends JAXRSService {
*/
@PUT
@Path("{type}/{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull @PathParam("type") LoggerType type, @NotNull LoggerTO logger);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java
index d8e747a..15f7703 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java
@@ -46,7 +46,7 @@ public interface MailTemplateService extends JAXRSService {
* @return list of all mail templates.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<MailTemplateTO> list();
/**
@@ -56,7 +56,7 @@ public interface MailTemplateService extends JAXRSService {
* @return Response object featuring Location header of created mail template
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull MailTemplateTO mailTemplateTO);
/**
@@ -67,7 +67,7 @@ public interface MailTemplateService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
MailTemplateTO read(@NotNull @PathParam("key") String key);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
index 7200ed8..c0ed504 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
@@ -49,7 +49,7 @@ public interface NotificationService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
NotificationTO read(@NotNull @PathParam("key") Long key);
/**
@@ -58,7 +58,7 @@ public interface NotificationService extends JAXRSService {
* @return list of all notifications.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<NotificationTO> list();
/**
@@ -68,7 +68,7 @@ public interface NotificationService extends JAXRSService {
* @return Response object featuring Location header of created notification
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull NotificationTO notificationTO);
/**
@@ -78,7 +78,7 @@ public interface NotificationService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull NotificationTO notificationTO);
/**
@@ -97,7 +97,7 @@ public interface NotificationService extends JAXRSService {
*/
@GET
@Path("job")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
JobTO getJob();
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
index c0e33e7..073e5dd 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
@@ -49,7 +49,7 @@ public interface PolicyService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractPolicyTO> T read(@NotNull @PathParam("key") Long key);
/**
@@ -60,7 +60,7 @@ public interface PolicyService extends JAXRSService {
* @return list of policies with matching type
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractPolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
/**
@@ -70,7 +70,7 @@ public interface PolicyService extends JAXRSService {
* @return Response object featuring Location header of created policy
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull AbstractPolicyTO policyTO);
/**
@@ -80,7 +80,7 @@ public interface PolicyService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull AbstractPolicyTO policyTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
index db772ce..17259f2 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java
@@ -44,7 +44,7 @@ public interface RealmService extends JAXRSService {
* @return list of all realms.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<RealmTO> list();
/**
@@ -55,7 +55,7 @@ public interface RealmService extends JAXRSService {
*/
@GET
@Path("{fullPath:.*}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<RealmTO> list(@NotNull @PathParam("fullPath") String fullPath);
/**
@@ -67,7 +67,7 @@ public interface RealmService extends JAXRSService {
*/
@POST
@Path("{parentPath:.*}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull @PathParam("parentPath") String parentPath, @NotNull RealmTO realmTO);
/**
@@ -77,7 +77,7 @@ public interface RealmService extends JAXRSService {
*/
@PUT
@Path("{fullPath:.*}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull RealmTO realmTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
index a2b199b..4b3c640 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java
@@ -44,7 +44,7 @@ public interface RelationshipTypeService extends JAXRSService {
* @return list of all relationshipTypes.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<RelationshipTypeTO> list();
/**
@@ -55,7 +55,7 @@ public interface RelationshipTypeService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
RelationshipTypeTO read(@NotNull @PathParam("key") String key);
/**
@@ -65,7 +65,7 @@ public interface RelationshipTypeService extends JAXRSService {
* @return Response object featuring Location header of created relationshipType
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull RelationshipTypeTO relationshipTypeTO);
/**
@@ -75,7 +75,7 @@ public interface RelationshipTypeService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull RelationshipTypeTO relationshipTypeTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
index 235cfcb..cd810e8 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
@@ -57,7 +57,7 @@ public interface ReportService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ReportTO read(@NotNull @PathParam("key") Long key);
/**
@@ -66,7 +66,7 @@ public interface ReportService extends JAXRSService {
* @return paged list of existing reports matching the given query
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ReportTO> list();
/**
@@ -76,7 +76,7 @@ public interface ReportService extends JAXRSService {
* @return Response object featuring Location header of created report
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull ReportTO reportTO);
/**
@@ -86,7 +86,7 @@ public interface ReportService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull ReportTO reportTO);
/**
@@ -106,7 +106,7 @@ public interface ReportService extends JAXRSService {
*/
@GET
@Path("executions/recent")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ExecTO> listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
/**
@@ -137,7 +137,7 @@ public interface ReportService extends JAXRSService {
*/
@POST
@Path("{key}/execute")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ExecTO execute(@BeanParam ExecuteQuery query);
/**
@@ -149,7 +149,7 @@ public interface ReportService extends JAXRSService {
*/
@GET
@Path("executions/{executionKey}/stream")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response exportExecutionResult(
@NotNull @PathParam("executionKey") Long executionKey,
@QueryParam("format") ReportExecExportFormat fmt);
@@ -161,7 +161,7 @@ public interface ReportService extends JAXRSService {
*/
@GET
@Path("jobs")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<JobTO> listJobs();
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportTemplateService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportTemplateService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportTemplateService.java
index e622582..12c197a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportTemplateService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportTemplateService.java
@@ -46,7 +46,7 @@ public interface ReportTemplateService extends JAXRSService {
* @return list of all report templates.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ReportTemplateTO> list();
/**
@@ -56,7 +56,7 @@ public interface ReportTemplateService extends JAXRSService {
* @return Response object featuring Location header of created report template
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull ReportTemplateTO reportTemplateTO);
/**
@@ -67,7 +67,7 @@ public interface ReportTemplateService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ReportTemplateTO read(@NotNull @PathParam("key") String key);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
index a007eaf..2aeb6aa 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
@@ -55,7 +55,7 @@ public interface ResourceService extends JAXRSService {
*/
@GET
@Path("{key}/{anyTypeKey}/{anyKey}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ConnObjectTO readConnObject(
@NotNull @PathParam("key") String key,
@NotNull @PathParam("anyTypeKey") String anyTypeKey,
@@ -72,7 +72,7 @@ public interface ResourceService extends JAXRSService {
*/
@GET
@Path("{key}/{anyTypeKey}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedConnObjectTOResult listConnObjects(
@NotNull @PathParam("key") String key,
@NotNull @PathParam("anyTypeKey") String anyTypeKey,
@@ -86,7 +86,7 @@ public interface ResourceService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ResourceTO read(@NotNull @PathParam("key") String key);
/**
@@ -95,7 +95,7 @@ public interface ResourceService extends JAXRSService {
* @return list of all resources
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ResourceTO> list();
/**
@@ -105,7 +105,7 @@ public interface ResourceService extends JAXRSService {
* @return Response object featuring Location header of created resource
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull ResourceTO resourceTO);
/**
@@ -115,7 +115,7 @@ public interface ResourceService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull ResourceTO resourceTO);
/**
@@ -125,7 +125,7 @@ public interface ResourceService extends JAXRSService {
*/
@DELETE
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void delete(@NotNull @PathParam("key") String key);
/**
@@ -135,8 +135,8 @@ public interface ResourceService extends JAXRSService {
*/
@POST
@Path("check")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void check(@NotNull ResourceTO resourceTO);
/**
@@ -147,8 +147,8 @@ public interface ResourceService extends JAXRSService {
*/
@POST
@Path("{key}/bulkDeassociation/{anyTypeKey}/{action}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
BulkActionResult bulkDeassociation(@NotNull ResourceDeassociationPatch patch);
/**
@@ -159,7 +159,7 @@ public interface ResourceService extends JAXRSService {
*/
@POST
@Path("bulk")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
index 6fe55a6..132e27a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java
@@ -44,7 +44,7 @@ public interface RoleService extends JAXRSService {
* @return list of all roles.
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<RoleTO> list();
/**
@@ -55,7 +55,7 @@ public interface RoleService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
RoleTO read(@NotNull @PathParam("key") String key);
/**
@@ -65,7 +65,7 @@ public interface RoleService extends JAXRSService {
* @return Response object featuring Location header of created role
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull RoleTO roleTO);
/**
@@ -75,7 +75,7 @@ public interface RoleService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull RoleTO roleTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
index 48f9b40..bca814e 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
@@ -51,7 +51,7 @@ public interface SchemaService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractSchemaTO> T read(
@NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String key);
@@ -63,7 +63,7 @@ public interface SchemaService extends JAXRSService {
* @return list of schemas with matching type, for the given anyTypeClass if provided
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractSchemaTO> List<T> list(@BeanParam SchemaQuery query);
/**
@@ -74,7 +74,7 @@ public interface SchemaService extends JAXRSService {
* @return Response object featuring Location header of created schema
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
/**
@@ -85,7 +85,7 @@ public interface SchemaService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
index be69f40..546365e 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java
@@ -44,7 +44,7 @@ public interface SecurityQuestionService extends JAXRSService {
* @return list of all security questions
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<SecurityQuestionTO> list();
/**
@@ -55,7 +55,7 @@ public interface SecurityQuestionService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
SecurityQuestionTO read(@NotNull @PathParam("key") Long key);
/**
@@ -65,7 +65,7 @@ public interface SecurityQuestionService extends JAXRSService {
* @return Response object featuring Location header of created security question
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull SecurityQuestionTO securityQuestionTO);
/**
@@ -75,7 +75,7 @@ public interface SecurityQuestionService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull SecurityQuestionTO securityQuestionTO);
/**
@@ -95,7 +95,7 @@ public interface SecurityQuestionService extends JAXRSService {
*/
@GET
@Path("byUser/{username}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
SecurityQuestionTO readByUser(@NotNull @PathParam("username") String username);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
index cb2ad8b..c60b974 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
@@ -41,7 +41,7 @@ public interface SyncopeService extends JAXRSService {
*/
@GET
@Path("/platform")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PlatformInfo platform();
/**
@@ -51,7 +51,7 @@ public interface SyncopeService extends JAXRSService {
*/
@GET
@Path("/system")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
SystemInfo system();
/** *
@@ -61,6 +61,6 @@ public interface SyncopeService extends JAXRSService {
*/
@GET
@Path("/numbers")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
NumbersInfo numbers();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
index 2e34de6..965c9c7 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
@@ -63,7 +63,7 @@ public interface TaskService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractTaskTO> T read(
@NotNull @PathParam("key") Long key,
@QueryParam(JAXRSService.PARAM_DETAILS) @DefaultValue("true") boolean details);
@@ -76,7 +76,7 @@ public interface TaskService extends JAXRSService {
* @return paged list of existing tasks matching the given query
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends AbstractTaskTO> PagedResult<T> list(@BeanParam TaskQuery query);
/**
@@ -86,7 +86,7 @@ public interface TaskService extends JAXRSService {
* @return Response object featuring Location header of created task
*/
@POST
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull SchedTaskTO taskTO);
/**
@@ -96,7 +96,7 @@ public interface TaskService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull AbstractTaskTO taskTO);
/**
@@ -116,7 +116,7 @@ public interface TaskService extends JAXRSService {
*/
@GET
@Path("{key}/executions")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedResult<ExecTO> listExecutions(@BeanParam TaskExecQuery query);
/**
@@ -127,7 +127,7 @@ public interface TaskService extends JAXRSService {
*/
@GET
@Path("executions/recent")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<ExecTO> listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
/**
@@ -158,7 +158,7 @@ public interface TaskService extends JAXRSService {
*/
@POST
@Path("{key}/execute")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
ExecTO execute(@BeanParam ExecuteQuery query);
/**
@@ -169,8 +169,8 @@ public interface TaskService extends JAXRSService {
*/
@POST
@Path("bulk")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
BulkActionResult bulk(@NotNull BulkAction bulkAction);
/**
@@ -180,7 +180,7 @@ public interface TaskService extends JAXRSService {
*/
@GET
@Path("jobs")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<JobTO> listJobs();
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
index 1248da5..44a592e 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java
@@ -47,7 +47,7 @@ public interface UserSelfService extends JAXRSService {
* {@link org.apache.syncope.common.rest.api.RESTHeaders#OWNED_ENTITLEMENTS}
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response read();
/**
@@ -59,8 +59,8 @@ public interface UserSelfService extends JAXRSService {
* itself - ProvisioningResult as Entity
*/
@POST
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull UserTO userTO,
@DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
@@ -72,8 +72,8 @@ public interface UserSelfService extends JAXRSService {
*/
@PATCH
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(@NotNull UserPatch patch);
/**
@@ -84,8 +84,8 @@ public interface UserSelfService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(@NotNull UserTO user);
/**
@@ -94,7 +94,7 @@ public interface UserSelfService extends JAXRSService {
* @return Response object featuring the deleted user - ProvisioningResult as Entity
*/
@DELETE
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response delete();
/**
@@ -106,7 +106,7 @@ public interface UserSelfService extends JAXRSService {
*/
@POST
@Path("changePassword")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response changePassword(@NotNull @QueryParam("password") String password);
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
index c333163..df57bd5 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java
@@ -70,7 +70,7 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
* @return paged list of existing users matching the given query
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
PagedResult<UserTO> list(@BeanParam AnyListQuery listQuery);
/**
@@ -82,8 +82,8 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
* enriched with propagation status information - ProvisioningResult as Entity
*/
@POST
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(
@NotNull UserTO userTO,
@DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
@@ -97,7 +97,7 @@ public interface UserService extends AnyService<UserTO, UserPatch> {
*/
@POST
@Path("{key}/status")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response status(@NotNull StatusPatch statusPatch);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
index f4166d3..f9362e0 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java
@@ -43,7 +43,7 @@ public interface UserWorkflowService extends JAXRSService {
*/
@GET
@Path("forms")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<WorkflowFormTO> getForms();
/**
@@ -54,7 +54,7 @@ public interface UserWorkflowService extends JAXRSService {
*/
@GET
@Path("forms/{userKey}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
WorkflowFormTO getFormForUser(@NotNull @PathParam("userKey") Long userKey);
/**
@@ -65,7 +65,7 @@ public interface UserWorkflowService extends JAXRSService {
*/
@POST
@Path("forms/{taskId}/claim")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
/**
@@ -76,8 +76,8 @@ public interface UserWorkflowService extends JAXRSService {
*/
@POST
@Path("forms")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
UserTO submitForm(@NotNull WorkflowFormTO form);
/**
@@ -89,7 +89,7 @@ public interface UserWorkflowService extends JAXRSService {
*/
@POST
@Path("tasks/{taskId}/execute")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
index 7654e6b..ceed92f 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java
@@ -43,7 +43,7 @@ public interface WorkflowService extends JAXRSService {
* @return workflow definition for matching kind
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response exportDefinition(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
/**
@@ -64,7 +64,7 @@ public interface WorkflowService extends JAXRSService {
* @param definition workflow definition for matching kind
*/
@PUT
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void importDefinition(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull String definition);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index d31a903..3346c5c 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -46,7 +46,7 @@ public interface CamelRouteService extends JAXRSService {
* @return all routes for the given any type kind
*/
@GET
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
List<CamelRouteTO> list(@NotNull @MatrixParam("anyTypeKind") AnyTypeKind anyTypeKind);
/**
@@ -57,7 +57,7 @@ public interface CamelRouteService extends JAXRSService {
*/
@GET
@Path("{key}")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
CamelRouteTO read(@NotNull @PathParam("key") String key);
/**
@@ -67,7 +67,7 @@ public interface CamelRouteService extends JAXRSService {
*/
@PUT
@Path("{key}")
- @Consumes({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
void update(@NotNull CamelRouteTO route);
/**
@@ -84,6 +84,6 @@ public interface CamelRouteService extends JAXRSService {
*/
@GET
@Path("metrics")
- @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
CamelMetrics metrics();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/23a391ea/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b33fe2b..679a530 100644
--- a/pom.xml
+++ b/pom.xml
@@ -375,7 +375,7 @@ under the License.
<swagger-core.version>1.5.8</swagger-core.version>
<swagger-ui.version>2.1.4</swagger-ui.version>
- <jquery.version>2.2.1</jquery.version>
+ <jquery.version>2.2.2</jquery.version>
<jquery-ui.version>1.11.4</jquery-ui.version>
<jquery-cookie.version>1.4.1-1</jquery-cookie.version>
@@ -385,7 +385,7 @@ under the License.
<font-awesome.version>4.5.0</font-awesome.version>
<ionicons.version>2.0.1</ionicons.version>
<highlightjs.version>9.2.0</highlightjs.version>
- <codemirror.version>5.13</codemirror.version>
+ <codemirror.version>5.13.2</codemirror.version>
<jsplumb.version>2.0.5</jsplumb.version>
<wicket.version>7.2.0</wicket.version>
[2/7] syncope git commit: Enabling console - besides core - into
enduser-reference
Posted by il...@apache.org.
Enabling console - besides core - into enduser-reference
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/85288b1e
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/85288b1e
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/85288b1e
Branch: refs/heads/master
Commit: 85288b1e7ec83b666657cfeb8c62ab728a7e7e2c
Parents: 5c73090
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Mar 22 17:38:43 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Mar 22 17:38:43 2016 +0100
----------------------------------------------------------------------
fit/console-reference/pom.xml | 4 +++-
fit/enduser-reference/pom.xml | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/85288b1e/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/pom.xml b/fit/console-reference/pom.xml
index f8b563b..7293558 100644
--- a/fit/console-reference/pom.xml
+++ b/fit/console-reference/pom.xml
@@ -419,7 +419,9 @@ under the License.
<phase>package</phase>
<configuration>
<target>
- <copy file="${project.build.directory}/test-classes/core-rebel.xml" tofile="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/rebel.xml" overwrite="true" />
+ <copy file="${project.build.directory}/test-classes/core-rebel.xml"
+ tofile="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/rebel.xml"
+ overwrite="true" />
</target>
</configuration>
<goals>
http://git-wip-us.apache.org/repos/asf/syncope/blob/85288b1e/fit/enduser-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/pom.xml b/fit/enduser-reference/pom.xml
index 48dd75f..b5d8ede 100644
--- a/fit/enduser-reference/pom.xml
+++ b/fit/enduser-reference/pom.xml
@@ -112,6 +112,20 @@ under the License.
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-core-reference</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.fit</groupId>
+ <artifactId>syncope-fit-console-reference</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -172,6 +186,12 @@ under the License.
</properties>
</deployable>
<deployable>
+ <location>${basedir}/../console-reference/target/syncope-fit-console-reference-${project.version}</location>
+ <properties>
+ <context>syncope-console</context>
+ </properties>
+ </deployable>
+ <deployable>
<location>${project.build.directory}/${project.build.finalName}</location>
<properties>
<context>syncope-enduser</context>
[5/7] syncope git commit: Upgrading Codemirror
Posted by il...@apache.org.
Upgrading Codemirror
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/371ad7bb
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/371ad7bb
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/371ad7bb
Branch: refs/heads/master
Commit: 371ad7bb6d705a27b426558e791284cebf4b57af
Parents: dd15ebd
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Mar 23 15:37:45 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Mar 23 15:37:45 2016 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/371ad7bb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e821302..b33fe2b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -385,7 +385,7 @@ under the License.
<font-awesome.version>4.5.0</font-awesome.version>
<ionicons.version>2.0.1</ionicons.version>
<highlightjs.version>9.2.0</highlightjs.version>
- <codemirror.version>5.12</codemirror.version>
+ <codemirror.version>5.13</codemirror.version>
<jsplumb.version>2.0.5</jsplumb.version>
<wicket.version>7.2.0</wicket.version>
[3/7] syncope git commit: [SYNCOPE-701] Various improvements
Posted by il...@apache.org.
[SYNCOPE-701] Various improvements
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/0b4c4c89
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/0b4c4c89
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/0b4c4c89
Branch: refs/heads/master
Commit: 0b4c4c8912daff5c22502467b2d743d525e3fa5a
Parents: 85288b1
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Mar 23 10:59:56 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Mar 23 10:59:56 2016 +0100
----------------------------------------------------------------------
.../enduser/resources/AbstractBaseResource.java | 32 ++++++++------------
.../enduser/resources/CaptchaResource.java | 23 ++++----------
.../resources/UserSelfCreateResource.java | 21 +++++++------
.../resources/UserSelfPasswordReset.java | 26 ++++++++--------
.../resources/UserSelfUpdateResource.java | 30 +++++++++---------
5 files changed, 59 insertions(+), 73 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/0b4c4c89/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
index a5ebe63..a364841 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
@@ -52,26 +52,20 @@ public abstract class AbstractBaseResource extends AbstractResource {
protected final boolean xsrfCheck(final HttpServletRequest request) {
final String requestXSRFHeader = request.getHeader(SyncopeEnduserConstants.XSRF_HEADER_NAME);
- if (SyncopeEnduserApplication.get().isXsrfEnabled()) {
- return StringUtils.isNotBlank(requestXSRFHeader)
- && SyncopeEnduserSession.get().getCookieUtils().getCookie(SyncopeEnduserConstants.XSRF_COOKIE).
- getValue().equals(requestXSRFHeader);
- } else {
- //if xsfr is disabled, we return always true
- return true;
- }
+
+ return SyncopeEnduserApplication.get().isXsrfEnabled()
+ ? StringUtils.isNotBlank(requestXSRFHeader)
+ && SyncopeEnduserSession.get().getCookieUtils().
+ getCookie(SyncopeEnduserConstants.XSRF_COOKIE).getValue().equals(requestXSRFHeader)
+ : true;
}
- protected final boolean captchaCheck(final String enteredCaptcha, final String currentCaptcha) {
- if (SyncopeEnduserApplication.get().isCaptchaEnabled()) {
- if (StringUtils.isBlank(currentCaptcha) || enteredCaptcha == null) {
- return false;
- } else {
- return enteredCaptcha.equals(currentCaptcha);
- }
- } else {
- //if captcha is disabled, we return always true
- return true;
- }
+ protected final boolean captchaCheck(final String enteredCaptcha, final Object currentCaptcha) {
+ String toCheck = currentCaptcha.toString();
+ return SyncopeEnduserApplication.get().isCaptchaEnabled()
+ ? StringUtils.isBlank(toCheck) || enteredCaptcha == null
+ ? false
+ : enteredCaptcha.equals(toCheck)
+ : true;
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0b4c4c89/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
index d856629..528bc46 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
@@ -19,6 +19,7 @@
package org.apache.syncope.client.enduser.resources;
import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.lang3.RandomStringUtils;
import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
import org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource;
import org.apache.wicket.request.cycle.RequestCycle;
@@ -31,26 +32,14 @@ public class CaptchaResource extends CaptchaImageResource {
private static final Logger LOG = LoggerFactory.getLogger(CaptchaResource.class);
- public static int randomInt(final int min, final int max) {
- return (int) (Math.random() * (max - min) + min);
- }
-
- public static String randomString(final int min, final int max) {
- int num = randomInt(min, max);
- byte[] b = new byte[num];
- for (int i = 0; i < num; i++) {
- b[i] = (byte) randomInt('a', 'z');
- }
- return new String(b);
- }
-
@Override
protected byte[] render() {
- LOG.info("Generate captcha");
- final String captcha = randomString(6, 8);
- HttpServletRequest httpRequest = ((HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest());
+ LOG.debug("Generate captcha");
+
+ String captcha = RandomStringUtils.randomAlphabetic(6);
+ HttpServletRequest request = ((HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest());
// store the captcha in the current session
- httpRequest.getSession().setAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY, captcha);
+ request.getSession().setAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY, captcha);
getChallengeIdModel().setObject(captcha);
return super.render();
http://git-wip-us.apache.org/repos/asf/syncope/blob/0b4c4c89/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
index 4ab2ca5..3453884 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
@@ -42,7 +42,6 @@ public class UserSelfCreateResource extends AbstractBaseResource {
@Override
protected ResourceResponse newResourceResponse(final Attributes attributes) {
-
final StringBuilder responseMessage = new StringBuilder();
ResourceResponse response = new ResourceResponse();
@@ -59,10 +58,11 @@ public class UserSelfCreateResource extends AbstractBaseResource {
final UserTO userTO = MAPPER.readValue(jsonString, UserTO.class);
- if (!captchaCheck(request.getHeader("captcha"), request.getSession().getAttribute(
- SyncopeEnduserConstants.CAPTCHA_SESSION_KEY).toString())) {
- LOG.error("Entered captcha is not matching");
- throw new Exception("Entered captcha is not matching");
+ if (!captchaCheck(
+ request.getHeader("captcha"),
+ request.getSession().getAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY))) {
+
+ throw new IllegalArgumentException("Entered captcha is not matching");
}
if (isSelfRegistrationAllowed() && userTO != null) {
@@ -93,11 +93,12 @@ public class UserSelfCreateResource extends AbstractBaseResource {
} catch (Exception e) {
LOG.error("Could not create userTO", e);
- response.setError(Response.Status.BAD_REQUEST.getStatusCode(), new StringBuilder()
- .append("ErrorMessage{{ ")
- .append(e.getMessage())
- .append(" }}")
- .toString());
+ response.setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ new StringBuilder().
+ append("ErrorMessage{{ ").
+ append(e.getMessage()).
+ append(" }}").
+ toString());
}
return response;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0b4c4c89/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
index 8a11ca7..84e1bba 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
@@ -44,7 +44,6 @@ public class UserSelfPasswordReset extends AbstractBaseResource {
@Override
protected ResourceResponse newResourceResponse(final IResource.Attributes attributes) {
-
AbstractResource.ResourceResponse response = new AbstractResource.ResourceResponse();
try {
@@ -63,19 +62,19 @@ public class UserSelfPasswordReset extends AbstractBaseResource {
username = parameters.get("username")[0];
}
- if (request.getHeader("captcha") == null || !captchaCheck(request.getHeader("captcha"), request.
- getSession().getAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY).
- toString())) {
- LOG.error("Entered captcha is not matching");
- throw new Exception("Entered captcha is not matching");
+ if (request.getHeader("captcha") == null
+ || !captchaCheck(
+ request.getHeader("captcha"),
+ request.getSession().getAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY))) {
+
+ throw new IllegalArgumentException("Entered captcha is not matching");
}
if (SyncopeEnduserSession.get().getPlatformInfo().isPwdResetRequiringSecurityQuestions()) {
if (parameters.get("securityanswer") == null || parameters.get("securityanswer").length == 0) {
throw new Exception("A correct security answer should be provided");
}
- userSelfService.requestPasswordReset(username,
- parameters.get("securityanswer")[0]);
+ userSelfService.requestPasswordReset(username, parameters.get("securityanswer")[0]);
} else {
userSelfService.requestPasswordReset(username, null);
}
@@ -94,11 +93,12 @@ public class UserSelfPasswordReset extends AbstractBaseResource {
} catch (final Exception e) {
LOG.error("Error while updating user", e);
- response.setError(Response.Status.BAD_REQUEST.getStatusCode(), new StringBuilder()
- .append("ErrorMessage{{ ")
- .append(e.getMessage())
- .append(" }}")
- .toString());
+ response.setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ new StringBuilder().
+ append("ErrorMessage{{ ").
+ append(e.getMessage()).
+ append(" }}").
+ toString());
}
return response;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/0b4c4c89/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
index 8e2c148..04c89af 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfUpdateResource.java
@@ -58,22 +58,23 @@ public class UserSelfUpdateResource extends AbstractBaseResource {
final UserTO userTO = MAPPER.readValue(jsonString, UserTO.class);
- if (!captchaCheck(request.getHeader("captcha"), request.getSession().getAttribute(
- SyncopeEnduserConstants.CAPTCHA_SESSION_KEY).toString())) {
- LOG.error("Entered captcha is not matching");
- throw new Exception("Entered captcha is not matching");
+ if (!captchaCheck(
+ request.getHeader("captcha"),
+ request.getSession().getAttribute(SyncopeEnduserConstants.CAPTCHA_SESSION_KEY))) {
+
+ throw new IllegalArgumentException("Entered captcha is not matching");
}
- LOG.debug("User {} id updating himself", userTO.getUsername());
+ LOG.debug("User {} id self-updating", userTO.getUsername());
// update user
Response res = userSelfService.update(userTO);
final String responseMessage = res.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)
- ? new StringBuilder().append("User").append(userTO.getUsername()).append(
- " successfully updated").toString()
- : new StringBuilder().append("ErrorMessage{{ ").
- append(res.getStatusInfo().getReasonPhrase()).append(" }}").toString();
+ ? new StringBuilder().
+ append("User").append(userTO.getUsername()).append(" successfully updated").toString()
+ : new StringBuilder().
+ append("ErrorMessage{{ ").append(res.getStatusInfo().getReasonPhrase()).append(" }}").toString();
response.setWriteCallback(new WriteCallback() {
@@ -87,11 +88,12 @@ public class UserSelfUpdateResource extends AbstractBaseResource {
} catch (final Exception e) {
LOG.error("Error while updating user", e);
- response.setError(Response.Status.BAD_REQUEST.getStatusCode(), new StringBuilder()
- .append("ErrorMessage{{ ")
- .append(e.getMessage())
- .append(" }}")
- .toString());
+ response.setError(Response.Status.BAD_REQUEST.getStatusCode(),
+ new StringBuilder().
+ append("ErrorMessage{{ ").
+ append(e.getMessage()).
+ append(" }}").
+ toString());
}
return response;
}
[7/7] syncope git commit: Adding Swagger test case
Posted by il...@apache.org.
Adding Swagger test case
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/18e9a490
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/18e9a490
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/18e9a490
Branch: refs/heads/master
Commit: 18e9a49072b9150fdb5ef3f3ce330f98311d7086
Parents: 23a391e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Mar 24 15:30:19 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Mar 24 15:30:19 2016 +0100
----------------------------------------------------------------------
.../apache/syncope/fit/core/SwaggerITCase.java | 67 ++++++++++++++++++++
1 file changed, 67 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/18e9a490/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SwaggerITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SwaggerITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SwaggerITCase.java
new file mode 100644
index 0000000..654583b
--- /dev/null
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SwaggerITCase.java
@@ -0,0 +1,67 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.syncope.fit.AbstractITCase;
+import org.junit.Assume;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+
+@FixMethodOrder(MethodSorters.JVM)
+public class SwaggerITCase extends AbstractITCase {
+
+ @Test
+ public void swagger() throws IOException {
+ WebClient webClient = WebClient.create(ADDRESS + "/swagger.json").accept(MediaType.APPLICATION_JSON_TYPE);
+ Response response = webClient.get();
+ Assume.assumeTrue(response.getStatus() == 200);
+
+ JsonNode tree = new ObjectMapper().readTree((InputStream) response.getEntity());
+ assertNotNull(tree);
+
+ JsonNode info = tree.get("info");
+ assertEquals("Apache Syncope", info.get("title").asText());
+
+ assertEquals("/syncope/rest", tree.get("basePath").asText());
+
+ JsonNode tags = tree.get("tags");
+ assertNotNull(tags);
+ assertTrue(tags.isContainerNode());
+
+ JsonNode paths = tree.get("paths");
+ assertNotNull(paths);
+ assertTrue(paths.isContainerNode());
+
+ JsonNode definitions = tree.get("definitions");
+ assertNotNull(definitions);
+ assertTrue(definitions.isContainerNode());
+ }
+}