You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/04/11 12:50:58 UTC
[6/6] syncope git commit: [SYNCOPE-1020] Implementation completed:
now several sub-processes can be managed besides the main workflow definition
[SYNCOPE-1020] Implementation completed: now several sub-processes can be managed besides the main workflow definition
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/4c2dd443
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/4c2dd443
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/4c2dd443
Branch: refs/heads/master
Commit: 4c2dd4433353a47b98fbdc4a9706ba6726b9fd44
Parents: b578e4b
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Fri Apr 7 08:52:49 2017 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Tue Apr 11 14:50:41 2017 +0200
----------------------------------------------------------------------
.../archetype-resources/console/pom.xml | 70 +++-
.../self/WorkflowSyncopeOperations.java | 11 +-
.../client/console/commons/Constants.java | 10 +
.../syncope/client/console/pages/BasePage.java | 2 +-
.../syncope/client/console/pages/LogViewer.java | 2 -
.../client/console/pages/ModelerPopupPage.java | 45 +++
.../syncope/client/console/pages/Workflow.java | 64 ++--
.../console/panels/NewWorkflowProcess.java | 87 +++++
.../console/panels/WorkflowDirectoryPanel.java | 346 +++++++++++++++++++
.../console/panels/WorkflowTogglePanel.java | 145 --------
.../resources/AbstractWorkflowResource.java | 54 +++
.../resources/WorkflowDefGETResource.java | 8 +-
.../resources/WorkflowDefPUTResource.java | 20 +-
.../client/console/rest/WorkflowRestClient.java | 22 +-
.../wicket/markup/html/form/ActionLink.java | 13 +-
.../markup/html/form/ActionLinksPanel.java | 38 +-
.../markup/html/form/ImageModalPanel.java | 58 ++++
.../client/console/pages/ModelerPopupPage.html | 28 ++
.../syncope/client/console/pages/Workflow.html | 17 +-
.../client/console/pages/Workflow.properties | 1 +
.../client/console/pages/Workflow_it.properties | 1 +
.../console/pages/Workflow_pt_BR.properties | 1 +
.../client/console/pages/Workflow_ru.properties | 1 +
.../console/panels/ConnObjectListViewPanel.html | 2 +-
.../console/panels/NewWorkflowProcess.html | 32 ++
.../console/panels/WorkflowDirectoryPanel.html | 23 ++
.../console/panels/WorkflowTogglePanel.html | 50 ---
.../client/console/panels/empty.bpmn20.xml | 49 +++
.../markup/html/form/ActionLinksPanel.html | 5 +
.../markup/html/form/ImageModalPanel.html | 23 ++
.../client/console/wizards/WizardMgtPanel.html | 4 +-
.../common/lib/to/WorkflowDefinitionTO.java | 71 ++++
.../common/lib/types/StandardEntitlement.java | 8 +-
.../rest/api/service/WorkflowService.java | 62 +++-
.../syncope/core/logic/WorkflowLogic.java | 120 +++----
.../rest/cxf/service/WorkflowServiceImpl.java | 59 ++--
.../activiti/ActivitiDefinitionLoader.java | 18 +-
.../workflow/activiti/ActivitiDeployUtils.java | 97 ++++++
.../workflow/activiti/ActivitiImportUtils.java | 93 -----
.../activiti/ActivitiUserWorkflowAdapter.java | 286 +++++++++------
.../api/AnyObjectWorkflowDefinitionAdapter.java | 22 ++
.../api/GroupWorkflowDefinitionAdapter.java | 22 ++
.../api/UserWorkflowDefinitionAdapter.java | 22 ++
.../core/workflow/api/WorkflowAdapter.java | 24 --
.../workflow/api/WorkflowDefinitionAdapter.java | 64 ++++
.../core/workflow/api/WorkflowException.java | 7 +-
.../java/AbstractAnyObjectWorkflowAdapter.java | 4 +-
.../java/AbstractGroupWorkflowAdapter.java | 3 +-
.../java/AbstractUserWorkflowAdapter.java | 3 +-
.../java/DefaultAnyObjectWorkflowAdapter.java | 29 +-
.../java/DefaultGroupWorkflowAdapter.java | 30 +-
.../java/DefaultUserWorkflowAdapter.java | 34 +-
fit/console-reference/pom.xml | 4 +-
.../src/main/resources/url-config.js | 4 +-
.../apache/syncope/fit/core/WorkflowITCase.java | 57 +--
55 files changed, 1653 insertions(+), 722 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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 111e262..a71c04b 100644
--- a/archetype/src/main/resources/archetype-resources/console/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/console/pom.xml
@@ -203,14 +203,74 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
<version>${syncope.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.syncope.ext.saml2sp</groupId>
- <artifactId>syncope-ext-saml2sp-client-console</artifactId>
- <version>${syncope.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.syncope.ext.saml2sp</groupId>
+ <artifactId>syncope-ext-saml2sp-client-console</artifactId>
+ <version>${syncope.version}</version>
+ </dependency>
</dependencies>
<build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>setupActivitiModeler</id>
+ <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" />
+
+ <mkdir dir="${activiti-modeler.directory}" />
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/modeler.html"
+ todir="${activiti-modeler.directory}" />
+ <replace file="${activiti-modeler.directory}/modeler.html"
+ token="</head>"
+ value="<script type="text/javascript">window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }</script></head>"/>
+ <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 =.*"editor/"; //TODO: Remove last slash!!"
+ replace="BASE_PATH = window.location.toString().substr(0, window.location.toString().indexOf('/wicket'));
+ORYX.CONFIG.ROOT_PATH = BASE_PATH + "/activiti-modeler/editor-app/editor/";"
+ byline="true"/>
+ <replace file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+ token="new Ajax.Request(ACTIVITI.CONFIG.contextRoot + '/editor/stencilset?version=' + Date.now(), {"
+ value="new Ajax.Request(window.location.toString().substr(0, window.location.toString().indexOf('/activiti-modeler')) + "/activiti-modeler/stencilset.json", {"/>
+ <replace file="${activiti-modeler.directory}/editor-app/editor/oryx.debug.js"
+ token="ORYX.Editor.createByUrl(modelUrl);"
+ value="modelUrl = BASE_PATH + "/workflowDefGET?modelId=" + modelId; 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 + "/workflowDefGET?modelId=" + modelId; ORYX.Editor.createByUrl = function(modelUrl){" />
+ <replace file="${activiti-modeler.directory}/editor-app/configuration/toolbar-default-actions.js"
+ token="window.location.href = "./";"
+ 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>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
index 6d0f3b2..45025d4 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/self/WorkflowSyncopeOperations.java
@@ -21,20 +21,21 @@ package org.apache.syncope.client.cli.commands.self;
import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.service.WorkflowService;
public class WorkflowSyncopeOperations {
+ private static final String DEFAULT = "userWorkflow";
+
private final WorkflowService workflowService = SyncopeServices.get(WorkflowService.class);
- public Response exportDiagram(final String anyTypeKindString) {
+ public Response exportDiagram(final String anyType) {
WebClient.client(workflowService).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- return workflowService.exportDiagram(AnyTypeKind.valueOf(anyTypeKindString));
+ return workflowService.exportDiagram(anyType, DEFAULT);
}
- public Response exportDefinition(final String anyTypeKindString) {
- return workflowService.exportDefinition(AnyTypeKind.valueOf(anyTypeKindString));
+ public Response exportDefinition(final String anyType) {
+ return workflowService.get(anyType, DEFAULT);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
index baf4653..affe16e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/Constants.java
@@ -29,6 +29,14 @@ public final class Constants {
public static final String SYNCOPE = "syncope";
+ public static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
+
+ public static final String FLOWABLE_MODELER_CONTEXT = "flowable-modeler";
+
+ public static final String MODELER_CONTEXT = "modelerContext";
+
+ public static final String MODEL_ID_PARAM = "modelId";
+
public static final String ON_CLICK = "click";
public static final String ON_CHANGE = "change";
@@ -139,6 +147,8 @@ public final class Constants {
public static final String PREF_REPORT_PAGINATOR_ROWS = "report.paginator.rows";
+ public static final String PREF_WORKFLOW_PAGINATOR_ROWS = "workflow.paginator.rows";
+
public static final String PAGEPARAM_CREATE = "CREATE";
public static final String PAGEPARAM_CURRENT_PAGE = "_current_page";
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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 54a6a29..c02a499 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
@@ -173,7 +173,7 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti"));
confULContainer.add(liContainer);
link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
- MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
+ MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.ENABLE, StandardEntitlement.WORKFLOW_DEF_GET);
liContainer.add(link);
liContainer = new WebMarkupContainer(getLIContainerId("audit"));
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/pages/LogViewer.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/LogViewer.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/LogViewer.java
index 820c6f9..22f2fc5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/LogViewer.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/LogViewer.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.client.console.pages;
-import static org.apache.wicket.Component.ENABLE;
-
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections4.list.SetUniqueList;
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/pages/ModelerPopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ModelerPopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ModelerPopupPage.java
new file mode 100644
index 0000000..3b3ed84
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ModelerPopupPage.java
@@ -0,0 +1,45 @@
+/*
+ * 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.syncope.client.console.commons.Constants;
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.string.StringValue;
+
+public class ModelerPopupPage extends WebPage {
+
+ private static final long serialVersionUID = -7031206743629422898L;
+
+ public ModelerPopupPage(final PageParameters parameters) {
+ super(parameters);
+
+ StringValue modelId = parameters.get(Constants.MODEL_ID_PARAM);
+
+ WebMarkupContainer refresh = new WebMarkupContainer("refresh");
+ // properly parameterize ?modelId=5 with SYNCOPE-1020
+ refresh.add(new AttributeModifier(
+ "content", "0; url=../../" + parameters.get(Constants.MODELER_CONTEXT)
+ + "/modeler.html?modelId=" + modelId.toString()));
+ add(refresh);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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
index a9e0b14..01f4655 100644
--- 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
@@ -18,71 +18,47 @@
*/
package org.apache.syncope.client.console.pages;
+import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.panels.WorkflowTogglePanel;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
import org.apache.syncope.common.lib.types.StandardEntitlement;
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.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.request.resource.DynamicImageResource;
-import org.apache.wicket.request.resource.IResource;
public class Workflow extends BasePage {
private static final long serialVersionUID = -8781434495150074529L;
- private final WorkflowRestClient wfRestClient = new WorkflowRestClient();
-
public Workflow(final PageParameters parameters) {
super(parameters);
- final boolean isActivitiEnabledForUsers =
- SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti");
-
- WebMarkupContainer noActivitiEnabledForUsers = new WebMarkupContainer("noActivitiEnabledForUsers");
- noActivitiEnabledForUsers.setOutputMarkupPlaceholderTag(true);
- body.add(noActivitiEnabledForUsers);
+ body.add(BookmarkablePageLinkBuilder.build("dashboard", "dashboardBr", Dashboard.class));
- WebMarkupContainer workflowDef = new WebMarkupContainer("workflowDefContainer");
- workflowDef.setOutputMarkupPlaceholderTag(true);
+ WebMarkupContainer content = new WebMarkupContainer("content");
+ content.setOutputMarkupId(true);
+ body.add(content);
- Image workflowDefDiagram = new Image("workflowDefDiagram", new Model<IResource>()) {
+ WebMarkupContainer disabled = new WebMarkupContainer("disabled");
+ disabled.setOutputMarkupPlaceholderTag(true);
+ content.add(disabled);
- private static final long serialVersionUID = -8457850449086490660L;
+ WizardMgtPanel<WorkflowDefinitionTO> workflowsPanel = new WorkflowDirectoryPanel.Builder(getPageReference()) {
- @Override
- protected IResource getImageResource() {
- return new DynamicImageResource() {
+ private static final long serialVersionUID = -5960765294082359003L;
- private static final long serialVersionUID = 923201517955737928L;
+ }.disableCheckBoxes().build("workflowsPanel");
+ workflowsPanel.setOutputMarkupPlaceholderTag(true);
+ MetaDataRoleAuthorizationStrategy.authorize(workflowsPanel, ENABLE, StandardEntitlement.WORKFLOW_DEF_LIST);
- @Override
- protected byte[] getImageData(final IResource.Attributes attributes) {
- return isActivitiEnabledForUsers
- ? wfRestClient.getDiagram()
- : new byte[0];
- }
- };
- }
- };
- workflowDefDiagram.setOutputMarkupId(true);
- workflowDef.add(workflowDefDiagram);
+ content.add(workflowsPanel);
- WorkflowTogglePanel togglePanel =
- new WorkflowTogglePanel("togglePanel", getPageReference(), workflowDefDiagram);
- togglePanel.setOutputMarkupId(true);
- workflowDef.add(togglePanel);
-
- if (isActivitiEnabledForUsers) {
- noActivitiEnabledForUsers.setVisible(false);
+ if (SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti")) {
+ disabled.setVisible(false);
} else {
- workflowDef.setVisible(false);
+ workflowsPanel.setVisible(false);
}
-
- MetaDataRoleAuthorizationStrategy.authorize(workflowDef, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
- body.add(workflowDef);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
new file mode 100644
index 0000000..ab4bda3
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/NewWorkflowProcess.java
@@ -0,0 +1,87 @@
+/*
+ * 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.panels;
+
+import java.io.Serializable;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.pdfbox.util.Charsets;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.model.Model;
+
+public class NewWorkflowProcess extends TogglePanel<Serializable> {
+
+ private static final long serialVersionUID = -4886361549305302161L;
+
+ private final WorkflowRestClient restClient = new WorkflowRestClient();
+
+ private final Form<?> form;
+
+ public NewWorkflowProcess(final String id, final WebMarkupContainer container, final PageReference pageRef) {
+ super(id, pageRef);
+
+ form = new Form<>("form");
+ addInnerObject(form);
+
+ final TextField<String> key = new TextField<>("key", new Model<String>());
+ key.setRequired(true);
+ form.add(key);
+
+ form.add(new AjaxSubmitLink("submit", form) {
+
+ private static final long serialVersionUID = 4947613489823025052L;
+
+ @Override
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE, key.getModelObject(),
+ IOUtils.toString(
+ getClass().getResourceAsStream("empty.bpmn20.xml"),
+ Charsets.UTF_8.name()).replaceAll("%KEY%", key.getModelObject()));
+
+ key.getModel().setObject(null);
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ toggle(target, false);
+ target.add(container);
+ } catch (Exception e) {
+ LOG.error("While creating new workflow process", e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ });
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
new file mode 100644
index 0000000..4bf7499
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.java
@@ -0,0 +1,346 @@
+/*
+ * 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.panels;
+
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.SyncopeConsoleApplication;
+import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.commons.DirectoryDataProvider;
+import org.apache.syncope.client.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.pages.ModelerPopupPage;
+import org.apache.syncope.client.console.panels.WorkflowDirectoryPanel.WorkflowDefinitionDataProvider;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.ActionColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn;
+import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.client.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.ImageModalPanel;
+import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
+import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
+import org.apache.syncope.client.console.wizards.WizardMgtPanel;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
+import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.Page;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
+import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import org.apache.wicket.extensions.wizard.WizardModel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+import org.apache.wicket.util.io.IOUtils;
+
+public class WorkflowDirectoryPanel extends DirectoryPanel<
+ WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowDefinitionDataProvider, WorkflowRestClient> {
+
+ private static final long serialVersionUID = 2705668831139984998L;
+
+ private final BaseModal<String> utility;
+
+ private String modelerCtx;
+
+ protected WorkflowDirectoryPanel(final String id, final Builder builder) {
+ super(id, builder);
+
+ this.addNewItemPanelBuilder(new AjaxWizardBuilder<WorkflowDefinitionTO>(new WorkflowDefinitionTO(), pageRef) {
+
+ private static final long serialVersionUID = 1633859795677053912L;
+
+ @Override
+ protected WizardModel buildModelSteps(
+ final WorkflowDefinitionTO modelObject, final WizardModel wizardModel) {
+
+ return wizardModel;
+ }
+ }, false);
+ final NewWorkflowProcess newWorkflowProcess = new NewWorkflowProcess("newWorkflowProcess", container, pageRef);
+ addInnerObject(newWorkflowProcess);
+ AjaxLink<Void> newWorkflowProcessLink = new AjaxLink<Void>("add") {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ newWorkflowProcess.toggle(target, true);
+ }
+ };
+ ((WebMarkupContainer) get("container:content")).addOrReplace(newWorkflowProcessLink);
+
+ setShowResultPage(true);
+
+ modal.size(Modal.Size.Large);
+
+ utility = new BaseModal<>("outer");
+ addOuterObject(utility);
+ utility.size(Modal.Size.Large);
+ AjaxSubmitLink xmlEditorSubmit = utility.addSubmitButton();
+ MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, StandardEntitlement.WORKFLOW_DEF_SET);
+ utility.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+ private static final long serialVersionUID = 8804221891699487139L;
+
+ @Override
+ public void onClose(final AjaxRequestTarget target) {
+ utility.show(false);
+ utility.close(target);
+ }
+ });
+ initResultTable();
+
+ // Check if Activiti or Flowable Modeler directory is found
+ modelerCtx = null;
+ try {
+ if (SyncopeConsoleApplication.get().getActivitiModelerDirectory() != null) {
+ File baseDir = new File(SyncopeConsoleApplication.get().getActivitiModelerDirectory());
+ if (baseDir.exists() && baseDir.canRead() && baseDir.isDirectory()) {
+ modelerCtx = Constants.ACTIVITI_MODELER_CONTEXT;
+ }
+ }
+ } catch (Exception e) {
+ LOG.error("Could not check for Modeler directory", e);
+ }
+ }
+
+ @Override
+ protected WorkflowDefinitionDataProvider dataProvider() {
+ return new WorkflowDefinitionDataProvider(rows);
+ }
+
+ @Override
+ protected String paginatorRowsKey() {
+ return Constants.PREF_WORKFLOW_PAGINATOR_ROWS;
+ }
+
+ @Override
+ protected List<IColumn<WorkflowDefinitionTO, String>> getColumns() {
+ List<IColumn<WorkflowDefinitionTO, String>> columns = new ArrayList<>();
+
+ columns.add(new KeyPropertyColumn<WorkflowDefinitionTO>(new ResourceModel("key"), "key", "key"));
+ columns.add(new PropertyColumn<WorkflowDefinitionTO, String>(new ResourceModel("name"), "name", "name"));
+ columns.add(new BooleanPropertyColumn<WorkflowDefinitionTO>(new ResourceModel("main"), null, "main"));
+
+ columns.add(new ActionColumn<WorkflowDefinitionTO, String>(new ResourceModel("actions")) {
+
+ private static final long serialVersionUID = 906457126287899096L;
+
+ @Override
+ public ActionLinksPanel<?> getActions(final String componentId, final IModel<WorkflowDefinitionTO> model) {
+ final ActionLinksPanel.Builder<WorkflowDefinitionTO> panel = ActionLinksPanel.builder();
+
+ panel.add(new ActionLink<WorkflowDefinitionTO>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
+ modal.header(Model.of(model.getObject().getKey()));
+ modal.setContent(new ImageModalPanel<>(
+ modal, restClient.getDiagram(model.getObject().getKey()), pageRef));
+ modal.show(target);
+ target.add(modal);
+ }
+ }, ActionLink.ActionType.VIEW, StandardEntitlement.WORKFLOW_DEF_GET);
+
+ panel.add(new ActionLink<WorkflowDefinitionTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
+ final IModel<String> wfDefinition = new Model<>();
+ try {
+ wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(
+ MediaType.APPLICATION_XML_TYPE, model.getObject().getKey())));
+ } catch (IOException e) {
+ LOG.error("Could not get workflow definition", e);
+ }
+
+ utility.header(Model.of(model.getObject().getKey()));
+ utility.setContent(new XMLEditorPanel(utility, wfDefinition, false, pageRef) {
+
+ private static final long serialVersionUID = -7688359318035249200L;
+
+ @Override
+ public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ if (StringUtils.isNotBlank(wfDefinition.getObject())) {
+ try {
+ restClient.setDefinition(MediaType.APPLICATION_XML_TYPE,
+ model.getObject().getKey(), wfDefinition.getObject());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+
+ utility.show(false);
+ utility.close(target);
+ } catch (SyncopeClientException e) {
+ SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
+ ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }
+ });
+ utility.show(target);
+ target.add(utility);
+ }
+ }, ActionLink.ActionType.EDIT, StandardEntitlement.WORKFLOW_DEF_SET);
+
+ panel.add(new ActionLink<WorkflowDefinitionTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public Class<? extends Page> getPageClass() {
+ return ModelerPopupPage.class;
+ }
+
+ @Override
+ public PageParameters getPageParameters() {
+ PageParameters parameters = new PageParameters();
+ if (modelerCtx != null) {
+ parameters.add(Constants.MODELER_CONTEXT, modelerCtx);
+ }
+ parameters.add(Constants.MODEL_ID_PARAM, model.getObject().getModelId());
+
+ return parameters;
+ }
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
+ // do nothing
+ }
+ }, ActionLink.ActionType.WORKFLOW_MODELER, StandardEntitlement.WORKFLOW_DEF_SET, modelerCtx != null);
+
+ panel.add(new ActionLink<WorkflowDefinitionTO>() {
+
+ private static final long serialVersionUID = -7978723352517770644L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
+ try {
+ restClient.deleteDefinition(model.getObject().getKey());
+ SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
+ target.add(container);
+ } catch (SyncopeClientException e) {
+ LOG.error("While deleting workflow definition {}", model.getObject().getName(), e);
+ SyncopeConsoleSession.get().error(
+ StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage());
+ }
+ ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
+ }
+ }, ActionLink.ActionType.DELETE, StandardEntitlement.WORKFLOW_DEF_DELETE, !model.getObject().isMain());
+
+ return panel.build(componentId);
+ }
+
+ @Override
+ public ActionLinksPanel<WorkflowDefinitionTO> getHeader(final String componentId) {
+ final ActionLinksPanel.Builder<WorkflowDefinitionTO> panel = ActionLinksPanel.builder();
+
+ return panel.add(new ActionLink<WorkflowDefinitionTO>() {
+
+ private static final long serialVersionUID = -184018732772021627L;
+
+ @Override
+ public void onClick(final AjaxRequestTarget target, final WorkflowDefinitionTO ignore) {
+ if (target != null) {
+ target.add(container);
+ }
+ }
+ }, ActionLink.ActionType.RELOAD, StandardEntitlement.WORKFLOW_DEF_LIST).build(componentId);
+ }
+ });
+
+ return columns;
+ }
+
+ @Override
+ protected Collection<ActionLink.ActionType> getBulkActions() {
+ return Collections.emptyList();
+ }
+
+ public abstract static class Builder
+ extends DirectoryPanel.Builder<WorkflowDefinitionTO, WorkflowDefinitionTO, WorkflowRestClient> {
+
+ private static final long serialVersionUID = 5088962796986706805L;
+
+ public Builder(final PageReference pageRef) {
+ super(new WorkflowRestClient(), pageRef);
+ }
+
+ @Override
+ protected WizardMgtPanel<WorkflowDefinitionTO> newInstance(final String id, final boolean wizardInModal) {
+ return new WorkflowDirectoryPanel(id, this);
+ }
+ }
+
+ protected class WorkflowDefinitionDataProvider extends DirectoryDataProvider<WorkflowDefinitionTO> {
+
+ private static final long serialVersionUID = 1764153405387687592L;
+
+ private final SortableDataProviderComparator<WorkflowDefinitionTO> comparator;
+
+ private final WorkflowRestClient restClient = new WorkflowRestClient();
+
+ public WorkflowDefinitionDataProvider(final int paginatorRows) {
+ super(paginatorRows);
+ this.comparator = new SortableDataProviderComparator<>(this);
+ setSort("main", SortOrder.DESCENDING);
+ }
+
+ @Override
+ public Iterator<WorkflowDefinitionTO> iterator(final long first, final long count) {
+ List<WorkflowDefinitionTO> result = restClient.getDefinitions();
+ Collections.sort(result, comparator);
+ return result.subList((int) first, (int) first + (int) count).iterator();
+ }
+
+ @Override
+ public long size() {
+ return restClient.getDefinitions().size();
+ }
+
+ @Override
+ public IModel<WorkflowDefinitionTO> model(final WorkflowDefinitionTO object) {
+ return new CompoundPropertyModel<>(object);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowTogglePanel.java
deleted file mode 100644
index be1553e..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowTogglePanel.java
+++ /dev/null
@@ -1,145 +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.
- */
-package org.apache.syncope.client.console.panels;
-
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import java.io.File;
-import java.io.IOException;
-import javax.ws.rs.core.MediaType;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.SyncopeConsoleApplication;
-import org.apache.syncope.client.console.SyncopeConsoleSession;
-import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.pages.ActivitiModelerPopupPage;
-import org.apache.syncope.client.console.pages.BasePage;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.form.XMLEditorPanel;
-import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
-import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.PageReference;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
-import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.markup.html.image.Image;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.util.io.IOUtils;
-
-public class WorkflowTogglePanel extends TogglePanel<String> {
-
- private static final long serialVersionUID = -2025535531121434056L;
-
- private final WebMarkupContainer container;
-
- protected final BaseModal<String> modal;
-
- public WorkflowTogglePanel(final String id, final PageReference pageRef, final Image workflowDefDiagram) {
- super(id, pageRef);
- modal = new BaseModal<>("outer");
- addOuterObject(modal);
- modal.size(Modal.Size.Large);
-
- container = new WebMarkupContainer("container");
- container.setOutputMarkupPlaceholderTag(true);
- addInnerObject(container);
-
- BookmarkablePageLink<Void> activitiModeler = new BookmarkablePageLink<>("activitiModeler",
- ActivitiModelerPopupPage.class);
- activitiModeler.setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800));
- MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
- container.add(activitiModeler);
- // Check if Activiti Modeler directory is found
- boolean activitiModelerEnabled = false;
- try {
- File baseDir = new File(SyncopeConsoleApplication.get().getActivitiModelerDirectory());
- activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && baseDir.isDirectory();
- } catch (Exception e) {
- LOG.error("Could not check for Activiti Modeler directory", e);
- }
- activitiModeler.setEnabled(activitiModelerEnabled);
-
- AjaxSubmitLink xmlEditorSubmit = modal.addSubmitButton();
- MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, RENDER, StandardEntitlement.WORKFLOW_DEF_UPDATE);
- modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
- private static final long serialVersionUID = 8804221891699487139L;
-
- @Override
- public void onClose(final AjaxRequestTarget target) {
- modal.show(false);
- modal.close(target);
- target.add(workflowDefDiagram);
- }
- });
-
- AjaxLink<Void> xmlEditor = new AjaxLink<Void>("xmlEditor") {
-
- private static final long serialVersionUID = -1964967067512351526L;
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
- @Override
- public void onClick(final AjaxRequestTarget target) {
- final IModel<String> wfDefinition = new Model<>();
- try {
- wfDefinition.setObject(IOUtils.toString(restClient.getDefinition(MediaType.APPLICATION_XML_TYPE)));
- } catch (IOException e) {
- LOG.error("Could not get workflow definition", e);
- }
-
- target.add(modal.setContent(new XMLEditorPanel(modal, wfDefinition, false, pageRef) {
-
- private static final long serialVersionUID = 5488080606102212554L;
-
- @Override
- public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- if (StringUtils.isNotBlank(wfDefinition.getObject())) {
- try {
- restClient.updateDefinition(MediaType.APPLICATION_XML_TYPE, wfDefinition.getObject());
- SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
-
- modal.show(false);
- modal.close(target);
- } catch (SyncopeClientException e) {
- SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage()) ? e.getClass().
- getName() : e.
- getMessage());
- }
- ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
- }
- }
- }));
-
- modal.header(new ResourceModel("xmlEditorTitle"));
- modal.show(true);
- }
- };
- MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, RENDER, StandardEntitlement.WORKFLOW_DEF_READ);
- container.add(xmlEditor);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
new file mode 100644
index 0000000..53bc669
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/resources/AbstractWorkflowResource.java
@@ -0,0 +1,54 @@
+/*
+ * 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 org.apache.commons.collections4.IterableUtils;
+import org.apache.commons.collections4.Predicate;
+import org.apache.syncope.client.console.commons.Constants;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
+import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.wicket.util.string.StringValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+abstract class AbstractWorkflowResource extends AbstractResource {
+
+ private static final long serialVersionUID = 5163553843196539019L;
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractWorkflowResource.class);
+
+ protected final WorkflowRestClient restClient = new WorkflowRestClient();
+
+ protected WorkflowDefinitionTO getWorkflowDefinition(final Attributes attributes) {
+ final StringValue modelId =
+ attributes.getRequest().getQueryParameters().getParameterValue(Constants.MODEL_ID_PARAM);
+
+ WorkflowDefinitionTO workflowDefinition = modelId == null ? null
+ : IterableUtils.find(restClient.getDefinitions(), new Predicate<WorkflowDefinitionTO>() {
+
+ @Override
+ public boolean evaluate(final WorkflowDefinitionTO object) {
+ return modelId.toString().equals(object.getModelId());
+ }
+ });
+
+ return workflowDefinition;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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
index 8735f4a..18cbb6a 100644
--- 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
@@ -22,7 +22,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import javax.ws.rs.core.MediaType;
import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
import org.apache.wicket.util.io.IOUtils;
/**
@@ -30,12 +30,14 @@ import org.apache.wicket.util.io.IOUtils;
*
* @see org.apache.syncope.common.rest.api.service.WorkflowService#exportDefinition
*/
-public class WorkflowDefGETResource extends AbstractResource {
+public class WorkflowDefGETResource extends AbstractWorkflowResource {
private static final long serialVersionUID = 4637304868056148970L;
@Override
protected ResourceResponse newResourceResponse(final Attributes attributes) {
+ final WorkflowDefinitionTO toGet = getWorkflowDefinition(attributes);
+
ResourceResponse response = new ResourceResponse();
response.disableCaching();
response.setContentType(MediaType.APPLICATION_JSON);
@@ -45,7 +47,7 @@ public class WorkflowDefGETResource extends AbstractResource {
@Override
public void writeData(final Attributes attributes) throws IOException {
IOUtils.copy(
- new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE),
+ new WorkflowRestClient().getDefinition(MediaType.APPLICATION_JSON_TYPE, toGet.getKey()),
attributes.getResponse().getOutputStream());
}
});
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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
index 9eeab54..5223dc0 100644
--- 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
@@ -23,25 +23,18 @@ import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.cxf.common.util.UrlUtils;
-import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.wicket.request.resource.AbstractResource;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
import org.apache.wicket.util.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Mirror REST resource for putting user workflow definition in JSON (used by Activiti Modeler).
*
* @see org.apache.syncope.common.rest.api.service.WorkflowService#importDefinition
*/
-public class WorkflowDefPUTResource extends AbstractResource {
+public class WorkflowDefPUTResource extends AbstractWorkflowResource {
private static final long serialVersionUID = 2964542005207297944L;
- private static final Logger LOG = LoggerFactory.getLogger(WorkflowDefPUTResource.class);
-
- private final WorkflowRestClient restClient = new WorkflowRestClient();
-
@Override
protected ResourceResponse newResourceResponse(final Attributes attributes) {
String definition = null;
@@ -58,14 +51,17 @@ public class WorkflowDefPUTResource extends AbstractResource {
} catch (IOException e) {
LOG.error("Could not extract workflow definition", e);
}
- if (definition == null) {
+
+ WorkflowDefinitionTO toSet = getWorkflowDefinition(attributes);
+
+ if (definition == null || toSet == null) {
return new ResourceResponse().setStatusCode(Response.Status.BAD_REQUEST.getStatusCode()).
setError(Response.Status.BAD_REQUEST.getStatusCode(),
- "Could not extract workflow definition");
+ "Could not extract workflow model id and / or definition");
}
try {
- restClient.updateDefinition(MediaType.APPLICATION_JSON_TYPE, definition);
+ restClient.setDefinition(MediaType.APPLICATION_JSON_TYPE, toSet.getKey(), definition);
return new ResourceResponse().setStatusCode(Response.Status.NO_CONTENT.getStatusCode());
} catch (Exception e) {
LOG.error("While updating workflow definition", e);
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
index 8d9c424..14711a4 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
@@ -19,11 +19,13 @@
package org.apache.syncope.client.console.rest;
import java.io.InputStream;
+import java.util.List;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.client.console.SyncopeConsoleSession;
+import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.service.WorkflowService;
@@ -36,16 +38,20 @@ public class WorkflowRestClient extends BaseRestClient {
return SyncopeConsoleSession.get().getService(mediaType, WorkflowService.class);
}
- public InputStream getDefinition(final MediaType mediaType) {
- Response response = getService(mediaType).exportDefinition(AnyTypeKind.USER);
+ public List<WorkflowDefinitionTO> getDefinitions() {
+ return getService(WorkflowService.class).list(AnyTypeKind.USER.name());
+ }
+
+ public InputStream getDefinition(final MediaType mediaType, final String key) {
+ Response response = getService(mediaType).get(AnyTypeKind.USER.name(), key);
return (InputStream) response.getEntity();
}
- public byte[] getDiagram() {
+ public byte[] getDiagram(final String key) {
WorkflowService service = getService(WorkflowService.class);
WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
- Response response = service.exportDiagram(AnyTypeKind.USER);
+ Response response = service.exportDiagram(AnyTypeKind.USER.name(), key);
byte[] diagram;
try {
@@ -57,7 +63,11 @@ public class WorkflowRestClient extends BaseRestClient {
return diagram;
}
- public void updateDefinition(final MediaType mediaType, final String definition) {
- getService(mediaType).importDefinition(AnyTypeKind.USER, definition);
+ public void setDefinition(final MediaType mediaType, final String key, final String definition) {
+ getService(mediaType).set(AnyTypeKind.USER.name(), key, definition);
+ }
+
+ public void deleteDefinition(final String key) {
+ getService(WorkflowService.class).delete(AnyTypeKind.USER.name(), key);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
index 2fef62f..c4c5bf7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLink.java
@@ -19,7 +19,9 @@
package org.apache.syncope.client.console.wicket.markup.html.form;
import java.io.Serializable;
+import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
public abstract class ActionLink<T extends Serializable> implements Serializable {
@@ -91,7 +93,8 @@ public abstract class ActionLink<T extends Serializable> implements Serializable
PROPAGATION_TASKS("read"),
NOTIFICATION_TASKS("read"),
ZOOM_IN("zoomin"),
- ZOOM_OUT("zoomout");
+ ZOOM_OUT("zoomout"),
+ WORKFLOW_MODELER("workflowModeler");
private final String actionId;
@@ -126,6 +129,14 @@ public abstract class ActionLink<T extends Serializable> implements Serializable
return true;
}
+ public Class<? extends Page> getPageClass() {
+ return null;
+ }
+
+ public PageParameters getPageParameters() {
+ return null;
+ }
+
public final ActionLink<T> disable() {
this.enabled = false;
return this;
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
index 9e2bd0c..c9a632d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksPanel.java
@@ -24,9 +24,11 @@ import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Triple;
+import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
@@ -103,6 +105,7 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel {
super.add(new Fragment("panelNotificationTasks", "emptyFragment", this));
super.add(new Fragment("panelZoomIn", "emptyFragment", this));
super.add(new Fragment("panelZoomOut", "emptyFragment", this));
+ super.add(new Fragment("panelWorkflowModeler", "emptyFragment", this));
}
public ActionLinksPanel<T> add(
@@ -945,19 +948,19 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel {
fragment.addOrReplace(
new IndicatingOnConfirmAjaxLink<Void>("unassignLink", "confirmUnassign", enabled) {
- private static final long serialVersionUID = -6957616042924610294L;
+ private static final long serialVersionUID = -6957616042924610294L;
- @Override
- public void onClick(final AjaxRequestTarget target) {
- link.onClick(target, model.getObject());
- }
+ @Override
+ public void onClick(final AjaxRequestTarget target) {
+ link.onClick(target, model.getObject());
+ }
- @Override
- public String getAjaxIndicatorMarkupId() {
- return disableIndicator || !link.isIndicatorEnabled()
- ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId();
- }
- }.setVisible(link.isEnabled(model.getObject())));
+ @Override
+ public String getAjaxIndicatorMarkupId() {
+ return disableIndicator || !link.isIndicatorEnabled()
+ ? StringUtils.EMPTY : super.getAjaxIndicatorMarkupId();
+ }
+ }.setVisible(link.isEnabled(model.getObject())));
break;
case ASSIGN:
@@ -1140,6 +1143,15 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel {
}.setVisible(link.isEnabled(model.getObject())));
break;
+ case WORKFLOW_MODELER:
+ fragment = new Fragment("panelWorkflowModeler", "fragmentWorkflowModeler", this);
+
+ fragment.addOrReplace(new BookmarkablePageLink<>(
+ "workflowModelerLink", link.getPageClass(), link.getPageParameters()).
+ setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800)).
+ setVisible(link.isEnabled(model.getObject())));
+ break;
+
default:
// do nothing
}
@@ -1336,6 +1348,10 @@ public final class ActionLinksPanel<T extends Serializable> extends Panel {
super.addOrReplace(new Fragment("panelZoomOut", "emptyFragment", this));
break;
+ case WORKFLOW_MODELER:
+ super.addOrReplace(new Fragment("panelWorkflowModelert", "emptyFragment", this));
+ break;
+
default:
// do nothing
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ImageModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ImageModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ImageModalPanel.java
new file mode 100644
index 0000000..cf9c108
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ImageModalPanel.java
@@ -0,0 +1,58 @@
+/*
+ * 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.form;
+
+import java.io.Serializable;
+import org.apache.syncope.client.console.panels.AbstractModalPanel;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.resource.DynamicImageResource;
+import org.apache.wicket.request.resource.IResource;
+
+public class ImageModalPanel<T extends Serializable> extends AbstractModalPanel<T> {
+
+ private static final long serialVersionUID = 5044632306261219075L;
+
+ public ImageModalPanel(final BaseModal<T> modal, final byte[] content, final PageReference pageRef) {
+ super(modal, pageRef);
+
+ Image image = new Image("image", 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 content;
+ }
+ };
+ }
+ };
+ image.setOutputMarkupId(true);
+ add(image);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/pages/ModelerPopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/ModelerPopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ModelerPopupPage.html
new file mode 100644
index 0000000..f266c81
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/ModelerPopupPage.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 / Workflow Modeler</title>
+
+ <meta wicket:id="refresh" http-equiv="refresh"/>
+ </head>
+ <body>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/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
index b0ed063..723c46a 100644
--- 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
@@ -20,17 +20,18 @@ under the License.
<wicket:extend>
<section class="content-header">
<h1> </h1>
+ <ol class="breadcrumb">
+ <li><a wicket:id="dashboardBr"><i class="fa fa-dashboard"></i> <wicket:message key="dashboard"/></a></li>
+ <li class="active"><wicket:message key="configuration"/></li>
+ <li class="active"><wicket:message key="workflow"/></li>
+ </ol>
</section>
- <section class="content">
- <div>
- <span wicket:id="noActivitiEnabledForUsers"><i><wicket:message key="noActivitiEnabledForUsers"/></i></span>
- <span wicket:id="workflowDefContainer">
- <img wicket:id="workflowDefDiagram" style="width: 100%;"/>
- <span wicket:id="togglePanel"/>
- </span>
+ <section class="content" wicket:id="content">
+ <span wicket:id="disabled"><i><wicket:message key="disabled"/></i></span>
+ <div class="box">
+ <div class="box-body" wicket:id="workflowsPanel"/>
</div>
</section>
-
</wicket:extend>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
index d22205c..a9635bf 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow.properties
@@ -16,3 +16,4 @@
# under the License.
noActivitiEnabledForUsers=Activiti not enabled for users
xmlEditorTitle=Workflow XML Editor
+main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
index faf7d0d..ff96099 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_it.properties
@@ -16,3 +16,4 @@
# under the License.
noActivitiEnabledForUsers=Activiti non configurato per gli utenti
xmlEditorTitle=Workflow XML Editor
+main=Principale
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
index c814c56..ae769c6 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_pt_BR.properties
@@ -16,3 +16,4 @@
# under the License.
noActivitiEnabledForUsers=Activiti n\u00e3o habilitado para usu\u00e1rios
xmlEditorTitle=Workflow XML Editor
+main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
index dfa590a..a05edf6 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/pages/Workflow_ru.properties
@@ -19,3 +19,4 @@
noActivitiEnabledForUsers=Activiti \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439
# xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
xmlEditorTitle=XML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f
+main=Main
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
index d700143..d0dad1e 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ConnObjectListViewPanel.html
@@ -20,7 +20,7 @@ under the License.
<wicket:panel>
<span wicket:id="objs"/>
<div wicket:id="arrows">
- <a haref="#" class="btn btn-primary btn-circle btn-lg pull-right" wicket:id="next"><i class="fa fa-chevron-right"></i></a>
+ <a href="#" class="btn btn-primary btn-circle btn-lg pull-right" wicket:id="next"><i class="fa fa-chevron-right"></i></a>
</div>
</wicket:panel>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
new file mode 100644
index 0000000..6197d5a
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/NewWorkflowProcess.html
@@ -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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:extend>
+ <div id="startAtContainer">
+ <form wicket:id="form">
+ <div class="input-group">
+ <input wicket:id="key"/>
+ <div class="input-group-addon">
+ <a wicket:id="submit"><i class="fa fa-file-o" alt="new" title="new"></i></a>
+ </div>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
new file mode 100644
index 0000000..d170041
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowDirectoryPanel.html
@@ -0,0 +1,23 @@
+<!--
+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>
+ <span wicket:id="newWorkflowProcess"/>
+ </wicket:extend>
+</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/4c2dd443/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowTogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowTogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowTogglePanel.html
deleted file mode 100644
index ee93861..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowTogglePanel.html
+++ /dev/null
@@ -1,50 +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.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <wicket:head>
- <script type="text/javascript">
- $(document).ready(function () {
- $("div.inactive-topology-menu").toggle("slow");
- $("div.inactive-topology-menu").attr("class", "topology-menu active-topology-menu");
- });
- </script>
-
- <style type="text/css">
- div.topology-menu {
- top: 65px !important;
- }
-
- div.topology-menu div.header {
- display: none !important;
- }
- </style>
- </wicket:head>
- <wicket:extend>
- <div wicket:id="container">
- <ul class="menu">
- <wicket:enclosure child="activitiModeler">
- <li><a href="#" wicket:id="activitiModeler"><i class="fa fa-file-image-o"></i>Activiti Modeler</a></li>
- </wicket:enclosure>
- <wicket:enclosure child="xmlEditor">
- <li><a href="#" wicket:id="xmlEditor"><i class="fa fa-file-text-o"></i>XML editor</a></li>
- </wicket:enclosure>
- </ul>
- </div>
- </wicket:extend>
-</html>