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 { ...@@ -94,4 +94,8 @@ public class Constants {
public static final String ACTION_MAPPING_SELECT_CANDIDATE_ENTITY = "selectCandidateEntity"; public static final String ACTION_MAPPING_SELECT_CANDIDATE_ENTITY = "selectCandidateEntity";
public static final String KDB_DOWN = "kdbDown";
public static final String I4D_DOWN = "i4dDown";
} }
...@@ -121,6 +121,33 @@ public class DocumentViewerController { ...@@ -121,6 +121,33 @@ public class DocumentViewerController {
// ############################################################################# // #############################################################################
// render mapping methods # // 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 * The main view rendering method
...@@ -137,6 +164,7 @@ public class DocumentViewerController { ...@@ -137,6 +164,7 @@ public class DocumentViewerController {
mav.addObject(Constants.IS_EMPTY, Boolean.TRUE); mav.addObject(Constants.IS_EMPTY, Boolean.TRUE);
mav.addObject(Constants.IS_SOURCE, Boolean.TRUE); mav.addObject(Constants.IS_SOURCE, Boolean.TRUE);
} }
mav.addObject(Constants.KDB_DOWN, this.kdbDown);
mav.addAllObjects(model); mav.addAllObjects(model);
......
...@@ -19,8 +19,14 @@ ...@@ -19,8 +19,14 @@
<property name="prefix" value="/jsp/" /> <property name="prefix" value="/jsp/" />
<property name="suffix" value=".jsp" /> <property name="suffix" value=".jsp" />
</bean> </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="legend.xml" />
<import resource="business-service-configuration.xml" /> <import resource="business-service-configuration.xml" />
<import resource="media-viewer-configuration.xml" /> <import resource="media-viewer-configuration.xml" />
</beans> </beans>
\ No newline at end of file
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
</c:if> </c:if>
<!-- validated instance control --> <!-- validated instance control -->
<div id="validated_instances_selected" class="validated_instances_selected" onclick="jQuery.change_validated_instance_visibility();"> <c:if test="${kdbDown == false}">
<fmt:message key="portlet.validated_instances_showing" /> <div id="validated_instances_selected" class="validated_instances_selected" onclick="jQuery.change_validated_instance_visibility();">
</div> <fmt:message key="portlet.validated_instances_showing" />
</div>
</c:if>
<!-- candidate instance control --> <!-- candidate instance control -->
<div id="candidate_instances_selected" class="candidate_instances_selected" onclick="jQuery.change_candidate_instance_visibility();"> <div id="candidate_instances_selected" class="candidate_instances_selected" onclick="jQuery.change_candidate_instance_visibility();">
<fmt:message key="portlet.candidate_instances_showing" /> <fmt:message key="portlet.candidate_instances_showing" />
......
...@@ -32,36 +32,42 @@ ...@@ -32,36 +32,42 @@
<portlet:param name="class_uri" value="${ent.entityClassURI }" /> <portlet:param name="class_uri" value="${ent.entityClassURI }" />
</portlet:actionURL> </portlet:actionURL>
<c:choose>
<c:when test="${ent.candidate}"> <c:if test="${kdbDown == false}">
<c:set var="selectInstanceUrl" value="${selectCandidateInstance}" /> <c:choose>
<c:set var="instanceIcon" value="iconKnowledgeCreate" /> <c:when test="${ent.candidate}">
<c:set var="instanceTitle"> <c:set var="selectInstanceUrl" value="${selectCandidateInstance}" />
<fmt:message key='portlet.tooltip.createCandidate' /> <c:set var="instanceIcon" value="iconKnowledgeCreate" />
</c:set> <c:set var="instanceTitle">
</c:when> <fmt:message key='portlet.tooltip.createCandidate' />
<c:otherwise> </c:set>
<c:set var="selectInstanceUrl" value="${selectValidatedInstance}" /> </c:when>
<c:set var="instanceIcon" value="iconKnowledgeEdit" /> <c:otherwise>
<c:set var="instanceTitle"> <c:set var="selectInstanceUrl" value="${selectValidatedInstance}" />
<fmt:message key='portlet.tooltip.editValidated' /> <c:set var="instanceIcon" value="iconKnowledgeEdit" />
</c:set> <c:set var="instanceTitle">
</c:otherwise> <fmt:message key='portlet.tooltip.editValidated' />
</c:choose> </c:set>
</c:otherwise>
</c:choose>
</c:if>
<div class="ui-tooltip-content"> <div class="ui-tooltip-content">
<div class="tooltip-field" <c:if test="${kdbDown == false}">
title='<c:out value="${instanceTitle}" />'> <div class="tooltip-field"
<a href="${selectInstanceUrl}" class="underline"> <span title='<c:out value="${instanceTitle}" />'>
class='<c:out value="${instanceIcon}" />' /> <a href="${selectInstanceUrl}" class="underline"> <span
${ent.entityLabels[0]} class='<c:out value="${instanceIcon}" />' />
</a> ${ent.entityLabels[0]}
</div> </a>
<div class="tooltip-field"> </div>
<span class="tooltip-field-title"> <fmt:message
key="portlet.tooltip.candidate" /></span> <span><fmt:message <div class="tooltip-field">
key="portlet.tooltip.candidate.${ent.candidate}" /> </span> <span class="tooltip-field-title"> <fmt:message
</div> key="portlet.tooltip.candidate" /></span> <span><fmt:message
key="portlet.tooltip.candidate.${ent.candidate}" /> </span>
</div>
</c:if>
<div class="tooltip-field"> <div class="tooltip-field">
<span class="tooltip-field-title"> <fmt:message <span class="tooltip-field-title"> <fmt:message
key="portlet.tooltip.type" /></span> <span 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