Fixed TimeZone

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-import-widget@115610 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-29 12:36:51 +00:00 committed by Giancarlo Panichi
parent a0242c2971
commit 5b5b56a612
1 changed files with 28 additions and 44 deletions

View File

@ -81,7 +81,6 @@ public class SDMXTableDetailCard extends WizardCard {
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
protected ComboBox<LicenceData> comboLicences;
TabResource detail;
public SDMXTableDetailCard(final SDMXImportSession importSession) {
@ -191,8 +190,8 @@ public class SDMXTableDetailCard extends WizardCard {
Log.trace("Combo Licence created");
// /
p.add(new FieldLabel(comboLicences, "Licence"),
new VerticalLayoutData(1, -1));
p.add(new FieldLabel(comboLicences, "Licence"), new VerticalLayoutData(
1, -1));
tableDetailPanel.add(form);
@ -320,39 +319,22 @@ public class SDMXTableDetailCard extends WizardCard {
protected void goNext() {
try {
detail= new TabResource();
detail = new TabResource();
detail.setName(name.getCurrentValue());
detail.setAgency(agencyName.getCurrentValue());
detail.setDescription(description.getCurrentValue());
detail.setRight(rights.getCurrentValue());
Date vFrom = validFrom.getCurrentValue();
if (vFrom == null) {
Log.debug("Valid From is null");
} else {
try {
detail.setValidFrom(sdf.format(vFrom));
} catch (Throwable e) {
Log.error("Error parsing Valid From "
+ e.getLocalizedMessage());
}
}
detail.setValidFrom(validFrom.getCurrentValue());
detail.setValidUntilTo(validUntilTo.getCurrentValue());
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){
if (validFrom.getCurrentValue() != null
&& validUntilTo.getCurrentValue() != null
&& validFrom.getCurrentValue().compareTo(
validUntilTo.getCurrentValue()) > 0) {
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() {
public void onHide(HideEvent event) {
@ -364,10 +346,12 @@ public class SDMXTableDetailCard extends WizardCard {
d.show();
}
if(comboLicences.getCurrentValue()!=null&&
comboLicences.getCurrentValue().getLicenceId()!=null && !comboLicences.getCurrentValue().getLicenceId().isEmpty()){
detail.setLicence(comboLicences.getCurrentValue().getLicenceId());
if (comboLicences.getCurrentValue() != null
&& comboLicences.getCurrentValue().getLicenceId() != null
&& !comboLicences.getCurrentValue().getLicenceId()
.isEmpty()) {
detail.setLicence(comboLicences.getCurrentValue()
.getLicenceId());
}
importSession.setTabResource(detail);