42 lines
1011 B
Java
42 lines
1011 B
Java
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 <T extends DocumentDV> String toHMLCode(T document, String projectID) {
|
|
String htmlCode = "";
|
|
|
|
if (document == null)
|
|
return htmlCode;
|
|
|
|
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
|
|
if (firstEntrySet != null) {
|
|
htmlCode += firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>";
|
|
}
|
|
|
|
if (projectID != null) {
|
|
htmlCode += " (id: " + projectID + ")";
|
|
}
|
|
|
|
return htmlCode;
|
|
}
|
|
|
|
public static <T extends DocumentDV> String toHMLCode(T document) {
|
|
String htmlCode = "";
|
|
|
|
if (document == null)
|
|
return htmlCode;
|
|
|
|
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
|
|
if (firstEntrySet != null) {
|
|
htmlCode += firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>";
|
|
}
|
|
|
|
return htmlCode;
|
|
}
|
|
|
|
}
|