feature complete and alpha tested

Feature/22177
Massimiliano Assante 2 years ago
parent 387a8a2e6d
commit 7e64528e05

@ -0,0 +1,14 @@
# Changelog for Catalogue Badge Portlet
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.1-SNAPSHOT] - 2021-10-13
- Feature qualcosa
## [v1.0.0] - 2019-05-21
First Release

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

@ -1,6 +1,6 @@
# gCube System - Catalogue Badge Portlet # gCube System - VRE Apps Integration Portlet
This component is a Liferay 6.2.6 CE Porlet which iinteracts with the VRE Modeler service during new VRE Creations
## Structure of the project ## Structure of the project
* The source code is present in the src folder. * The source code is present in the src folder.
@ -12,11 +12,11 @@
## Documentation ## Documentation
* Use of this service is described in the [Wiki](https://wiki.gcube-system.org/gcube/User%27s_Guide). * No Documentation is provided
## Change log ## Change log
See [Releases](https://code-repo.d4science.org/gCubeSystem/about-vre/releases). See [Releases](https://code-repo.d4science.org/gCubeSystem/VREApp-Integration-portlet/releases).
## Authors ## Authors
@ -37,12 +37,6 @@ open-source software toolkit used for building and operating Hybrid Data
Infrastructures enabling the dynamic deployment of Virtual Research Environments Infrastructures enabling the dynamic deployment of Virtual Research Environments
by favouring the realisation of reuse oriented policies. by favouring the realisation of reuse oriented policies.
The projects leading to this software have received funding from a series of European Union programmes including: The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)
- the Sixth Framework Programme for Research and Technological Development
- DILIGENT (grant no. 004260);
- the Seventh Framework Programme for research, technological development and demonstration
- D4Science (grant no. 212488), D4Science-II (grant no.239019), ENVRI (grant no. 283465), EUBrazilOpenBio (grant no. 288754), iMarine(grant no. 283644);
- the H2020 research and innovation programme
- BlueBRIDGE (grant no. 675680), EGIEngage (grant no. 654142), ENVRIplus (grant no. 654182), Parthenos (grant no. 654119), SoBigData (grant no. 654024),DESIRA (grant no. 818194), ARIADNEplus (grant no. 823914), RISIS2 (grant no. 824091), PerformFish (grant no. 727610), AGINFRAplus (grant no. 731001);

@ -1,5 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
@ -11,16 +12,16 @@
<artifactId>catalogue-badge-portlet</artifactId> <artifactId>catalogue-badge-portlet</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>Catalogue-badge-portlet Portlet</name> <name>Catalogue-badge-portlet Portlet</name>
<version>1.0.0-SNAPSHOT</version> <version>1.1.1-SNAPSHOT</version>
<description> <description>
accept-invite-portlet manage the sent invitations Catalogue badge portlet displays a synoptic view of the catalogue content
</description> </description>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/catalogue-badge-portlet.git</connection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/catalogue-badge-portlet.git</developerConnection> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/catalogue-badge-portlet</url> <url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm> </scm>
<properties> <properties>
<distroDirectory>distro</distroDirectory> <distroDirectory>distro</distroDirectory>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
@ -37,7 +38,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>LATEST</version> <version>3.6.3-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -59,10 +60,14 @@
<artifactId>portal-manager</artifactId> <artifactId>portal-manager</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.10.2</version>
</dependency>
<dependency> <dependency>
<groupId>com.liferay.portal</groupId> <groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId> <artifactId>portal-service</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -80,7 +85,6 @@
<dependency> <dependency>
<groupId>com.liferay.portal</groupId> <groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId> <artifactId>util-java</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -173,8 +177,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<source>1.8</source> <source>${maven.compiler.source}</source>
<target>1.8</target> <target>${maven.compiler.target}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>

@ -0,0 +1,38 @@
package org.gcube.portlets.user.cataloguebadge;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.DefaultConfigurationAction;
public class CatalogueBadgeConfigurationAction extends DefaultConfigurationAction {
private static Log _log = LogFactoryUtil.getLog(CatalogueBadgeConfigurationAction.class);
@Override
public void processAction(
PortletConfig portletConfig, ActionRequest actionRequest,
ActionResponse actionResponse) throws Exception {
super.processAction(portletConfig, actionRequest, actionResponse);
PortletPreferences prefs = actionRequest.getPreferences();
String catalogueURL = prefs.getValue("catalogueURL", "true");
_log.debug("catalogueURL = " + catalogueURL + " in CatalogueBadgeConfigurationAction.processAction().");
}
@Override
public String render(PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse)
throws Exception {
return "/WEB-INF/jsp/Catalogue-badge-portlet/config.jsp";
}
}

@ -0,0 +1,48 @@
package org.gcube.portlets.user.cataloguebadge;
public class CatalogueType implements Comparable<CatalogueType>{
private String name;
private String img;
private String link;
private int occurrence;
public CatalogueType(String name, String img, String link, int occurrence) {
super();
this.name = name;
this.img = img;
this.link = link;
this.occurrence = occurrence;
}
public String getName() {
return name;
}
public String getImg() {
return img;
}
public String getLink() {
return link;
}
public int getOccurrence() {
return occurrence;
}
@Override
public String toString() {
return "CatalogueType [name=" + name + ", img=" + img + ", link=" + link + ", occurrence=" + occurrence + "]";
}
@Override
public int compareTo(CatalogueType o) {
if (this.occurrence > o.occurrence)
return 1;
if (this.occurrence < o.occurrence)
return -1;
return 0;
}
}

@ -16,7 +16,12 @@ package org.gcube.portlets.user.cataloguebadge;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Collections;
import java.util.List;
import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest; import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse; import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -29,6 +34,10 @@ import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogueImpl;
import org.gcube.datacatalogue.ckanutillibrary.shared.Statistics; import org.gcube.datacatalogue.ckanutillibrary.shared.Statistics;
import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -36,7 +45,9 @@ import org.springframework.web.portlet.bind.annotation.RenderMapping;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ReleaseInfo; import com.liferay.portal.kernel.util.ReleaseInfo;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.Group; import com.liferay.portal.model.Group;
import com.liferay.portal.service.GroupLocalServiceUtil; import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
@ -45,60 +56,119 @@ import com.liferay.portal.util.PortalUtil;
@RequestMapping("VIEW") @RequestMapping("VIEW")
public class PortletViewController { public class PortletViewController {
private static Log _log = LogFactoryUtil.getLog(PortletViewController.class); private static Log _log = LogFactoryUtil.getLog(PortletViewController.class);
private DataCatalogueFactory factory = DataCatalogueFactory.getFactory(); private static final String IMAGES_BASE_URL = "https://catalogue.d4science.org/";
private static final long K = 1000; private static final long K = 1000;
private static final long M = K * K; private static final long M = K * K;
private static final long G = M * K; private static final long G = M * K;
private DataCatalogueFactory factory = DataCatalogueFactory.getFactory();
private static GroupManager gm = new LiferayGroupManager(); private static GroupManager gm = new LiferayGroupManager();
@RenderMapping @RenderMapping
public String question(RenderRequest request,RenderResponse response, Model model) { public String question(RenderRequest request,RenderResponse response, Model model) {
model.addAttribute("releaseInfo", ReleaseInfo.getReleaseInfo()); model.addAttribute("releaseInfo", ReleaseInfo.getReleaseInfo());
PortletPreferences prefs = request.getPreferences();
String catalogueBaseURL = GetterUtil.getString(prefs.getValue("catalogueURL", StringPool.BLANK));
HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(request);
long groupId = -1;
boolean isRootVO = false;
String catalogueURL = "";
try { try {
HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(request); groupId = PortalUtil.getScopeGroupId(request);
isRootVO = gm.isRootVO(groupId);
long groupId = PortalUtil.getScopeGroupId(request); catalogueURL = getCatalougeFriendlyURL(GroupLocalServiceUtil.getGroup(groupId));
PortalContext pContext = PortalContext.getConfiguration(); } catch (Exception e1) {
String context = pContext.getCurrentScope(""+groupId); e1.printStackTrace();
String catalogueURL = getCatalougeFriendlyURL(GroupLocalServiceUtil.getGroup(groupId)); }
DataCatalogueImpl utils = null; model.addAttribute("isRootVO", isRootVO);
if (gm.isRootVO(groupId)) { if (isRootVO) {
String gatewaySiteURL = pContext.getGatewayURL(httpServletRequest); try {
if (!gatewaySiteURL.startsWith("https")) List<CatalogueType> theTypes = parseTypes(catalogueBaseURL+"/type", catalogueURL);
gatewaySiteURL = gatewaySiteURL.replaceAll("http:", "https:"); Collections.sort(theTypes, Collections.reverseOrder());
String siteLandingPage = pContext.getSiteLandingPagePath(httpServletRequest); List<CatalogueType> theFiveTypes = new ArrayList<>();
String clientURL = gatewaySiteURL+siteLandingPage; for (int i = 0; i < 6; i++) {
try { theFiveTypes.add(theTypes.get(i));
String appPerScopeURL = ApplicationProfileScopePerUrlReader.getScopePerUrl(clientURL);
_log.info("Catalogue for this Gateway is in this scope: " + appPerScopeURL);
utils = factory.getUtilsPerScope(appPerScopeURL);
_log.info("Here I instanciated factory.getUtilsPerScope with scope " + appPerScopeURL);
} catch (Exception e) {
_log.warn("Returning default catalogue for the context, could not find the catologue for this Gateway: " + clientURL);
utils = factory.getUtilsPerScope(context);
} }
model.addAttribute("catalogueTypes", theFiveTypes);
model.addAttribute("catalogueURL", catalogueURL);
} catch (Exception e) {
e.printStackTrace();
} }
else { }
utils = factory.getUtilsPerScope(context); else { //in VRE
_log.info("regular factory.getUtilsPerScope with context: " + context); try {
PortalContext pContext = PortalContext.getConfiguration();
String context = pContext.getCurrentScope(""+groupId);
DataCatalogueImpl utils = null;
if (gm.isRootVO(groupId)) {
String gatewaySiteURL = pContext.getGatewayURL(httpServletRequest);
if (!gatewaySiteURL.startsWith("https"))
gatewaySiteURL = gatewaySiteURL.replaceAll("http:", "https:");
String siteLandingPage = pContext.getSiteLandingPagePath(httpServletRequest);
String clientURL = gatewaySiteURL+siteLandingPage;
try {
String appPerScopeURL = ApplicationProfileScopePerUrlReader.getScopePerUrl(clientURL);
_log.info("Catalogue for this Gateway is in this scope: " + appPerScopeURL);
utils = factory.getUtilsPerScope(appPerScopeURL);
_log.info("Here I instanciated factory.getUtilsPerScope with scope " + appPerScopeURL);
} catch (Exception e) {
_log.warn("Returning default catalogue for the context, could not find the catologue for this Gateway: " + clientURL);
utils = factory.getUtilsPerScope(context);
}
}
else {
utils = factory.getUtilsPerScope(context);
_log.info("regular factory.getUtilsPerScope with context: " + context);
}
Statistics stats = utils.getStatistics();
_log.info("Got Statistics ... ");
model.addAttribute("itemsNo", convertToStringRepresentation(stats.getNumItems()));
model.addAttribute("groupsNo", stats.getNumGroups());
model.addAttribute("organisationsNo", stats.getNumOrganizations());
model.addAttribute("typesNo", stats.getNumTypes());
model.addAttribute("catalogueURL", catalogueURL);
} catch (Exception e) {
e.printStackTrace();
} }
Statistics stats = utils.getStatistics();
_log.info("Got Statistics ... ");
model.addAttribute("itemsNo", convertToStringRepresentation(stats.getNumItems()));
model.addAttribute("groupsNo", stats.getNumGroups());
model.addAttribute("organisationsNo", stats.getNumOrganizations());
model.addAttribute("typesNo", stats.getNumTypes());
model.addAttribute("catalogueURL", catalogueURL);
} catch (Exception e) {
e.printStackTrace();
} }
return "Catalogue-badge-portlet/view"; return "Catalogue-badge-portlet/view";
} }
private List<CatalogueType> parseTypes(String url, String catalogueURL) throws Exception {
List<CatalogueType> toReturn = new ArrayList<>();
Document doc = Jsoup.connect(url)
.userAgent("Mozilla")
.timeout(5000)
.referrer("http://www.d4science.org")
.header("headersecurity", "xyz123")
.get();
Elements types = doc.select("article li");
for (Element type : types) {
Element imgElement = type.select("div img").first();
String imgUrl = imgElement.attr("src");
Element aElement = type.select("h3 a").first();
Element h3Element = type.select("h3").first();
//String href = aElement.attr("href");
String name = aElement.text();
String nameAndOccurrence = h3Element.text();
int occurrence = 0;
String query = "systemtype="+name;
String encodedQuery = Base64.getEncoder().encodeToString(query.getBytes());
String hrefPortlet = catalogueURL+"?path=dataset&query="+encodedQuery;
try {
int bracketOpen = nameAndOccurrence.indexOf("(");
int brackeClosed = nameAndOccurrence.indexOf(")");
String numberToParse = nameAndOccurrence.substring(bracketOpen+1, brackeClosed);
occurrence = Integer.parseInt(numberToParse);
} catch (Exception e) {
_log.error("Could not find occurrence in string "+ nameAndOccurrence);
}
toReturn.add(new CatalogueType(name, IMAGES_BASE_URL+imgUrl, hrefPortlet, occurrence));
}
return toReturn;
}
public static String convertToStringRepresentation(final long value){ public static String convertToStringRepresentation(final long value){
final long[] dividers = new long[] { G, M, K, 1 }; final long[] dividers = new long[] { G, M, K, 1 };
final String[] units = new String[] {"Giga", "M", "K", ""}; final String[] units = new String[] {"Giga", "M", "K", ""};
@ -136,4 +206,5 @@ public class PortletViewController {
} }
} }

@ -0,0 +1,41 @@
<%@ 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" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<liferay-theme:defineObjects />
<portlet:defineObjects />
<liferay-portlet:actionURL portletConfiguration="true"
var="configurationURL" />
<%
String appURL_cfg = GetterUtil.getString(portletPreferences.getValue("catalogueURL", StringPool.BLANK));
%>
<aui:form action="<%=configurationURL%>" method="post" name="fm">
<aui:input name="<%=Constants.CMD%>" type="hidden"
value="<%=Constants.UPDATE%>" />
<!-- Application URL -->
<aui:field-wrapper cssClass="field-group">
<aui:input style="width: 100%;" name="preferences--catalogueURL--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="Catalogue URL" inlineField="true" inlineLabel="left"
placeholder="Enter Catalogue URL (e.g. https://ckan-sobigdata.d4science.org)"
helpMessage="Actual endpoint of the ckan instance (e.g. https://ckan-sobigdata.d4science.org)"
value="<%=appURL_cfg%>" required="true" />
</aui:field-wrapper>
<aui:button-row>
<aui:button type="submit" />
</aui:button-row>
</aui:form>

@ -1,43 +1,77 @@
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ page contentType="text/html" pageEncoding="UTF-8"%> <%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<input type="hidden" value="${catalogueURL}" id="catalogueURL"> <c:choose>
<div id="catalogueDiv"> <c:when test="${isRootVO}">
<div class="input-append input-catalogue">
<input type="text" class="input-large" name="q" value="" <input type="hidden" value="${catalogueURL}" id="catalogueURL">
autocomplete="off" placeholder="Insert keywords here" id="inputQueryCatalogue"> <table class="catalogue-container">
<button class="btn btn-primary" type="button" title="Search" id="searchCatalogueButton"> <tr class="catalogue-table-row">
<i class="icon-search"></i> <span>Search</span> <td class="catalogue-table-cell">
</button> <div class="input-append input-catalogue">
</div> <input type="text" class="input-large" name="q" value=""
<div class="catstats"> autocomplete="off" placeholder="Insert keywords here"
<ul> id="inputQueryCatalogue">
<li><a href="${catalogueURL}?path=/dataset/"> <b><span>${itemsNo}</span></b> items <button class="btn btn-primary" type="button" title="Search"
</a></li> id="searchCatalogueButton">
<li><a href="${catalogueURL}?path=/organization/"> <b><span>${organisationsNo}</span></b> <i class="icon-search"></i> <span>Search</span>
organisation </button>
</a></li> </div>
<li><a href="${catalogueURL}?path=/group/"> <b><span>${groupsNo}</span></b> groups <div>
</a></li> <a href="${catalogueURL}?path=/dataset">See All Items</a> <a
<li><a href="${catalogueURL}?path=/type/"> <b><span>${typesNo}</span></b> types href="${catalogueURL}?path=/tags" style="float: right;">See
</a></li> All Tags</a>
</ul> </div>
</div> </td>
</div> <td class="catalogue-table-cell-max">
<table>
<tr>
<c:forEach var="type" items="${catalogueTypes}">
<td class="media-item-homepage"><a href="${type.link}"
title="View ${type.name}"> <img class="logo-homepage"
src="${type.img}" alt="${type.name}"
title="${type.name} group">
</a>
<p class="media-heading-homepage">
<a href="${type.link}" title="View ${type.name}">
${type.name} (${type.occurrence}) </a>
</p></td>
</c:forEach>
</tr>
</table>
</td>
</tr>
</table>
</c:when>
<c:otherwise>
<div id="catalogueDiv">
<div class="input-append input-catalogue">
<input type="text" class="input-large" name="q" value=""
autocomplete="off" placeholder="Insert keywords here"
id="inputQueryCatalogue">
<button class="btn btn-primary" type="button" title="Search"
id="searchCatalogueButton">
<i class="icon-search"></i> <span>Search</span>
</button>
</div>
<div class="catstats">
<ul>
<li><a href="${catalogueURL}?path=/dataset/"> <b><span>${itemsNo}</span></b>
items
</a></li>
<li><a href="${catalogueURL}?path=/organization/"> <b><span>${organisationsNo}</span></b>
organisation
</a></li>
<li><a href="${catalogueURL}?path=/group/"> <b><span>${groupsNo}</span></b>
groups
</a></li>
<li><a href="${catalogueURL}?path=/type/"> <b><span>${typesNo}</span></b>
types
</a></li>
</ul>
</div>
</div>
</c:otherwise>
</c:choose>

@ -5,6 +5,8 @@
<portlet> <portlet>
<portlet-name>Catalogue-badge-portlet</portlet-name> <portlet-name>Catalogue-badge-portlet</portlet-name>
<icon>/icon.png</icon> <icon>/icon.png</icon>
<configuration-action-class>org.gcube.portlets.user.cataloguebadge.CatalogueBadgeConfigurationAction</configuration-action-class>
<requires-namespaced-parameters>false</requires-namespaced-parameters>
<header-portlet-css>/css/main.css</header-portlet-css> <header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript> <footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
</portlet> </portlet>

@ -9,6 +9,10 @@
<name>contextConfigLocation</name> <name>contextConfigLocation</name>
<value>/WEB-INF/spring-context/portlet/Catalogue-badge-portlet-portlet.xml</value> <value>/WEB-INF/spring-context/portlet/Catalogue-badge-portlet-portlet.xml</value>
</init-param> </init-param>
<init-param>
<name>config-template</name>
<value>/WEB-INF/jsp/Catalogue-badge-portlet/config.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache> <expiration-cache>0</expiration-cache>
<supports> <supports>
<mime-type>text/html</mime-type> <mime-type>text/html</mime-type>

@ -8,6 +8,47 @@
width: 100%; width: 100%;
} }
.catalogue-container {
display: table;
width: 100%;
}
.catalogue-table-row {
display: table-row;
overflow: hidden;
}
.catalogue-table-cell {
display: table-cell;
padding: 0;
}
.catalogue-table-cell-max {
width: 100%;
display: table-cell;
padding-left: 25px;
}
.media-heading-homepage {
font-size: 14px;
hyphens: auto;
line-height: 1.3;
}
.media-item-homepage {
background-color: white;
border-radius: 3px;
float: left;
overflow: hidden;
position: relative;
text-align: center;
width: 130px;
}
.logo-homepage {
max-height: 60px;
}
div.catstats { div.catstats {
padding-bottom: 60px; padding-bottom: 60px;
} }
@ -24,9 +65,8 @@ div.catstats ul li {
} }
div.catstats ul li a b { div.catstats ul li a b {
font-size: 35px; font-size: 35px;
line-height: 1.1; line-height: 1.1;
display: block; display: block;
font-weight: 300; font-weight: 300;
} }
Loading…
Cancel
Save