Fixed TimeZone

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@115606 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-06-29 12:36:09 +00:00
parent 268ac70b6a
commit 316cf01f36
1 changed files with 169 additions and 231 deletions

View File

@ -57,19 +57,19 @@ import com.sencha.gxt.widget.core.client.form.TextField;
/** /**
* *
* @author giancarlo * @author giancarlo email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class TabularResourceProperties extends FramedPanel { public class TabularResourceProperties extends FramedPanel {
private static final String DESCRIPTION_FIELD_HEIGHT = "70px"; private static final String DESCRIPTION_FIELD_HEIGHT = "70px";
private static final DateTimeFormat sdf = DateTimeFormat
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd"); .getFormat("yyyy-MM-dd HH:mm");
private TabularResourcePropertiesMessages msgs; private TabularResourcePropertiesMessages msgs;
private EventBus eventBus; private EventBus eventBus;
private TRId trId; private TRId trId;
private TabResource tabResource; private TabResource tabResource;
private TextField nameField; private TextField nameField;
private TextArea descriptionField; private TextArea descriptionField;
@ -81,7 +81,7 @@ public class TabularResourceProperties extends FramedPanel {
private TextField ownerField; private TextField ownerField;
private CheckBox validField; private CheckBox validField;
private CheckBox finalizedField; private CheckBox finalizedField;
private ComboBox<LicenceData> comboLicences; private ComboBox<LicenceData> comboLicences;
private ListStore<LicenceData> storeCombo; private ListStore<LicenceData> storeCombo;
@ -94,12 +94,10 @@ public class TabularResourceProperties extends FramedPanel {
private VerticalLayoutContainer layoutTabularResource; private VerticalLayoutContainer layoutTabularResource;
private TextButton saveButton; private TextButton saveButton;
//private TextButton validationsButton; // private TextButton validationsButton;
//private TextButton resourcesButton; // private TextButton resourcesButton;
private ArrayList<LicenceData> licencesList;
private ArrayList<LicenceData> licencesList;
public TabularResourceProperties(String name, EventBus eventBus) { public TabularResourceProperties(String name, EventBus eventBus) {
super(); super();
@ -107,84 +105,81 @@ public class TabularResourceProperties extends FramedPanel {
this.eventBus = eventBus; this.eventBus = eventBus;
this.msgs = GWT.create(TabularResourcePropertiesMessages.class); this.msgs = GWT.create(TabularResourcePropertiesMessages.class);
forceLayoutOnResize = true; forceLayoutOnResize = true;
retrieveLicencesList(); retrieveLicencesList();
} }
public void addTabularResource() { public void addTabularResource() {
layoutTabularResource = new VerticalLayoutContainer(); layoutTabularResource = new VerticalLayoutContainer();
layoutTabularResource.setScrollMode(ScrollMode.AUTOY); layoutTabularResource.setScrollMode(ScrollMode.AUTOY);
layoutTabularResource.setAdjustForScroll(true); layoutTabularResource.setAdjustForScroll(true);
nameField = new TextField(); nameField = new TextField();
nameField.setValue(""); nameField.setValue("");
FieldLabel nameLabel=new FieldLabel(nameField, msgs.nameLabel()); FieldLabel nameLabel = new FieldLabel(nameField, msgs.nameLabel());
nameLabel.setToolTip(msgs.nameLabelToolTip()); nameLabel.setToolTip(msgs.nameLabelToolTip());
layoutTabularResource.add(nameLabel, layoutTabularResource.add(nameLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
descriptionField = new TextArea(); descriptionField = new TextArea();
descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT); descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT);
descriptionField.setValue(""); descriptionField.setValue("");
FieldLabel descriptionLabel=new FieldLabel(descriptionField, FieldLabel descriptionLabel = new FieldLabel(descriptionField,
msgs.descriptionLabel()); msgs.descriptionLabel());
descriptionLabel.setToolTip(msgs.descriptionLabelToolTip()); descriptionLabel.setToolTip(msgs.descriptionLabelToolTip());
layoutTabularResource.add(descriptionLabel, new VerticalLayoutData(1, -1)); layoutTabularResource.add(descriptionLabel, new VerticalLayoutData(1,
-1));
typeField = new TextField(); typeField = new TextField();
typeField.setReadOnly(true); typeField.setReadOnly(true);
typeField.setValue(""); typeField.setValue("");
FieldLabel typeLabel= new FieldLabel(typeField, msgs.typeLabel()); FieldLabel typeLabel = new FieldLabel(typeField, msgs.typeLabel());
typeLabel.setToolTip(msgs.typeLabelToolTip()); typeLabel.setToolTip(msgs.typeLabelToolTip());
layoutTabularResource.add(typeLabel,
new VerticalLayoutData(1, -1));
layoutTabularResource.add(typeLabel, new VerticalLayoutData(1, -1));
agencyField = new TextField(); agencyField = new TextField();
agencyField.setValue(""); agencyField.setValue("");
FieldLabel agencyLabel=new FieldLabel(agencyField, msgs.agencyLabel()); FieldLabel agencyLabel = new FieldLabel(agencyField, msgs.agencyLabel());
agencyLabel.setToolTip(msgs.agencyLabelToolTip()); agencyLabel.setToolTip(msgs.agencyLabelToolTip());
layoutTabularResource.add(agencyLabel, layoutTabularResource.add(agencyLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
dateField = new TextField(); dateField = new TextField();
dateField.setReadOnly(true); dateField.setReadOnly(true);
dateField.setValue(""); dateField.setValue("");
FieldLabel dateLabel= new FieldLabel(dateField, msgs.dateLabel()); FieldLabel dateLabel = new FieldLabel(dateField, msgs.dateLabel());
dateLabel.setToolTip(msgs.dateLabelToolTip()); dateLabel.setToolTip(msgs.dateLabelToolTip());
layoutTabularResource.add(dateLabel, layoutTabularResource.add(dateLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
tableTypeNameField = new TextField(); tableTypeNameField = new TextField();
tableTypeNameField.setReadOnly(true); tableTypeNameField.setReadOnly(true);
tableTypeNameField.setValue(""); tableTypeNameField.setValue("");
FieldLabel tableTypeNameLabel=new FieldLabel(tableTypeNameField, msgs.tableTypeNameLabel()); FieldLabel tableTypeNameLabel = new FieldLabel(tableTypeNameField,
msgs.tableTypeNameLabel());
tableTypeNameLabel.setToolTip(msgs.tableTypeNameLabelToolTip()); tableTypeNameLabel.setToolTip(msgs.tableTypeNameLabelToolTip());
layoutTabularResource.add(tableTypeNameLabel, layoutTabularResource.add(tableTypeNameLabel, new VerticalLayoutData(1,
new VerticalLayoutData(1, -1)); -1));
rightField = new TextArea(); rightField = new TextArea();
rightField.setValue(""); rightField.setValue("");
FieldLabel rightLabel=new FieldLabel(rightField, msgs.rightLabel()); FieldLabel rightLabel = new FieldLabel(rightField, msgs.rightLabel());
rightLabel.setToolTip(msgs.rightLabelToolTip()); rightLabel.setToolTip(msgs.rightLabelToolTip());
layoutTabularResource.add(rightLabel, layoutTabularResource.add(rightLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
validFromField = new DateField(); validFromField = new DateField();
FieldLabel validFromLabel=new FieldLabel(validFromField, msgs.validFromLabel()); FieldLabel validFromLabel = new FieldLabel(validFromField,
msgs.validFromLabel());
validFromLabel.setToolTip(msgs.validFromLabelToolTip()); validFromLabel.setToolTip(msgs.validFromLabelToolTip());
layoutTabularResource.add(validFromLabel, layoutTabularResource
new VerticalLayoutData(1, -1)); .add(validFromLabel, new VerticalLayoutData(1, -1));
validUntilToField = new DateField(); validUntilToField = new DateField();
FieldLabel validUntilToLabel= new FieldLabel(validUntilToField, FieldLabel validUntilToLabel = new FieldLabel(validUntilToField,
msgs.validUntilToLabel()); msgs.validUntilToLabel());
validUntilToLabel.setToolTip(msgs.validUntilToLabelToolTip()); validUntilToLabel.setToolTip(msgs.validUntilToLabelToolTip());
layoutTabularResource.add(validUntilToLabel, new VerticalLayoutData(1, -1)); layoutTabularResource.add(validUntilToLabel, new VerticalLayoutData(1,
-1));
// Combo Licences // Combo Licences
LicenceDataPropertiesCombo propsLicenceData = GWT LicenceDataPropertiesCombo propsLicenceData = GWT
@ -200,19 +195,18 @@ public class TabularResourceProperties extends FramedPanel {
comboLicences.setTriggerAction(TriggerAction.ALL); comboLicences.setTriggerAction(TriggerAction.ALL);
Log.trace("Combo Licence created"); Log.trace("Combo Licence created");
FieldLabel licencesLabel=new FieldLabel(comboLicences, msgs.licencesLabel()); FieldLabel licencesLabel = new FieldLabel(comboLicences,
msgs.licencesLabel());
licencesLabel.setToolTip(msgs.licencesLabelToolTip()); licencesLabel.setToolTip(msgs.licencesLabelToolTip());
layoutTabularResource.add(licencesLabel, layoutTabularResource.add(licencesLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
// / // /
ownerField = new TextField(); ownerField = new TextField();
ownerField.setReadOnly(true); ownerField.setReadOnly(true);
ownerField.setValue(""); ownerField.setValue("");
FieldLabel ownerLabel=new FieldLabel(ownerField, msgs.ownerLabel()); FieldLabel ownerLabel = new FieldLabel(ownerField, msgs.ownerLabel());
ownerLabel.setToolTip(msgs.ownerLabelToolTip()); ownerLabel.setToolTip(msgs.ownerLabelToolTip());
layoutTabularResource.add(ownerLabel, layoutTabularResource.add(ownerLabel, new VerticalLayoutData(1, -1));
new VerticalLayoutData(1, -1));
btnShare = new IconButton(); btnShare = new IconButton();
btnShare.setIcon(ResourceBundle.INSTANCE.share()); btnShare.setIcon(ResourceBundle.INSTANCE.share());
@ -234,10 +228,10 @@ public class TabularResourceProperties extends FramedPanel {
validField.setValue(false); validField.setValue(false);
validField.setReadOnly(true); validField.setReadOnly(true);
validField.setEnabled(false); validField.setEnabled(false);
FieldLabel validLabel=new FieldLabel(validField, msgs.validLabel()); FieldLabel validLabel = new FieldLabel(validField, msgs.validLabel());
validLabel.setToolTip(msgs.validLabelToolTip()); validLabel.setToolTip(msgs.validLabelToolTip());
layoutTabularResource.add(validLabel, layoutTabularResource.add(validLabel, new VerticalLayoutData(1, -1,
new VerticalLayoutData(1, -1, new Margins(0))); new Margins(0)));
finalizedField = new CheckBox(); finalizedField = new CheckBox();
finalizedField.setValue(false); finalizedField.setValue(false);
@ -252,11 +246,12 @@ public class TabularResourceProperties extends FramedPanel {
} }
} }
}); });
FieldLabel finalizedLabel=new FieldLabel(finalizedField, msgs.finalizedLabel()); FieldLabel finalizedLabel = new FieldLabel(finalizedField,
msgs.finalizedLabel());
finalizedLabel.setToolTip(msgs.finalizedLabelToolTip()); finalizedLabel.setToolTip(msgs.finalizedLabelToolTip());
layoutTabularResource.add(finalizedLabel, layoutTabularResource.add(finalizedLabel, new VerticalLayoutData(1, -1,
new VerticalLayoutData(1, -1, new Margins(0))); new Margins(0)));
// Save Button // Save Button
saveButton = new TextButton(msgs.saveButton()); saveButton = new TextButton(msgs.saveButton());
@ -273,50 +268,45 @@ public class TabularResourceProperties extends FramedPanel {
saveButton.addSelectHandler(saveHandler); saveButton.addSelectHandler(saveHandler);
// Validation Button // Validation Button
/*validationsButton = new TextButton(msgs.validationsButton()); /*
validationsButton.setIcon(ResourceBundle.INSTANCE.tableValidation()); * validationsButton = new TextButton(msgs.validationsButton());
validationsButton.setIconAlign(IconAlign.RIGHT); * validationsButton.setIcon(ResourceBundle.INSTANCE.tableValidation());
validationsButton.setToolTip(msgs.validationsButtonToolTip()); * validationsButton.setIconAlign(IconAlign.RIGHT);
* validationsButton.setToolTip(msgs.validationsButtonToolTip());
*
* SelectHandler validationsHandler = new SelectHandler() {
*
* public void onSelect(SelectEvent event) { openValidations();
*
* } }; validationsButton.addSelectHandler(validationsHandler);
*/
SelectHandler validationsHandler = new SelectHandler() {
public void onSelect(SelectEvent event) {
openValidations();
}
};
validationsButton.addSelectHandler(validationsHandler);
*/
// Resources Button // Resources Button
/*resourcesButton = new TextButton(msgs.resourcesButton()); /*
resourcesButton.setIcon(ResourceBundle.INSTANCE.resources()); * resourcesButton = new TextButton(msgs.resourcesButton());
resourcesButton.setIconAlign(IconAlign.RIGHT); * resourcesButton.setIcon(ResourceBundle.INSTANCE.resources());
resourcesButton.setToolTip(msgs.resourcesButtonToolTip()); * resourcesButton.setIconAlign(IconAlign.RIGHT);
* resourcesButton.setToolTip(msgs.resourcesButtonToolTip());
*
* SelectHandler resourcesHandler = new SelectHandler() {
*
* public void onSelect(SelectEvent event) { openResources();
*
* } }; resourcesButton.addSelectHandler(resourcesHandler);
*/
SelectHandler resourcesHandler = new SelectHandler() {
public void onSelect(SelectEvent event) {
openResources();
}
};
resourcesButton.addSelectHandler(resourcesHandler);*/
// //
HBoxLayoutContainer hBox = new HBoxLayoutContainer(); HBoxLayoutContainer hBox = new HBoxLayoutContainer();
hBox.setPack(BoxLayoutPack.START); hBox.setPack(BoxLayoutPack.START);
hBox.add(saveButton, new BoxLayoutData(new Margins(2, 5, 2, 5))); hBox.add(saveButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
//hBox.add(validationsButton, new BoxLayoutData(new Margins(2, 5, 2, 5))); // hBox.add(validationsButton, new BoxLayoutData(new Margins(2, 5, 2,
//hBox.add(resourcesButton, new BoxLayoutData(new Margins(2, 5, 2, 5))); // 5)));
// hBox.add(resourcesButton, new BoxLayoutData(new Margins(2, 5, 2,
// 5)));
layoutTabularResource.add(hBox, new VerticalLayoutData(1, -1, layoutTabularResource.add(hBox, new VerticalLayoutData(1, -1,
new Margins(2))); new Margins(2)));
add(layoutTabularResource); add(layoutTabularResource);
} }
@ -354,40 +344,28 @@ public class TabularResourceProperties extends FramedPanel {
descriptionField.setValue(tabResource.getDescription()); descriptionField.setValue(tabResource.getDescription());
typeField.setValue(tabResource.getTabResourceType()); typeField.setValue(tabResource.getTabResourceType());
agencyField.setValue(tabResource.getAgency()); agencyField.setValue(tabResource.getAgency());
dateField.setValue(tabResource.getDate()); try {
dateField.setValue(sdf.format(tabResource.getDate()));
} catch (Throwable e) {
Log.error("Error parsing cration date: " + e.getLocalizedMessage());
}
tableTypeNameField.setValue(tabResource.getTableTypeName()); tableTypeNameField.setValue(tabResource.getTableTypeName());
rightField.setValue(tabResource.getRight()); rightField.setValue(tabResource.getRight());
validFromField.clear(); validFromField.clear();
if (tabResource.getValidFrom() == null if (tabResource.getValidFrom() == null) {
|| tabResource.getValidFrom().isEmpty()) {
Log.debug("ValidFrom null or empty"); Log.debug("ValidFrom null or empty");
} else { } else {
Date vFrom; validFromField.setValue(tabResource.getValidFrom());
try {
vFrom = sdf.parse(tabResource.getValidFrom());
validFromField.setValue(vFrom);
} catch (IllegalArgumentException e) {
Log.error("Error Parsing Valid From for Tabular Resource: "
+ tabResource);
e.printStackTrace();
}
} }
validUntilToField.clear(); validUntilToField.clear();
if (tabResource.getValidUntilTo() == null if (tabResource.getValidUntilTo() == null) {
|| tabResource.getValidUntilTo().isEmpty()) {
Log.debug("ValidUntilTo null or empty"); Log.debug("ValidUntilTo null or empty");
} else { } else {
Date vUntilTo; validUntilToField.setValue(tabResource.getValidUntilTo());
try {
vUntilTo = sdf.parse(tabResource.getValidUntilTo());
validUntilToField.setValue(vUntilTo);
} catch (IllegalArgumentException e) {
Log.error("Error Parsing Valid Until To for Tabular Resource: "
+ tabResource);
e.printStackTrace();
}
} }
comboLicences.clear(); comboLicences.clear();
@ -426,78 +404,56 @@ public class TabularResourceProperties extends FramedPanel {
finalizedField.setValue(false); finalizedField.setValue(false);
saveButton.setEnabled(true); saveButton.setEnabled(true);
} }
ArrayList<Contacts> contacts = tabResource.getContacts(); ArrayList<Contacts> contacts = tabResource.getContacts();
if (contacts != null && contacts.size() > 0) { if (contacts != null && contacts.size() > 0) {
shareLabel.setVisible(true); shareLabel.setVisible(true);
} else { } else {
shareLabel.setVisible(false); shareLabel.setVisible(false);
} }
} }
/*
protected void updateShareInfo(ShareInfo result) {
ArrayList<Contacts> contacts = result.getContacts();
if (contacts != null && contacts.size() > 0) {
shareLabel.setVisible(true);
} else {
shareLabel.setVisible(false);
}
}*/
/* /*
public void addTable() { * protected void updateShareInfo(ShareInfo result) { ArrayList<Contacts>
tableFieldSet = new FieldSet(); * contacts = result.getContacts(); if (contacts != null && contacts.size()
tableFieldSet.setHeadingText("Table"); * > 0) { shareLabel.setVisible(true); } else {
tableFieldSet.setCollapsible(true); * shareLabel.setVisible(false); } }
tableFieldSet.setResize(true); */
layoutTable = new VerticalLayoutContainer();
tableFieldSet.add(layoutTable);
tableTypeDefField = new TextField();
tableTypeDefField.setReadOnly(true);
tableTypeDefField.setValue("");
layoutTable.add(new FieldLabel(tableTypeDefField, "Type"),
new VerticalLayoutData(1, -1));
vl.add(tableFieldSet);
}*/
/* /*
protected void openValidations() { * public void addTable() { tableFieldSet = new FieldSet();
Log.debug("Request Validations Tab"); * tableFieldSet.setHeadingText("Table");
if (trId != null) { * tableFieldSet.setCollapsible(true); tableFieldSet.setResize(true);
WidgetRequestEvent e = new WidgetRequestEvent( *
WidgetRequestType.VALIDATIONSTASKSPANEL); * layoutTable = new VerticalLayoutContainer();
e.setTrId(trId); *
eventBus.fireEvent(e); * tableFieldSet.add(layoutTable);
} else { *
Log.error("TRId is null"); * tableTypeDefField = new TextField(); tableTypeDefField.setReadOnly(true);
} * tableTypeDefField.setValue(""); layoutTable.add(new
} * FieldLabel(tableTypeDefField, "Type"), new VerticalLayoutData(1, -1));
*/ *
* vl.add(tableFieldSet); }
*/
/* /*
protected void openResources() { * protected void openValidations() { Log.debug("Request Validations Tab");
Log.debug("Request Resources Tab"); * if (trId != null) { WidgetRequestEvent e = new WidgetRequestEvent(
if (trId != null) { * WidgetRequestType.VALIDATIONSTASKSPANEL); e.setTrId(trId);
WidgetRequestEvent e = new WidgetRequestEvent( * eventBus.fireEvent(e); } else { Log.error("TRId is null"); } }
WidgetRequestType.RESOURCESPANEL); */
e.setTrId(trId);
eventBus.fireEvent(e); /*
} else { * protected void openResources() { Log.debug("Request Resources Tab"); if
Log.error("TRId is null"); * (trId != null) { WidgetRequestEvent e = new WidgetRequestEvent(
} * WidgetRequestType.RESOURCESPANEL); e.setTrId(trId);
} * eventBus.fireEvent(e); } else { Log.error("TRId is null"); } }
*/ */
protected void updateTable(TableData tableData) { protected void updateTable(TableData tableData) {
trId = tableData.getTrId(); trId = tableData.getTrId();
Log.debug("New :"+trId); Log.debug("New :" + trId);
forceLayout(); forceLayout();
} }
@ -530,40 +486,31 @@ public class TabularResourceProperties extends FramedPanel {
}); });
} }
/* /*
protected void getShareInformation(TRId trId) { * protected void getShareInformation(TRId trId) {
TDGWTServiceAsync.INSTANCE.getShareInfo(trId, * TDGWTServiceAsync.INSTANCE.getShareInfo(trId, new
new AsyncCallback<ShareInfo>() { * AsyncCallback<ShareInfo>() {
*
public void onSuccess(ShareInfo result) { * public void onSuccess(ShareInfo result) {
Log.debug("Retrived share info:" + result); * Log.debug("Retrived share info:" + result); updateShareInfo(result);
updateShareInfo(result); * getLastTable(tabResource.getTrId());
getLastTable(tabResource.getTrId()); *
* }
} *
* public void onFailure(Throwable caught) { if (caught instanceof
public void onFailure(Throwable caught) { * TDGWTSessionExpiredException) { eventBus.fireEvent(new
if (caught instanceof TDGWTSessionExpiredException) { * SessionExpiredEvent( SessionExpiredType.EXPIREDONSERVER)); } else { if
eventBus.fireEvent(new SessionExpiredEvent( * (caught instanceof TDGWTIsLockedException) {
SessionExpiredType.EXPIREDONSERVER)); * Log.error(caught.getLocalizedMessage()); UtilsGXT3.alert("Error Locked",
} else { * caught.getLocalizedMessage()); } else {
if (caught instanceof TDGWTIsLockedException) { * Log.error("Error retrienving Share Informations: " +
Log.error(caught.getLocalizedMessage()); * caught.getLocalizedMessage()); UtilsGXT3.alert("Error",
UtilsGXT3.alert("Error Locked", * "Error retrienving Share Informations: " + caught.getLocalizedMessage());
caught.getLocalizedMessage()); * } } }
} else { *
Log.error("Error retrienving Share Informations: " * }); }
+ caught.getLocalizedMessage()); */
UtilsGXT3.alert("Error",
"Error retrienving Share Informations: "
+ caught.getLocalizedMessage());
}
}
}
});
}*/
protected void getLastTable(TRId trId) { protected void getLastTable(TRId trId) {
TDGWTServiceAsync.INSTANCE.getLastTable(trId, TDGWTServiceAsync.INSTANCE.getLastTable(trId,
@ -618,40 +565,28 @@ public class TabularResourceProperties extends FramedPanel {
if (vFrom == null) { if (vFrom == null) {
Log.debug("No valid from set"); Log.debug("No valid from set");
} else { } else {
try { tabResource.setValidFrom(vFrom);
String vFr = sdf.format(vFrom);
tabResource.setValidFrom(vFr);
} catch (Throwable e) {
Log.error("No valid from field: " + vFrom);
e.printStackTrace();
}
} }
Date vUntilTo = validUntilToField.getValue(); Date vUntilTo = validUntilToField.getValue();
if (vUntilTo == null) { if (vUntilTo == null) {
Log.debug("No valid until to set"); Log.debug("No valid until to set");
} else { } else {
try { tabResource.setValidUntilTo(vUntilTo);
String vUTo = sdf.format(vUntilTo);
tabResource.setValidUntilTo(vUTo);
} catch (Throwable e) {
Log.error("No valid until to field: " + vUntilTo);
e.printStackTrace();
}
} }
if(vFrom!=null && vUntilTo!=null && vFrom.compareTo(vUntilTo)>0){ 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");
UtilsGXT3.info("Attention", "Valid From field is higher than Valid Until To field"); UtilsGXT3.info("Attention",
"Valid From field is higher than Valid Until To field");
return; return;
} }
if (comboLicences.getCurrentValue() != null if (comboLicences.getCurrentValue() != null
&& comboLicences.getCurrentValue().getLicenceId() != null && comboLicences.getCurrentValue().getLicenceId() != null
&& !comboLicences.getCurrentValue().getLicenceId().isEmpty()) { && !comboLicences.getCurrentValue().getLicenceId().isEmpty()) {
tabResource tabResource.setLicence(comboLicences.getCurrentValue()
.setLicence(comboLicences.getCurrentValue().getLicenceId()); .getLicenceId());
} }
tabResource.setValid(validField.getValue()); tabResource.setValid(validField.getValue());
@ -700,10 +635,13 @@ public class TabularResourceProperties extends FramedPanel {
finalizedField.setValue(false); finalizedField.setValue(false);
saveButton.setEnabled(true); saveButton.setEnabled(true);
} }
DataViewRequestEvent dataViewRequestEvent=new DataViewRequestEvent(); DataViewRequestEvent dataViewRequestEvent = new DataViewRequestEvent();
TabularResourceDataView tabularResouceDataView=new TabularResourceDataView(tabResource.getTrId(),tabResource.getName()); TabularResourceDataView tabularResouceDataView = new TabularResourceDataView(
dataViewRequestEvent.setDataView(tabularResouceDataView); tabResource.getTrId(), tabResource.getName());
dataViewRequestEvent.setDataViewRequestType(DataViewRequestType.UPDATE_TAB_NAME); dataViewRequestEvent
.setDataView(tabularResouceDataView);
dataViewRequestEvent
.setDataViewRequestType(DataViewRequestType.UPDATE_TAB_NAME);
eventBus.fireEvent(dataViewRequestEvent); eventBus.fireEvent(dataViewRequestEvent);
} }