package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project; import java.util.Map.Entry; import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV; public class ProjectUtil { public static String toHMLCode(T document, String projectID) { String htmlCode = ""; if (document == null) return htmlCode; Entry firstEntrySet = document.getFirstEntryOfMap(); if (firstEntrySet != null) { htmlCode += firstEntrySet.getKey() + ": " + firstEntrySet.getValue() + ""; } if (projectID != null) { htmlCode += " (id: " + projectID + ")"; } return htmlCode; } public static String toHMLCode(boolean showkey, T document, String projectID) { String htmlCode = ""; if (document == null) return htmlCode; Entry firstEntrySet = document.getFirstEntryOfMap(); if (firstEntrySet != null) { htmlCode += showkey ? firstEntrySet.getKey() + ": " + firstEntrySet.getValue() + "" : firstEntrySet.getValue(); } if (projectID != null) { htmlCode += " (id: " + projectID + ")"; } return htmlCode; } public static String toHMLCode(T document) { String htmlCode = ""; if (document == null) return htmlCode; Entry firstEntrySet = document.getFirstEntryOfMap(); if (firstEntrySet != null) { htmlCode += firstEntrySet.getKey() + ": " + firstEntrySet.getValue() + ""; } return htmlCode; } }