feature complete and alpha tested
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);
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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"%>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
|
||||
<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">
|
||||
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
|
||||
<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
|
||||
<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
|
||||
<li><a href="${catalogueURL}?path=/type/"> <b><span>${typesNo}</span></b>
|
||||
types
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
|
Loading…
Reference in New Issue