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:
Giancarlo Panichi 2014-09-05 16:42:07 +00:00
parent a78836a032
commit a1a0adf945
2 changed files with 19 additions and 43 deletions

View File

@ -1,47 +1,21 @@
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.licenses.LicenceData;
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 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.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
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.box.AlertMessageBox;
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.event.HideEvent;
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.FieldSet;
import com.sencha.gxt.widget.core.client.form.TextArea;
import com.sencha.gxt.widget.core.client.form.TextField;
/**
@ -65,14 +39,14 @@ public class ExtractCodelistDetailsCard extends WizardCard {
protected VerticalPanel tableDetailPanel;
protected TextField name;
protected TextArea description;
/*protected TextArea description;
protected TextArea rights;
protected DateField validFrom;
protected DateField validUntilTo;
protected ListLoader<ListLoadConfig, ListLoadResult<LicenceData>> loader;
protected ComboBox<LicenceData> comboLicences;
protected ComboBox<LicenceData> comboLicences;*/
protected TabResource detail;
@ -107,6 +81,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
name.setAllowBlank(false);
p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1));
/*
description = new TextArea();
description.setAllowBlank(false);
description.setEmptyText("Enter a description...");
@ -178,14 +153,14 @@ public class ExtractCodelistDetailsCard extends WizardCard {
// /
p.add(new FieldLabel(comboLicences, "Licence"),
new VerticalLayoutData(1, -1));
*/
tableDetailPanel.add(form);
setContent(tableDetailPanel);
}
/*
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
TDGWTServiceAsync.INSTANCE
@ -216,7 +191,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
});
}
*/
@Override
public void setup() {
@ -262,19 +237,20 @@ public class ExtractCodelistDetailsCard extends WizardCard {
};
if (name.getValue() == null || name.getValue().isEmpty()
|| !name.isValid() || description.getValue() == null
|| !name.isValid()
/*|| description.getValue() == null
|| description.getValue().isEmpty() || !description.isValid()
|| 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.show();
} else {
name.setReadOnly(true);
description.setReadOnly(true);
rights.setReadOnly(true);
/*description.setReadOnly(true);
rights.setReadOnly(true);*/
goNext();
}
}
@ -283,7 +259,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
try {
detail= new TabResource();
detail.setName(name.getCurrentValue());
detail.setDescription(description.getCurrentValue());
/*detail.setDescription(description.getCurrentValue());
detail.setRight(rights.getCurrentValue());
Date vFrom = validFrom.getCurrentValue();
@ -314,13 +290,13 @@ public class ExtractCodelistDetailsCard extends WizardCard {
&& !comboLicences.getCurrentValue().getLicence().isEmpty()){
detail.setLicence(comboLicences.getCurrentValue().getLicence());
}
*/
extractCodelistSession.setTabResource(detail);
ExtractCodelistOperationInProgressCard csvOperationInProgressCard = new ExtractCodelistOperationInProgressCard(
ExtractCodelistOperationInProgressCard extractCodelistOperationInProgressCard = new ExtractCodelistOperationInProgressCard(
extractCodelistSession);
getWizardWindow().addCard(csvOperationInProgressCard);
getWizardWindow().addCard(extractCodelistOperationInProgressCard);
Log.info("NextCard ExtractCodelistOperationInProgressCard");
getWizardWindow().nextCard();
} catch (Exception e) {

View File

@ -69,10 +69,10 @@ public class TargetColumnsSelectionCard extends WizardCard {
protected void goNext() {
try {
/*ExtractCodelistDetailsCard destCard= new ExtractCodelistDetailsCard(
extractCodelistSession);*/
ExtractCodelistOperationInProgressCard destCard = new ExtractCodelistOperationInProgressCard(
ExtractCodelistDetailsCard destCard= new ExtractCodelistDetailsCard(
extractCodelistSession);
/*ExtractCodelistOperationInProgressCard destCard = new ExtractCodelistOperationInProgressCard(
extractCodelistSession);*/
Log.info("NextCard ExtractCodelistOperationInProgressCard");
getWizardWindow().addCard(destCard);
getWizardWindow().nextCard();