You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/01/20 17:33:30 UTC

[1/3] syncope git commit: [SYNCOPE-156] Completing removal of old XMLEditorPopupPage

Repository: syncope
Updated Branches:
  refs/heads/master de21e7165 -> 6ca9d6ea0


[SYNCOPE-156] Completing removal of old XMLEditorPopupPage


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

Branch: refs/heads/master
Commit: 77fa0f61d405de50545c4e8f63309c8b1d47d09f
Parents: de21e71
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 20 16:36:23 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 20 16:36:23 2016 +0100

----------------------------------------------------------------------
 .../client/console/pages/BasePopupPage.java     | 25 ------
 .../syncope/client/console/pages/Workflow.java  | 45 +++++++++-
 .../console/pages/XMLEditorPopupPage.java       | 86 ------------------
 .../console/panels/AbstractModalPanel.java      |  4 -
 .../client/console/panels/RealmModalPanel.java  |  2 +-
 .../panels/XMLWorkflowEditorModalPanel.java     | 95 ++++++++++++++++++++
 .../console/rest/AnyTypeClassRestClient.java    |  2 -
 .../markup/html/bootstrap/dialog/BaseModal.java | 21 +----
 .../syncope/client/console/pages/BasePage.html  |  2 +-
 .../client/console/pages/BasePopupPage.html     | 34 -------
 .../syncope/client/console/pages/Workflow.html  |  1 +
 .../client/console/pages/Workflow.properties    |  1 +
 .../client/console/pages/Workflow_it.properties |  1 +
 .../console/pages/Workflow_pt_BR.properties     |  1 +
 .../console/pages/XMLEditorPopupPage.html       | 78 ----------------
 .../console/pages/XMLEditorPopupPage.properties | 19 ----
 .../pages/XMLEditorPopupPage_it.properties      | 19 ----
 .../pages/XMLEditorPopupPage_pt_BR.properties   | 19 ----
 .../panels/XMLWorkflowEditorModalPanel.html     | 52 +++++++++++
 .../console/panels/CamelRoutesDetailsPanel.java |  8 +-
 .../console/panels/CamelRoutesDetailsPanel.html |  3 +
 21 files changed, 205 insertions(+), 313 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
deleted file mode 100644
index 1df5fec..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePopupPage.java
+++ /dev/null
@@ -1,25 +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.pages;
-
-public class BasePopupPage extends BasePage {
-
-    private static final long serialVersionUID = -2633667311332659505L;
-
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 6d90a19..95fb238 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,16 +18,24 @@
  */
 package org.apache.syncope.client.console.pages;
 
+import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import org.apache.syncope.client.console.panels.XMLWorkflowEditorModalPanel;
 import java.io.File;
 import org.apache.syncope.client.console.SyncopeConsoleApplication;
 import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.buttons.PrimaryModalButton;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
 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.image.Image;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.model.Model;
+import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.DynamicImageResource;
 import org.apache.wicket.request.resource.IResource;
@@ -45,7 +53,7 @@ public class Workflow extends BasePage {
         noActivitiEnabledForUsers.setOutputMarkupPlaceholderTag(true);
         add(noActivitiEnabledForUsers);
 
-        WebMarkupContainer workflowDef = new WebMarkupContainer("workflowDefContainer");
+        final WebMarkupContainer workflowDef = new WebMarkupContainer("workflowDefContainer");
         workflowDef.setOutputMarkupPlaceholderTag(true);
 
         if (wfRestClient.isActivitiEnabledForUsers()) {
@@ -69,12 +77,30 @@ public class Workflow extends BasePage {
         }
         activitiModeler.setEnabled(activitiModelerEnabled);
 
-        BookmarkablePageLink<Void> xmlEditor = new BookmarkablePageLink<>("xmlEditor", XMLEditorPopupPage.class);
-        xmlEditor.setPopupSettings(new VeilPopupSettings().setHeight(480).setWidth(800));
+        final BaseModal<String> xmlEditorModal = new BaseModal<>("xmlEditorModal");
+        PrimaryModalButton xmlEditorSubmit = xmlEditorModal.addSumbitButton();
+        MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, ENABLE, StandardEntitlement.WORKFLOW_DEF_UPDATE);
+        xmlEditorModal.size(Modal.Size.Large);
+        add(xmlEditorModal);
+
+        AjaxLink<Void> xmlEditor = new AjaxLink<Void>("xmlEditor") {
+
+            private static final long serialVersionUID = -1964967067512351526L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                target.add(xmlEditorModal.setContent(new XMLWorkflowEditorModalPanel(
+                        xmlEditorModal, wfRestClient, Workflow.this.getPageReference())));
+
+                xmlEditorModal.header(new ResourceModel("xmlEditorTitle"));
+
+                xmlEditorModal.show(true);
+            }
+        };
         MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
         workflowDef.add(xmlEditor);
 
-        Image workflowDefDiagram = new Image("workflowDefDiagram", new Model<IResource>()) {
+        final Image workflowDefDiagram = new Image("workflowDefDiagram", new Model<IResource>()) {
 
             private static final long serialVersionUID = -8457850449086490660L;
 
@@ -93,8 +119,19 @@ public class Workflow extends BasePage {
                 };
             }
         };
+        workflowDefDiagram.setOutputMarkupId(true);
         workflowDef.add(workflowDefDiagram);
 
+        xmlEditorModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+            private static final long serialVersionUID = 8804221891699487139L;
+
+            @Override
+            public void onClose(final AjaxRequestTarget target) {
+                target.add(workflowDefDiagram);
+            }
+        });
+
         MetaDataRoleAuthorizationStrategy.authorize(workflowDef, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
         add(workflowDef);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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
deleted file mode 100644
index b8b505c..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
+++ /dev/null
@@ -1,86 +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.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.StandardEntitlement;
-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.util.io.IOUtils;
-
-public class XMLEditorPopupPage extends BasePopupPage {
-
-    private static final long serialVersionUID = 5816041644635271734L;
-
-    private final WorkflowRestClient wfRestClient = new WorkflowRestClient();
-
-    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());
-                }
-                notificationPanel.refresh(target);
-            }
-
-            @Override
-            protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-                notificationPanel.refresh(target);
-            }
-        };
-
-        final Button close = new Button("closePage", new Model<>(getString(CANCEL)));
-
-        MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, StandardEntitlement.WORKFLOW_DEF_UPDATE);
-        wfForm.add(submit);
-        wfForm.add(close);
-        this.add(wfForm);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
index dae4216..dcb4553 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
@@ -75,10 +75,6 @@ public class AbstractModalPanel<T extends Serializable> extends Panel implements
         response.render(new PriorityHeaderItem(meta));
     }
 
-    protected void closeAction(final AjaxRequestTarget target, final Form<?> form) {
-        this.modal.close(target);
-    }
-
     @Override
     public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
         modal.getNotificationPanel().refresh(target);

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
index 4912dfd..ed6bf82 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
@@ -81,7 +81,7 @@ public class RealmModalPanel extends AbstractModalPanel<RealmTO> {
             }
 
             info(getString(Constants.OPERATION_SUCCEEDED));
-            closeAction(target, form);
+            modal.close(target);
         } catch (Exception e) {
             LOG.error("While creating or updating realm", e);
             error(getString(Constants.ERROR) + ": " + e.getMessage());

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.java
new file mode 100644
index 0000000..8fdf2ae
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.java
@@ -0,0 +1,95 @@
+/*
+ * 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.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.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.head.OnLoadHeaderItem;
+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.util.io.IOUtils;
+
+public class XMLWorkflowEditorModalPanel extends AbstractModalPanel<String> {
+
+    private static final long serialVersionUID = 1937773326401753564L;
+
+    private final WorkflowRestClient wfRestClient;
+
+    private final TextArea<String> workflowDefArea;
+
+    private String wfDefinition;
+
+    public XMLWorkflowEditorModalPanel(
+            final BaseModal<String> modal,
+            final WorkflowRestClient wfRestClient,
+            final PageReference pageRef) {
+
+        super(modal, pageRef);
+        this.wfRestClient = wfRestClient;
+
+        try {
+            wfDefinition = IOUtils.toString(wfRestClient.getDefinition(MediaType.APPLICATION_XML_TYPE));
+        } catch (IOException e) {
+            LOG.error("Could not get workflow definition", e);
+            wfDefinition = StringUtils.EMPTY;
+        }
+
+        workflowDefArea = new TextArea<>("workflowDefArea", new Model<>(wfDefinition));
+        add(workflowDefArea);
+    }
+
+    @Override
+    public String getItem() {
+        return this.wfDefinition;
+    }
+
+    @Override
+    public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+        try {
+            wfRestClient.updateDefinition(MediaType.APPLICATION_XML_TYPE, workflowDefArea.getModelObject());
+            info(getString(Constants.OPERATION_SUCCEEDED));
+
+            modal.show(false);
+            modal.close(target);
+        } catch (SyncopeClientException scee) {
+            error(getString(Constants.ERROR) + ": " + scee.getMessage());
+        }
+        modal.getNotificationPanel().refresh(target);
+    }
+
+    @Override
+    public void renderHead(final IHeaderResponse response) {
+        super.renderHead(response);
+        response.render(OnLoadHeaderItem.forScript(
+                "CodeMirror.fromTextArea(document.getElementById('workflowDefArea'), {"
+                + "  lineNumbers: true, "
+                + "  autoRefresh: true"
+                + "}).on('change', updateTextArea);"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeClassRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeClassRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeClassRestClient.java
index 10375ca..2f9d0f1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeClassRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/AnyTypeClassRestClient.java
@@ -18,8 +18,6 @@
  */
 package org.apache.syncope.client.console.rest;
 
-import static org.apache.syncope.client.console.rest.BaseRestClient.getService;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java
index 4437adb..18e18f3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/bootstrap/dialog/BaseModal.java
@@ -33,10 +33,8 @@ import org.apache.syncope.client.console.panels.NotificationPanel;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.buttons.DefaultModalCloseButton;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.buttons.PrimaryModalButton;
 import org.apache.wicket.Component;
-import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.behavior.Behavior;
 import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
 import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.WindowClosedCallback;
 import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -99,10 +97,10 @@ public class BaseModal<T extends Serializable> extends Modal<T> implements Notif
         this.windowClosedCallback = null;
         components = new ArrayList<>();
 
-        // Note: it would imply the adding of WebjarsJavaScriptResourceReference about JQuery resizable and mouse
+        // Note: not adding this would imply adding WebjarsJavaScriptResourceReference about JQuery resizable and mouse
         add(new Resizable().withChildSelector(".modal-content"));
 
-        // Note: it would imply the adding of WebjarsJavaScriptResourceReference about JQuery draggable
+        // Note: not adding this would imply adding of WebjarsJavaScriptResourceReference about JQuery draggable
         add(new Draggable(new DraggableConfig().withHandle(".modal-header").withCursor("move")));
 
         addButton(new DefaultModalCloseButton());
@@ -111,21 +109,6 @@ public class BaseModal<T extends Serializable> extends Modal<T> implements Notif
     }
 
     @Override
-    public final Component add(final Behavior... behaviors) {
-        return super.add(behaviors);
-    }
-
-    @Override
-    public final MarkupContainer add(final Component... childs) {
-        return super.add(childs);
-    }
-
-    @Override
-    public final MarkupContainer addOrReplace(final Component... childs) {
-        return super.addOrReplace(childs);
-    }
-
-    @Override
     public NotificationPanel getNotificationPanel() {
         return notificationPanel;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 7a18415..f219b8a 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
@@ -126,7 +126,7 @@ under the License.
       </div>
 
       <footer class="main-footer block-footer">
-        Apache Syncope <label wicket:id="version"/><br/>
+        Apache Syncope <label wicket:id="version"/> -
         <strong>Copyright &copy; 2010–<span id="spanYear"></span> 
           <a href="http://www.apache.org/" target="_blank">The Apache Software Foundation</a>.</strong>
         All rights reserved.

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html b/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
deleted file mode 100644
index 2d9bca1..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/BasePopupPage.html
+++ /dev/null
@@ -1,34 +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">
-  <head>
-    <title></title>
-
-    <style type="text/css">
-      table.palette td.header {
-        background:url("images/ui-bg_glass_75_e6e6e6_1x400.png")
-          repeat-x scroll 50% 50% #E6E6E6 !important;
-      }
-    </style>
-
-  </head>
-  <body onload="setTimeout('window.focus();', 0);">
-    <wicket:child />
-  </body>
-</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 aa77a3f..56bb31d 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
@@ -53,5 +53,6 @@ under the License.
       </div>
     </section>
 
+    <div wicket:id="xmlEditorModal"/>
   </wicket:extend>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 3772362..d22205c 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
@@ -15,3 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 noActivitiEnabledForUsers=Activiti not enabled for users
+xmlEditorTitle=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 a4975e8..faf7d0d 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
@@ -15,3 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 noActivitiEnabledForUsers=Activiti non configurato per gli utenti
+xmlEditorTitle=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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 ea20be7..c814c56 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
@@ -15,3 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 noActivitiEnabledForUsers=Activiti n\u00e3o habilitado para usu\u00e1rios
+xmlEditorTitle=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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
deleted file mode 100644
index 22a00d5..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!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"/>
-            <input type="submit"
-                   wicket:id="closePage"
-                   class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
-                   onclick="window.close();"/>
-          </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/77fa0f61/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
deleted file mode 100644
index 2276791..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage.properties
+++ /dev/null
@@ -1,19 +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.
-submit=Save
-cancel=Close
-title=Workflow XML Editor

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

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/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
deleted file mode 100644
index e9cd1ec..0000000
--- a/client/console/src/main/resources/org/apache/syncope/client/console/pages/XMLEditorPopupPage_pt_BR.properties
+++ /dev/null
@@ -1,19 +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.
-submit=Salvar
-cancel=Fechar
-title=Workflow XML Editor

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/client/console/src/main/resources/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.html
new file mode 100644
index 0000000..6e979ea
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/XMLWorkflowEditorModalPanel.html
@@ -0,0 +1,52 @@
+<!--
+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" src="webjars/codemirror/${codemirror.version}/addon/display/autorefresh.js"></script>
+    <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/addon/search/search.js"></script>
+    <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/addon/search/searchcursor.js"></script>
+    <script type="text/javascript">
+      function updateTextArea(editor) {
+        document.getElementById("workflowDefArea").value = editor.getValue();
+      }
+    </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:panel>
+    <div style="padding: 1%;">
+      <div class="w_content_3">
+        <textarea wicket:id="workflowDefArea" id="workflowDefArea" name="workflowDefArea" style="width: 100%; height: 350px;">
+        </textarea>
+      </div>
+    </div>
+  </wicket:panel>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.java
index 2fe9c5b..cc73d4d 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.java
@@ -29,6 +29,8 @@ import org.apache.wicket.model.PropertyModel;
 
 public class CamelRoutesDetailsPanel extends Panel {
 
+    private static final long serialVersionUID = -768345003061796383L;
+
     public CamelRoutesDetailsPanel(final String id, final CamelRouteTO camelRoute) {
         super(id);
 
@@ -44,8 +46,10 @@ public class CamelRoutesDetailsPanel extends Panel {
     public void renderHead(final IHeaderResponse response) {
         super.renderHead(response);
         response.render(OnLoadHeaderItem.forScript(
-                "CodeMirror.fromTextArea(document.getElementById('route'), {lineNumbers: true})."
-                + "on('change', updateTextArea)"));
+                "CodeMirror.fromTextArea(document.getElementById('route'), {"
+                + "  lineNumbers: true, "
+                + "  autoRefresh: true"
+                + "}).on('change', updateTextArea);"));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/77fa0f61/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.html
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.html b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.html
index 8850975..882ac6f 100644
--- a/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.html
+++ b/ext/camel/client-console/src/main/resources/org/apache/syncope/client/console/panels/CamelRoutesDetailsPanel.html
@@ -22,6 +22,9 @@ under the License.
 
     <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" src="webjars/codemirror/${codemirror.version}/addon/display/autorefresh.js"></script>
+    <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/addon/search/search.js"></script>
+    <script type="text/javascript" src="webjars/codemirror/${codemirror.version}/addon/search/searchcursor.js"></script>
     <script type="text/javascript">
       function updateTextArea(editor) {
         document.getElementById("routeDefForm").elements["route"].value = editor.getValue();


[2/3] syncope git commit: [SYNCOPE-156] Modernizing workflow page

Posted by il...@apache.org.
[SYNCOPE-156] Modernizing workflow page


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

Branch: refs/heads/master
Commit: de9c213baaf098e5ade455c6775e4ccc70f1495a
Parents: 77fa0f6
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 20 17:31:40 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 20 17:31:40 2016 +0100

----------------------------------------------------------------------
 .../syncope/client/console/pages/Workflow.java  |  61 +----------
 .../client/console/panels/TogglePanel.java      |   8 +-
 .../console/panels/WorkflowTogglePanel.java     | 108 +++++++++++++++++++
 .../client/console/topology/Topology.java       |   2 +-
 .../console/topology/TopologyTogglePanel.java   |   6 +-
 .../syncope/client/console/pages/Workflow.html  |  26 +----
 .../client/console/panels/TogglePanel.html      |   2 +-
 .../console/panels/WorkflowTogglePanel.html     |  49 +++++++++
 .../console/topology/TopologyTogglePanel.html   |   2 +-
 9 files changed, 170 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/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 95fb238..01135ea 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,24 +18,13 @@
  */
 package org.apache.syncope.client.console.pages;
 
-import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
-import org.apache.syncope.client.console.panels.XMLWorkflowEditorModalPanel;
-import java.io.File;
-import org.apache.syncope.client.console.SyncopeConsoleApplication;
+import org.apache.syncope.client.console.panels.WorkflowTogglePanel;
 import org.apache.syncope.client.console.rest.WorkflowRestClient;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.buttons.PrimaryModalButton;
-import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
 import org.apache.syncope.common.lib.types.StandardEntitlement;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
 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.image.Image;
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.model.Model;
-import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.DynamicImageResource;
 import org.apache.wicket.request.resource.IResource;
@@ -62,44 +51,6 @@ public class Workflow extends BasePage {
             workflowDef.setVisible(false);
         }
 
-        BookmarkablePageLink<Void> activitiModeler =
-                new BookmarkablePageLink<>("activitiModeler", ActivitiModelerPopupPage.class);
-        activitiModeler.setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800));
-        MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
-        workflowDef.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);
-
-        final BaseModal<String> xmlEditorModal = new BaseModal<>("xmlEditorModal");
-        PrimaryModalButton xmlEditorSubmit = xmlEditorModal.addSumbitButton();
-        MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, ENABLE, StandardEntitlement.WORKFLOW_DEF_UPDATE);
-        xmlEditorModal.size(Modal.Size.Large);
-        add(xmlEditorModal);
-
-        AjaxLink<Void> xmlEditor = new AjaxLink<Void>("xmlEditor") {
-
-            private static final long serialVersionUID = -1964967067512351526L;
-
-            @Override
-            public void onClick(final AjaxRequestTarget target) {
-                target.add(xmlEditorModal.setContent(new XMLWorkflowEditorModalPanel(
-                        xmlEditorModal, wfRestClient, Workflow.this.getPageReference())));
-
-                xmlEditorModal.header(new ResourceModel("xmlEditorTitle"));
-
-                xmlEditorModal.show(true);
-            }
-        };
-        MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
-        workflowDef.add(xmlEditor);
-
         final Image workflowDefDiagram = new Image("workflowDefDiagram", new Model<IResource>()) {
 
             private static final long serialVersionUID = -8457850449086490660L;
@@ -122,15 +73,7 @@ public class Workflow extends BasePage {
         workflowDefDiagram.setOutputMarkupId(true);
         workflowDef.add(workflowDefDiagram);
 
-        xmlEditorModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
-
-            private static final long serialVersionUID = 8804221891699487139L;
-
-            @Override
-            public void onClose(final AjaxRequestTarget target) {
-                target.add(workflowDefDiagram);
-            }
-        });
+        add(new WorkflowTogglePanel("togglePanel", getPageReference(), workflowDefDiagram));
 
         MetaDataRoleAuthorizationStrategy.authorize(workflowDef, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
         add(workflowDef);

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
index 208a802..23bd786 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
@@ -28,8 +28,10 @@ import org.apache.wicket.markup.html.panel.Panel;
 
 /**
  * Toggle panel.
+ *
+ * @param <T>
  */
-public abstract class TogglePanel extends Panel {
+public abstract class TogglePanel<T extends Serializable> extends Panel {
 
     private static final long serialVersionUID = -2025535531121434056L;
 
@@ -39,7 +41,7 @@ public abstract class TogglePanel extends Panel {
 
     }
 
-    protected final BaseModal<Serializable> modal;
+    protected final BaseModal<T> modal;
 
     private Status status = Status.INACTIVE;
 
@@ -50,7 +52,7 @@ public abstract class TogglePanel extends Panel {
         setRenderBodyOnly(true);
         setOutputMarkupId(true);
 
-        this.modal = new BaseModal<Serializable>("resource-modal");
+        this.modal = new BaseModal<>("resource-modal");
         add(modal);
 
         header = new Label("label", StringUtils.EMPTY);

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/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
new file mode 100644
index 0000000..7993076
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/WorkflowTogglePanel.java
@@ -0,0 +1,108 @@
+/*
+ * 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 org.apache.syncope.client.console.SyncopeConsoleApplication;
+import org.apache.syncope.client.console.pages.ActivitiModelerPopupPage;
+import org.apache.syncope.client.console.rest.WorkflowRestClient;
+import org.apache.syncope.client.console.wicket.markup.html.bootstrap.buttons.PrimaryModalButton;
+import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
+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.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.image.Image;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowTogglePanel extends TogglePanel<String> {
+
+    private static final long serialVersionUID = -2025535531121434056L;
+
+    private static final Logger LOG = LoggerFactory.getLogger(WorkflowTogglePanel.class);
+
+    private final WebMarkupContainer container;
+
+    private final PageReference pageRef;
+
+    private final Image workflowDefDiagram;
+
+    public WorkflowTogglePanel(final String id, final PageReference pageRef, final Image workflowDefDiagram) {
+        super(id);
+        this.pageRef = pageRef;
+        this.workflowDefDiagram = workflowDefDiagram;
+
+        modal.size(Modal.Size.Large);
+
+        container = new WebMarkupContainer("container");
+        container.setOutputMarkupPlaceholderTag(true);
+        add(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);
+
+        PrimaryModalButton xmlEditorSubmit = modal.addSumbitButton();
+        MetaDataRoleAuthorizationStrategy.authorize(xmlEditorSubmit, ENABLE, StandardEntitlement.WORKFLOW_DEF_UPDATE);
+        modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
+
+            private static final long serialVersionUID = 8804221891699487139L;
+
+            @Override
+            public void onClose(final AjaxRequestTarget target) {
+                target.add(workflowDefDiagram);
+            }
+        });
+
+        AjaxLink<Void> xmlEditor = new AjaxLink<Void>("xmlEditor") {
+
+            private static final long serialVersionUID = -1964967067512351526L;
+
+            @Override
+            public void onClick(final AjaxRequestTarget target) {
+                target.add(modal.setContent(new XMLWorkflowEditorModalPanel(modal, new WorkflowRestClient(), pageRef)));
+
+                modal.header(new ResourceModel("xmlEditorTitle"));
+
+                modal.show(true);
+            }
+        };
+        MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
+        container.add(xmlEditor);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
index cc74ac8..1d4b1ab 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
@@ -325,7 +325,7 @@ public class Topology extends BasePage {
                         final ConnInstanceTO conn = item.getModelObject();
 
                         final TopologyNode topologynode = new TopologyNode(
-                                Long.valueOf(conn.getKey()), conn.getDisplayName(), TopologyNode.Kind.CONNECTOR);
+                                conn.getKey(), conn.getDisplayName(), TopologyNode.Kind.CONNECTOR);
 
                         // Define the parent note
                         final TopologyNode parent = servers.get(conn.getLocation());

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
index 68a111e..ad62deb 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/TopologyTogglePanel.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.client.console.topology;
 
 import de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal;
+import java.io.Serializable;
 import java.text.MessageFormat;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.pages.BasePage;
@@ -46,10 +47,7 @@ import org.apache.wicket.model.ResourceModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * Toggle panel.
- */
-public class TopologyTogglePanel extends TogglePanel {
+public class TopologyTogglePanel extends TogglePanel<Serializable> {
 
     private static final long serialVersionUID = -2025535531121434056L;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/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 56bb31d..5a49ee8 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
@@ -24,35 +24,11 @@ under the License.
       <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>
 
-    <div wicket:id="xmlEditorModal"/>
+    <span wicket:id="togglePanel"/>
   </wicket:extend>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
index f42367b..326f697 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
@@ -45,7 +45,7 @@ under the License.
           top: 130px;
           width: auto;
           min-width: 250px;
-          z-index: 6000;
+          z-index: 999;
         }
 
         div.topology-menu ul.menu {

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/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
new file mode 100644
index 0000000..9cbe6ba
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/WorkflowTogglePanel.html
@@ -0,0 +1,49 @@
+<!--
+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">
+  <head><title>toggle menu</title></head>
+  <body>
+    <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">
+          <li><i class="fa fa-file-image-o"></i><a href="#" wicket:id="activitiModeler">Activiti Modeler</a></li>
+          <li><i class="fa fa-file-text-o"></i><a href="#" wicket:id="xmlEditor">XML editor</a></li>
+        </ul>
+      </div>
+    </wicket:extend>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/syncope/blob/de9c213b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
index fb861a4..5cd694b 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyTogglePanel.html
@@ -16,7 +16,7 @@ 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://xmlns.jcp.org/jsf/composite">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
   <head><title>toggle menu</title></head>
   <body>
     <wicket:extend>


[3/3] syncope git commit: Upgrading the compiler plugin

Posted by il...@apache.org.
Upgrading the compiler plugin


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

Branch: refs/heads/master
Commit: 6ca9d6ea028ce0bfc55dfaabc6732fe5cb68ba84
Parents: de9c213
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Jan 20 17:33:21 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Jan 20 17:33:21 2016 +0100

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/6ca9d6ea/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8c8a719..b5aec89 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1190,7 +1190,7 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.3</version> 
+          <version>3.5</version> 
           <configuration>
             <source>${targetJdk}</source>
             <target>${targetJdk}</target>