You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by gi...@apache.org on 2015/01/09 14:35:10 UTC

[1/2] syncope git commit: [SYNCOPE-627] Updating console counterpart

Repository: syncope
Updated Branches:
  refs/heads/master 0edb2a245 -> 25bb5c9d3


[SYNCOPE-627] Updating console counterpart


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/3838763f
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/3838763f
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/3838763f

Branch: refs/heads/master
Commit: 3838763f6eb2a6464786f6b83044c43260558be6
Parents: 0edb2a2
Author: giacomolm <gi...@hotmail.it>
Authored: Fri Jan 9 14:19:25 2015 +0100
Committer: giacomolm <gi...@hotmail.it>
Committed: Fri Jan 9 14:19:25 2015 +0100

----------------------------------------------------------------------
 .../org/apache/syncope/common/to/RouteTO.java   |  11 +
 .../syncope/console/pages/Configuration.java    |   4 +-
 .../syncope/console/pages/RouteModalPage.java   |   2 +-
 .../syncope/console/rest/RouteRestClient.java   |  10 +-
 .../syncope/core/init/CamelRouteLoader.java     |  50 +-
 .../camel/CamelRoleProvisioningManager.java     |   2 +-
 .../provisioning/camel/SyncopeCamelContext.java |  10 +-
 .../syncope/core/services/RouteServiceImpl.java |   4 +-
 core/src/main/resources/camelRoute.xml          | 468 -------------------
 core/src/main/resources/roleRoute.xml           |   2 -
 core/src/main/resources/userRoute.xml           |   4 +-
 11 files changed, 68 insertions(+), 499 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/common/src/main/java/org/apache/syncope/common/to/RouteTO.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/syncope/common/to/RouteTO.java b/common/src/main/java/org/apache/syncope/common/to/RouteTO.java
index 709297e..9b6f25f 100644
--- a/common/src/main/java/org/apache/syncope/common/to/RouteTO.java
+++ b/common/src/main/java/org/apache/syncope/common/to/RouteTO.java
@@ -21,6 +21,7 @@ package org.apache.syncope.common.to;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 import org.apache.syncope.common.AbstractBaseBean;
+import org.apache.syncope.common.types.SubjectType;
 
 @XmlRootElement(name = "route")
 @XmlType
@@ -32,6 +33,8 @@ public class RouteTO extends AbstractBaseBean {
 
     private String routeContent;
 
+    private SubjectType subject;
+
     public void setId(Long id) {
         this.id = id;
     }
@@ -47,6 +50,14 @@ public class RouteTO extends AbstractBaseBean {
     public String getName() {
         return name;
     }
+    
+    public SubjectType getSubject() {
+        return subject;
+    }
+
+    public void setSubject(SubjectType subject) {
+        this.subject = subject;
+    }
 
     public String getRouteContent() {
         return routeContent;

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/pages/Configuration.java b/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
index 0f97ff5..54c5132 100644
--- a/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
+++ b/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
@@ -809,8 +809,8 @@ public class Configuration extends BasePage {
 
                             @Override
                             public Page createPage() {
-                                return new RouteModalPage(Configuration.this.getPageReference(), editRouteWin, routeRestClient.readRoute(model.getObject().getId()), false);
-                                //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+                                return new RouteModalPage(Configuration.this.getPageReference(), editRouteWin, 
+                                        routeRestClient.readRoute(model.getObject().getId(),model.getObject().getSubject()), false);                                
                             }
 
                         });

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/console/src/main/java/org/apache/syncope/console/pages/RouteModalPage.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/pages/RouteModalPage.java b/console/src/main/java/org/apache/syncope/console/pages/RouteModalPage.java
index 8cc02e6..7965023 100644
--- a/console/src/main/java/org/apache/syncope/console/pages/RouteModalPage.java
+++ b/console/src/main/java/org/apache/syncope/console/pages/RouteModalPage.java
@@ -62,7 +62,7 @@ public class RouteModalPage extends BaseModalPage{
                     @Override
                     protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
                         try {
-                            restClient.updateRoute(routeTO.getId(), ((RouteTO)form.getModelObject()).getRouteContent());
+                            restClient.updateRoute(routeTO.getId(), ((RouteTO)form.getModelObject()).getRouteContent(), routeTO.getSubject());
                             info(getString(Constants.OPERATION_SUCCEEDED));
                             
                             Configuration callerPage = (Configuration) pageRef.getPage();

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/console/src/main/java/org/apache/syncope/console/rest/RouteRestClient.java
----------------------------------------------------------------------
diff --git a/console/src/main/java/org/apache/syncope/console/rest/RouteRestClient.java b/console/src/main/java/org/apache/syncope/console/rest/RouteRestClient.java
index 422b4ee..90adc3e 100644
--- a/console/src/main/java/org/apache/syncope/console/rest/RouteRestClient.java
+++ b/console/src/main/java/org/apache/syncope/console/rest/RouteRestClient.java
@@ -37,14 +37,14 @@ public class RouteRestClient extends BaseRestClient{
         return getService(RouteService.class).getRoutes(subject);
     }
     
-    public RouteTO readRoute(Long id){
-        return getService(RouteService.class).getRoute(id);
+    public RouteTO readRoute(final Long id, final SubjectType subject){
+        return getService(RouteService.class).getRoute(subject,id);
     }
     
-    public void updateRoute(Long id, String definition){
-        RouteTO routeTO = readRoute(id);        
+    public void updateRoute(Long id, String definition, final SubjectType subject){
+        RouteTO routeTO = readRoute(id,subject);        
         routeTO.setRouteContent(definition);     
-        getService(RouteService.class).importRoute(routeTO.getId(), routeTO);
+        getService(RouteService.class).importRoute(subject, routeTO.getId(), routeTO);
     }
     
     public boolean isCamelEnabledForUsers() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/java/org/apache/syncope/core/init/CamelRouteLoader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/init/CamelRouteLoader.java b/core/src/main/java/org/apache/syncope/core/init/CamelRouteLoader.java
index a293da4..afd72c8 100644
--- a/core/src/main/java/org/apache/syncope/core/init/CamelRouteLoader.java
+++ b/core/src/main/java/org/apache/syncope/core/init/CamelRouteLoader.java
@@ -21,6 +21,10 @@ package org.apache.syncope.core.init;
 import java.io.File;
 import java.io.StringWriter;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import javax.sql.DataSource;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.OutputKeys;
@@ -36,6 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import org.w3c.dom.Document;
@@ -51,27 +56,35 @@ public class CamelRouteLoader {
     @Autowired
     private RouteDAO routeDAO;
     
+    @Autowired
+    private DataSource dataSource;
+    
     private int size = 0;
-
+    
+    private boolean routeLoaded = false;
+    
     @Transactional
     public void load() {
-        loadRoutes("/userRoute.xml", SubjectType.USER);
-        loadRoutes("/roleRoute.xml", SubjectType.ROLE);
+        if(!routeLoaded){
+            loadRoutes("/userRoute.xml", SubjectType.USER);
+            loadRoutes("/roleRoute.xml", SubjectType.ROLE);        
+            routeLoaded = true;
+        }
     }
     
     public void loadRoutes(String path, SubjectType subject) {
 
-        if(routeDAO.findAll(subject).isEmpty()){
+        if(getRoutes(subject).isEmpty()){
             URL url = getClass().getResource(path);
 
             File file = new File(url.getPath());
-            
+            String query = "INSERT INTO CamelRoute(ID, NAME, SUBJECT, ROUTECONTENT) VALUES (?, ?, ?, ?)";
             try {
 
                 DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                 Document doc = dBuilder.parse(file);
                 doc.getDocumentElement().normalize();
-
+                JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
                 NodeList listOfRoutes = doc.getElementsByTagName("route");
                 for (int s = 0; s < listOfRoutes.getLength(); s++) {
                     //getting the route node element
@@ -80,8 +93,9 @@ public class CamelRouteLoader {
                     CamelRoute route = new CamelRoute();
                     route.setSubject(subject);
                     route.setName(((Element) routeEl).getAttribute("id"));
-                    route.setRouteContent(nodeToString(listOfRoutes.item(s)));                    
-                    routeDAO.save(route);
+                    route.setRouteContent(nodeToString(listOfRoutes.item(s)));
+                    jdbcTemplate.update(query, new Object[] { size++, ((Element) routeEl).getAttribute("id"), 
+                                                             subject.name(), nodeToString(listOfRoutes.item(s)) });
                     LOG.info("Route with id {} Registration Successed", ((Element) routeEl).getAttribute("id"));
                 }
             } catch (DataAccessException e) {
@@ -91,7 +105,7 @@ public class CamelRouteLoader {
             }
         }
     }
-
+    
     private String nodeToString(Node node) {
         StringWriter sw = new StringWriter();
         try {
@@ -99,8 +113,24 @@ public class CamelRouteLoader {
             t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
             t.transform(new DOMSource(node), new StreamResult(sw));
         } catch (TransformerException te) {
-            System.out.println("nodeToString Transformer Exception");
+            LOG.debug("nodeToString Transformer Exception");
         }
         return sw.toString();
     }
+    
+    @Transactional(readOnly = true)
+    public List<CamelRoute> getRoutes(final SubjectType subject) {                        
+        String sql = "SELECT * FROM CAMELROUTE WHERE SUBJECT = ?";
+        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
+        List<CamelRoute> routes = new ArrayList<CamelRoute>();
+        List<Map<String,Object>> rows = jdbcTemplate.queryForList(sql, new Object[] {subject.name()});
+        for (Map row : rows) {
+            CamelRoute route = new CamelRoute();                    
+            route.setName((String)row.get("NAME"));
+            route.setSubject(SubjectType.valueOf((String)row.get("SUBJECT")));
+            route.setRouteContent((String) row.get("ROUTECONTENT"));
+            routes.add(route);
+        }
+        return routes;
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/java/org/apache/syncope/core/provisioning/camel/CamelRoleProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/provisioning/camel/CamelRoleProvisioningManager.java b/core/src/main/java/org/apache/syncope/core/provisioning/camel/CamelRoleProvisioningManager.java
index 6e75771..ca7521b 100644
--- a/core/src/main/java/org/apache/syncope/core/provisioning/camel/CamelRoleProvisioningManager.java
+++ b/core/src/main/java/org/apache/syncope/core/provisioning/camel/CamelRoleProvisioningManager.java
@@ -69,7 +69,7 @@ public class CamelRoleProvisioningManager implements RoleProvisioningManager {
     }
 
     public void startContext() throws Exception {
-        camelContext.start();
+        getContext().start();
     }
 
     public void stopContext() throws Exception {

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java b/core/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java
index 1a59a70..3acea2c 100644
--- a/core/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java
+++ b/core/src/main/java/org/apache/syncope/core/provisioning/camel/SyncopeCamelContext.java
@@ -33,12 +33,15 @@ import org.apache.camel.model.Constants;
 import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.spring.SpringCamelContext;
 import org.apache.syncope.common.types.SubjectType;
+import org.apache.syncope.core.init.CamelRouteLoader;
 import org.apache.syncope.core.persistence.beans.CamelRoute;
 import org.apache.syncope.core.persistence.dao.RouteDAO;
 import org.apache.syncope.core.util.ApplicationContextProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
@@ -59,12 +62,9 @@ public class SyncopeCamelContext {
         }
         if (camelContext.getRouteDefinitions().isEmpty()) {
 
-            List<CamelRoute> crl = new ArrayList<CamelRoute>();
-            crl.addAll(routeDAO.findAll(SubjectType.USER));
-            crl.addAll(routeDAO.findAll(SubjectType.ROLE));
-            LOG.info("{} route(s) are going to be loaded ", crl.size());
+            List<CamelRoute> crl = routeDAO.findAll();
+            LOG.debug("{} route(s) are going to be loaded ", crl.size());
             loadContext(routeDAO, crl);
-
             try {
                 camelContext.start();
             } catch (Exception ex) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/java/org/apache/syncope/core/services/RouteServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/services/RouteServiceImpl.java b/core/src/main/java/org/apache/syncope/core/services/RouteServiceImpl.java
index 71f94ac..8c2de1b 100644
--- a/core/src/main/java/org/apache/syncope/core/services/RouteServiceImpl.java
+++ b/core/src/main/java/org/apache/syncope/core/services/RouteServiceImpl.java
@@ -69,8 +69,8 @@ public class RouteServiceImpl extends AbstractServiceImpl implements RouteServic
     }
     
     @Override
-    public RouteTO getRoute(SubjectType subject, Long Id) {
-        return controller.readRoute(Id, subject);
+    public RouteTO getRoute(SubjectType subject, Long id) {
+        return controller.readRoute(id);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/resources/camelRoute.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/camelRoute.xml b/core/src/main/resources/camelRoute.xml
deleted file mode 100644
index 7cebf73..0000000
--- a/core/src/main/resources/camelRoute.xml
+++ /dev/null
@@ -1,468 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-                           http://www.springframework.org/schema/beans/spring-beans.xsd
-                           http://camel.apache.org/schema/spring
-                           http://camel.apache.org/schema/spring/camel-spring.xsd">
- 
-  <!--
-      The default routes define each task involved in user creation:
-      main operations consist in user workflow creation and its propagation.         
-  -->
-  <routeContext id="defaultRoutes" xmlns="http://camel.apache.org/schema/spring">    
-        
-    <!--
-        CREATE USER
-        This is the entry point of the route and is involved in accepting
-        the UserTO. When it arrives, the user workflow is created. If the
-        creation is successfull, the result is sent to propagation, otherwise
-        if an exception was raised, the exception has to be returned to the
-        caller. The property actual allows to store the received UserTO in
-        order to use it later.
-    -->
-        
-    <route id="createUser">
-      <from uri="direct:createUser"/>
-      <setProperty propertyName="actual">
-        <simple>${body}</simple>
-      </setProperty>
-      <doTry>
-        <bean ref="uwfAdapter" method="create(${body},${property.disablePwdPolicyCheck},
-                                 ${property.enabled},${property.storePassword})"/>
-        <process ref="defaultUserCreatePropagation" />
-        <to uri="direct:createPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:createPort"/>
-        </doCatch>
-      </doTry>
-    </route> 
-        
-    <!--
-        The propagation route deals with propagation of created user. In this
-        case we used a custom processor to perform this task: it means that
-        a custom java class contains the propagation strategy.
-    -->
-       
-    <!--
-        UPDATE USER
-    -->
-    <route id="updateUser">
-      <from uri="direct:updateUser"/>
-      <setProperty propertyName="actual">
-        <simple>${body}</simple>
-      </setProperty>
-      <doTry>
-        <bean ref="uwfAdapter" method="update(${body})"/>
-        <process ref="defaultUserUpdatePropagation" />
-        <to uri="direct:updatePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:updatePort"/>
-        </doCatch>
-      </doTry>
-    </route>
-        
-
-                
-    <!--
-        UPDATE SYNC USER
-    -->
-    <route id="updateSyncUser">
-      <from uri="direct:updateSyncUser"/>            
-      <doTry>
-        <bean ref="uwfAdapter" method="update(${body})"/>
-        <to uri="direct:syncUserStatus"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:updateSyncPort"/>
-        </doCatch>
-      </doTry>
-    </route>
-        
-    <route id="syncUserStatus">
-      <from uri="direct:syncUserStatus"/>
-      <process ref="userStatusOnSync" />
-      <process ref="defaultUserUpdateInSyncPropagation" />
-      <to uri="direct:updateSyncPort"/>
-    </route>
-    <!--
-        DELETE USER
-    -->
-    <route id="deleteUser">
-      <from uri="direct:deleteUser"/>
-      <doTry>
-        <process ref="defaultUserDeletePropagation" />
-        <bean ref="uwfAdapter" method="delete(${body})"/>
-        <setBody>
-          <simple>${property.statuses}</simple>
-        </setBody>
-        <to uri="direct:deletePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:deletePort"/>
-        </doCatch>
-      </doTry>
-    </route>
-        
-    <!-- 
-        UNLINK USER
-    -->
-    <route id="unlinkUser">
-      <from uri="direct:unlinkUser"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="update(${body})"/>
-        <setBody>
-          <simple>${body.getResult.getKey}</simple>
-        </setBody>
-        <to uri="direct:unlinkPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:unlinkPort"/>
-        </doCatch>
-      </doTry>            
-    </route>
-        
-    <!--
-        LINK USER
-    -->
-        
-    <route id="linkUser">
-      <from uri="direct:linkUser"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="update(${body})"/>
-        <setBody>
-          <simple>${body.getResult.getKey}</simple>
-        </setBody>
-        <to uri="direct:linkPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:linkPort"/>
-        </doCatch>
-      </doTry>            
-    </route>
-        
-    <!-- 
-        ACTIVATE USER
-    -->
-    <route id="activateUser">
-      <from uri="direct:activateUser"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="activate(${body}, ${property.token})"/>
-        <to uri="direct:statusUser"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:statusPort"/>
-        </doCatch>
-      </doTry>    
-    </route>
-    <!-- 
-        REACTIVATE USER
-    -->
-    <route id="reactivateUser">
-      <from uri="direct:reactivateUser"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="reactivate(${body})"/>
-        <to uri="direct:statusUser"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:statusPort"/>
-        </doCatch>
-      </doTry>    
-    </route>
-    <!-- 
-        SUSPEND USER
-    -->
-    <route id="suspendUser">
-      <from uri="direct:suspendUser"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="suspend(${body})"/>
-        <to uri="direct:statusUser"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:statusPort"/>
-        </doCatch>
-      </doTry>  
-    </route>
-        
-    <!-- 
-        STATUS PROPAGATION
-    -->
-        
-    <route id="statusUser">
-      <from uri="direct:statusUser"/>            
-      <process ref="defaultUserStatusPropagation" />
-      <to uri="direct:statusPort"/>              
-    </route>
-        
-        
-    <!--
-        DEPROVISION USER
-    -->
-    <route id="deprovisionUser">
-      <from uri="direct:deprovisionUser"/>            
-      <process ref="defaultUserDeprovisionPropagation" />
-      <to uri="direct:deprovisionPort"/>              
-    </route>
-        
-    <!--
-        CREATE ROLE
-    -->
-        
-    <route id="createRole">
-      <from uri="direct:createRole"/>
-      <setProperty propertyName="subject">
-        <simple>${body}</simple>
-      </setProperty>
-      <doTry>
-        <bean ref="rwfAdapter" method="create(${body})"/>
-        <process ref="defaultRoleCreatePropagation" />
-        <to uri="direct:createRolePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:createRolePort"/>
-        </doCatch>
-      </doTry>
-    </route> 
-               
-    <!--
-        CREATE ROLE SYNC
-    -->
-    <route id="createRoleSync">
-      <from uri="direct:createRoleSync"/>
-      <setProperty propertyName="subject">
-        <simple>${body}</simple>
-      </setProperty>
-      <doTry>
-        <bean ref="rwfAdapter" method="create(${body})"/>
-        <process ref="defaultRoleCreateSyncPropagation" />
-        <to uri="direct:createRoleSyncPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:createRoleSyncPort"/>
-        </doCatch>
-      </doTry>
-    </route> 
-        
-         
-    <!--
-        UPDATE ROLE
-    -->
-    <route id="updateRole">
-      <from uri="direct:updateRole"/>
-      <setProperty propertyName="subjectMod">
-        <simple>${body}</simple>
-      </setProperty>
-      <doTry>
-        <bean ref="rwfAdapter" method="update(${body})"/>
-        <process ref="defaultRoleUpdatePropagation" />
-        <to uri="direct:updateRolePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:updateRolePort"/>
-        </doCatch>
-      </doTry>
-    </route>
-               
-    <!--
-        DELETE ROLE
-    -->
-    <route id="deleteRole">
-      <from uri="direct:deleteRole"/>
-      <doTry>
-        <process ref="defaultRoleDeletePropagation" />
-        <bean ref="rwfAdapter" method="delete(${body})"/>
-        <setBody>
-          <simple>${property.statuses}</simple>
-        </setBody>
-        <to uri="direct:deleteRolePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:deleteRolePort"/>
-        </doCatch>
-      </doTry>
-    </route>
-        
-    <!-- 
-        UNLINK USER
-    -->
-    <route id="unlinkRole">
-      <from uri="direct:unlinkRole"/>
-      <doTry>
-        <bean ref="rwfAdapter" method="update(${body})"/>
-        <setBody>
-          <simple>${body.getResult}</simple>
-        </setBody>
-        <to uri="direct:unlinkRolePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:unlinkRolePort"/>
-        </doCatch>
-      </doTry>            
-    </route>
-        
-    <!--
-        LINK USER
-    -->
-        
-    <route id="linkRole">
-      <from uri="direct:linkRole"/>
-      <doTry>
-        <bean ref="rwfAdapter" method="update(${body})"/>
-        <setBody>
-          <simple>${body.getResult}</simple>
-        </setBody>
-        <to uri="direct:linkRolePort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:linkRolePort"/>
-        </doCatch>
-      </doTry>            
-    </route>
-        
-    <!--
-        DEPROVISION ROLE
-    -->
-    <route id="deprovisionRole">
-      <from uri="direct:deprovisionRole"/>            
-      <process ref="defaultRoleDeprovisionPropagation" />
-      <to uri="direct:deprovisionRolePort"/>              
-    </route>
-        
-    <!--
-        SUSPEND USER AFTER POLICY VIOLATION
-    -->
-        
-    <route id="suspendUserWF">
-      <from uri="direct:suspendUserWF"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="suspend(${body})"/>
-        <process ref="defaultUserWFSuspendPropagation"/>
-        <to uri="direct:suspendWFPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:suspendWFPort"/>
-        </doCatch>
-      </doTry>  
-    </route>
-        
-    <!--
-        REQUEST PASSWORD RESET ROUTE
-    -->
-        
-    <route id="requestPwdReset">
-      <from uri="direct:requestPwdReset"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="requestPasswordReset(${body})"/>
-        <to uri="direct:requestPwdResetPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:requestPwdResetPort"/>
-        </doCatch>
-      </doTry>  
-    </route>
-    <!--
-        CONFIRM PASSWORD RESET
-    -->
-    <route id="confirmPwdReset">
-      <from uri="direct:confirmPwdReset"/>
-      <doTry>
-        <bean ref="uwfAdapter" method="confirmPasswordReset(${property.userId},${property.token},${property.password})"/>
-        <process ref="defaultUserConfirmPwdResetPropagation" />
-        <to uri="direct:confirmPwdResetPort"/>
-        <doCatch>        
-          <exception>java.lang.RuntimeException</exception>
-          <handled>
-            <constant>false</constant>
-          </handled>
-          <to uri="direct:confirmPwdResetPort"/>
-        </doCatch>
-      </doTry>
-    </route>
-        
-  </routeContext>
-  <bean id="defaultUserCreatePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserCreatePropagation"/>
-  <bean id="defaultUserUpdatePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserUpdatePropagation"/>    
-  <bean id="userStatusOnSync" class="org.apache.syncope.core.provisioning.camel.processors.UserStatusOnSync"/>
-  <bean id="defaultUserUpdateInSyncPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserUpdateInSyncPropagation"/>
-  <bean id="defaultUserDeletePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserDeletePropagation"/>    
-  <bean id="defaultUserDeprovisionPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserDeprovisionPropagation"/>    
-  <bean id="defaultUserWFSuspendPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserWFSuspendPropagation"/>
-  <bean id="defaultUserStatusPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserStatusPropagation"/>
-  <bean id="defaultUserConfirmPwdResetPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultUserConfirmPwdResetPropagation"/>
-  <bean id="defaultRoleCreatePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultRoleCreatePropagation"/>
-  <bean id="defaultRoleCreateSyncPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultRoleCreateSyncPropagation"/>
-  <bean id="defaultRoleUpdatePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultRoleUpdatePropagation"/>
-  <bean id="defaultRoleDeletePropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultRoleDeletePropagation"/>    
-  <bean id="defaultRoleDeprovisionPropagation" class="org.apache.syncope.core.provisioning.camel.processors.DefaultRoleDeprovisionPropagation"/>            
-</beans>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/resources/roleRoute.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/roleRoute.xml b/core/src/main/resources/roleRoute.xml
index 44cdfa4..3d0d9d7 100644
--- a/core/src/main/resources/roleRoute.xml
+++ b/core/src/main/resources/roleRoute.xml
@@ -28,7 +28,6 @@ under the License.
       The default routes define each task involved in user creation:
       main operations consist in user workflow creation and its propagation.         
   -->
-  <routeContext id="defaultRoleRoutes" xmlns="http://camel.apache.org/schema/spring"> 
     <!--
         CREATE ROLE
     -->
@@ -170,5 +169,4 @@ under the License.
       <process ref="defaultRoleDeprovisionPropagation" />
       <to uri="direct:deprovisionRolePort"/>              
     </route>
-  </routeContext>
 </beans>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3838763f/core/src/main/resources/userRoute.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/userRoute.xml b/core/src/main/resources/userRoute.xml
index 6c5a394..c95e7fa 100644
--- a/core/src/main/resources/userRoute.xml
+++ b/core/src/main/resources/userRoute.xml
@@ -27,8 +27,7 @@ under the License.
   <!--
       The default routes define each task involved in user creation:
       main operations consist in user workflow creation and its propagation.         
-  -->
-  <routeContext id="defaultUserRoutes" xmlns="http://camel.apache.org/schema/spring">  	
+  -->  	
     <!--
         CREATE USER
         This is the entry point of the route and is involved in accepting
@@ -307,5 +306,4 @@ under the License.
       </doTry>
     </route>
 
-  </routeContext>
 </beans>


[2/2] syncope git commit: [SYNCOPE-627] Cleaning workflow editor from route management

Posted by gi...@apache.org.
[SYNCOPE-627] Cleaning workflow editor from route management


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/25bb5c9d
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/25bb5c9d
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/25bb5c9d

Branch: refs/heads/master
Commit: 25bb5c9d39061de6a8d95a29d9a3761f991abe33
Parents: 3838763
Author: giacomolm <gi...@hotmail.it>
Authored: Fri Jan 9 14:34:39 2015 +0100
Committer: giacomolm <gi...@hotmail.it>
Committed: Fri Jan 9 14:34:39 2015 +0100

----------------------------------------------------------------------
 .../org/apache/syncope/common/services/WorkflowService.java | 8 --------
 .../apache/syncope/core/services/WorkflowServiceImpl.java   | 9 ---------
 2 files changed, 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/25bb5c9d/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java b/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
index da70043..f6c55b4 100644
--- a/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
+++ b/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
@@ -87,12 +87,4 @@ public interface WorkflowService extends JAXRSService {
     @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
     void importDefinition(@NotNull @PathParam("kind") SubjectType kind, @NotNull String definition);
     
-    @GET
-    @Path("{id}")
-    @Produces({ MediaType.APPLICATION_XML })
-    Response getRoute(@PathParam("id") Long id);
-    
-    @GET
-    @Produces({ MediaType.APPLICATION_XML })
-    Response getRoutes();
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/25bb5c9d/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java b/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
index 7ab3691..8e8afa5 100644
--- a/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
+++ b/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
@@ -114,13 +114,4 @@ public class WorkflowServiceImpl extends AbstractServiceImpl implements Workflow
         }
     }
 
-    @Override
-    public Response getRoute(Long id) {
-        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
-
-    @Override
-    public Response getRoutes() {
-        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
-    }
 }