Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@111555 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8cfc066088
commit
84ec439a3c
|
@ -2,7 +2,6 @@ package org.gcube.portlets.user.td.informationwidget.client;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
@ -17,8 +16,6 @@ import org.gcube.portlets.user.td.informationwidget.client.custom.IconButton;
|
||||||
import org.gcube.portlets.user.td.informationwidget.client.licence.LicenceDataPropertiesCombo;
|
import org.gcube.portlets.user.td.informationwidget.client.licence.LicenceDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.informationwidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.informationwidget.client.resources.ResourceBundle;
|
||||||
import org.gcube.portlets.user.td.informationwidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.informationwidget.client.util.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.td.metadatawidget.client.TRMetadataAccordionPanel;
|
|
||||||
import org.gcube.portlets.user.td.metadatawidget.client.TableMetadataAccordionPanel;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.DataViewRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.DataViewRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
@ -44,9 +41,6 @@ import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.data.shared.ListStore;
|
import com.sencha.gxt.data.shared.ListStore;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoader;
|
|
||||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||||
|
@ -71,51 +65,40 @@ import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
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 String LISTVIEWWIDTH="250px";
|
|
||||||
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
protected String headingTitle;
|
private EventBus eventBus;
|
||||||
protected HashMap<String, String> tabularResourcePropertiesMap;
|
private TRId trId;
|
||||||
//protected VerticalLayoutContainer vl;
|
|
||||||
protected EventBus eventBus;
|
|
||||||
protected TRId trId;
|
|
||||||
|
|
||||||
//protected FieldSet trFieldSet;
|
|
||||||
//protected FieldSet tableFieldSet;
|
|
||||||
|
|
||||||
protected TabResource tabResource;
|
|
||||||
protected TextField nameField;
|
|
||||||
protected TextArea descriptionField;
|
|
||||||
protected TextField agencyField;
|
|
||||||
protected TextField dateField;
|
|
||||||
protected TextArea rightField;
|
|
||||||
protected DateField validFromField;
|
|
||||||
protected DateField validUntilToField;
|
|
||||||
protected TextField ownerField;
|
|
||||||
protected CheckBox validField;
|
|
||||||
protected CheckBox finalizedField;
|
|
||||||
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
|
|
||||||
protected ComboBox<LicenceData> comboLicences;
|
|
||||||
protected ListStore<LicenceData> storeCombo;
|
|
||||||
|
|
||||||
protected TextField typeField;
|
|
||||||
protected TextField tableTypeNameField;
|
|
||||||
|
|
||||||
protected IconButton btnShare;
|
|
||||||
protected FieldLabel shareLabel;
|
|
||||||
|
|
||||||
protected TRMetadataAccordionPanel trMetadataPanel;
|
|
||||||
protected VerticalLayoutContainer layoutTabularResource;
|
|
||||||
|
|
||||||
protected TextField tableTypeDefField;
|
|
||||||
protected TableMetadataAccordionPanel tableMetadataPanel;
|
|
||||||
protected VerticalLayoutContainer layoutTable;
|
|
||||||
protected TextButton saveButton;
|
|
||||||
protected TextButton validationsButton;
|
|
||||||
protected TextButton resourcesButton;
|
|
||||||
|
|
||||||
protected ArrayList<LicenceData> licencesList;
|
private TabResource tabResource;
|
||||||
|
private TextField nameField;
|
||||||
|
private TextArea descriptionField;
|
||||||
|
private TextField agencyField;
|
||||||
|
private TextField dateField;
|
||||||
|
private TextArea rightField;
|
||||||
|
private DateField validFromField;
|
||||||
|
private DateField validUntilToField;
|
||||||
|
private TextField ownerField;
|
||||||
|
private CheckBox validField;
|
||||||
|
private CheckBox finalizedField;
|
||||||
|
|
||||||
|
private ComboBox<LicenceData> comboLicences;
|
||||||
|
private ListStore<LicenceData> storeCombo;
|
||||||
|
|
||||||
|
private TextField typeField;
|
||||||
|
private TextField tableTypeNameField;
|
||||||
|
|
||||||
|
private IconButton btnShare;
|
||||||
|
private FieldLabel shareLabel;
|
||||||
|
|
||||||
|
private VerticalLayoutContainer layoutTabularResource;
|
||||||
|
|
||||||
|
private TextButton saveButton;
|
||||||
|
private TextButton validationsButton;
|
||||||
|
private TextButton resourcesButton;
|
||||||
|
|
||||||
|
private ArrayList<LicenceData> licencesList;
|
||||||
|
|
||||||
public TabularResourceProperties(String name, EventBus eventBus) {
|
public TabularResourceProperties(String name, EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
|
@ -128,29 +111,17 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTabularResource() {
|
public void addTabularResource() {
|
||||||
//vl = new VerticalLayoutContainer();
|
|
||||||
//vl.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1
|
|
||||||
//vl.setAdjustForScroll(true);
|
|
||||||
|
|
||||||
//trFieldSet = new FieldSet();
|
|
||||||
//trFieldSet.setHeadingText("Tabular Resource");
|
|
||||||
//trFieldSet.setCollapsible(true);
|
|
||||||
//trFieldSet.setResize(true);
|
|
||||||
|
|
||||||
layoutTabularResource = new VerticalLayoutContainer();
|
layoutTabularResource = new VerticalLayoutContainer();
|
||||||
layoutTabularResource.setScrollMode(ScrollMode.AUTOY);
|
layoutTabularResource.setScrollMode(ScrollMode.AUTOY);
|
||||||
layoutTabularResource.setAdjustForScroll(true);
|
layoutTabularResource.setAdjustForScroll(true);
|
||||||
//trFieldSet.add(layoutTabularResource);
|
|
||||||
|
|
||||||
nameField = new TextField();
|
nameField = new TextField();
|
||||||
// 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.setHeight(DESCRIPTION_FIELD_HEIGHT);
|
descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT);
|
||||||
// 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));
|
||||||
|
@ -163,7 +134,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
|
|
||||||
|
|
||||||
agencyField = new TextField();
|
agencyField = new TextField();
|
||||||
// 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));
|
||||||
|
@ -181,7 +151,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
new VerticalLayoutData(1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
rightField = new TextArea();
|
rightField = new TextArea();
|
||||||
// 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));
|
||||||
|
@ -194,7 +163,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
layoutTabularResource.add(new FieldLabel(validUntilToField,
|
layoutTabularResource.add(new FieldLabel(validUntilToField,
|
||||||
"Valid Until To"), new VerticalLayoutData(1, -1));
|
"Valid Until To"), new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
// //
|
|
||||||
// Combo Licences
|
// Combo Licences
|
||||||
LicenceDataPropertiesCombo propsLicenceData = GWT
|
LicenceDataPropertiesCombo propsLicenceData = GWT
|
||||||
.create(LicenceDataPropertiesCombo.class);
|
.create(LicenceDataPropertiesCombo.class);
|
||||||
|
@ -210,7 +178,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
|
|
||||||
Log.trace("Combo Licence created");
|
Log.trace("Combo Licence created");
|
||||||
|
|
||||||
// /
|
|
||||||
layoutTabularResource.add(new FieldLabel(comboLicences, "Licence"),
|
layoutTabularResource.add(new FieldLabel(comboLicences, "Licence"),
|
||||||
new VerticalLayoutData(1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
// /
|
// /
|
||||||
|
@ -242,7 +209,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
new VerticalLayoutData(1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
finalizedField = new CheckBox();
|
finalizedField = new CheckBox();
|
||||||
// finalizedField.setBoxLabel("");
|
|
||||||
finalizedField.setValue(false);
|
finalizedField.setValue(false);
|
||||||
finalizedField.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
finalizedField.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||||
|
|
||||||
|
@ -314,8 +280,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//vl.add(trFieldSet, new VerticalLayoutData(1, -1,
|
|
||||||
// new Margins(0)));
|
|
||||||
add(layoutTabularResource);
|
add(layoutTabularResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,17 +454,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
|
|
||||||
protected void updateTable(TableData tableData) {
|
protected void updateTable(TableData tableData) {
|
||||||
trId = tableData.getTrId();
|
trId = tableData.getTrId();
|
||||||
/*
|
|
||||||
* tableTypeNameField.setValue(tableData.getTypeName()); if
|
|
||||||
* (tableMetadataPanel != null) { tableFieldSet.remove(layoutTable);
|
|
||||||
* layoutTable.remove(tableMetadataPanel); }
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* tableMetadataPanel = new TableMetadataAccordionPanel(
|
|
||||||
* "TableInformation", trId, eventBus);
|
|
||||||
* layoutTable.add(tableMetadataPanel, new VerticalLayoutData(-1, -1));
|
|
||||||
* tableFieldSet.add(layoutTable);
|
|
||||||
*/
|
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +465,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
Log.info("Retrived TR: " + result.getTrId());
|
Log.info("Retrived TR: " + result.getTrId());
|
||||||
updateTabularResource(result);
|
updateTabularResource(result);
|
||||||
getLastTable(tabResource.getTrId());
|
getLastTable(tabResource.getTrId());
|
||||||
//getShareInformation(result.getTrId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -527,9 +479,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
} else {
|
} else {
|
||||||
Log.error("Error retrienving properties: "
|
Log.error("Error retrienving properties: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
/*UtilsGXT3.alert("Error",
|
|
||||||
"Error retrienving properties: "
|
|
||||||
+ caught.getLocalizedMessage());*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -577,7 +526,6 @@ public class TabularResourceProperties extends FramedPanel {
|
||||||
new AsyncCallback<TableData>() {
|
new AsyncCallback<TableData>() {
|
||||||
|
|
||||||
public void onSuccess(TableData result) {
|
public void onSuccess(TableData result) {
|
||||||
//Log.debug("Retrieved LastTable:" + result);
|
|
||||||
updateTable(result);
|
updateTable(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue