Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@92909 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-10 17:48:24 +00:00
parent 5813edcb0f
commit 14e0a7e90e
1 changed files with 34 additions and 14 deletions

View File

@ -78,19 +78,19 @@ public class TabularResourceProperties extends FramedPanel {
trFieldSet.add(layoutTabularResource); trFieldSet.add(layoutTabularResource);
nameField = new TextField(); nameField = new TextField();
nameField.setReadOnly(true); //nameField.setReadOnly(true);
nameField.setValue(""); nameField.setValue("");
layoutTabularResource.add(new FieldLabel(nameField, "Name"), layoutTabularResource.add(new FieldLabel(nameField, "Name"),
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
descriptionField = new TextArea(); descriptionField = new TextArea();
descriptionField.setReadOnly(true); //descriptionField.setReadOnly(true);
descriptionField.setValue(""); descriptionField.setValue("");
layoutTabularResource.add(new FieldLabel(descriptionField, layoutTabularResource.add(new FieldLabel(descriptionField,
"Description"), new VerticalLayoutData(1, -1)); "Description"), new VerticalLayoutData(1, -1));
agencyField = new TextField(); agencyField = new TextField();
agencyField.setReadOnly(true); //agencyField.setReadOnly(true);
agencyField.setValue(""); agencyField.setValue("");
layoutTabularResource.add(new FieldLabel(agencyField, "Agency"), layoutTabularResource.add(new FieldLabel(agencyField, "Agency"),
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
@ -102,7 +102,7 @@ public class TabularResourceProperties extends FramedPanel {
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
rightField = new TextArea(); rightField = new TextArea();
rightField.setReadOnly(true); //rightField.setReadOnly(true);
rightField.setValue(""); rightField.setValue("");
layoutTabularResource.add(new FieldLabel(rightField, "Rights"), layoutTabularResource.add(new FieldLabel(rightField, "Rights"),
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
@ -234,29 +234,49 @@ public class TabularResourceProperties extends FramedPanel {
protected void onSave(){ protected void onSave(){
if(nameField.getValue()==null || nameField.getValue().isEmpty() ){
alert("Attention","Fill name field");
return;
}
if(descriptionField.getValue()==null || descriptionField.getValue().isEmpty() ){
alert("Attention","Fill description field");
return;
}
if(rightField.getValue()==null || rightField.getValue().isEmpty() ){
alert("Attention","Fill rights field");
return;
}
tabResource.setName(nameField.getValue());
tabResource.setDescription(descriptionField.getValue());
tabResource.setAgency(agencyField.getValue());
tabResource.setRight(rightField.getValue());
/*TDGWTServiceAsync.INSTANCE.setTabResourceInfo(tabResource, TDGWTServiceAsync.INSTANCE.setTabResourceInformation(tabResource,
new AsyncCallback<Void>() { new AsyncCallback<Void>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
Log.debug("Share Error: " Log.debug("Error Setting Tabular Resoruce Properties: "
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
alert("Error sharing tabular resource", alert("Error",
"Error shareing tabular resource"); "Error setting tabular resource properties");
} }
public void onSuccess(Void result) { public void onSuccess(Void result) {
Log.debug("Tabular Resource Shared: " Log.debug("Tabular Resource properties are set: "
+ shareInfo.getTabResource().getTrId() + tabResource);
.toString()); info("Proprerties",
info("Shared", "Tabular Resource properties are set");
"Tabular Resource is shared");
} }
}); });
*/
} }
private void alert(String title, String message) { private void alert(String title, String message) {