Commit e797c65d authored by Antoine Grinenwald's avatar Antoine Grinenwald

Adding a boolean to show/hide the link to the Knowledge Base on the web...

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
parent 79cfe65e
Pipeline #683 passed with stages
in 1 minute and 43 seconds
......@@ -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";
}
......@@ -122,6 +122,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);
......
......@@ -20,7 +20,13 @@
<property name="suffix" value=".jsp" />
</bean>
<bean id="mainController" class="com.airbus.weblab.portlets.result.controllers.ResultsController">
<constructor-arg index="0" type="java.lang.String" value="#{systemProperties['kdb.portlet.down']}" />
</bean>
<import resource="legend.xml" />
<import resource="business-service-configuration.xml" />
<import resource="media-viewer-configuration.xml" />
</beans>
\ No newline at end of file
......@@ -31,9 +31,12 @@
</c:if>
<!-- validated instance control -->
<c:if test="${kdbDown == false}">
<div id="validated_instances_selected" class="validated_instances_selected" onclick="jQuery.change_validated_instance_visibility();">
<fmt:message key="portlet.validated_instances_showing" />
</div>
</c:if>
<!-- candidate instance control -->
<div id="candidate_instances_selected" class="candidate_instances_selected" onclick="jQuery.change_candidate_instance_visibility();">
<fmt:message key="portlet.candidate_instances_showing" />
......
......@@ -32,6 +32,8 @@
<portlet:param name="class_uri" value="${ent.entityClassURI }" />
</portlet:actionURL>
<c:if test="${kdbDown == false}">
<c:choose>
<c:when test="${ent.candidate}">
<c:set var="selectInstanceUrl" value="${selectCandidateInstance}" />
......@@ -48,8 +50,10 @@
</c:set>
</c:otherwise>
</c:choose>
</c:if>
<div class="ui-tooltip-content">
<c:if test="${kdbDown == false}">
<div class="tooltip-field"
title='<c:out value="${instanceTitle}" />'>
<a href="${selectInstanceUrl}" class="underline"> <span
......@@ -57,11 +61,13 @@
${ent.entityLabels[0]}
</a>
</div>
<div class="tooltip-field">
<span class="tooltip-field-title"> <fmt:message
key="portlet.tooltip.candidate" /></span> <span><fmt:message
key="portlet.tooltip.candidate.${ent.candidate}" /> </span>
</div>
</c:if>
<div class="tooltip-field">
<span class="tooltip-field-title"> <fmt:message
key="portlet.tooltip.type" /></span> <span
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment