in progress on Update Facility

This commit is contained in:
Francesco Mangiacrapa 2023-04-21 10:54:57 +02:00
parent a352933b68
commit ca51fc0543
4 changed files with 43 additions and 6 deletions

View File

@ -64,7 +64,8 @@ public class UploadedFilesBrowse<T extends FileUploaded> extends Composite {
table.setHTML(0, 0, "<span style='color:rgb(155, 80, 78); font-weight:bold;'>Current content:</span>");
table.setHTML(1, 0, "<span style='color:rgb(155, 80, 78);'>Filename</span>");
table.setHTML(1, 1, "<span style='color:rgb(155, 80, 78);'>MimeType<span>");
table.setHTML(1, 2, "<span style='color:rgb(155, 80, 78);'>Link</span>");
table.setHTML(1, 2, "<span style='color:rgb(155, 80, 78);'>Field Label</span>");
table.setHTML(1, 3, "<span style='color:rgb(155, 80, 78);'>Link</span>");
int i = 2;
int index = 0;
@ -76,6 +77,8 @@ public class UploadedFilesBrowse<T extends FileUploaded> extends Composite {
if (file instanceof FileUploadedRemote) {
FileUploadedRemote fur = (FileUploadedRemote) file;
table.setHTML(i, ++columnIndex, fur.getMimeType());
String fieldLabel = file.getFilePath().getFormFieldLabel();
table.setHTML(i, ++columnIndex, fieldLabel);
String link = "<a target=\"_blank\" href=" + fur.getUrl() + ">View</a>";
table.setHTML(i, ++columnIndex, link);
}

View File

@ -984,7 +984,7 @@ public class MetaDataFieldSkeleton extends Composite {
break;
case File:
GWT.log("here");
if (holder.getClass().equals(MultipleDilaogUpload.class) || holder.getClass().equals(DialogUpload.class)) {
DialogUpload dUpload = (DialogUpload) holder;
dUpload.enableUpload(!bool);

View File

@ -22,7 +22,6 @@ import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
// TODO: Auto-generated Javadoc
/**
* The Class MultipleDilaogUploadStream.
*
@ -46,8 +45,11 @@ public class MultipleDilaogUpload extends DialogUpload {
/** The id folder. */
private String idFolder;
/**
* Instantiates a new multiple dilaog upload.
*
* @param fieldName the field name used in the web form
*/
public MultipleDilaogUpload(String fieldName) {
this.fileUploadID = GenerateUUID.get(10, 16); // is tagID

View File

@ -7,15 +7,16 @@ import java.io.Serializable;
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Mar 21, 2022
* Apr 13, 2023
*/
public class FilePath implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5321133561716734223L;
String formFieldLabel; // is the gcubeProfileFieldName in the UCD of Geoportal
private static final long serialVersionUID = -1544808784879956412L;
private String formFieldLabel; // It is the gcubeProfileFieldName registered in the UCD of Geoportal
private String fieldName; // It is the fieldName registered in the UCD of Geoportal
/**
* Instantiates a new file paths.
@ -32,6 +33,17 @@ public class FilePath implements Serializable {
this.formFieldLabel = formFieldLabel;
}
/**
* Instantiates a new file path.
*
* @param formFieldLabel the form field label
* @param fieldName the field name
*/
public FilePath(String formFieldLabel, String fieldName) {
this.formFieldLabel = formFieldLabel;
this.fieldName = fieldName;
}
/**
* Gets the form field label.
*
@ -50,6 +62,24 @@ public class FilePath implements Serializable {
this.formFieldLabel = formFieldLabel;
}
/**
* Gets the field name.
*
* @return the field name
*/
public String getFieldName() {
return fieldName;
}
/**
* Sets the field name.
*
* @param fieldName the new field name
*/
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
/**
* To string.
*
@ -60,6 +90,8 @@ public class FilePath implements Serializable {
StringBuilder builder = new StringBuilder();
builder.append("FilePath [formFieldLabel=");
builder.append(formFieldLabel);
builder.append(", fieldName=");
builder.append(fieldName);
builder.append("]");
return builder.toString();
}