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 2012/03/15 11:17:24 UTC

svn commit: r1300882 [16/22] - in /incubator/syncope/trunk: build-tools/src/main/java/org/syncope/buildtools/ client/src/main/java/org/syncope/annotation/ client/src/main/java/org/syncope/client/ client/src/main/java/org/syncope/client/http/ client/src...

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ReportController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ReportController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ReportController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ReportController.java Thu Mar 15 10:17:12 2012
@@ -119,8 +119,7 @@ public class ReportController extends Ab
 
     @PreAuthorize("hasRole('REPORT_UPDATE')")
     @RequestMapping(method = RequestMethod.POST, value = "/update")
-    public ReportTO update(@RequestBody final ReportTO reportTO)
-            throws NotFoundException {
+    public ReportTO update(@RequestBody final ReportTO reportTO) throws NotFoundException {
 
         LOG.debug("Report update called with parameter {}", reportTO);
 
@@ -135,8 +134,7 @@ public class ReportController extends Ab
         try {
             jobInstanceLoader.registerJob(report);
         } catch (Exception e) {
-            LOG.error("While registering quartz job for report "
-                    + report.getId(), e);
+            LOG.error("While registering quartz job for report " + report.getId(), e);
 
             SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
             SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.Scheduling);
@@ -209,8 +207,7 @@ public class ReportController extends Ab
 
     @PreAuthorize("hasRole('REPORT_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/read/{reportId}")
-    public ReportTO read(@PathVariable("reportId") final Long reportId)
-            throws NotFoundException {
+    public ReportTO read(@PathVariable("reportId") final Long reportId) throws NotFoundException {
 
         Report report = reportDAO.find(reportId);
         if (report == null) {
@@ -223,8 +220,7 @@ public class ReportController extends Ab
     @PreAuthorize("hasRole('REPORT_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/execution/read/{executionId}")
     @Transactional(readOnly = true)
-    public ReportExecTO readExecution(@PathVariable("executionId") final Long executionId)
-            throws NotFoundException {
+    public ReportExecTO readExecution(@PathVariable("executionId") final Long executionId) throws NotFoundException {
 
         ReportExec execution = reportExecDAO.find(executionId);
         if (execution == null) {
@@ -239,16 +235,15 @@ public class ReportController extends Ab
     @Transactional(readOnly = true)
     public void exportExecutionResult(final HttpServletResponse response,
             @PathVariable("executionId") final Long executionId,
-            @RequestParam(value = "fmt", required = false) final ReportExecExportFormat fmt)
-            throws NotFoundException {
+            @RequestParam(value = "fmt", required = false) final ReportExecExportFormat fmt) throws NotFoundException {
 
         ReportExec reportExec = reportExecDAO.find(executionId);
         if (reportExec == null) {
             throw new NotFoundException("Report execution " + executionId);
         }
         if (!ReportExecStatus.SUCCESS.name().equals(reportExec.getStatus()) || reportExec.getExecResult() == null) {
-            SyncopeClientCompositeErrorException sccee =
-                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException sccee = new SyncopeClientCompositeErrorException(
+                    HttpStatus.BAD_REQUEST);
             SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.InvalidReportExec);
             sce.addElement(reportExec.getExecResult() == null
                     ? "No report data produced"
@@ -257,14 +252,15 @@ public class ReportController extends Ab
             throw sccee;
         }
 
-        ReportExecExportFormat format =
-                fmt == null ? ReportExecExportFormat.XML : fmt;
+        ReportExecExportFormat format = fmt == null
+                ? ReportExecExportFormat.XML
+                : fmt;
 
         LOG.debug("Exporting result of {} as {}", reportExec, format);
 
         response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
-        response.addHeader("Content-Disposition",
-                "attachment; filename=" + reportExec.getReport().getName() + "." + format.name().toLowerCase());
+        response.addHeader("Content-Disposition", "attachment; filename=" + reportExec.getReport().getName() + "."
+                + format.name().toLowerCase());
 
         // streaming SAX handler from a compressed byte array stream
         ByteArrayInputStream bais = new ByteArrayInputStream(reportExec.getExecResult());
@@ -273,8 +269,7 @@ public class ReportController extends Ab
             // a single ZipEntry in the ZipInputStream (see ReportJob)
             zis.getNextEntry();
 
-            Pipeline<SAXPipelineComponent> pipeline =
-                    new NonCachingPipeline<SAXPipelineComponent>();
+            Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
             pipeline.addComponent(new XMLGenerator(zis));
 
             Map<String, Object> parameters = new HashMap<String, Object>();
@@ -313,8 +308,7 @@ public class ReportController extends Ab
             pipeline.setup(response.getOutputStream());
             pipeline.execute();
 
-            LOG.debug("Result of {} successfully exported as {}",
-                    reportExec, format);
+            LOG.debug("Result of {} successfully exported as {}", reportExec, format);
         } catch (Throwable t) {
             LOG.error("While exporting content", t);
         } finally {
@@ -329,8 +323,7 @@ public class ReportController extends Ab
 
     @PreAuthorize("hasRole('REPORT_EXECUTE')")
     @RequestMapping(method = RequestMethod.POST, value = "/execute/{reportId}")
-    public ReportExecTO execute(@PathVariable("reportId") final Long reportId)
-            throws NotFoundException {
+    public ReportExecTO execute(@PathVariable("reportId") final Long reportId) throws NotFoundException {
 
         Report report = reportDAO.find(reportId);
         if (report == null) {

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ResourceController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ResourceController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ResourceController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/ResourceController.java Thu Mar 15 10:17:12 2012
@@ -82,10 +82,8 @@ public class ResourceController extends 
     private ConnInstanceLoader connLoader;
 
     @PreAuthorize("hasRole('RESOURCE_CREATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/create")
-    public ResourceTO create(final HttpServletResponse response,
-            final @RequestBody ResourceTO resourceTO)
+    @RequestMapping(method = RequestMethod.POST, value = "/create")
+    public ResourceTO create(final HttpServletResponse response, final @RequestBody ResourceTO resourceTO)
             throws SyncopeClientCompositeErrorException, NotFoundException {
 
         LOG.debug("Resource creation: {}", resourceTO);
@@ -96,15 +94,11 @@ public class ResourceController extends 
             throw new NotFoundException("Missing resource");
         }
 
-        SyncopeClientCompositeErrorException scce =
-                new SyncopeClientCompositeErrorException(
-                HttpStatus.BAD_REQUEST);
+        SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
 
         LOG.debug("Verify that resource doesn't exist yet");
-        if (resourceTO.getName() != null
-                && resourceDAO.find(resourceTO.getName()) != null) {
-            SyncopeClientException ex = new SyncopeClientException(
-                    SyncopeClientExceptionType.DataIntegrityViolation);
+        if (resourceTO.getName() != null && resourceDAO.find(resourceTO.getName()) != null) {
+            SyncopeClientException ex = new SyncopeClientException(SyncopeClientExceptionType.DataIntegrityViolation);
 
             ex.addElement("Existing " + resourceTO.getName());
             scce.addException(ex);
@@ -116,8 +110,7 @@ public class ResourceController extends 
         if (resource == null) {
             LOG.error("Resource creation failed");
 
-            SyncopeClientException ex = new SyncopeClientException(
-                    SyncopeClientExceptionType.Unknown);
+            SyncopeClientException ex = new SyncopeClientException(SyncopeClientExceptionType.Unknown);
 
             scce.addException(ex);
 
@@ -131,10 +124,8 @@ public class ResourceController extends 
     }
 
     @PreAuthorize("hasRole('RESOURCE_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/update")
-    public ResourceTO update(final HttpServletResponse response,
-            final @RequestBody ResourceTO resourceTO)
+    @RequestMapping(method = RequestMethod.POST, value = "/update")
+    public ResourceTO update(final HttpServletResponse response, final @RequestBody ResourceTO resourceTO)
             throws SyncopeClientCompositeErrorException, NotFoundException {
 
         LOG.debug("Role update request: {}", resourceTO);
@@ -145,19 +136,15 @@ public class ResourceController extends 
         }
         if (resource == null) {
             LOG.error("Missing resource: {}", resourceTO.getName());
-            throw new NotFoundException(
-                    "Resource '" + resourceTO.getName() + "'");
+            throw new NotFoundException("Resource '" + resourceTO.getName() + "'");
         }
 
         resource = binder.update(resource, resourceTO);
         if (resource == null) {
             LOG.error("Resource update failed");
 
-            SyncopeClientCompositeErrorException scce =
-                    new SyncopeClientCompositeErrorException(
-                    HttpStatus.BAD_REQUEST);
-            SyncopeClientException ex = new SyncopeClientException(
-                    SyncopeClientExceptionType.Unknown);
+            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientException ex = new SyncopeClientException(SyncopeClientExceptionType.Unknown);
             scce.addException(ex);
             throw scce;
         }
@@ -168,10 +155,8 @@ public class ResourceController extends 
     }
 
     @PreAuthorize("hasRole('RESOURCE_DELETE')")
-    @RequestMapping(method = RequestMethod.DELETE,
-    value = "/delete/{resourceName}")
-    public void delete(final HttpServletResponse response,
-            final @PathVariable("resourceName") String resourceName)
+    @RequestMapping(method = RequestMethod.DELETE, value = "/delete/{resourceName}")
+    public void delete(final HttpServletResponse response, final @PathVariable("resourceName") String resourceName)
             throws NotFoundException {
 
         ExternalResource resource = resourceDAO.find(resourceName);
@@ -186,10 +171,8 @@ public class ResourceController extends 
 
     @PreAuthorize("hasRole('RESOURCE_READ')")
     @Transactional(readOnly = true)
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read/{resourceName}")
-    public ResourceTO read(final HttpServletResponse response,
-            final @PathVariable("resourceName") String resourceName)
+    @RequestMapping(method = RequestMethod.GET, value = "/read/{resourceName}")
+    public ResourceTO read(final HttpServletResponse response, final @PathVariable("resourceName") String resourceName)
             throws NotFoundException {
 
         ExternalResource resource = resourceDAO.find(resourceName);
@@ -202,11 +185,8 @@ public class ResourceController extends 
     }
 
     @Transactional(readOnly = true)
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/list")
-    public List<ResourceTO> list(
-            @RequestParam(required = false, value = "connInstanceId")
-            final Long connInstanceId)
+    @RequestMapping(method = RequestMethod.GET, value = "/list")
+    public List<ResourceTO> list(@RequestParam(required = false, value = "connInstanceId") final Long connInstanceId)
             throws NotFoundException {
 
         final List<ExternalResource> resources;
@@ -227,12 +207,9 @@ public class ResourceController extends 
     }
 
     @PreAuthorize("hasRole('RESOURCE_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{roleName}/mappings")
-    public List<SchemaMappingTO> getRoleResourcesMapping(
-            final HttpServletResponse response,
-            @PathVariable("roleName") final Long roleId)
-            throws SyncopeClientCompositeErrorException {
+    @RequestMapping(method = RequestMethod.GET, value = "/{roleName}/mappings")
+    public List<SchemaMappingTO> getRoleResourcesMapping(final HttpServletResponse response,
+            @PathVariable("roleName") final Long roleId) throws SyncopeClientCompositeErrorException {
 
         SyncopeRole role = null;
         if (roleId != null) {
@@ -242,12 +219,10 @@ public class ResourceController extends 
         if (role == null) {
             LOG.error("Role " + roleId + " not found.");
 
-            SyncopeClientCompositeErrorException compositeErrorException =
-                    new SyncopeClientCompositeErrorException(
+            SyncopeClientCompositeErrorException compositeErrorException = new SyncopeClientCompositeErrorException(
                     HttpStatus.BAD_REQUEST);
 
-            SyncopeClientException ex = new SyncopeClientException(
-                    SyncopeClientExceptionType.RequiredValuesMissing);
+            SyncopeClientException ex = new SyncopeClientException(SyncopeClientExceptionType.RequiredValuesMissing);
 
             ex.addElement("resource");
 
@@ -259,8 +234,7 @@ public class ResourceController extends 
         List<SchemaMappingTO> roleMappings = new ArrayList<SchemaMappingTO>();
 
         for (ExternalResource resource : role.getResources()) {
-            roleMappings.addAll(
-                    binder.getSchemaMappingTOs(resource.getMappings()));
+            roleMappings.addAll(binder.getSchemaMappingTOs(resource.getMappings()));
         }
 
         LOG.debug("Mappings found: {} ", roleMappings);
@@ -270,11 +244,9 @@ public class ResourceController extends 
 
     @PreAuthorize("hasRole('RESOURCE_GETOBJECT')")
     @Transactional(readOnly = true)
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{resourceName}/read/{objectId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/{resourceName}/read/{objectId}")
     public ConnObjectTO getObject(final HttpServletResponse response,
-            @PathVariable("resourceName") String resourceName,
-            @PathVariable("objectId") final String objectId)
+            @PathVariable("resourceName") String resourceName, @PathVariable("objectId") final String objectId)
             throws NotFoundException {
 
         ExternalResource resource = resourceDAO.find(resourceName);
@@ -285,16 +257,11 @@ public class ResourceController extends 
 
         final ConnectorFacadeProxy connector = connLoader.getConnector(resource);
 
-        final ConnectorObject connectorObject =
-                connector.getObject(
-                ObjectClass.ACCOUNT,
-                new Uid(objectId),
-                connector.getOperationOptions(resource));
+        final ConnectorObject connectorObject = connector.getObject(ObjectClass.ACCOUNT, new Uid(objectId), connector
+                .getOperationOptions(resource));
 
         if (connectorObject == null) {
-            throw new NotFoundException(
-                    "Object " + objectId + " not found on resource "
-                    + resourceName);
+            throw new NotFoundException("Object " + objectId + " not found on resource " + resourceName);
         }
 
         final Set<Attribute> attributes = connectorObject.getAttributes();

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/RoleController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/RoleController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/RoleController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/RoleController.java Thu Mar 15 10:17:12 2012
@@ -49,19 +49,14 @@ public class RoleController extends Abst
     private RoleDataBinder roleDataBinder;
 
     @PreAuthorize("hasRole('ROLE_CREATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/create")
-    public RoleTO create(final HttpServletResponse response,
-            final @RequestBody RoleTO roleTO)
-            throws SyncopeClientCompositeErrorException,
-            UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.POST, value = "/create")
+    public RoleTO create(final HttpServletResponse response, final @RequestBody RoleTO roleTO)
+            throws SyncopeClientCompositeErrorException, UnauthorizedRoleException {
 
         LOG.debug("Role create called with parameters {}", roleTO);
 
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
-        if (roleTO.getParent() != 0
-                && !allowedRoleIds.contains(roleTO.getParent())) {
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
+        if (roleTO.getParent() != 0 && !allowedRoleIds.contains(roleTO.getParent())) {
 
             throw new UnauthorizedRoleException(roleTO.getParent());
         }
@@ -81,18 +76,15 @@ public class RoleController extends Abst
     }
 
     @PreAuthorize("hasRole('ROLE_DELETE')")
-    @RequestMapping(method = RequestMethod.DELETE,
-    value = "/delete/{roleId}")
-    public void delete(@PathVariable("roleId") Long roleId)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.DELETE, value = "/delete/{roleId}")
+    public void delete(@PathVariable("roleId") Long roleId) throws NotFoundException, UnauthorizedRoleException {
 
         SyncopeRole role = roleDAO.find(roleId);
         if (role == null) {
             throw new NotFoundException("Role " + String.valueOf(roleId));
         }
 
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
         if (!allowedRoleIds.contains(role.getId())) {
             throw new UnauthorizedRoleException(role.getId());
         }
@@ -100,8 +92,7 @@ public class RoleController extends Abst
         roleDAO.delete(roleId);
     }
 
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/list")
     public List<RoleTO> list() {
         List<SyncopeRole> roles = roleDAO.findAll();
         List<RoleTO> roleTOs = new ArrayList<RoleTO>();
@@ -113,34 +104,29 @@ public class RoleController extends Abst
     }
 
     @PreAuthorize("hasRole('ROLE_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/parent/{roleId}")
-    public RoleTO parent(@PathVariable("roleId") Long roleId)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.GET, value = "/parent/{roleId}")
+    public RoleTO parent(@PathVariable("roleId") Long roleId) throws NotFoundException, UnauthorizedRoleException {
 
         SyncopeRole role = roleDAO.find(roleId);
         if (role == null) {
             throw new NotFoundException("Role " + String.valueOf(roleId));
         }
 
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
-        if (role.getParent() != null
-                && !allowedRoleIds.contains(role.getParent().getId())) {
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
+        if (role.getParent() != null && !allowedRoleIds.contains(role.getParent().getId())) {
 
             throw new UnauthorizedRoleException(role.getParent().getId());
         }
 
-        return role.getParent() == null ? null
+        return role.getParent() == null
+                ? null
                 : roleDataBinder.getRoleTO(role.getParent());
     }
 
     @PreAuthorize("hasRole('ROLE_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/children/{roleId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/children/{roleId}")
     public List<RoleTO> children(@PathVariable("roleId") Long roleId) {
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
 
         List<SyncopeRole> roles = roleDAO.findChildren(roleId);
         List<RoleTO> roleTOs = new ArrayList<RoleTO>(roles.size());
@@ -154,18 +140,15 @@ public class RoleController extends Abst
     }
 
     @PreAuthorize("hasRole('ROLE_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read/{roleId}")
-    public RoleTO read(@PathVariable("roleId") Long roleId)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.GET, value = "/read/{roleId}")
+    public RoleTO read(@PathVariable("roleId") Long roleId) throws NotFoundException, UnauthorizedRoleException {
 
         SyncopeRole role = roleDAO.find(roleId);
         if (role == null) {
             throw new NotFoundException(String.valueOf(roleId));
         }
 
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
         if (!allowedRoleIds.contains(role.getId())) {
             throw new UnauthorizedRoleException(role.getId());
         }
@@ -174,21 +157,17 @@ public class RoleController extends Abst
     }
 
     @PreAuthorize("hasRole('ROLE_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/update")
-    public RoleTO update(@RequestBody RoleMod roleMod)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.POST, value = "/update")
+    public RoleTO update(@RequestBody RoleMod roleMod) throws NotFoundException, UnauthorizedRoleException {
 
         LOG.debug("Role update called with parameter {}", roleMod);
 
         SyncopeRole role = roleDAO.find(roleMod.getId());
         if (role == null) {
-            throw new NotFoundException(
-                    "Role " + String.valueOf(roleMod.getId()));
+            throw new NotFoundException("Role " + String.valueOf(roleMod.getId()));
         }
 
-        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> allowedRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
         if (!allowedRoleIds.contains(role.getId())) {
             throw new UnauthorizedRoleException(role.getId());
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/SchemaController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/SchemaController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/SchemaController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/SchemaController.java Thu Mar 15 10:17:12 2012
@@ -46,10 +46,8 @@ public class SchemaController extends Ab
     private SchemaDataBinder schemaDataBinder;
 
     @PreAuthorize("hasRole('SCHEMA_CREATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/{kind}/create")
-    public SchemaTO create(final HttpServletResponse response,
-            @RequestBody final SchemaTO schemaTO,
+    @RequestMapping(method = RequestMethod.POST, value = "/{kind}/create")
+    public SchemaTO create(final HttpServletResponse response, @RequestBody final SchemaTO schemaTO,
             @PathVariable("kind") final String kind) {
 
         AbstractSchema schema = getAttributableUtil(kind).newSchema();
@@ -61,10 +59,8 @@ public class SchemaController extends Ab
     }
 
     @PreAuthorize("hasRole('SCHEMA_DELETE')")
-    @RequestMapping(method = RequestMethod.DELETE,
-    value = "/{kind}/delete/{schema}")
-    public void delete(@PathVariable("kind") final String kind,
-            @PathVariable("schema") final String schemaName)
+    @RequestMapping(method = RequestMethod.DELETE, value = "/{kind}/delete/{schema}")
+    public void delete(@PathVariable("kind") final String kind, @PathVariable("schema") final String schemaName)
             throws NotFoundException {
 
         Class reference = getAttributableUtil(kind).schemaClass();
@@ -78,32 +74,26 @@ public class SchemaController extends Ab
         schemaDAO.delete(schemaName, getAttributableUtil(kind));
     }
 
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{kind}/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/list")
     public List<SchemaTO> list(@PathVariable("kind") final String kind) {
         AttributableUtil attributableUtil = getAttributableUtil(kind);
-        List<AbstractSchema> schemas = schemaDAO.findAll(
-                attributableUtil.schemaClass());
+        List<AbstractSchema> schemas = schemaDAO.findAll(attributableUtil.schemaClass());
 
         List<SchemaTO> schemaTOs = new ArrayList<SchemaTO>(schemas.size());
         for (AbstractSchema schema : schemas) {
-            schemaTOs.add(schemaDataBinder.getSchemaTO(
-                    schema, attributableUtil));
+            schemaTOs.add(schemaDataBinder.getSchemaTO(schema, attributableUtil));
         }
 
         return schemaTOs;
     }
 
     @PreAuthorize("hasRole('SCHEMA_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{kind}/read/{schema}")
-    public SchemaTO read(@PathVariable("kind") final String kind,
-            @PathVariable("schema") final String schemaName)
+    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/read/{schema}")
+    public SchemaTO read(@PathVariable("kind") final String kind, @PathVariable("schema") final String schemaName)
             throws NotFoundException {
 
         AttributableUtil attributableUtil = getAttributableUtil(kind);
-        AbstractSchema schema = schemaDAO.find(schemaName,
-                attributableUtil.schemaClass());
+        AbstractSchema schema = schemaDAO.find(schemaName, attributableUtil.schemaClass());
         if (schema == null) {
             LOG.error("Could not find schema '" + schemaName + "'");
             throw new NotFoundException("Schema '" + schemaName + "'");
@@ -113,15 +103,12 @@ public class SchemaController extends Ab
     }
 
     @PreAuthorize("hasRole('SCHEMA_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/{kind}/update")
-    public SchemaTO update(@RequestBody final SchemaTO schemaTO,
-            @PathVariable("kind") final String kind)
+    @RequestMapping(method = RequestMethod.POST, value = "/{kind}/update")
+    public SchemaTO update(@RequestBody final SchemaTO schemaTO, @PathVariable("kind") final String kind)
             throws NotFoundException {
 
         AttributableUtil attributableUtil = getAttributableUtil(kind);
-        AbstractSchema schema = schemaDAO.find(schemaTO.getName(),
-                attributableUtil.schemaClass());
+        AbstractSchema schema = schemaDAO.find(schemaTO.getName(), attributableUtil.schemaClass());
         if (schema == null) {
             LOG.error("Could not find schema '" + schemaTO.getName() + "'");
             throw new NotFoundException("Schema '" + schemaTO.getName() + "'");

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/TaskController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/TaskController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/TaskController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/TaskController.java Thu Mar 15 10:17:12 2012
@@ -126,8 +126,7 @@ public class TaskController extends Abst
         } catch (Exception e) {
             LOG.error("While registering quartz job for task " + task.getId(), e);
 
-            SyncopeClientCompositeErrorException scce =
-                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
             SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.Scheduling);
             sce.addElement(e.getMessage());
             scce.addException(sce);
@@ -140,16 +139,14 @@ public class TaskController extends Abst
 
     @PreAuthorize("hasRole('TASK_UPDATE')")
     @RequestMapping(method = RequestMethod.POST, value = "/update/sync")
-    public TaskTO updateSync(@RequestBody final SyncTaskTO taskTO)
-            throws NotFoundException {
+    public TaskTO updateSync(@RequestBody final SyncTaskTO taskTO) throws NotFoundException {
 
         return updateSched(taskTO);
     }
 
     @PreAuthorize("hasRole('TASK_UPDATE')")
     @RequestMapping(method = RequestMethod.POST, value = "/update/sched")
-    public TaskTO updateSched(@RequestBody final SchedTaskTO taskTO)
-            throws NotFoundException {
+    public TaskTO updateSched(@RequestBody final SchedTaskTO taskTO) throws NotFoundException {
 
         LOG.debug("Task update called with parameter {}", taskTO);
 
@@ -201,9 +198,7 @@ public class TaskController extends Abst
 
     @PreAuthorize("hasRole('TASK_LIST')")
     @RequestMapping(method = RequestMethod.GET, value = "/{kind}/list/{page}/{size}")
-    public List<TaskTO> list(
-            @PathVariable("kind") final String kind,
-            @PathVariable("page") final int page,
+    public List<TaskTO> list(@PathVariable("kind") final String kind, @PathVariable("page") final int page,
             @PathVariable("size") final int size) {
 
         TaskUtil taskUtil = getTaskUtil(kind);
@@ -218,8 +213,7 @@ public class TaskController extends Abst
     }
 
     @PreAuthorize("hasRole('TASK_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{kind}/execution/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/execution/list")
     public List<TaskExecTO> listExecutions(@PathVariable("kind") final String kind) {
 
         List<TaskExec> executions = taskExecDAO.findAll(getTaskUtil(kind).taskClass());
@@ -243,12 +237,11 @@ public class TaskController extends Abst
                 ClassMetadata metadata = cachingMetadataReaderFactory.getMetadataReader(resource).getClassMetadata();
 
                 try {
-                    Set<Class> interfaces = ClassUtils.getAllInterfacesForClassAsSet(
-                            ClassUtils.forName(metadata.getClassName(), ClassUtils.getDefaultClassLoader()));
+                    Set<Class> interfaces = ClassUtils.getAllInterfacesForClassAsSet(ClassUtils.forName(metadata
+                            .getClassName(), ClassUtils.getDefaultClassLoader()));
 
                     if ((interfaces.contains(Job.class) || interfaces.contains(StatefulJob.class))
-                            && !metadata.isAbstract()
-                            && !SyncJob.class.getName().equals(metadata.getClassName())
+                            && !metadata.isAbstract() && !SyncJob.class.getName().equals(metadata.getClassName())
                             && !ReportJob.class.getName().equals(metadata.getClassName())
                             && !NotificationJob.class.getName().equals(metadata.getClassName())) {
 
@@ -278,8 +271,8 @@ public class TaskController extends Abst
                 ClassMetadata metadata = cachingMetadataReaderFactory.getMetadataReader(resource).getClassMetadata();
 
                 try {
-                    Set<Class> interfaces = ClassUtils.getAllInterfacesForClassAsSet(
-                            ClassUtils.forName(metadata.getClassName(), ClassUtils.getDefaultClassLoader()));
+                    Set<Class> interfaces = ClassUtils.getAllInterfacesForClassAsSet(ClassUtils.forName(metadata
+                            .getClassName(), ClassUtils.getDefaultClassLoader()));
 
                     if (interfaces.contains(SyncJobActions.class) && !metadata.isAbstract()) {
                         jobActionsClasses.add(metadata.getClassName());
@@ -299,8 +292,7 @@ public class TaskController extends Abst
 
     @PreAuthorize("hasRole('TASK_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/read/{taskId}")
-    public TaskTO read(@PathVariable("taskId") final Long taskId)
-            throws NotFoundException {
+    public TaskTO read(@PathVariable("taskId") final Long taskId) throws NotFoundException {
 
         Task task = taskDAO.find(taskId);
         if (task == null) {
@@ -312,9 +304,7 @@ public class TaskController extends Abst
 
     @PreAuthorize("hasRole('TASK_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/execution/read/{executionId}")
-    public TaskExecTO readExecution(
-            @PathVariable("executionId") final Long executionId)
-            throws NotFoundException {
+    public TaskExecTO readExecution(@PathVariable("executionId") final Long executionId) throws NotFoundException {
 
         TaskExec execution = taskExecDAO.find(executionId);
         if (execution == null) {
@@ -327,8 +317,7 @@ public class TaskController extends Abst
     @PreAuthorize("hasRole('TASK_EXECUTE')")
     @RequestMapping(method = RequestMethod.POST, value = "/execute/{taskId}")
     public TaskExecTO execute(@PathVariable("taskId") final Long taskId,
-            @RequestParam(value = "dryRun", defaultValue = "false") final boolean dryRun)
-            throws NotFoundException {
+            @RequestParam(value = "dryRun", defaultValue = "false") final boolean dryRun) throws NotFoundException {
 
         Task task = taskDAO.find(taskId);
         if (task == null) {
@@ -351,20 +340,18 @@ public class TaskController extends Abst
             case SCHED:
             case SYNC:
                 try {
-                    jobInstanceLoader.registerJob(task,
-                            ((SchedTask) task).getJobClassName(),
-                            ((SchedTask) task).getCronExpression());
+                    jobInstanceLoader.registerJob(task, ((SchedTask) task).getJobClassName(), ((SchedTask) task)
+                            .getCronExpression());
 
                     JobDataMap map = new JobDataMap();
                     map.put(AbstractTaskJob.DRY_RUN_JOBDETAIL_KEY, dryRun);
-                    scheduler.getScheduler().triggerJob(
-                            JobInstanceLoader.getJobName(task),
-                            Scheduler.DEFAULT_GROUP, map);
+                    scheduler.getScheduler().triggerJob(JobInstanceLoader.getJobName(task), Scheduler.DEFAULT_GROUP,
+                            map);
                 } catch (Exception e) {
                     LOG.error("While executing task {}", task, e);
 
-                    SyncopeClientCompositeErrorException scce =
-                            new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+                    SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(
+                            HttpStatus.BAD_REQUEST);
                     SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.Scheduling);
                     sce.addElement(e.getMessage());
                     scce.addException(sce);
@@ -387,8 +374,7 @@ public class TaskController extends Abst
 
     @PreAuthorize("hasRole('TASK_READ')")
     @RequestMapping(method = RequestMethod.GET, value = "/execution/report/{executionId}")
-    public TaskExecTO report(
-            @PathVariable("executionId") final Long executionId,
+    public TaskExecTO report(@PathVariable("executionId") final Long executionId,
             @RequestParam("executionStatus") final PropagationTaskExecStatus status,
             @RequestParam("message") final String message)
             throws NotFoundException, SyncopeClientCompositeErrorException {
@@ -398,8 +384,8 @@ public class TaskController extends Abst
             throw new NotFoundException("Task execution " + executionId);
         }
 
-        SyncopeClientException invalidReportException =
-                new SyncopeClientException(SyncopeClientExceptionType.InvalidPropagationTaskExecReport);
+        SyncopeClientException invalidReportException = new SyncopeClientException(
+                SyncopeClientExceptionType.InvalidPropagationTaskExecReport);
 
         TaskUtil taskUtil = getTaskUtil(exec.getTask());
         if (taskUtil != TaskUtil.PROPAGATION) {
@@ -426,8 +412,7 @@ public class TaskController extends Abst
         }
 
         if (!invalidReportException.isEmpty()) {
-            SyncopeClientCompositeErrorException scce =
-                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
+            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
             scce.addException(invalidReportException);
             throw scce;
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java Thu Mar 15 10:17:12 2012
@@ -76,8 +76,7 @@ public class UserController {
     /**
      * Logger.
      */
-    private static final Logger LOG =
-            LoggerFactory.getLogger(UserController.class);
+    private static final Logger LOG = LoggerFactory.getLogger(UserController.class);
 
     @Autowired
     private UserDAO userDAO;
@@ -107,57 +106,47 @@ public class UserController {
     private ConnObjectUtil connObjectUtil;
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/verifyPassword/{userId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/verifyPassword/{userId}")
     @Transactional(readOnly = true)
     public ModelAndView verifyPassword(@PathVariable("userId") Long userId,
-            @RequestParam("password") final String password)
-            throws NotFoundException, UnauthorizedRoleException {
+            @RequestParam("password") final String password) throws NotFoundException, UnauthorizedRoleException {
 
-        return new ModelAndView().addObject(
-                userDataBinder.verifyPassword(userId, password));
+        return new ModelAndView().addObject(userDataBinder.verifyPassword(userId, password));
     }
 
     @PreAuthorize("hasRole('USER_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/count")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/count")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
     public ModelAndView count() {
-        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
 
         return new ModelAndView().addObject(userDAO.count(adminRoleIds));
     }
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/search/count")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public ModelAndView searchCount(@RequestBody final NodeCond searchCondition)
-            throws InvalidSearchConditionException {
+    @RequestMapping(method = RequestMethod.POST, value = "/search/count")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public ModelAndView searchCount(@RequestBody final NodeCond searchCondition) throws InvalidSearchConditionException {
 
         if (!searchCondition.checkValidity()) {
             LOG.error("Invalid search condition: {}", searchCondition);
             throw new InvalidSearchConditionException();
         }
 
-        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
 
-        return new ModelAndView().addObject(
-                searchDAO.count(adminRoleIds, searchCondition));
+        return new ModelAndView().addObject(searchDAO.count(adminRoleIds, searchCondition));
     }
 
     @PreAuthorize("hasRole('USER_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/list")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/list")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
     public List<UserTO> list() {
-        List<SyncopeUser> users = 
-                userDAO.findAll(EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames()));
-        
+        List<SyncopeUser> users = userDAO.findAll(EntitlementUtil
+                .getRoleIds(EntitlementUtil.getOwnedEntitlementNames()));
+
         List<UserTO> userTOs = new ArrayList<UserTO>(users.size());
-        
+
         for (SyncopeUser user : users) {
             userTOs.add(userDataBinder.getUserTO(user));
         }
@@ -166,15 +155,11 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/list/{page}/{size}")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public List<UserTO> list(
-            @PathVariable("page") final int page,
-            @PathVariable("size") final int size) {
+    @RequestMapping(method = RequestMethod.GET, value = "/list/{page}/{size}")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public List<UserTO> list(@PathVariable("page") final int page, @PathVariable("size") final int size) {
 
-        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames());
+        Set<Long> adminRoleIds = EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
 
         List<SyncopeUser> users = userDAO.findAll(adminRoleIds, page, size);
         List<UserTO> userTOs = new ArrayList<UserTO>(users.size());
@@ -186,19 +171,16 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read/{userId}")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public UserTO read(@PathVariable("userId") final Long userId)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.GET, value = "/read/{userId}")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public UserTO read(@PathVariable("userId") final Long userId) throws NotFoundException, UnauthorizedRoleException {
 
         return userDataBinder.getUserTO(userId);
     }
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/read")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
     public UserTO read(@RequestParam("username") final String username)
             throws NotFoundException, UnauthorizedRoleException {
 
@@ -206,11 +188,9 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/search")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public List<UserTO> search(@RequestBody final NodeCond searchCondition)
-            throws InvalidSearchConditionException {
+    @RequestMapping(method = RequestMethod.POST, value = "/search")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public List<UserTO> search(@RequestBody final NodeCond searchCondition) throws InvalidSearchConditionException {
 
         LOG.debug("User search called with condition {}", searchCondition);
 
@@ -219,8 +199,8 @@ public class UserController {
             throw new InvalidSearchConditionException();
         }
 
-        List<SyncopeUser> matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames()), searchCondition);
+        List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(EntitlementUtil
+                .getOwnedEntitlementNames()), searchCondition);
         List<UserTO> result = new ArrayList<UserTO>(matchingUsers.size());
         for (SyncopeUser user : matchingUsers) {
             result.add(userDataBinder.getUserTO(user));
@@ -230,14 +210,10 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/search/{page}/{size}")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public List<UserTO> search(
-            @RequestBody final NodeCond searchCondition,
-            @PathVariable("page") final int page,
-            @PathVariable("size") final int size)
-            throws InvalidSearchConditionException {
+    @RequestMapping(method = RequestMethod.POST, value = "/search/{page}/{size}")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public List<UserTO> search(@RequestBody final NodeCond searchCondition, @PathVariable("page") final int page,
+            @PathVariable("size") final int size) throws InvalidSearchConditionException {
 
         LOG.debug("User search called with condition {}", searchCondition);
 
@@ -246,10 +222,8 @@ public class UserController {
             throw new InvalidSearchConditionException();
         }
 
-        final List<SyncopeUser> matchingUsers = searchDAO.search(
-                EntitlementUtil.getRoleIds(
-                EntitlementUtil.getOwnedEntitlementNames()),
-                searchCondition, page, size);
+        final List<SyncopeUser> matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(EntitlementUtil
+                .getOwnedEntitlementNames()), searchCondition, page, size);
 
         final List<UserTO> result = new ArrayList<UserTO>(matchingUsers.size());
         for (SyncopeUser user : matchingUsers) {
@@ -260,8 +234,7 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_CREATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/create")
+    @RequestMapping(method = RequestMethod.POST, value = "/create")
     public UserTO create(final HttpServletResponse response, @RequestBody final UserTO userTO)
             throws PropagationException, UnauthorizedRoleException, WorkflowException, NotFoundException {
 
@@ -280,19 +253,16 @@ public class UserController {
 
         WorkflowResult<Map.Entry<Long, Boolean>> created = wfAdapter.create(userTO);
 
-        List<PropagationTask> tasks =
-                propagationManager.getCreateTaskIds(created, userTO.getPassword(), userTO.getVirtualAttributes());
+        List<PropagationTask> tasks = propagationManager.getCreateTaskIds(created, userTO.getPassword(), userTO
+                .getVirtualAttributes());
 
         final List<PropagationTO> propagations = new ArrayList<PropagationTO>();
 
         propagationManager.execute(tasks, new PropagationHandler() {
 
             @Override
-            public void handle(
-                    final String resourceName,
-                    final PropagationTaskExecStatus executionStatus,
-                    final ConnectorObject before,
-                    final ConnectorObject after) {
+            public void handle(final String resourceName, final PropagationTaskExecStatus executionStatus,
+                    final ConnectorObject before, final ConnectorObject after) {
 
                 final PropagationTO propagation = new PropagationTO();
                 propagation.setResourceName(resourceName);
@@ -310,8 +280,8 @@ public class UserController {
             }
         });
 
-        notificationManager.createTasks(new WorkflowResult<Long>(
-                created.getResult().getKey(), created.getPropByRes(), created.getPerformedTasks()));
+        notificationManager.createTasks(new WorkflowResult<Long>(created.getResult().getKey(), created.getPropByRes(),
+                created.getPerformedTasks()));
 
         final UserTO savedTO = userDataBinder.getUserTO(created.getResult().getKey());
 
@@ -324,32 +294,24 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/update")
+    @RequestMapping(method = RequestMethod.POST, value = "/update")
     public UserTO update(@RequestBody final UserMod userMod)
-            throws NotFoundException, PropagationException,
-            UnauthorizedRoleException, WorkflowException {
+            throws NotFoundException, PropagationException, UnauthorizedRoleException, WorkflowException {
 
         LOG.debug("User update called with {}", userMod);
 
         WorkflowResult<Map.Entry<Long, Boolean>> updated = wfAdapter.update(userMod);
 
-        List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
-                updated, userMod.getPassword(),
-                userMod.getVirtualAttributesToBeRemoved(),
-                userMod.getVirtualAttributesToBeUpdated(),
-                null);
+        List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(updated, userMod.getPassword(), userMod
+                .getVirtualAttributesToBeRemoved(), userMod.getVirtualAttributesToBeUpdated(), null);
 
         final List<PropagationTO> propagations = new ArrayList<PropagationTO>();
 
         propagationManager.execute(tasks, new PropagationHandler() {
 
             @Override
-            public void handle(
-                    final String resourceName,
-                    final PropagationTaskExecStatus executionStatus,
-                    final ConnectorObject before,
-                    final ConnectorObject after) {
+            public void handle(final String resourceName, final PropagationTaskExecStatus executionStatus,
+                    final ConnectorObject before, final ConnectorObject after) {
 
                 final PropagationTO propagation = new PropagationTO();
                 propagation.setResourceName(resourceName);
@@ -367,9 +329,7 @@ public class UserController {
             }
         });
 
-        notificationManager.createTasks(
-                new WorkflowResult<Long>(updated.getResult().getKey(),
-                updated.getPropByRes(),
+        notificationManager.createTasks(new WorkflowResult<Long>(updated.getResult().getKey(), updated.getPropByRes(),
                 updated.getPerformedTasks()));
 
         final UserTO updatedTO = userDataBinder.getUserTO(updated.getResult().getKey());
@@ -382,79 +342,51 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/activate")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public UserTO activate(
-            @RequestBody final UserTO userTO,
+    @RequestMapping(method = RequestMethod.POST, value = "/activate")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public UserTO activate(@RequestBody final UserTO userTO,
             @RequestParam(required = false) final Set<String> resourceNames,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performLocally,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performRemotely)
-            throws WorkflowException, NotFoundException,
-            UnauthorizedRoleException, PropagationException {
+            @RequestParam(required = false, defaultValue = "true") final Boolean performLocally,
+            @RequestParam(required = false, defaultValue = "true") final Boolean performRemotely)
+            throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
 
         LOG.debug("About to activate " + userTO.getId());
 
-
         SyncopeUser user = userDAO.find(userTO.getId());
         if (user == null) {
             throw new NotFoundException("User " + userTO.getId());
         }
 
-        return setStatus(
-                user,
-                resourceNames,
-                performLocally,
-                performRemotely,
-                true,
-                "activate");
+        return setStatus(user, resourceNames, performLocally, performRemotely, true, "activate");
     }
 
     @PreAuthorize("hasRole('USER_UPDATE')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/suspend/{userId}")
-    @Transactional(rollbackFor = {Throwable.class})
-    public UserTO suspend(
-            @PathVariable("userId") final Long userId,
+    @RequestMapping(method = RequestMethod.GET, value = "/suspend/{userId}")
+    @Transactional(rollbackFor = { Throwable.class })
+    public UserTO suspend(@PathVariable("userId") final Long userId,
             @RequestParam(required = false) final Set<String> resourceNames,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performLocally,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performRemotely)
-            throws NotFoundException, WorkflowException,
-            UnauthorizedRoleException, PropagationException {
+            @RequestParam(required = false, defaultValue = "true") final Boolean performLocally,
+            @RequestParam(required = false, defaultValue = "true") final Boolean performRemotely)
+            throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException {
 
         LOG.debug("About to suspend " + userId);
 
-
         SyncopeUser user = userDAO.find(userId);
         if (user == null) {
             throw new NotFoundException("User " + userId);
         }
 
-        return setStatus(
-                user,
-                resourceNames,
-                performLocally,
-                performRemotely,
-                false,
-                "suspend");
+        return setStatus(user, resourceNames, performLocally, performRemotely, false, "suspend");
     }
 
     @PreAuthorize("hasRole('USER_UPDATE')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/reactivate/{userId}")
-    @Transactional(rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/reactivate/{userId}")
+    @Transactional(rollbackFor = { Throwable.class })
     public UserTO reactivate(final @PathVariable("userId") Long userId,
             @RequestParam(required = false) final Set<String> resourceNames,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performLocally,
-            @RequestParam(required = false, defaultValue = "true")
-            final Boolean performRemotely)
-            throws NotFoundException, WorkflowException,
-            UnauthorizedRoleException, PropagationException {
+            @RequestParam(required = false, defaultValue = "true") final Boolean performLocally,
+            @RequestParam(required = false, defaultValue = "true") final Boolean performRemotely)
+            throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException {
 
         LOG.debug("About to reactivate " + userId);
 
@@ -463,21 +395,13 @@ public class UserController {
             throw new NotFoundException("User " + userId);
         }
 
-        return setStatus(
-                user,
-                resourceNames,
-                performLocally,
-                performRemotely,
-                true,
-                "reactivate");
+        return setStatus(user, resourceNames, performLocally, performRemotely, true, "reactivate");
     }
 
     @PreAuthorize("hasRole('USER_DELETE')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/delete/{userId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/delete/{userId}")
     public UserTO delete(@PathVariable("userId") final Long userId)
-            throws NotFoundException, WorkflowException, PropagationException,
-            UnauthorizedRoleException {
+            throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
 
         LOG.debug("User delete called with {}", userId);
 
@@ -486,11 +410,9 @@ public class UserController {
         // information could only be available after wfAdapter.delete(), which
         // will also effectively remove user from db, thus making virtually
         // impossible by NotificationManager to fetch required user information
-        notificationManager.createTasks(
-                new WorkflowResult<Long>(userId, null, "delete"));
+        notificationManager.createTasks(new WorkflowResult<Long>(userId, null, "delete"));
 
-        List<PropagationTask> tasks =
-                propagationManager.getDeleteTaskIds(userId);
+        List<PropagationTask> tasks = propagationManager.getDeleteTaskIds(userId);
 
         final UserTO userTO = new UserTO();
         userTO.setId(userId);
@@ -498,11 +420,8 @@ public class UserController {
         propagationManager.execute(tasks, new PropagationHandler() {
 
             @Override
-            public void handle(
-                    final String resourceName,
-                    final PropagationTaskExecStatus executionStatus,
-                    final ConnectorObject before,
-                    final ConnectorObject after) {
+            public void handle(final String resourceName, final PropagationTaskExecStatus executionStatus,
+                    final ConnectorObject before, final ConnectorObject after) {
 
                 final PropagationTO propagation = new PropagationTO();
                 propagation.setResourceName(resourceName);
@@ -528,22 +447,16 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('USER_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/execute/workflow/{taskId}")
-    public UserTO executeWorkflow(
-            @RequestBody final UserTO userTO,
-            @PathVariable("taskId") final String taskId)
-            throws WorkflowException, NotFoundException,
-            UnauthorizedRoleException, PropagationException {
+    @RequestMapping(method = RequestMethod.POST, value = "/execute/workflow/{taskId}")
+    public UserTO executeWorkflow(@RequestBody final UserTO userTO, @PathVariable("taskId") final String taskId)
+            throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
 
         LOG.debug("About to execute {} on {}", taskId, userTO.getId());
 
         WorkflowResult<Long> updated = wfAdapter.execute(userTO, taskId);
 
         List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(new WorkflowResult<Map.Entry<Long, Boolean>>(
-                new DefaultMapEntry(updated.getResult(), null),
-                updated.getPropByRes(),
-                updated.getPerformedTasks()));
+                new DefaultMapEntry(updated.getResult(), null), updated.getPropByRes(), updated.getPerformedTasks()));
 
         propagationManager.execute(tasks);
 
@@ -557,57 +470,45 @@ public class UserController {
     }
 
     @PreAuthorize("hasRole('WORKFLOW_FORM_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/workflow/form/list")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/workflow/form/list")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
     public List<WorkflowFormTO> getForms() {
         return wfAdapter.getForms();
     }
 
     @PreAuthorize("hasRole('WORKFLOW_FORM_READ') and hasRole('USER_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/workflow/form/{userId}")
-    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
-    public WorkflowFormTO getFormForUser(
-            @PathVariable("userId") final Long userId)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException {
+    @RequestMapping(method = RequestMethod.GET, value = "/workflow/form/{userId}")
+    @Transactional(readOnly = true, rollbackFor = { Throwable.class })
+    public WorkflowFormTO getFormForUser(@PathVariable("userId") final Long userId)
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException {
 
         SyncopeUser user = userDataBinder.getUserFromId(userId);
         return wfAdapter.getForm(user.getWorkflowId());
     }
 
     @PreAuthorize("hasRole('WORKFLOW_FORM_CLAIM')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/workflow/form/claim/{taskId}")
-    @Transactional(rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.GET, value = "/workflow/form/claim/{taskId}")
+    @Transactional(rollbackFor = { Throwable.class })
     public WorkflowFormTO claimForm(@PathVariable("taskId") final String taskId)
             throws NotFoundException, WorkflowException {
 
-        return wfAdapter.claimForm(taskId,
-                SecurityContextHolder.getContext().
-                getAuthentication().getName());
+        return wfAdapter.claimForm(taskId, SecurityContextHolder.getContext().getAuthentication().getName());
     }
 
     @PreAuthorize("hasRole('WORKFLOW_FORM_SUBMIT')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/workflow/form/submit")
-    @Transactional(rollbackFor = {Throwable.class})
+    @RequestMapping(method = RequestMethod.POST, value = "/workflow/form/submit")
+    @Transactional(rollbackFor = { Throwable.class })
     public UserTO submitForm(@RequestBody final WorkflowFormTO form)
-            throws NotFoundException, WorkflowException, PropagationException,
-            UnauthorizedRoleException {
+            throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
 
         LOG.debug("About to process form {}", form);
 
-        WorkflowResult<Map.Entry<Long, String>> updated =
-                wfAdapter.submitForm(form, SecurityContextHolder.getContext().getAuthentication().getName());
+        WorkflowResult<Map.Entry<Long, String>> updated = wfAdapter.submitForm(form, SecurityContextHolder.getContext()
+                .getAuthentication().getName());
 
-        List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
-                new WorkflowResult<Map.Entry<Long, Boolean>>(
-                new DefaultMapEntry(updated.getResult().getKey(), Boolean.TRUE),
-                updated.getPropByRes(),
-                updated.getPerformedTasks()),
-                updated.getResult().getValue(), null, null);
+        List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(new WorkflowResult<Map.Entry<Long, Boolean>>(
+                new DefaultMapEntry(updated.getResult().getKey(), Boolean.TRUE), updated.getPropByRes(), updated
+                        .getPerformedTasks()), updated.getResult().getValue(), null, null);
         propagationManager.execute(tasks);
 
         final UserTO savedTO = userDataBinder.getUserTO(updated.getResult().getKey());
@@ -617,15 +518,9 @@ public class UserController {
         return savedTO;
     }
 
-    private UserTO setStatus(
-            final SyncopeUser user,
-            final Set<String> resourceNames,
-            final boolean performLocally,
-            final boolean performRemotely,
-            final boolean status,
-            final String performedTask)
-            throws NotFoundException, WorkflowException,
-            UnauthorizedRoleException, PropagationException {
+    private UserTO setStatus(final SyncopeUser user, final Set<String> resourceNames, final boolean performLocally,
+            final boolean performRemotely, final boolean status, final String performedTask)
+            throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException {
 
         LOG.debug("About to suspend " + user.getId());
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserRequestController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserRequestController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserRequestController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserRequestController.java Thu Mar 15 10:17:12 2012
@@ -49,8 +49,7 @@ public class UserRequestController {
     /**
      * Logger.
      */
-    private static final Logger LOG =
-            LoggerFactory.getLogger(UserRequestController.class);
+    private static final Logger LOG = LoggerFactory.getLogger(UserRequestController.class);
 
     @Autowired
     private ConfDAO confDAO;
@@ -62,11 +61,9 @@ public class UserRequestController {
     private UserRequestDataBinder dataBinder;
 
     @PreAuthorize("isAuthenticated()")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read/self")
+    @RequestMapping(method = RequestMethod.GET, value = "/read/self")
     @Transactional(readOnly = true)
-    public UserTO read()
-            throws NotFoundException {
+    public UserTO read() throws NotFoundException {
 
         return dataBinder.getAuthUserTO();
     }
@@ -77,19 +74,15 @@ public class UserRequestController {
         return Boolean.valueOf(createRequestAllowed.getValue());
     }
 
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/create/allowed")
+    @RequestMapping(method = RequestMethod.GET, value = "/create/allowed")
     @Transactional(readOnly = true)
     public ModelAndView isCreateAllowed() {
 
-        return new ModelAndView().addObject(
-                isCreateAllowedByConf());
+        return new ModelAndView().addObject(isCreateAllowedByConf());
     }
 
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/create")
-    public UserRequestTO create(@RequestBody final UserTO userTO)
-            throws UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.POST, value = "/create")
+    public UserRequestTO create(@RequestBody final UserTO userTO) throws UnauthorizedRoleException {
 
         if (!isCreateAllowedByConf()) {
             LOG.error("Create requests are not allowed");
@@ -112,10 +105,8 @@ public class UserRequestController {
     }
 
     @PreAuthorize("isAuthenticated()")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/update")
-    public UserRequestTO update(@RequestBody final UserMod userMod)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.POST, value = "/update")
+    public UserRequestTO update(@RequestBody final UserMod userMod) throws NotFoundException, UnauthorizedRoleException {
 
         LOG.debug("Request user update called with {}", userMod);
 
@@ -132,10 +123,8 @@ public class UserRequestController {
     }
 
     @PreAuthorize("isAuthenticated()")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/delete")
-    public UserRequestTO delete(@RequestBody final Long userId)
-            throws NotFoundException, UnauthorizedRoleException {
+    @RequestMapping(method = RequestMethod.POST, value = "/delete")
+    public UserRequestTO delete(@RequestBody final Long userId) throws NotFoundException, UnauthorizedRoleException {
 
         LOG.debug("Request user delete called with {}", userId);
 
@@ -152,8 +141,7 @@ public class UserRequestController {
     }
 
     @PreAuthorize("hasRole('USER_REQUEST_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/list")
     @Transactional(readOnly = true)
     public List<UserRequestTO> list() {
         List<UserRequestTO> result = new ArrayList<UserRequestTO>();
@@ -166,11 +154,9 @@ public class UserRequestController {
     }
 
     @PreAuthorize("hasRole('USER_REQUEST_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/read/{requestId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/read/{requestId}")
     @Transactional(readOnly = true)
-    public UserRequestTO read(@PathVariable("requestId") final Long requestId)
-            throws NotFoundException {
+    public UserRequestTO read(@PathVariable("requestId") final Long requestId) throws NotFoundException {
 
         UserRequest request = userRequestDAO.find(requestId);
         if (request == null) {
@@ -181,10 +167,8 @@ public class UserRequestController {
     }
 
     @PreAuthorize("hasRole('USER_REQUEST_DELETE')")
-    @RequestMapping(method = RequestMethod.DELETE,
-    value = "/deleteRequest/{requestId}")
-    public void deleteRequest(@PathVariable("requestId") final Long requestId)
-            throws NotFoundException {
+    @RequestMapping(method = RequestMethod.DELETE, value = "/deleteRequest/{requestId}")
+    public void deleteRequest(@PathVariable("requestId") final Long requestId) throws NotFoundException {
 
         UserRequest request = userRequestDAO.find(requestId);
         if (request == null) {

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/VirtualSchemaController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/VirtualSchemaController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/VirtualSchemaController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/VirtualSchemaController.java Thu Mar 15 10:17:12 2012
@@ -46,18 +46,13 @@ public class VirtualSchemaController ext
     private VirtualSchemaDataBinder virtualSchemaDataBinder;
 
     @PreAuthorize("hasRole('SCHEMA_CREATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/{kind}/create")
+    @RequestMapping(method = RequestMethod.POST, value = "/{kind}/create")
     public VirtualSchemaTO create(final HttpServletResponse response,
-            @RequestBody final VirtualSchemaTO virtualSchemaTO,
-            @PathVariable("kind") final String kind)
+            @RequestBody final VirtualSchemaTO virtualSchemaTO, @PathVariable("kind") final String kind)
             throws SyncopeClientCompositeErrorException {
 
-        AbstractVirSchema virtualSchema =
-                virtualSchemaDataBinder.create(
-                virtualSchemaTO,
-                getAttributableUtil(kind).newVirtualSchema(),
-                getAttributableUtil(kind).schemaClass());
+        AbstractVirSchema virtualSchema = virtualSchemaDataBinder.create(virtualSchemaTO, getAttributableUtil(kind)
+                .newVirtualSchema(), getAttributableUtil(kind).schemaClass());
 
         virtualSchema = virtualSchemaDAO.save(virtualSchema);
 
@@ -66,58 +61,44 @@ public class VirtualSchemaController ext
     }
 
     @PreAuthorize("hasRole('SCHEMA_DELETE')")
-    @RequestMapping(method = RequestMethod.DELETE,
-    value = "/{kind}/delete/{schema}")
-    public void delete(HttpServletResponse response,
-            @PathVariable("kind") final String kind,
-            @PathVariable("schema") final String virtualSchemaName)
-            throws NotFoundException {
+    @RequestMapping(method = RequestMethod.DELETE, value = "/{kind}/delete/{schema}")
+    public void delete(HttpServletResponse response, @PathVariable("kind") final String kind,
+            @PathVariable("schema") final String virtualSchemaName) throws NotFoundException {
 
         Class reference = getAttributableUtil(kind).virtualSchemaClass();
-        AbstractVirSchema virtualSchema =
-                virtualSchemaDAO.find(virtualSchemaName, reference);
+        AbstractVirSchema virtualSchema = virtualSchemaDAO.find(virtualSchemaName, reference);
         if (virtualSchema == null) {
-            LOG.error("Could not find virtual schema '"
-                    + virtualSchemaName + "'");
+            LOG.error("Could not find virtual schema '" + virtualSchemaName + "'");
 
             throw new NotFoundException(virtualSchemaName);
         } else {
-            virtualSchemaDAO.delete(
-                    virtualSchemaName, getAttributableUtil(kind));
+            virtualSchemaDAO.delete(virtualSchemaName, getAttributableUtil(kind));
         }
     }
 
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{kind}/list")
+    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/list")
     public List<VirtualSchemaTO> list(@PathVariable("kind") final String kind) {
         Class reference = getAttributableUtil(kind).virtualSchemaClass();
-        List<AbstractVirSchema> virtualAttributeSchemas =
-                virtualSchemaDAO.findAll(reference);
+        List<AbstractVirSchema> virtualAttributeSchemas = virtualSchemaDAO.findAll(reference);
 
-        List<VirtualSchemaTO> virtualSchemaTOs =
-                new ArrayList<VirtualSchemaTO>(virtualAttributeSchemas.size());
+        List<VirtualSchemaTO> virtualSchemaTOs = new ArrayList<VirtualSchemaTO>(virtualAttributeSchemas.size());
         for (AbstractVirSchema virtualSchema : virtualAttributeSchemas) {
 
-            virtualSchemaTOs.add(virtualSchemaDataBinder.getVirtualSchemaTO(
-                    virtualSchema));
+            virtualSchemaTOs.add(virtualSchemaDataBinder.getVirtualSchemaTO(virtualSchema));
         }
 
         return virtualSchemaTOs;
     }
 
     @PreAuthorize("hasRole('SCHEMA_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/{kind}/read/{virtualSchema}")
+    @RequestMapping(method = RequestMethod.GET, value = "/{kind}/read/{virtualSchema}")
     public VirtualSchemaTO read(@PathVariable("kind") final String kind,
-            @PathVariable("virtualSchema") final String virtualSchemaName)
-            throws NotFoundException {
+            @PathVariable("virtualSchema") final String virtualSchemaName) throws NotFoundException {
 
         Class reference = getAttributableUtil(kind).virtualSchemaClass();
-        AbstractVirSchema virtualSchema =
-                virtualSchemaDAO.find(virtualSchemaName, reference);
+        AbstractVirSchema virtualSchema = virtualSchemaDAO.find(virtualSchemaName, reference);
         if (virtualSchema == null) {
-            LOG.error("Could not find virtual schema '"
-                    + virtualSchemaName + "'");
+            LOG.error("Could not find virtual schema '" + virtualSchemaName + "'");
             throw new NotFoundException(virtualSchemaName);
         }
 
@@ -125,24 +106,19 @@ public class VirtualSchemaController ext
     }
 
     @PreAuthorize("hasRole('SCHEMA_UPDATE')")
-    @RequestMapping(method = RequestMethod.POST,
-    value = "/{kind}/update")
-    public VirtualSchemaTO update(
-            @RequestBody final VirtualSchemaTO virtualSchemaTO,
-            @PathVariable("kind") final String kind)
-            throws SyncopeClientCompositeErrorException, NotFoundException {
+    @RequestMapping(method = RequestMethod.POST, value = "/{kind}/update")
+    public VirtualSchemaTO update(@RequestBody final VirtualSchemaTO virtualSchemaTO,
+            @PathVariable("kind") final String kind) throws SyncopeClientCompositeErrorException, NotFoundException {
 
         Class reference = getAttributableUtil(kind).virtualSchemaClass();
-        AbstractVirSchema virtualSchema =
-                virtualSchemaDAO.find(virtualSchemaTO.getName(), reference);
+        AbstractVirSchema virtualSchema = virtualSchemaDAO.find(virtualSchemaTO.getName(), reference);
         if (virtualSchema == null) {
-            LOG.error("Could not find virtual schema '"
-                    + virtualSchemaTO.getName() + "'");
+            LOG.error("Could not find virtual schema '" + virtualSchemaTO.getName() + "'");
             throw new NotFoundException(virtualSchemaTO.getName());
         }
 
-        virtualSchema = virtualSchemaDataBinder.update(virtualSchemaTO,
-                virtualSchema, getAttributableUtil(kind).schemaClass());
+        virtualSchema = virtualSchemaDataBinder.update(virtualSchemaTO, virtualSchema, getAttributableUtil(kind)
+                .schemaClass());
 
         virtualSchema = virtualSchemaDAO.save(virtualSchema);
         return virtualSchemaDataBinder.getVirtualSchemaTO(virtualSchema);

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/WorkflowController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/WorkflowController.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/WorkflowController.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/WorkflowController.java Thu Mar 15 10:17:12 2012
@@ -39,30 +39,24 @@ public class WorkflowController extends 
     private UserWorkflowAdapter wfAdapter;
 
     @PreAuthorize("hasRole('WORKFLOW_DEF_READ')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/definition")
+    @RequestMapping(method = RequestMethod.GET, value = "/definition")
     @Transactional(readOnly = true)
-    public WorkflowDefinitionTO getDefinition()
-            throws WorkflowException {
+    public WorkflowDefinitionTO getDefinition() throws WorkflowException {
 
         return wfAdapter.getDefinition();
     }
 
     @PreAuthorize("hasRole('WORKFLOW_DEF_UPDATE')")
-    @RequestMapping(method = RequestMethod.PUT,
-    value = "/definition")
-    public void updateDefinition(
-            @RequestBody final WorkflowDefinitionTO definition)
+    @RequestMapping(method = RequestMethod.PUT, value = "/definition")
+    public void updateDefinition(@RequestBody final WorkflowDefinitionTO definition)
             throws NotFoundException, WorkflowException {
 
         wfAdapter.updateDefinition(definition);
     }
 
     @PreAuthorize("hasRole('WORKFLOW_TASK_LIST')")
-    @RequestMapping(method = RequestMethod.GET,
-    value = "/tasks")
-    public ModelAndView getDefinedTasks()
-            throws WorkflowException {
+    @RequestMapping(method = RequestMethod.GET, value = "/tasks")
+    public ModelAndView getDefinedTasks() throws WorkflowException {
 
         return new ModelAndView().addObject(wfAdapter.getDefinedTasks());
     }