Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@99566 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a78836a032
commit
a1a0adf945
|
@ -1,47 +1,21 @@
|
||||||
package org.gcube.portlets.user.td.extractcodelistwidget.client;
|
package org.gcube.portlets.user.td.extractcodelistwidget.client;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.extractcodelistwidget.client.licence.LicenceDataPropertiesCombo;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.core.client.Scheduler;
|
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
|
||||||
import com.google.gwt.i18n.client.DateTimeFormat;
|
import com.google.gwt.i18n.client.DateTimeFormat;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
|
||||||
import com.sencha.gxt.data.client.loader.RpcProxy;
|
|
||||||
import com.sencha.gxt.data.shared.ListStore;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfigBean;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoader;
|
|
||||||
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
|
||||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.DateField;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||||
import com.sencha.gxt.widget.core.client.form.TextArea;
|
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,14 +39,14 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
protected VerticalPanel tableDetailPanel;
|
protected VerticalPanel tableDetailPanel;
|
||||||
|
|
||||||
protected TextField name;
|
protected TextField name;
|
||||||
protected TextArea description;
|
/*protected TextArea description;
|
||||||
protected TextArea rights;
|
protected TextArea rights;
|
||||||
protected DateField validFrom;
|
protected DateField validFrom;
|
||||||
protected DateField validUntilTo;
|
protected DateField validUntilTo;
|
||||||
|
|
||||||
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
|
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
|
||||||
protected ComboBox<LicenceData> comboLicences;
|
protected ComboBox<LicenceData> comboLicences;*/
|
||||||
|
|
||||||
protected TabResource detail;
|
protected TabResource detail;
|
||||||
|
|
||||||
|
@ -107,6 +81,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
name.setAllowBlank(false);
|
name.setAllowBlank(false);
|
||||||
p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1));
|
p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
|
/*
|
||||||
description = new TextArea();
|
description = new TextArea();
|
||||||
description.setAllowBlank(false);
|
description.setAllowBlank(false);
|
||||||
description.setEmptyText("Enter a description...");
|
description.setEmptyText("Enter a description...");
|
||||||
|
@ -178,14 +153,14 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
// /
|
// /
|
||||||
p.add(new FieldLabel(comboLicences, "Licence"),
|
p.add(new FieldLabel(comboLicences, "Licence"),
|
||||||
new VerticalLayoutData(1, -1));
|
new VerticalLayoutData(1, -1));
|
||||||
|
*/
|
||||||
tableDetailPanel.add(form);
|
tableDetailPanel.add(form);
|
||||||
|
|
||||||
setContent(tableDetailPanel);
|
setContent(tableDetailPanel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
protected void loadData(ListLoadConfig loadConfig,
|
protected void loadData(ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
|
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
|
@ -216,7 +191,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
|
@ -262,19 +237,20 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (name.getValue() == null || name.getValue().isEmpty()
|
if (name.getValue() == null || name.getValue().isEmpty()
|
||||||
|| !name.isValid() || description.getValue() == null
|
|| !name.isValid()
|
||||||
|
/*|| description.getValue() == null
|
||||||
|| description.getValue().isEmpty() || !description.isValid()
|
|| description.getValue().isEmpty() || !description.isValid()
|
||||||
|| rights.getValue() == null || rights.getValue().isEmpty()
|
|| rights.getValue() == null || rights.getValue().isEmpty()
|
||||||
|| !rights.isValid()
|
|| !rights.isValid()*/
|
||||||
|
|
||||||
) {
|
) {
|
||||||
d = new AlertMessageBox("Attention!", "Fill in all fields");
|
d = new AlertMessageBox("Attention!", "Fill name fields");
|
||||||
d.addHideHandler(hideHandler);
|
d.addHideHandler(hideHandler);
|
||||||
d.show();
|
d.show();
|
||||||
} else {
|
} else {
|
||||||
name.setReadOnly(true);
|
name.setReadOnly(true);
|
||||||
description.setReadOnly(true);
|
/*description.setReadOnly(true);
|
||||||
rights.setReadOnly(true);
|
rights.setReadOnly(true);*/
|
||||||
goNext();
|
goNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -283,7 +259,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
try {
|
try {
|
||||||
detail= new TabResource();
|
detail= new TabResource();
|
||||||
detail.setName(name.getCurrentValue());
|
detail.setName(name.getCurrentValue());
|
||||||
detail.setDescription(description.getCurrentValue());
|
/*detail.setDescription(description.getCurrentValue());
|
||||||
detail.setRight(rights.getCurrentValue());
|
detail.setRight(rights.getCurrentValue());
|
||||||
|
|
||||||
Date vFrom = validFrom.getCurrentValue();
|
Date vFrom = validFrom.getCurrentValue();
|
||||||
|
@ -314,13 +290,13 @@ public class ExtractCodelistDetailsCard extends WizardCard {
|
||||||
&& !comboLicences.getCurrentValue().getLicence().isEmpty()){
|
&& !comboLicences.getCurrentValue().getLicence().isEmpty()){
|
||||||
detail.setLicence(comboLicences.getCurrentValue().getLicence());
|
detail.setLicence(comboLicences.getCurrentValue().getLicence());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
extractCodelistSession.setTabResource(detail);
|
extractCodelistSession.setTabResource(detail);
|
||||||
|
|
||||||
ExtractCodelistOperationInProgressCard csvOperationInProgressCard = new ExtractCodelistOperationInProgressCard(
|
ExtractCodelistOperationInProgressCard extractCodelistOperationInProgressCard = new ExtractCodelistOperationInProgressCard(
|
||||||
extractCodelistSession);
|
extractCodelistSession);
|
||||||
getWizardWindow().addCard(csvOperationInProgressCard);
|
getWizardWindow().addCard(extractCodelistOperationInProgressCard);
|
||||||
Log.info("NextCard ExtractCodelistOperationInProgressCard");
|
Log.info("NextCard ExtractCodelistOperationInProgressCard");
|
||||||
getWizardWindow().nextCard();
|
getWizardWindow().nextCard();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -69,10 +69,10 @@ public class TargetColumnsSelectionCard extends WizardCard {
|
||||||
|
|
||||||
protected void goNext() {
|
protected void goNext() {
|
||||||
try {
|
try {
|
||||||
/*ExtractCodelistDetailsCard destCard= new ExtractCodelistDetailsCard(
|
ExtractCodelistDetailsCard destCard= new ExtractCodelistDetailsCard(
|
||||||
extractCodelistSession);*/
|
|
||||||
ExtractCodelistOperationInProgressCard destCard = new ExtractCodelistOperationInProgressCard(
|
|
||||||
extractCodelistSession);
|
extractCodelistSession);
|
||||||
|
/*ExtractCodelistOperationInProgressCard destCard = new ExtractCodelistOperationInProgressCard(
|
||||||
|
extractCodelistSession);*/
|
||||||
Log.info("NextCard ExtractCodelistOperationInProgressCard");
|
Log.info("NextCard ExtractCodelistOperationInProgressCard");
|
||||||
getWizardWindow().addCard(destCard);
|
getWizardWindow().addCard(destCard);
|
||||||
getWizardWindow().nextCard();
|
getWizardWindow().nextCard();
|
||||||
|
|
Loading…
Reference in New Issue