updated date format

This commit is contained in:
francesco 2020-10-19 18:04:22 +02:00
parent b6d6d07aa7
commit 0ef68513b4
4 changed files with 84 additions and 37 deletions

View File

@ -20,6 +20,10 @@ public class ConstantsMPFormBuilder {
public static final int LIMIT_UPLOADS = 50;
public static final String DATE_FORMAT = "yyyy-MM-dd";
public static final String TIME_FORMAT = "HH:mm";
/**
* Log.
*

View File

@ -633,8 +633,8 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
}
GenericDatasetBean gdb = new GenericDatasetBean();
gdb.setMetadataList(metadataProfiles);
gdb.setCustomFields(customFieldsMap);
gdb.setMetadataProfileList(metadataProfiles);
gdb.setFormDataEntryFields(customFieldsMap);
gdb.setFilesUploaded(listFilesUploaded);
formDataBean = gdb;

View File

@ -2,6 +2,8 @@ package org.gcube.portlets.widgets.mpformbuilder.client.ui.timeandranges;
import java.util.Date;
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
import com.github.gwtbootstrap.datepicker.client.ui.DateBox;
import com.github.gwtbootstrap.datetimepicker.client.ui.DateTimeBox;
import com.google.gwt.core.client.GWT;
@ -32,8 +34,8 @@ public class DataTimeBox extends Composite{
private static final String INSERT_TIME_INSTANT_LABEL = "Hour and minutes";
private static final String INSERT_DATE_START_LABEL = "Insert a start date";
private static final String INSERT_DATE_END_LABEL = "Insert an end date";
private static final DateTimeFormat formatDate = DateTimeFormat.getFormat("yyyy-MM-dd");
private static final DateTimeFormat formatTime = DateTimeFormat.getFormat("HH:mm");
private static final DateTimeFormat formatDate = DateTimeFormat.getFormat(ConstantsMPFormBuilder.DATE_FORMAT);
private static final DateTimeFormat formatTime = DateTimeFormat.getFormat(ConstantsMPFormBuilder.TIME_FORMAT);
private boolean isRange;

View File

@ -13,18 +13,21 @@ import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
* Oct 8, 2020
* Oct 19, 2020
*/
public class GenericDatasetBean implements Serializable {
/**
*
*/
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5215392381589702647L;
private List<MetaDataProfileBean> metadataList;
private Map<String, List<String>> customFields;
/** The metadata profile list. */
private List<MetaDataProfileBean> metadataProfileList;
/** The form data entry fields. */
private Map<String, List<String>> formDataEntryFields;
/** The files uploaded. */
private List<FileUploaded> filesUploaded;
/**
@ -34,55 +37,93 @@ public class GenericDatasetBean implements Serializable {
}
public GenericDatasetBean(List<MetaDataProfileBean> metadataList, Map<String, List<String>> customFields,
/**
* Instantiates a new generic dataset bean.
*
* @param metadataProfileList the metadata profile list
* @param formDataEntryFields the form data entry fields
* @param filesUploaded the files uploaded
*/
public GenericDatasetBean(List<MetaDataProfileBean> metadataProfileList, Map<String, List<String>> formDataEntryFields,
List<FileUploaded> filesUploaded) {
super();
this.metadataList = metadataList;
this.customFields = customFields;
this.metadataProfileList = metadataProfileList;
this.formDataEntryFields = formDataEntryFields;
this.filesUploaded = filesUploaded;
}
public List<MetaDataProfileBean> getMetadataList() {
return metadataList;
}
public void setMetadataList(List<MetaDataProfileBean> metadataList) {
this.metadataList = metadataList;
}
public Map<String, List<String>> getCustomFields() {
return customFields;
}
public void setCustomFields(Map<String, List<String>> customFields) {
this.customFields = customFields;
/**
* Gets the metadata profile list.
*
* @return the metadata profile list
*/
public List<MetaDataProfileBean> getMetadataProfileList() {
return metadataProfileList;
}
/**
* Sets the metadata profile list.
*
* @param metadataProfileList the new metadata profile list
*/
public void setMetadataProfileList(List<MetaDataProfileBean> metadataProfileList) {
this.metadataProfileList = metadataProfileList;
}
/**
* Gets the form data entry fields.
*
* @return the form data entry fields
*/
public Map<String, List<String>> getFormDataEntryFields() {
return formDataEntryFields;
}
/**
* Sets the form data entry fields.
*
* @param formDataEntryFields the form data entry fields
*/
public void setFormDataEntryFields(Map<String, List<String>> formDataEntryFields) {
this.formDataEntryFields = formDataEntryFields;
}
/**
* Gets the files uploaded.
*
* @return the files uploaded
*/
public List<FileUploaded> getFilesUploaded() {
return filesUploaded;
}
/**
* Sets the files uploaded.
*
* @param filesUploaded the new files uploaded
*/
public void setFilesUploaded(List<FileUploaded> filesUploaded) {
this.filesUploaded = filesUploaded;
}
/**
* To string.
*
* @return the string
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GenericDatasetBean [metadataList=");
builder.append(metadataList);
builder.append(", customFields=");
builder.append(customFields);
builder.append(", filesUploaded=");
builder.append(filesUploaded);
builder.append("]");
return builder.toString();
return "GenericDatasetBean [metadataProfileList=" + metadataProfileList + ", formDataEntryFields="
+ formDataEntryFields + ", filesUploaded=" + filesUploaded + "]";
}
}