Fixed TimeZone
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-import-widget@115603 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c3aa19ed66
commit
a5edf9072b
|
@ -176,10 +176,8 @@ public class CSVTableDetailCard extends WizardCard {
|
||||||
Log.trace("Combo Licence created");
|
Log.trace("Combo Licence created");
|
||||||
|
|
||||||
// /
|
// /
|
||||||
p.add(new FieldLabel(comboLicences, "Licence"),
|
p.add(new FieldLabel(comboLicences, "Licence"), new VerticalLayoutData(
|
||||||
new VerticalLayoutData(1, -1));
|
1, -1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tableDetailPanel.add(form);
|
tableDetailPanel.add(form);
|
||||||
|
|
||||||
|
@ -202,7 +200,8 @@ public class CSVTableDetailCard extends WizardCard {
|
||||||
Log.error("load combo failure:"
|
Log.error("load combo failure:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
showErrorAndHide("Error",
|
showErrorAndHide("Error",
|
||||||
"Error retrieving licences.",caught.getLocalizedMessage(),caught);
|
"Error retrieving licences.",
|
||||||
|
caught.getLocalizedMessage(), caught);
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
@ -292,38 +291,20 @@ public class CSVTableDetailCard extends WizardCard {
|
||||||
|
|
||||||
protected void goNext() {
|
protected void goNext() {
|
||||||
try {
|
try {
|
||||||
detail= new TabResource();
|
detail = new TabResource();
|
||||||
detail.setName(name.getCurrentValue());
|
detail.setName(name.getCurrentValue());
|
||||||
detail.setDescription(description.getCurrentValue());
|
detail.setDescription(description.getCurrentValue());
|
||||||
detail.setRight(rights.getCurrentValue());
|
detail.setRight(rights.getCurrentValue());
|
||||||
|
detail.setValidFrom(validFrom.getCurrentValue());
|
||||||
|
detail.setValidUntilTo(validUntilTo.getCurrentValue());
|
||||||
|
|
||||||
Date vFrom = validFrom.getCurrentValue();
|
if (validFrom.getCurrentValue() != null
|
||||||
if (vFrom == null) {
|
&& validUntilTo.getCurrentValue() != null
|
||||||
Log.debug("Valid From is null");
|
&& validFrom.getCurrentValue().compareTo(
|
||||||
} else {
|
validUntilTo.getCurrentValue()) > 0) {
|
||||||
try {
|
|
||||||
detail.setValidFrom(sdf.format(vFrom));
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Log.error("Error parsing Valid From "
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Date vUntilTo = validUntilTo.getCurrentValue();
|
|
||||||
if (vUntilTo == null) {
|
|
||||||
Log.debug("Valid Until To is null");
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
detail.setValidUntilTo(sdf.format(vUntilTo));
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Log.error("Error parsing Valid Until To "
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(vFrom!=null && vUntilTo!=null && vFrom.compareTo(vUntilTo)>0){
|
|
||||||
Log.debug("Attention Valid From field is higher than Valid Until To field");
|
Log.debug("Attention Valid From field is higher than Valid Until To field");
|
||||||
AlertMessageBox d = new AlertMessageBox("Attention!", "Valid From field is higher than Valid Until To field");
|
AlertMessageBox d = new AlertMessageBox("Attention!",
|
||||||
|
"Valid From field is higher than Valid Until To field");
|
||||||
d.addHideHandler(new HideHandler() {
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
|
@ -336,9 +317,12 @@ public class CSVTableDetailCard extends WizardCard {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(comboLicences.getCurrentValue()!=null&&
|
if (comboLicences.getCurrentValue() != null
|
||||||
comboLicences.getCurrentValue().getLicenceId()!=null && !comboLicences.getCurrentValue().getLicenceId().isEmpty()){
|
&& comboLicences.getCurrentValue().getLicenceId() != null
|
||||||
detail.setLicence(comboLicences.getCurrentValue().getLicenceId());
|
&& !comboLicences.getCurrentValue().getLicenceId()
|
||||||
|
.isEmpty()) {
|
||||||
|
detail.setLicence(comboLicences.getCurrentValue()
|
||||||
|
.getLicenceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
importSession.setTabResource(detail);
|
importSession.setTabResource(detail);
|
||||||
|
|
Loading…
Reference in New Issue