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:
parent
a0242c2971
commit
5b5b56a612
|
@ -81,7 +81,6 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
|
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
|
||||||
protected ComboBox<LicenceData> comboLicences;
|
protected ComboBox<LicenceData> comboLicences;
|
||||||
|
|
||||||
|
|
||||||
TabResource detail;
|
TabResource detail;
|
||||||
|
|
||||||
public SDMXTableDetailCard(final SDMXImportSession importSession) {
|
public SDMXTableDetailCard(final SDMXImportSession importSession) {
|
||||||
|
@ -191,8 +190,8 @@ public class SDMXTableDetailCard 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);
|
||||||
|
|
||||||
|
@ -320,39 +319,22 @@ public class SDMXTableDetailCard 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.setAgency(agencyName.getCurrentValue());
|
detail.setAgency(agencyName.getCurrentValue());
|
||||||
detail.setDescription(description.getCurrentValue());
|
detail.setDescription(description.getCurrentValue());
|
||||||
detail.setRight(rights.getCurrentValue());
|
detail.setRight(rights.getCurrentValue());
|
||||||
|
|
||||||
Date vFrom = validFrom.getCurrentValue();
|
detail.setValidFrom(validFrom.getCurrentValue());
|
||||||
if (vFrom == null) {
|
detail.setValidUntilTo(validUntilTo.getCurrentValue());
|
||||||
Log.debug("Valid From is null");
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
detail.setValidFrom(sdf.format(vFrom));
|
|
||||||
} catch (Throwable e) {
|
|
||||||
Log.error("Error parsing Valid From "
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Date vUntilTo = validUntilTo.getCurrentValue();
|
if (validFrom.getCurrentValue() != null
|
||||||
if (vUntilTo == null) {
|
&& validUntilTo.getCurrentValue() != null
|
||||||
Log.debug("Valid Until To is null");
|
&& validFrom.getCurrentValue().compareTo(
|
||||||
} else {
|
validUntilTo.getCurrentValue()) > 0) {
|
||||||
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) {
|
||||||
|
@ -364,10 +346,12 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
d.show();
|
d.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (comboLicences.getCurrentValue() != null
|
||||||
if(comboLicences.getCurrentValue()!=null&&
|
&& comboLicences.getCurrentValue().getLicenceId() != null
|
||||||
comboLicences.getCurrentValue().getLicenceId()!=null && !comboLicences.getCurrentValue().getLicenceId().isEmpty()){
|
&& !comboLicences.getCurrentValue().getLicenceId()
|
||||||
detail.setLicence(comboLicences.getCurrentValue().getLicenceId());
|
.isEmpty()) {
|
||||||
|
detail.setLicence(comboLicences.getCurrentValue()
|
||||||
|
.getLicenceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
importSession.setTabResource(detail);
|
importSession.setTabResource(detail);
|
||||||
|
|
Loading…
Reference in New Issue