syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [3/4] syncope git commit: Do not show the Configuration > Workflow menu item is Activiti was not enabled
Date Wed, 22 Feb 2017 18:01:34 GMT
Do not show the Configuration > Workflow menu item is Activiti was not enabled


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

Branch: refs/heads/master
Commit: 0d090c7b74d1d399f8c488790aad2826bb0a2558
Parents: 716c3bd
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Feb 22 18:58:38 2017 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Feb 22 19:00:32 2017 +0100

----------------------------------------------------------------------
 .../apache/syncope/client/console/pages/BasePage.java    |  3 +++
 .../apache/syncope/client/console/pages/Workflow.java    | 11 +++++------
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/0d090c7b/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 255145f..f61c8da 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
@@ -189,6 +189,9 @@ public class BasePage extends WebPage implements IAjaxIndicatorAware {
         confLIContainer.add(confULContainer);
 
         liContainer = new WebMarkupContainer(getLIContainerId("workflow"));
+        liContainer.setOutputMarkupPlaceholderTag(true);
+        liContainer.setVisible(
+                SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti"));
         confULContainer.add(liContainer);
         link = BookmarkablePageLinkBuilder.build("workflow", Workflow.class);
         MetaDataRoleAuthorizationStrategy.authorize(link, WebPage.ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);

http://git-wip-us.apache.org/repos/asf/syncope/blob/0d090c7b/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 3746c0d..a9e0b14 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
@@ -39,6 +39,9 @@ public class Workflow extends BasePage {
     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);
@@ -58,7 +61,7 @@ public class Workflow extends BasePage {
 
                     @Override
                     protected byte[] getImageData(final IResource.Attributes attributes)
{
-                        return isActivitiEnabledForUsers()
+                        return isActivitiEnabledForUsers
                                 ? wfRestClient.getDiagram()
                                 : new byte[0];
                     }
@@ -73,7 +76,7 @@ public class Workflow extends BasePage {
         togglePanel.setOutputMarkupId(true);
         workflowDef.add(togglePanel);
 
-        if (isActivitiEnabledForUsers()) {
+        if (isActivitiEnabledForUsers) {
             noActivitiEnabledForUsers.setVisible(false);
         } else {
             workflowDef.setVisible(false);
@@ -82,8 +85,4 @@ public class Workflow extends BasePage {
         MetaDataRoleAuthorizationStrategy.authorize(workflowDef, ENABLE, StandardEntitlement.WORKFLOW_DEF_READ);
         body.add(workflowDef);
     }
-
-    private boolean isActivitiEnabledForUsers() {
-        return SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti");
-    }
 }


Mime
View raw message