From e797c65d54735a6e7d96d20d187769ac14985e91 Mon Sep 17 00:00:00 2001 From: Antoine Grinenwald Date: Mon, 22 Jan 2018 15:17:04 +0100 Subject: [PATCH] Adding a boolean to show/hide the link to the Knowledge Base on the web interface - This boolean will be added to the configuration.xml file through Liferay parameter --- .../org/ow2/weblab/portlet/Constants.java | 4 ++ .../controller/DocumentViewerController.java | 28 +++++++++ .../webapp/WEB-INF/DocViewPortlet-portlet.xml | 6 ++ .../src/main/webapp/jsp/legend.jsp | 9 ++- .../src/main/webapp/jsp/tooltip.jsp | 62 ++++++++++--------- 5 files changed, 78 insertions(+), 31 deletions(-) diff --git a/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/Constants.java b/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/Constants.java index f4b3cec..6dd3adf 100644 --- a/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/Constants.java +++ b/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/Constants.java @@ -94,4 +94,8 @@ public class Constants { public static final String ACTION_MAPPING_SELECT_CANDIDATE_ENTITY = "selectCandidateEntity"; + + public static final String KDB_DOWN = "kdbDown"; + + public static final String I4D_DOWN = "i4dDown"; } diff --git a/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/controller/DocumentViewerController.java b/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/controller/DocumentViewerController.java index 2db31cb..0204c20 100644 --- a/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/controller/DocumentViewerController.java +++ b/document-viewer-portlet/src/main/java/org/ow2/weblab/portlet/controller/DocumentViewerController.java @@ -121,6 +121,33 @@ public class DocumentViewerController { // ############################################################################# // render mapping methods # // ############################################################################# + + + + /** + * Show links to workspace if set in configuration.xml + */ + private boolean kdbDown = false; + + /** + * Default constructor + */ + public DocumentViewerController() { + // TODO Auto-generated constructor stub + } + + + /** + * Constructor for DocView + */ + public DocumentViewerController(final String kdbDown) { + + if (kdbDown != null){ + this.kdbDown = Boolean.parseBoolean(kdbDown); + } + logger.info("workspace down :" + this.kdbDown); + } + /** * The main view rendering method @@ -137,6 +164,7 @@ public class DocumentViewerController { mav.addObject(Constants.IS_EMPTY, Boolean.TRUE); mav.addObject(Constants.IS_SOURCE, Boolean.TRUE); } + mav.addObject(Constants.KDB_DOWN, this.kdbDown); mav.addAllObjects(model); diff --git a/document-viewer-portlet/src/main/webapp/WEB-INF/DocViewPortlet-portlet.xml b/document-viewer-portlet/src/main/webapp/WEB-INF/DocViewPortlet-portlet.xml index 46d9829..80c3f5e 100644 --- a/document-viewer-portlet/src/main/webapp/WEB-INF/DocViewPortlet-portlet.xml +++ b/document-viewer-portlet/src/main/webapp/WEB-INF/DocViewPortlet-portlet.xml @@ -19,8 +19,14 @@ + + + + + + \ No newline at end of file diff --git a/document-viewer-portlet/src/main/webapp/jsp/legend.jsp b/document-viewer-portlet/src/main/webapp/jsp/legend.jsp index 968d358..62b9db1 100644 --- a/document-viewer-portlet/src/main/webapp/jsp/legend.jsp +++ b/document-viewer-portlet/src/main/webapp/jsp/legend.jsp @@ -31,9 +31,12 @@ -
- -
+ +
+ +
+
+
diff --git a/document-viewer-portlet/src/main/webapp/jsp/tooltip.jsp b/document-viewer-portlet/src/main/webapp/jsp/tooltip.jsp index c8b6fc6..16e7dc4 100644 --- a/document-viewer-portlet/src/main/webapp/jsp/tooltip.jsp +++ b/document-viewer-portlet/src/main/webapp/jsp/tooltip.jsp @@ -32,36 +32,42 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +