[SYNCOPE-618] Upgraded to 5.17 with new Activiti Modeler

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

Branch: refs/heads/master
Commit: 04415543cc7728e7cd915638ed8f4f98b0e8822d
Parents: 5d45494
Author: Francesco Chicchiriccò <[email protected]>
Authored: Thu Apr 30 18:16:40 2015 +0200
Committer: Francesco Chicchiriccò <[email protected]>
Committed: Thu Apr 30 18:16:40 2015 +0200

----------------------------------------------------------------------
 archetype/pom.xml                               |   7 +-
 .../archetype-resources/console/pom.xml         |  77 ++++++-------
 .../console/SyncopeConsoleApplication.java      |  70 +++++++++++-
 .../SyncopeConsoleRequestCycleListener.java     |  84 +++++++++++++++
 .../client/console/SyncopeConsoleSession.java   |  17 ++-
 .../init/ImplementationClassNamesLoader.java    |   4 -
 .../console/pages/ActivitiModelerPopupPage.java |  27 +++++
 .../syncope/client/console/pages/BasePage.java  |  76 ++++++++++++-
 .../syncope/client/console/pages/ErrorPage.java |  42 ++++++++
 .../syncope/client/console/pages/Workflow.java  | 107 +++++++++++++++++++
 .../console/pages/XMLEditorPopupPage.java       |  90 ++++++++++++++++
 .../console/resources/FilesystemResource.java   |  83 ++++++++++++++
 .../resources/WorkflowDefGETResource.java       |  59 ++++++++++
 .../resources/WorkflowDefPUTResource.java       |  74 +++++++++++++
 .../markup/html/link/VeilPopupSettings.java     |  32 ++++++
 .../console/pages/ActivitiModelerPopupPage.html |  28 +++++
 .../syncope/client/console/pages/BasePage.html  |   8 +-
 .../syncope/client/console/pages/ErrorPage.html |  37 +++++++
 .../syncope/client/console/pages/Workflow.html  |  57 ++++++++++
 .../console/pages/XMLEditorPopupPage.html       |  80 ++++++++++++++
 .../console/pages/XMLEditorPopupPage.properties |  19 ++++
 .../pages/XMLEditorPopupPage_it.properties      |  19 ++++
 .../pages/XMLEditorPopupPage_pt_BR.properties   |  19 ++++
 core/logic/pom.xml                              |   9 --
 .../provisioning/java/sync/SyncJobImpl.java     |   6 +-
 fit/console-reference/pom.xml                   |  78 +++++++-------
 .../oryx.debug.js-tokenValueMap.properties      |  35 ------
 .../src/main/resources/save-model.html          |  59 ++++++++++
 .../src/main/resources/url-config.js            |  34 ++++++
 .../syncope/installer/files/ModelerPom.java     |  80 --------------
 .../installer/files/ModelerTokenValueMap.java   |  58 ----------
 .../installer/processes/ArchetypeProcess.java   |  13 ++-
 .../src/main/resources/installer.properties     |   3 +-
 installer/src/main/resources/modelerPom.xml     |  85 +++++++--------
 pom.xml                                         |  23 +---
 35 files changed, 1253 insertions(+), 346 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index 94e7e0d..0d33034 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -38,7 +38,7 @@ under the License.
       <extension>
         <groupId>org.apache.maven.archetype</groupId>
         <artifactId>archetype-packaging</artifactId>
-        <version>2.2</version>
+        <version>2.3</version>
       </extension>
     </extensions>
 
@@ -47,7 +47,7 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-archetype-plugin</artifactId>
-          <version>2.2</version>
+          <version>2.3</version>
           <extensions>true</extensions>
         </plugin>
       </plugins>
@@ -199,7 +199,8 @@ under the License.
         
<targetPath>${project.build.outputDirectory}/archetype-resources/console/src/main/resources</targetPath>
         <includes>
           <include>log4j2.xml</include>
-          <include>oryx.debug.js-tokenValueMap.properties</include>
+          <include>save-model.html</include>
+          <include>url-config.js</include>
         </includes>
       </resource>
       <resource>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/archetype/src/main/resources/archetype-resources/console/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/console/pom.xml 
b/archetype/src/main/resources/archetype-resources/console/pom.xml
index 0344a40..77f873d 100644
--- a/archetype/src/main/resources/archetype-resources/console/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/console/pom.xml
@@ -106,28 +106,48 @@ under the License.
             <phase>process-resources</phase>
             <configuration>
               <target>
-                <unzip 
src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
 dest="${project.build.directory}/activiti-webapp-explorer2" />
+                <unzip 
src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
 
+                       
dest="${project.build.directory}/activiti-webapp-explorer2" />
                 
                 <mkdir dir="${activiti-modeler.directory}" />
-                
-                <mkdir dir="${activiti-modeler.directory}/editor" />
-                <copy todir="${activiti-modeler.directory}/editor">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/editor">
-                    <exclude name="oryx.js" />
-                  </fileset>
-                </copy>
-                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml"
 todir="${activiti-modeler.directory}/editor" />
-                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
 todir="${activiti-modeler.directory}/editor" />
-                
-                <mkdir dir="${activiti-modeler.directory}/explorer" />
-                <copy todir="${activiti-modeler.directory}/explorer">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/explorer" />
-                </copy>
-                
-                <mkdir dir="${activiti-modeler.directory}/libs" />
-                <copy todir="${activiti-modeler.directory}/libs">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/libs" />
+                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/modeler.html" 
+                      todir="${activiti-modeler.directory}" />
+                <replace file="${activiti-modeler.directory}/modeler.html"
+                         token="&lt;/head&gt;"
+                         value="&lt;script 
type=&quot;text/javascript&quot;&gt;window.onunload = refreshParent; function 
refreshParent() { window.opener.location.reload(); 
}&lt;/script&gt;&lt;/head&gt;"/>
+                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
 
+                      todir="${activiti-modeler.directory}" />
+
+                <mkdir dir="${activiti-modeler.directory}/editor-app" />
+                <copy todir="${activiti-modeler.directory}/editor-app">
+                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/editor-app" />        
          
                 </copy>
+                <replaceregexp 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                               match="ORYX.CONFIG.ROOT_PATH 
=.*&quot;editor/&quot;; //TODO: Remove last slash!!"
+                               replace="BASE_PATH = 
window.location.toString().substr(0, 
window.location.toString().indexOf(&#39;/wicket&#39;));
+ORYX.CONFIG.ROOT_PATH = BASE_PATH + 
&quot;/activiti-modeler/editor-app/editor/&quot;;"
+                               byline="true"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="new Ajax.Request(ACTIVITI.CONFIG.contextRoot + 
&#39;/editor/stencilset?version=&#39; + Date.now(), {"
+                         value="new 
Ajax.Request(window.location.toString().substr(0, 
window.location.toString().indexOf(&#39;/activiti-modeler&#39;)) + 
&quot;/activiti-modeler/stencilset.json&quot;, {"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="ORYX.Editor.createByUrl(modelUrl);"
+                         value="modelUrl = BASE_PATH + 
&quot;/workflowDefGET&quot;;
+ORYX.Editor.createByUrl(modelUrl);"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="ORYX.Editor.createByUrl = function(modelUrl){"
+                         value="modelUrl = BASE_PATH + 
&quot;/workflowDefGET&quot;;
+ORYX.Editor.createByUrl = function(modelUrl){"/>                
+                <replace 
file="${activiti-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
+                         token="window.location.href = &quot;./&quot;;"
+                         value="window.close();"/>
+                                               
+                <copy file="${basedir}/src/main/resources/url-config.js" 
+                      
todir="${activiti-modeler.directory}/editor-app/configuration"
+                      overwrite="true" />
+                <copy file="${basedir}/src/main/resources/save-model.html" 
+                      todir="${activiti-modeler.directory}/editor-app/popups"
+                      overwrite="true" />
               </target>
             </configuration>
             <goals>
@@ -138,25 +158,6 @@ under the License.
       </plugin>
       
       <plugin>
-        <groupId>com.google.code.maven-replacer-plugin</groupId>
-        <artifactId>replacer</artifactId>
-        <executions>
-          <execution>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>replace</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <file>${activiti-modeler.directory}/editor/oryx.debug.js</file>
-          
<tokenValueMap>${basedir}/src/main/resources/oryx.debug.js-tokenValueMap.properties</tokenValueMap>
-          <unescape>true</unescape>
-          <regex>false</regex>
-        </configuration>
-      </plugin>
-      
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <inherited>true</inherited>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index b7b442f..2bff477 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -22,34 +22,102 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.pages.Dashboard;
 import org.apache.syncope.client.console.pages.Login;
+import org.apache.syncope.client.console.resources.FilesystemResource;
+import org.apache.syncope.client.console.resources.WorkflowDefGETResource;
+import org.apache.syncope.client.console.resources.WorkflowDefPUTResource;
 import org.apache.wicket.Page;
 import 
org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
 import 
org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
 import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.request.resource.ResourceReference;
 import org.apache.wicket.resource.DynamicJQueryResourceReference;
 import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import 
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
+import org.springframework.core.type.filter.AssignableTypeFilter;
+import org.springframework.util.ClassUtils;
+import org.springframework.web.context.support.WebApplicationContextUtils;
 
 public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
+    private static final Logger LOG = 
LoggerFactory.getLogger(SyncopeConsoleApplication.class);
+
     public static final List<Locale> SUPPORTED_LOCALES = 
Collections.unmodifiableList(Arrays.asList(
             new Locale[] {
                 Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR")
             }));
 
+    private static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
+
     @Override
     protected void init() {
         super.init();
 
         getComponentInstantiationListeners().add(new 
SpringComponentInjector(this));
+        getResourceSettings().setThrowExceptionOnMissingResource(true);
         getJavaScriptLibrarySettings().setJQueryReference(new 
DynamicJQueryResourceReference());
 
         getSecuritySettings().setAuthorizationStrategy(new 
MetaDataRoleAuthorizationStrategy(this));
-        MetaDataRoleAuthorizationStrategy.authorize(getHomePage(), 
SyncopeConsoleSession.AUTHENTICATED);
+        ClassPathScanningCandidateComponentProvider scanner = new 
ClassPathScanningCandidateComponentProvider(false);
+        scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
+
+        for (BeanDefinition bd : 
scanner.findCandidateComponents(StringUtils.EMPTY)) {
+            try {
+                @SuppressWarnings("unchecked")
+                Class<? extends BasePage> clazz = (Class<? extends BasePage>) 
ClassUtils.resolveClassName(
+                        bd.getBeanClassName(), 
ClassUtils.getDefaultClassLoader());
+                MetaDataRoleAuthorizationStrategy.authorize(clazz, 
SyncopeConsoleSession.AUTHENTICATED);
+            } catch (Throwable t) {
+                LOG.warn("Could not inspect class {}", bd.getBeanClassName(), 
t);
+            }
+        }
+
+        getMarkupSettings().setStripWicketTags(true);
+        getMarkupSettings().setCompressWhitespace(true);
+
+        getRequestCycleListeners().add(new 
SyncopeConsoleRequestCycleListener());
 
         mountPage("/login", getSignInPageClass());
+
+        final String activitiModelerDirectory = 
WebApplicationContextUtils.getWebApplicationContext(
+                
WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", 
String.class);
+        mountResource("/" + ACTIVITI_MODELER_CONTEXT, new 
ResourceReference(ACTIVITI_MODELER_CONTEXT) {
+
+            private static final long serialVersionUID = -128426276529456602L;
+
+            @Override
+            public IResource getResource() {
+                return new FilesystemResource(ACTIVITI_MODELER_CONTEXT, 
activitiModelerDirectory);
+            }
+
+        });
+        mountResource("/workflowDefGET", new 
ResourceReference("workflowDefGET") {
+
+            private static final long serialVersionUID = -128426276529456602L;
+
+            @Override
+            public IResource getResource() {
+                return new WorkflowDefGETResource();
+            }
+        });
+        mountResource("/workflowDefPUT", new 
ResourceReference("workflowDefPUT") {
+
+            private static final long serialVersionUID = -128426276529456602L;
+
+            @Override
+            public IResource getResource() {
+                return new WorkflowDefPUTResource();
+            }
+        });
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleRequestCycleListener.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleRequestCycleListener.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleRequestCycleListener.java
new file mode 100644
index 0000000..925e140
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleRequestCycleListener.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console;
+
+import java.security.AccessControlException;
+import javax.ws.rs.BadRequestException;
+import javax.xml.ws.WebServiceException;
+import org.apache.syncope.client.console.pages.ErrorPage;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.wicket.Page;
+import org.apache.wicket.authorization.UnauthorizedInstantiationException;
+import org.apache.wicket.core.request.handler.PageProvider;
+import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
+import org.apache.wicket.markup.html.pages.ExceptionErrorPage;
+import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.protocol.http.PageExpiredException;
+import org.apache.wicket.request.IRequestHandler;
+import org.apache.wicket.request.cycle.AbstractRequestCycleListener;
+import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SyncopeConsoleRequestCycleListener extends 
AbstractRequestCycleListener {
+
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = 
LoggerFactory.getLogger(SyncopeConsoleRequestCycleListener.class);
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IRequestHandler onException(final RequestCycle cycle, final 
Exception e) {
+        LOG.error("Exception found", e);
+
+        PageParameters errorParameters = new PageParameters();
+        errorParameters.add("errorTitle", new StringResourceModel("alert", 
null).getString());
+
+        final Page errorPage;
+        if (e instanceof UnauthorizedInstantiationException) {
+            errorParameters.add("errorMessage",
+                    new 
StringResourceModel("unauthorizedInstantiationException", null).getString());
+
+            errorPage = new ErrorPage(errorParameters);
+        } else if (e.getCause() instanceof AccessControlException) {
+            errorParameters.add("errorMessage", new 
StringResourceModel("accessControlException", null).getString());
+
+            errorPage = new ErrorPage(errorParameters);
+        } else if (e instanceof PageExpiredException || 
!(SyncopeConsoleSession.get()).isSignedIn()) {
+            errorParameters.add("errorMessage", new 
StringResourceModel("pageExpiredException", null).getString());
+
+            errorPage = new ErrorPage(errorParameters);
+        } else if (e.getCause() instanceof BadRequestException || e.getCause() 
instanceof WebServiceException
+                || e.getCause() instanceof SyncopeClientException) {
+
+            errorParameters.add("errorMessage", new 
StringResourceModel("restClientException", null).getString());
+
+            errorPage = new ErrorPage(errorParameters);
+        } else {
+            // redirect to default Wicket error page
+            errorPage = new ExceptionErrorPage(e, null);
+        }
+
+        return new RenderPageRequestHandler(new PageProvider(errorPage));
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
index 31ef98e..8a5add1 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
@@ -61,6 +61,10 @@ public class SyncopeConsoleSession extends 
AuthenticatedWebSession {
 
     private SyncopeClient client;
 
+    private String username;
+
+    private String password;
+
     private UserTO selfTO;
 
     private Map<String, Set<String>> auth;
@@ -106,6 +110,8 @@ public class SyncopeConsoleSession extends 
AuthenticatedWebSession {
             auth = self.getKey();
             selfTO = self.getValue();
 
+            this.username = username;
+            this.password = password;
             authenticated = true;
         } catch (Exception e) {
             LOG.error("Authentication failed", e);
@@ -153,8 +159,15 @@ public class SyncopeConsoleSession extends 
AuthenticatedWebSession {
     }
 
     public <T> T getService(final MediaType mediaType, final Class<T> 
serviceClass) {
-        T service = client.getService(serviceClass);
-        WebClient.client(service).type(mediaType).accept(mediaType);
+        T service;
+
+        synchronized (clientFactory) {
+            SyncopeClientFactoryBean.ContentType preType = 
clientFactory.getContentType();
+
+            
clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
+            service = clientFactory.create(username, 
password).getService(serviceClass);
+            clientFactory.setContentType(preType);
+        }
 
         return service;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
index 6b0666e..00a9027 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
@@ -38,9 +38,6 @@ import org.springframework.util.ClassUtils;
 @Component
 public class ImplementationClassNamesLoader implements SyncopeConsoleLoader {
 
-    /**
-     * Logger.
-     */
     private static final Logger LOG = 
LoggerFactory.getLogger(ImplementationClassNamesLoader.class);
 
     private List<Class<? extends AbstractBinaryPreviewer>> previewers;
@@ -73,7 +70,6 @@ public class ImplementationClassNamesLoader implements 
SyncopeConsoleLoader {
                 } else if 
(AbstractExtensionPanel.class.isAssignableFrom(clazz) && !isAbsractClazz) {
                     extPanels.add((Class<? extends AbstractExtensionPanel>) 
clazz);
                 }
-
             } catch (Throwable t) {
                 LOG.warn("Could not inspect class {}", bd.getBeanClassName(), 
t);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
new file mode 100644
index 0000000..05658fc
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class ActivitiModelerPopupPage extends WebPage {
+
+    private static final long serialVersionUID = -7031206743629422898L;
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index 1cfc535..434a620 100644
--- 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -20,11 +20,17 @@ package org.apache.syncope.client.console.pages;
 
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.common.lib.types.Entitlement;
+import org.apache.wicket.Component;
 import org.apache.wicket.Page;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.IAjaxIndicatorAware;
+import 
org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.behavior.Behavior;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
@@ -37,12 +43,81 @@ public class BasePage extends AbstractBasePage implements 
IAjaxIndicatorAware {
         this(null);
     }
 
+    private String getLIContainerId(final String linkId) {
+        return linkId + "LI";
+    }
+
+    private String getULContainerId(final String linkId) {
+        return linkId + "UL";
+    }
+
     public BasePage(final PageParameters parameters) {
         super(parameters);
 
         add(new Label("version", SyncopeConsoleSession.get().getVersion()));
         add(new Label("username", 
SyncopeConsoleSession.get().getSelfTO().getUsername()));
+
+        // menu
+        WebMarkupContainer liContainer = new 
WebMarkupContainer(getLIContainerId("dashboard"));
+        add(liContainer);
+        liContainer.add(new BookmarkablePageLink<>("dashboard", 
Dashboard.class));
+
+        WebMarkupContainer confLIContainer = new 
WebMarkupContainer(getLIContainerId("configuration"));
+        add(confLIContainer);
+        WebMarkupContainer confULContainer = new 
WebMarkupContainer(getULContainerId("configuration"));
+        confLIContainer.add(confULContainer);
+
+        liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
+        confULContainer.add(liContainer);
+        BookmarkablePageLink<Page> link = new 
BookmarkablePageLink<>("workflow", Workflow.class);
+        MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.ENABLE, 
Entitlement.WORKFLOW_DEF_READ);
+        liContainer.add(link);
+
         add(new BookmarkablePageLink<Page>("logout", Logout.class));
+
+        // set 'active' menu item
+        // 1. check if current class is set to top-level menu
+        Component containingLI = 
get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
+        // 2. if not, check if it is under 'Configuration'
+        if (containingLI == null) {
+            containingLI = 
confULContainer.get(getLIContainerId(getClass().getSimpleName().toLowerCase()));
+        }
+        // 3. when found, set CSS coordinates for menu
+        if (containingLI != null) {
+            containingLI.add(new Behavior() {
+
+                private static final long serialVersionUID = 
1469628524240283489L;
+
+                @Override
+                public void onComponentTag(final Component component, final 
ComponentTag tag) {
+                    tag.put("class", "active");
+                }
+            });
+
+            if 
(confULContainer.getId().equals(containingLI.getParent().getId())) {
+                confULContainer.add(new Behavior() {
+
+                    private static final long serialVersionUID = 
3109256773218160485L;
+
+                    @Override
+                    public void onComponentTag(final Component component, 
final ComponentTag tag) {
+                        tag.put("class", "treeview-menu menu-open");
+                        tag.put("style", "display: block;");
+                    }
+
+                });
+
+                confLIContainer.add(new Behavior() {
+
+                    private static final long serialVersionUID = 
3109256773218160485L;
+
+                    @Override
+                    public void onComponentTag(final Component component, 
final ComponentTag tag) {
+                        tag.put("class", "treeview active");
+                    }
+                });
+            }
+        }
     }
 
     @Override
@@ -57,7 +132,6 @@ public class BasePage extends AbstractBasePage implements 
IAjaxIndicatorAware {
      * @param container container
      */
     protected void setWindowClosedCallback(final ModalWindow window, final 
WebMarkupContainer container) {
-
         window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
 
             private static final long serialVersionUID = 8804221891699487139L;

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
new file mode 100644
index 0000000..d4db0bc
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/ErrorPage.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+/**
+ * Error WebPage.
+ */
+public class ErrorPage extends BasePage {
+
+    private static final long serialVersionUID = -390761262038796657L;
+
+    public ErrorPage(final PageParameters parameters) {
+        super(parameters);
+
+        add(new Label("errorTitle", new 
Model<>(parameters.get("errorTitle").toString())));
+        add(new Label("errorMessage", new 
Model<>(parameters.get("errorMessage").toString())));
+
+        add(new BookmarkablePageLink<Page>("home", 
getApplication().getHomePage()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
new file mode 100644
index 0000000..b16bd2a
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.File;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import 
org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
+import org.apache.syncope.common.lib.types.Entitlement;
+import 
org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.request.resource.DynamicImageResource;
+import org.apache.wicket.request.resource.IResource;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+public class Workflow extends BasePage {
+
+    private static final long serialVersionUID = -8781434495150074529L;
+
+    @SpringBean
+    private WorkflowRestClient wfRestClient;
+
+    public Workflow(final PageParameters parameters) {
+        super(parameters);
+
+        WebMarkupContainer noActivitiEnabledForUsers = new 
WebMarkupContainer("noActivitiEnabledForUsers");
+        noActivitiEnabledForUsers.setOutputMarkupPlaceholderTag(true);
+        add(noActivitiEnabledForUsers);
+
+        WebMarkupContainer workflowDefContainer = new 
WebMarkupContainer("workflowDefContainer");
+        workflowDefContainer.setOutputMarkupPlaceholderTag(true);
+
+        if (wfRestClient.isActivitiEnabledForUsers()) {
+            noActivitiEnabledForUsers.setVisible(false);
+        } else {
+            workflowDefContainer.setVisible(false);
+        }
+
+        BookmarkablePageLink<Void> activitiModeler =
+                new BookmarkablePageLink<>("activitiModeler", 
ActivitiModelerPopupPage.class);
+        activitiModeler.setPopupSettings(new 
VeilPopupSettings().setHeight(600).setWidth(800));
+        MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE, 
Entitlement.WORKFLOW_DEF_READ);
+        workflowDefContainer.add(activitiModeler);
+        // Check if Activiti Modeler directory is found
+        boolean activitiModelerEnabled = false;
+        try {
+            String activitiModelerDirectory = 
WebApplicationContextUtils.getWebApplicationContext(
+                    
WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", 
String.class);
+            File baseDir = new File(activitiModelerDirectory);
+            activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && 
baseDir.isDirectory();
+        } catch (Exception e) {
+            LOG.error("Could not check for Activiti Modeler directory", e);
+        }
+        activitiModeler.setEnabled(activitiModelerEnabled);
+
+        BookmarkablePageLink<Void> xmlEditor = new 
BookmarkablePageLink<>("xmlEditor", XMLEditorPopupPage.class);
+        xmlEditor.setPopupSettings(new 
VeilPopupSettings().setHeight(480).setWidth(800));
+        MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE, 
Entitlement.WORKFLOW_DEF_READ);
+        workflowDefContainer.add(xmlEditor);
+
+        Image workflowDefDiagram = new Image("workflowDefDiagram", new 
Model<IResource>()) {
+
+            private static final long serialVersionUID = -8457850449086490660L;
+
+            @Override
+            protected IResource getImageResource() {
+                return new DynamicImageResource() {
+
+                    private static final long serialVersionUID = 
923201517955737928L;
+
+                    @Override
+                    protected byte[] getImageData(final IResource.Attributes 
attributes) {
+                        return wfRestClient.isActivitiEnabledForUsers()
+                                ? wfRestClient.getDiagram()
+                                : new byte[0];
+                    }
+                };
+            }
+        };
+        workflowDefContainer.add(workflowDefDiagram);
+
+        MetaDataRoleAuthorizationStrategy.authorize(workflowDefContainer, 
ENABLE, Entitlement.WORKFLOW_DEF_READ);
+        add(workflowDefContainer);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
new file mode 100644
index 0000000..c02d9ac
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.pages;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.types.Entitlement;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import 
org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextArea;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.spring.injection.annot.SpringBean;
+import org.apache.wicket.util.io.IOUtils;
+
+public class XMLEditorPopupPage extends BasePopupPage {
+
+    private static final long serialVersionUID = 5816041644635271734L;
+
+    @SpringBean
+    private WorkflowRestClient wfRestClient;
+
+    public XMLEditorPopupPage() {
+        Form<?> wfForm = new Form<>("workflowDefForm");
+
+        String definition;
+        try {
+            definition = 
IOUtils.toString(wfRestClient.getDefinition(MediaType.APPLICATION_XML_TYPE));
+        } catch (IOException e) {
+            LOG.error("Could not get workflow definition", e);
+            definition = StringUtils.EMPTY;
+        }
+        final TextArea<String> workflowDefArea = new 
TextArea<>("workflowDefArea", new Model<>(definition));
+        wfForm.add(workflowDefArea);
+
+        AjaxButton submit =
+                new IndicatingAjaxButton(APPLY, new 
Model<>(getString(SUBMIT))) {
+
+                    private static final long serialVersionUID = 
-958724007591692537L;
+
+                    @Override
+                    protected void onSubmit(final AjaxRequestTarget target, 
final Form<?> form) {
+                        try {
+                            wfRestClient.updateDefinition(
+                                    MediaType.APPLICATION_XML_TYPE, 
workflowDefArea.getModelObject());
+                            info(getString(Constants.OPERATION_SUCCEEDED));
+                        } catch (SyncopeClientException scee) {
+                            error(getString(Constants.ERROR) + ": " + 
scee.getMessage());
+                        }
+                        feedbackPanel.refresh(target);
+                    }
+
+                    @Override
+                    protected void onError(final AjaxRequestTarget target, 
final Form<?> form) {
+                        feedbackPanel.refresh(target);
+                    }
+                };
+
+        final Button close = new Button("closePage", new 
Model<>(getString(CANCEL)));
+
+        MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, 
Entitlement.WORKFLOW_DEF_UPDATE);
+        wfForm.add(submit);
+        wfForm.add(close);
+        this.add(wfForm);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
new file mode 100644
index 0000000..8a95de6
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/FilesystemResource.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.resources;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Mounts directory on local filesystem as subcontext.
+ */
+public class FilesystemResource extends AbstractResource {
+
+    private static final long serialVersionUID = -4791087117785935198L;
+
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = 
LoggerFactory.getLogger(FilesystemResource.class);
+
+    private final String baseCtx;
+
+    private final String basePath;
+
+    public FilesystemResource(final String baseCtx, final String basePath) {
+        this.baseCtx = baseCtx;
+        this.basePath = basePath;
+    }
+
+    @Override
+    protected ResourceResponse newResourceResponse(final Attributes 
attributes) {
+        ResourceResponse response = new ResourceResponse();
+
+        final File baseDir = new File(basePath);
+        if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
+            String reqPath = attributes.getRequest().getUrl().getPath();
+            final String subPath = reqPath.substring(reqPath.indexOf(baseCtx) 
+ baseCtx.length()).
+                    replace('/', File.separatorChar);
+            LOG.debug("Request for {}", subPath);
+
+            response.setWriteCallback(new WriteCallback() {
+
+                @Override
+                public void writeData(final Attributes attributes) throws 
IOException {
+                    FileInputStream resourceIS = null;
+                    try {
+                        resourceIS = new FileInputStream(new File(baseDir, 
subPath));
+                        IOUtils.copy(resourceIS, 
attributes.getResponse().getOutputStream());
+                    } catch (IOException e) {
+                        LOG.error("Could not read from {}", 
baseDir.getAbsolutePath() + subPath, e);
+                    } finally {
+                        IOUtils.closeQuietly(resourceIS);
+                    }
+                }
+            });
+        } else {
+            LOG.error("{} not found, not readable or not a directory", 
basePath);
+        }
+
+        return response;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
new file mode 100644
index 0000000..faf3a57
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefGETResource.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.resources;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for obtaining user workflow definition in JSON (used 
by Activiti Modeler).
+ *
+ * @see 
org.apache.syncope.common.rest.api.service.WorkflowService#exportDefinition(
+ * org.apache.syncope.common.types.SubjectType)
+ */
+public class WorkflowDefGETResource extends AbstractResource {
+
+    private static final long serialVersionUID = 4637304868056148970L;
+
+    @Override
+    protected ResourceResponse newResourceResponse(final Attributes 
attributes) {
+        ResourceResponse response = new ResourceResponse();
+        response.disableCaching();
+        response.setContentType(MediaType.APPLICATION_JSON);
+
+        response.setWriteCallback(new WriteCallback() {
+
+            @Override
+            public void writeData(final Attributes attributes) throws 
IOException {
+                
IOUtils.copy(WebApplicationContextUtils.getWebApplicationContext(
+                        
WebApplication.get().getServletContext()).getBean(WorkflowRestClient.class).
+                        getDefinition(MediaType.APPLICATION_JSON_TYPE),
+                        attributes.getResponse().getOutputStream());
+            }
+        });
+
+        return response;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
new file mode 100644
index 0000000..e603ab2
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/resources/WorkflowDefPUTResource.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MediaType;
+import org.apache.cxf.common.util.UrlUtils;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.io.IOUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * Mirror REST resource for putting user workflow definition in JSON (used by 
Activiti Modeler).
+ *
+ * @see org.apache.syncope.common.rest.api.service.#importDefinition(
+ * org.apache.syncope.common.types.SubjectType, java.lang.String)
+ */
+public class WorkflowDefPUTResource extends AbstractResource {
+
+    private static final long serialVersionUID = 2964542005207297944L;
+
+    /**
+     * Logger.
+     */
+    private static final Logger LOG = 
LoggerFactory.getLogger(WorkflowDefPUTResource.class);
+
+    @Override
+    protected ResourceResponse newResourceResponse(final Attributes 
attributes) {
+        String definition = null;
+        try {
+            HttpServletRequest request = (HttpServletRequest) 
attributes.getRequest().getContainerRequest();
+            String requestBody = IOUtils.toString(request.getInputStream());
+            String[] split = requestBody.split("&");
+            for (int i = 0; i < split.length && definition == null; i++) {
+                String keyValue = split[i];
+                if (keyValue.startsWith("json_xml=")) {
+                    definition = UrlUtils.urlDecode(keyValue.split("=")[1]);
+                }
+            }
+        } catch (IOException e) {
+            LOG.error("Could not extract workflow definition from request", e);
+        }
+
+        
WebApplicationContextUtils.getWebApplicationContext(WebApplication.get().getServletContext()).
+                getBean(WorkflowRestClient.class).
+                updateDefinition(MediaType.APPLICATION_JSON_TYPE, definition);
+
+        ResourceResponse response = new ResourceResponse();
+        response.setStatusCode(204);
+        return response;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
 
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
new file mode 100644
index 0000000..51c8ec5
--- /dev/null
+++ 
b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/link/VeilPopupSettings.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.wicket.markup.html.link;
+
+import org.apache.wicket.markup.html.link.PopupSettings;
+
+public class VeilPopupSettings extends PopupSettings {
+
+    private static final long serialVersionUID = -2727046117490858226L;
+
+    @Override
+    public String getPopupJavaScript() {
+        return "document.getElementById('veil').style.display = 'block';" + 
super.getPopupJavaScript();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
new file mode 100644
index 0000000..416df19
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ActivitiModelerPopupPage.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html>
+  <head>
+    <title>Apache Syncope / Activiti Modeler</title>
+
+    <meta http-equiv="refresh" content="0; 
url=../../activiti-modeler/modeler.html"/>
+  </head>
+  <body>
+  </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
index 5851ceb..7546a6a 100644
--- 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePage.html
@@ -87,16 +87,16 @@ under the License.
         <section class="sidebar">
           <ul class="sidebar-menu">
             <li class="header">&nbsp;</li>
-            <li class="active"><a href="#"><i class="fa 
fa-dashboard"></i><span>Dashboard</span></a></li>
+            <li wicket:id="dashboardLI"><a href="#" wicket:id="dashboard"><i 
class="fa fa-dashboard"></i><span>Dashboard</span></a></li>
             <li><a href="#"><i class="fa 
fa-users"></i><span>Realms</span></a></li>
             <li><a href="#"><i class="fa 
fa-th"></i><span>Resources</span></a></li>
             <li><a href="#"><i class="fa 
fa-pie-chart"></i><span>Reports</span></a></li>
-            <li class="treeview">
+            <li wicket:id="configurationLI" class="treeview">
               <a href="#"><i class="fa fa-edit"></i><span>Configuration</span> 
<i class="fa fa-angle-left pull-right"></i></a>
-              <ul class="treeview-menu">
+              <ul wicket:id="configurationUL" class="treeview-menu">
                 <li><a href="#"><i class="fa fa-circle-o"></i>Policies</a></li>
                 <li><a href="#"><i class="fa fa-circle-o"></i>Security 
Questions</a></li>
-                <li><a href="#"><i class="fa fa-circle-o"></i>Workflow</a></li>
+                <li wicket:id="workflowLI"><a href="#" wicket:id="workflow"><i 
class="fa fa-circle-o"></i>Workflow</a></li>
                 <li><a href="#"><i class="fa fa-circle-o"></i>Logs</a></li>
                 <li><a href="#"><i class="fa fa-circle-o"></i>Layouts</a></li>
                 <li><a href="#"><i class="fa fa-circle-o"></i>Schemas</a></li>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
new file mode 100644
index 0000000..bea9c9f
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ErrorPage.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+  <wicket:extend>
+
+    <div class="ui-widget">
+      <div class="ui-state-error ui-corner-all">
+        <p>
+          <span class="ui-icon ui-icon-alert"></span>
+          <strong><span wicket:id="errorTitle"/></strong>
+          <div><span wicket:id="errorMessage"/></div>
+          <p>
+            <a href="" wicket:id="home">
+              <wicket:message key="home"/>
+            </a>
+          </p>
+        </p>
+      </div>
+    </div>
+  </wicket:extend>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
new file mode 100644
index 0000000..aa77a3f
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+  <wicket:extend>
+
+    <section class="content">
+      <div>
+        <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message 
key="noActivitiEnabledForUsers"/></i></span>
+        <span wicket:id="workflowDefContainer">
+          <div style="float: left;">
+            <button wicket:id="activitiModeler" style="width: 122px">
+              <div style="display: table-row;">
+                <div style="display: table-cell">
+                  <i class="fa fa-file-image-o fa-4x"></i>
+                </div>
+                <div style="display: 
table-cell;vertical-align:middle;font-size:62.5%;">
+                  Activiti Modeler
+                </div>
+              </div>
+            </button>
+          </div>
+          <div>
+            <button wicket:id="xmlEditor" style="width: 122px">
+              <div style="display: table-row;">
+                <div style="display: table-cell">
+                  <i class="fa fa-file-text-o fa-4x"></i>
+                </div>
+                <div style="display: 
table-cell;vertical-align:middle;font-size:62.5%;">                  
+                  XML editor
+                </div>
+              </div>
+            </button>
+          </div>
+          <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
+        </span>
+      </div>
+    </section>
+
+  </wicket:extend>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
new file mode 100644
index 0000000..0d6cd15
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<!--
+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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org";>
+  <wicket:head>
+    <link rel="stylesheet" type="text/css" 
href="webjars/codemirror/${codemirror.version}/lib/codemirror.css"/>
+
+    <script type="text/javascript" 
src="webjars/codemirror/${codemirror.version}/lib/codemirror.js"></script>
+    <script type="text/javascript" 
src="webjars/codemirror/${codemirror.version}/mode/xml/xml.js"></script>
+    <script type="text/javascript">
+      function updateTextArea(editor) {
+        document.getElementById("workflowDefArea").value = editor.getValue();
+      }
+    </script>
+    <script>
+      window.onunload = refreshParent;
+      function refreshParent() {
+        window.opener.location.reload();
+      }
+    </script>
+    <style>
+      .w_content_3 {
+        padding: 0;
+        color: #333333;
+        font-family: Verdana,Tahoma,sans-serif;
+        font-size: 100%;
+        border: 1px solid #BBBBBB;
+        padding: 1%;
+      }
+    </style>
+  </wicket:head>
+  <wicket:extend>
+    <div style="padding: 1%;">
+      <div class="w_content_3">
+        <p class="ui-widget ui-corner-all ui-widget-header">
+          <wicket:message key="title"/>
+        </p>
+        <form wicket:id="workflowDefForm">
+          <div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
+            <textarea wicket:id="workflowDefArea" id="workflowDefArea" 
style="width: 100%; height: 350px;">
+            </textarea>
+          </div>
+          <div style="padding-top: 1%;">
+            <input type="submit"
+                   class="ui-button ui-widget ui-state-default ui-corner-all 
ui-button-text-only"
+                   wicket:id="apply"
+                   style="width: 50px"/>
+            <input type="submit"
+                   wicket:id="closePage"
+                   class="ui-button ui-widget ui-state-default ui-corner-all 
ui-button-text-only"
+                   onclick="window.close();"
+                   style="width: 50px"/>
+          </div>
+        </form>
+      </div>
+    </div>
+    <script>
+      window.onload = function() {
+        var editor = 
CodeMirror.fromTextArea(document.getElementById("workflowDefArea"), 
{lineNumbers: true});
+        editor.on("change", updateTextArea);
+      };
+    </script>
+  </wicket:extend>
+</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
new file mode 100644
index 0000000..2276791
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
@@ -0,0 +1,19 @@
+# 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.
+submit=Save
+cancel=Close
+title=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
new file mode 100644
index 0000000..818dfb4
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_it.properties
@@ -0,0 +1,19 @@
+# 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.
+submit=Salva
+cancel=Chiudi
+title=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
----------------------------------------------------------------------
diff --git 
a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
new file mode 100644
index 0000000..4152188
--- /dev/null
+++ 
b/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
@@ -0,0 +1,19 @@
+# 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.
+submit=Salvar
+cancel=Fechar
+title=Workflow XML Editor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/core/logic/pom.xml
----------------------------------------------------------------------
diff --git a/core/logic/pom.xml b/core/logic/pom.xml
index 6a9aaa3..b6e48de 100644
--- a/core/logic/pom.xml
+++ b/core/logic/pom.xml
@@ -84,15 +84,6 @@ under the License.
     </dependency>
 
     <dependency>
-      <groupId>xalan</groupId>
-      <artifactId>xalan</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/SyncJobImpl.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/SyncJobImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/SyncJobImpl.java
index 28cd5b4..1d47bfb 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/SyncJobImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/SyncJobImpl.java
@@ -107,7 +107,7 @@ public class SyncJobImpl extends 
AbstractProvisioningJob<SyncTask, SyncActions>
 
         LOG.debug("Execute synchronization with token {}", 
syncTask.getResource().getUsyncToken());
 
-        final ProvisioningProfile<SyncTask, SyncActions> profile = new 
ProvisioningProfile<>(connector, syncTask);
+        ProvisioningProfile<SyncTask, SyncActions> profile = new 
ProvisioningProfile<>(connector, syncTask);
         if (actions != null) {
             profile.getActions().addAll(actions);
         }
@@ -115,13 +115,13 @@ public class SyncJobImpl extends 
AbstractProvisioningJob<SyncTask, SyncActions>
         
profile.setResAct(getSyncPolicySpec(syncTask).getConflictResolutionAction());
 
         // Prepare handler for SyncDelta objects (users)
-        final UserSyncResultHandler uhandler =
+        UserSyncResultHandler uhandler =
                 (UserSyncResultHandler) 
ApplicationContextProvider.getApplicationContext().getBeanFactory().
                 createBean(UserSyncResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         uhandler.setProfile(profile);
 
         // Prepare handler for SyncDelta objects (groups)
-        final GroupSyncResultHandler rhandler =
+        GroupSyncResultHandler rhandler =
                 (GroupSyncResultHandler) 
ApplicationContextProvider.getApplicationContext().getBeanFactory().
                 createBean(GroupSyncResultHandlerImpl.class, 
AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
         rhandler.setProfile(profile);

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/fit/console-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/pom.xml b/fit/console-reference/pom.xml
index f9710d4..df4403b 100644
--- a/fit/console-reference/pom.xml
+++ b/fit/console-reference/pom.xml
@@ -114,7 +114,6 @@ under the License.
     <dependency>
       <groupId>net.tirasa.connid.bundles.soap</groupId>
       <artifactId>wssample</artifactId>
-      <version>${connid.soap.version}</version>
       <type>war</type>
       <scope>test</scope>
     </dependency>
@@ -150,28 +149,48 @@ under the License.
             <phase>process-resources</phase>
             <configuration>
               <target>
-                <unzip 
src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
 dest="${project.build.directory}/activiti-webapp-explorer2" />
+                <unzip 
src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
 
+                       
dest="${project.build.directory}/activiti-webapp-explorer2" />
                 
                 <mkdir dir="${activiti-modeler.directory}" />
-                
-                <mkdir dir="${activiti-modeler.directory}/editor" />
-                <copy todir="${activiti-modeler.directory}/editor">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/editor">
-                    <exclude name="oryx.js" />
-                  </fileset>
-                </copy>
-                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml"
 todir="${activiti-modeler.directory}/editor" />
-                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
 todir="${activiti-modeler.directory}/editor" />
-                
-                <mkdir dir="${activiti-modeler.directory}/explorer" />
-                <copy todir="${activiti-modeler.directory}/explorer">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/explorer" />
-                </copy>
-                
-                <mkdir dir="${activiti-modeler.directory}/libs" />
-                <copy todir="${activiti-modeler.directory}/libs">
-                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/libs" />
+                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/modeler.html" 
+                      todir="${activiti-modeler.directory}" />
+                <replace file="${activiti-modeler.directory}/modeler.html"
+                         token="&lt;/head&gt;"
+                         value="&lt;script 
type=&quot;text/javascript&quot;&gt;window.onunload = refreshParent; function 
refreshParent() { window.opener.location.reload(); 
}&lt;/script&gt;&lt;/head&gt;"/>
+                <copy 
file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
 
+                      todir="${activiti-modeler.directory}" />
+
+                <mkdir dir="${activiti-modeler.directory}/editor-app" />
+                <copy todir="${activiti-modeler.directory}/editor-app">
+                  <fileset 
dir="${project.build.directory}/activiti-webapp-explorer2/editor-app" />        
          
                 </copy>
+                <replaceregexp 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                               match="ORYX.CONFIG.ROOT_PATH 
=.*&quot;editor/&quot;; //TODO: Remove last slash!!"
+                               replace="BASE_PATH = 
window.location.toString().substr(0, 
window.location.toString().indexOf(&#39;/wicket&#39;));
+ORYX.CONFIG.ROOT_PATH = BASE_PATH + 
&quot;/activiti-modeler/editor-app/editor/&quot;;"
+                               byline="true"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="new Ajax.Request(ACTIVITI.CONFIG.contextRoot + 
&#39;/editor/stencilset?version=&#39; + Date.now(), {"
+                         value="new 
Ajax.Request(window.location.toString().substr(0, 
window.location.toString().indexOf(&#39;/activiti-modeler&#39;)) + 
&quot;/activiti-modeler/stencilset.json&quot;, {"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="ORYX.Editor.createByUrl(modelUrl);"
+                         value="modelUrl = BASE_PATH + 
&quot;/workflowDefGET&quot;;
+ORYX.Editor.createByUrl(modelUrl);"/>
+                <replace 
file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+                         token="ORYX.Editor.createByUrl = function(modelUrl){"
+                         value="modelUrl = BASE_PATH + 
&quot;/workflowDefGET&quot;;
+ORYX.Editor.createByUrl = function(modelUrl){"/>                
+                <replace 
file="${activiti-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
+                         token="window.location.href = &quot;./&quot;;"
+                         value="window.close();"/>
+                                               
+                <copy file="${basedir}/src/main/resources/url-config.js" 
+                      
todir="${activiti-modeler.directory}/editor-app/configuration"
+                      overwrite="true" />
+                <copy file="${basedir}/src/main/resources/save-model.html" 
+                      todir="${activiti-modeler.directory}/editor-app/popups"
+                      overwrite="true" />
               </target>
             </configuration>
             <goals>
@@ -182,25 +201,6 @@ under the License.
       </plugin>
       
       <plugin>
-        <groupId>com.google.code.maven-replacer-plugin</groupId>
-        <artifactId>replacer</artifactId>
-        <executions>
-          <execution>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>replace</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <file>${activiti-modeler.directory}/editor/oryx.debug.js</file>
-          
<tokenValueMap>${basedir}/src/main/resources/oryx.debug.js-tokenValueMap.properties</tokenValueMap>
-          <unescape>true</unescape>
-          <regex>false</regex>
-        </configuration>
-      </plugin>
-      
-      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <inherited>true</inherited>

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
----------------------------------------------------------------------
diff --git 
a/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
 
b/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
deleted file mode 100644
index 17fdbcc..0000000
--- 
a/fit/console-reference/src/main/resources/oryx.debug.js-tokenValueMap.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-# 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.
-ORYX.CONFIG.ROOT_PATH \=                                       "../editor/"; 
//TODO: Remove last slash!!=BASE_PATH =                                     
window.location.toString().substr(0, 
window.location.toString().indexOf('/wicket'));\nORYX.CONFIG.ROOT_PATH =        
                 BASE_PATH + "/activiti-modeler/editor/";
-ORYX.CONFIG.EXPLORER_PATH \=                           
"../explorer";=ORYX.CONFIG.EXPLORER_PATH =                      BASE_PATH + 
"/activiti-modeler/explorer";
-ORYX.CONFIG.LIBS_PATH \=                                       
"../libs";=ORYX.CONFIG.LIBS_PATH =                              BASE_PATH + 
"/activiti-modeler/libs";
-ORYX.CONFIG.SYNTAXCHECKER_URL \==ORYX.CONFIG.PLUGINS_CONFIG =                  
ORYX.CONFIG.ROOT_PATH + "plugins.xml";\nORYX.CONFIG.SYNTAXCHECKER_URL =
-this._baseUrl \= "../editor/stencilsets/bpmn2.0/";=this._baseUrl = 
ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/";
-this._source \= "../stencilsets/bpmn2.0/bpmn2.0.json";=this._source = 
ORYX.CONFIG.ROOT_PATH + "stencilsets/bpmn2.0/bpmn2.0.json";
-"../service/editor/stencilset"=ORYX.CONFIG.ROOT_PATH + "stencilset.json"
-ORYX.Editor.createByUrl=modelUrl = BASE_PATH + 
"/workflowDefGET";\nORYX.Editor.createByUrl
-../explorer/src/img/signavio/smoky/logo2.png="+ORYX.CONFIG.EXPLORER_PATH+"/src/img/signavio/smoky/logo2.png
-<a href\=\\""+ORYX.CONFIG.WEB_URL+"\\" target\=\\"_self\\" title\=\\"close 
modeler\\">=<a href=\\"#\\" title=\\"close modeler\\" 
onclick=\\"window.close();\\">
-../editor/images/close_button.png="+ORYX.CONFIG.ROOT_PATH+"images/close_button.png
-height:16px;width:16px;margin-bottom:-4px;background: transparent 
url(../libs/ext-2.0.2/resources/images/default/tree/loading.gif) no-repeat 
center;=height:16px;width:16px;margin-bottom:-4px;background: transparent 
url("+ORYX.CONFIG.LIBS_PATH+"/ext-2.0.2/resources/images/default/tree/loading.gif)
 no-repeat center;
-icon: '../editor/images/add.png',=icon: ORYX.CONFIG.ROOT_PATH + 
'images/add.png',
-icon: '../editor/images/delete.png',=icon: ORYX.CONFIG.ROOT_PATH + 
'images/delete.png',
-id\="edit_model_title"=id="edit_model_title" readonly="readonly"
-id\="edit_model_summary"=id="edit_model_summary" readonly="readonly"
-"../service/model/" + modelMeta.modelId + "/json"=BASE_PATH + "/workflowDefGET"
-// Send the request to the server.=saveUri = BASE_PATH + 
"/workflowDefPUT";\n// Send the request to the server.
-'Accept':"application/json", 
'Content-Type':'charset\=UTF-8'='Accept':"application/json", 
'Content-Type':'application/json'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/04415543/fit/console-reference/src/main/resources/save-model.html
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/save-model.html 
b/fit/console-reference/src/main/resources/save-model.html
new file mode 100644
index 0000000..4c6173d
--- /dev/null
+++ b/fit/console-reference/src/main/resources/save-model.html
@@ -0,0 +1,59 @@
+<!--
+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.
+-->
+<div class="modal" ng-controller="SaveModelCtrl">
+  <div class="modal-dialog">
+    <div class="modal-content">
+      <div class="modal-header">
+        <h2>{{'MODEL.SAVE.TITLE'| translate}}</h2>
+      </div>
+      <div class="modal-body">
+
+        <div class="form-group">
+          <label for="nameField">{{'MODEL.NAME'| translate}}</label>
+          <input type="text"
+                 ng-disabled="status.loading"
+                 id="nameField"
+                 class="form-control"
+                 ng-model="saveDialog.name"
+                 ui-keypress="{13:'save()'}"
+                 auto-focus readonly/>
+        </div>
+        <div class="form-group">
+          <label for="docTextArea">{{'MODEL.DESCRIPTION'| translate}}</label>
+          <textarea id="docTextArea" ng-disabled="status.loading" 
class="form-control" 
+                    ng-model="saveDialog.description" readonly></textarea>
+        </div>
+      </div>
+      <div class="modal-footer">
+
+        <div class="pull-right">
+          <button type="button" class="btn" ng-click="close()" 
ng-disabled="status.loading" translate>ACTION.CANCEL</button>
+          <button class="btn btn-primary" ng-click="saveAndClose()" 
ng-disabled="status.loading" ng-show="!error" 
translate>ACTION.SAVE-AND-CLOSE</button>
+        </div>
+
+        <div class="pull-right popup-error" ng-if="error && !error.isConflict">
+          <span>{{'MODEL.SAVE.ERROR'| translate}}</span>
+        </div>
+
+        <loading></loading>
+
+      </div>
+    </div>
+  </div>
+</div>
\ No newline at end of file

Reply via email to