Browse Source

feature complete and alpha tested

Feature/22177
Massimiliano Assante 2 months ago
parent
commit
7e64528e05
  1. 14
      CHANGELOG.md
  2. 26
      FUNDING.md
  3. 18
      README.md
  4. 28
      pom.xml
  5. 38
      src/main/java/org/gcube/portlets/user/cataloguebadge/CatalogueBadgeConfigurationAction.java
  6. 48
      src/main/java/org/gcube/portlets/user/cataloguebadge/CatalogueType.java
  7. 147
      src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java
  8. 41
      src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/config.jsp
  9. 112
      src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp
  10. 2
      src/main/webapp/WEB-INF/liferay-portlet.xml
  11. 4
      src/main/webapp/WEB-INF/portlet.xml
  12. 52
      src/main/webapp/css/main.css

14
CHANGELOG.md

@ -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

26
FUNDING.md

@ -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);

18
README.md

@ -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
* The source code is present in the src folder.
@ -12,11 +12,11 @@
## 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
See [Releases](https://code-repo.d4science.org/gCubeSystem/about-vre/releases).
See [Releases](https://code-repo.d4science.org/gCubeSystem/VREApp-Integration-portlet/releases).
## 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
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 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);
The projects leading to this software have received funding from a series of European Union programmes see [FUNDING.md](FUNDING.md)

28
pom.xml

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

38
src/main/java/org/gcube/portlets/user/cataloguebadge/CatalogueBadgeConfigurationAction.java

@ -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";
}
}

48
src/main/java/org/gcube/portlets/user/cataloguebadge/CatalogueType.java

@ -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;
}
}

147
src/main/java/org/gcube/portlets/user/cataloguebadge/PortletViewController.java

@ -16,7 +16,12 @@ package org.gcube.portlets.user.cataloguebadge;
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.RenderResponse;
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.vomanagement.usermanagement.GroupManager;
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.ui.Model;
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.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ReleaseInfo;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.Group;
import com.liferay.portal.service.GroupLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
@ -45,60 +56,119 @@ import com.liferay.portal.util.PortalUtil;
@RequestMapping("VIEW")
public class PortletViewController {
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 M = K * K;
private static final long G = M * K;
private DataCatalogueFactory factory = DataCatalogueFactory.getFactory();
private static GroupManager gm = new LiferayGroupManager();
@RenderMapping
public String question(RenderRequest request,RenderResponse response, Model model) {
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 {
HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(request);
long groupId = PortalUtil.getScopeGroupId(request);
PortalContext pContext = PortalContext.getConfiguration();
String context = pContext.getCurrentScope(""+groupId);
String catalogueURL = getCatalougeFriendlyURL(GroupLocalServiceUtil.getGroup(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);
groupId = PortalUtil.getScopeGroupId(request);
isRootVO = gm.isRootVO(groupId);
catalogueURL = getCatalougeFriendlyURL(GroupLocalServiceUtil.getGroup(groupId));
} catch (Exception e1) {
e1.printStackTrace();
}
model.addAttribute("isRootVO", isRootVO);
if (isRootVO) {
try {
List<CatalogueType> theTypes = parseTypes(catalogueBaseURL+"/type", catalogueURL);
Collections.sort(theTypes, Collections.reverseOrder());
List<CatalogueType> theFiveTypes = new ArrayList<>();
for (int i = 0; i < 6; i++) {
theFiveTypes.add(theTypes.get(i));
}
model.addAttribute("catalogueTypes", theFiveTypes);
model.addAttribute("catalogueURL", catalogueURL);
} catch (Exception e) {
e.printStackTrace();
}
else {
utils = factory.getUtilsPerScope(context);
_log.info("regular factory.getUtilsPerScope with context: " + context);
}
else { //in VRE
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";
}
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){
final long[] dividers = new long[] { G, M, K, 1 };
final String[] units = new String[] {"Giga", "M", "K", ""};
@ -136,4 +206,5 @@ public class PortletViewController {
}
}

41
src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/config.jsp

@ -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>

112
src/main/webapp/WEB-INF/jsp/Catalogue-badge-portlet/view.jsp

@ -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"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<input type="hidden" value="${catalogueURL}" id="catalogueURL">
<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:choose>
<c:when test="${isRootVO}">
<input type="hidden" value="${catalogueURL}" id="catalogueURL">
<table class="catalogue-container">
<tr class="catalogue-table-row">
<td class="catalogue-table-cell">
<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>
<a href="${catalogueURL}?path=/dataset">See All Items</a> <a
href="${catalogueURL}?path=/tags" style="float: right;">See
All Tags</a>
</div>
</td>
<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>

2
src/main/webapp/WEB-INF/liferay-portlet.xml

@ -5,6 +5,8 @@
<portlet>
<portlet-name>Catalogue-badge-portlet</portlet-name>
<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>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
</portlet>

4
src/main/webapp/WEB-INF/portlet.xml

@ -9,6 +9,10 @@
<name>contextConfigLocation</name>
<value>/WEB-INF/spring-context/portlet/Catalogue-badge-portlet-portlet.xml</value>
</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>
<supports>
<mime-type>text/html</mime-type>

52
src/main/webapp/css/main.css

@ -8,6 +8,47 @@
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 {
padding-bottom: 60px;
}
@ -24,9 +65,8 @@ div.catstats ul li {
}
div.catstats ul li a b {
font-size: 35px;
line-height: 1.1;
display: block;
font-weight: 300;
}
font-size: 35px;
line-height: 1.1;
display: block;
font-weight: 300;
}
Loading…
Cancel
Save