From 5447c142e3e83697f5cc793304b9a4ad11787dc4 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 13 Oct 2021 08:58:31 +0200 Subject: [PATCH] show the types when instance is specified in the config portlet part --- .../cataloguebadge/PortletViewController.java | 4 ++-- .../jsp/Catalogue-badge-portlet/view.jsp | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java b/src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java index c755479..30272a0 100644 --- a/src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java +++ b/src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java @@ -80,7 +80,7 @@ public class PortletViewController { e1.printStackTrace(); } model.addAttribute("isRootVO", isRootVO); - if (isRootVO) { + if (catalogueBaseURL != null && catalogueBaseURL.compareTo("") != 0) { //if the config textbox with catalogueURL is filled in we show the types try { List theTypes = parseTypes(catalogueBaseURL+"/type", catalogueURL); Collections.sort(theTypes, Collections.reverseOrder()); @@ -100,7 +100,7 @@ public class PortletViewController { String context = pContext.getCurrentScope(""+groupId); DataCatalogueImpl utils = null; - if (gm.isRootVO(groupId)) { + if (isRootVO) { String gatewaySiteURL = pContext.getGatewayURL(httpServletRequest); if (!gatewaySiteURL.startsWith("https")) gatewaySiteURL = gatewaySiteURL.replaceAll("http:", "https:"); diff --git a/src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp b/src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp index 202cc0f..4aff25b 100644 --- a/src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp +++ b/src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp @@ -1,10 +1,23 @@ <%@ page contentType="text/html" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> +<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %> +<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %> + +<%@ page import="com.liferay.portal.kernel.util.Constants" %> +<%@ page import="com.liferay.portal.kernel.util.GetterUtil" %> +<%@ page import="com.liferay.portal.kernel.util.StringPool" %> +<%@ page import="com.liferay.portal.util.PortalUtil" %> + +<% +String catalogueActualURL = GetterUtil.getString(portletPreferences.getValue("catalogueURL", StringPool.BLANK)); +pageContext.setAttribute("catalogueActualURL", catalogueActualURL); +%> + - - + @@ -20,8 +33,8 @@
See All Items See - All Tags + href="${catalogueURL}?path=/types" style="float: right;">See + All Types