From 95693aee694f5b454219dc3a29e0e9850c5779a1 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Thu, 24 Oct 2019 17:36:21 +0200 Subject: [PATCH] implementation completed --- .../user/thematicgateways/Gateway.java | 33 +++++++++++++++++++ .../thematicgateways/GatewayComparator.java | 16 +++++++++ .../SortCriteria.jsp | 9 ----- 3 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/thematicgateways/Gateway.java create mode 100644 src/main/java/org/gcube/portlets/user/thematicgateways/GatewayComparator.java delete mode 100644 src/main/webapp/html/thematic-gateways-portlet/SortCriteria.jsp diff --git a/src/main/java/org/gcube/portlets/user/thematicgateways/Gateway.java b/src/main/java/org/gcube/portlets/user/thematicgateways/Gateway.java new file mode 100644 index 0000000..248d8f2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/thematicgateways/Gateway.java @@ -0,0 +1,33 @@ +package org.gcube.portlets.user.thematicgateways; + +import java.util.ArrayList; + +import com.liferay.portal.model.Group; + +public class Gateway { + private Group site; + private ArrayList vres; + public Gateway(Group site, ArrayList vres) { + super(); + this.site = site; + this.vres = vres; + } + public Group getSite() { + return site; + } + public void setSite(Group site) { + this.site = site; + } + public ArrayList getVres() { + return vres; + } + public void setVres(ArrayList vres) { + this.vres = vres; + } + @Override + public String toString() { + return "Gateway [site=" + site + ", vres=" + vres + "]"; + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/thematicgateways/GatewayComparator.java b/src/main/java/org/gcube/portlets/user/thematicgateways/GatewayComparator.java new file mode 100644 index 0000000..16739ae --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/thematicgateways/GatewayComparator.java @@ -0,0 +1,16 @@ +package org.gcube.portlets.user.thematicgateways; + +import java.util.Comparator; + + public class GatewayComparator implements Comparator { + @Override + public int compare(Gateway o1, Gateway o2) { + if (o1.getVres().size() > o2.getVres().size()) + return -1; + if (o1.getVres().size() < o2.getVres().size()) + return 1; + return 0; + } + } + + diff --git a/src/main/webapp/html/thematic-gateways-portlet/SortCriteria.jsp b/src/main/webapp/html/thematic-gateways-portlet/SortCriteria.jsp deleted file mode 100644 index 1b9f32d..0000000 --- a/src/main/webapp/html/thematic-gateways-portlet/SortCriteria.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> - - - -
-

Please select the farm you wish to operate

- You are assigned to more than one company - Farm. You can work on one farm at a time. -
\ No newline at end of file