diff --git a/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/FetchPDF.java b/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/FetchPDF.java new file mode 100644 index 0000000..227e5ed --- /dev/null +++ b/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/FetchPDF.java @@ -0,0 +1,65 @@ +package org.gcube.datatransfer.resolver.geoportal.exporter; + +import org.gcube.application.geoportaldatamapper.shared.FileReference; + +public class FetchPDF { + + private final int MAX_RETRY = 10; + private FileReference fileRef; + private String code; + + private int attempt = 0; + + public FetchPDF() { + + } + + public FetchPDF(FileReference fileRef, String code, int attempt) { + super(); + this.fileRef = fileRef; + this.code = code; + this.attempt = attempt; + } + + public int getMAX_RETRY() { + return MAX_RETRY; + } + + public FileReference getFileRef() { + return fileRef; + } + + public String getCode() { + return code; + } + + public int getAttempt() { + return attempt; + } + + public void setFileRef(FileReference fileRef) { + this.fileRef = fileRef; + } + + public synchronized void incrementAttempt() { + attempt++; + } + + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("FetchPDF [MAX_RETRY="); + builder.append(MAX_RETRY); + builder.append(", fileRef="); + builder.append(fileRef); + builder.append(", code="); + builder.append(code); + builder.append(", attempt="); + builder.append(attempt); + builder.append("]"); + return builder.toString(); + } + + +} diff --git a/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/HTML_Page.java b/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/HTML_Page.java new file mode 100644 index 0000000..c4c958d --- /dev/null +++ b/src/main/java/org/gcube/datatransfer/resolver/geoportal/exporter/HTML_Page.java @@ -0,0 +1,133 @@ +package org.gcube.datatransfer.resolver.geoportal.exporter; + +public class HTML_Page { + + + /** + * Sets the HTML message. + * + * @param action the action + * @param message the message + * @param waiting the waiting + * @return the string + */ + public static String entityHTMLMessage(String action, String message, boolean waiting, String viewPdfURL) { + + String newHTML = "\n" + + "\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + "" + action + "
"; + + if (waiting) { + newHTML += "" + message + "
"; + newHTML += "" + action + "
"; + newHTML += "" + message + "
"; + newHTML += "" + action + "
"; -// -// if (waiting) { -// html += "" + message + "
"; -// html += "