915: TDM - Support the Spanish language

Task-Url: https://support.d4science.org/issues/915

Updated Spanish Support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@120230 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-11-06 17:29:41 +00:00
parent a37a3b83cc
commit af6d14f0a3
17 changed files with 621 additions and 267 deletions

View File

@ -39,7 +39,7 @@ Documentation
tabular-data-extractcodelist-widget ensures the extraction of codelist from tabular resources
Documentation is available on-line from the Projects Documentation Wiki:
https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager
http://wiki.gcube-system.org/gcube/Tabular_Data_Manager
Licensing

View File

@ -38,7 +38,8 @@
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<release.date>2015-10-15</release.date>
<wikiurl>https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager</wikiurl>
<wikiurl>http://wiki.gcube-system.org/gcube/Tabular_Data_Manager</wikiurl>
<templatesDirectory>templates</templatesDirectory>
<distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory>

View File

@ -1,9 +1,9 @@
package org.gcube.portlets.user.td.extractcodelistwidget.client;
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo;
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
@ -33,7 +33,6 @@ 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.Radio;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.info.Info;
/**
*
@ -42,12 +41,13 @@ import com.sencha.gxt.widget.core.client.info.Info;
*
*/
public class ExtractCodelistDetailsCard extends WizardCard {
// private static DateTimeFormat sdf =
// DateTimeFormat.getFormat("yyyy-MM-dd");
private static final String TABLEDETAILPANELWIDTH = "100%";
private static final String TABLEDETAILPANELHEIGHT = "100%";
private static final String FORMWIDTH = "538px";
private static ExtractCodelistMessages msgs = GWT
.create(ExtractCodelistMessages.class);
private CommonMessages msgsCommon;
private ExtractCodelistSession extractCodelistSession;
private ExtractCodelistDetailsCard thisCard;
@ -55,23 +55,34 @@ public class ExtractCodelistDetailsCard extends WizardCard {
private VerticalLayoutContainer p;
private VerticalPanel tableDetailPanel;
private TextField name;
private TextField nameField;
private Radio automaticallyAttachTrue;
private Radio automaticallyAttachFalse;
private TabResource detail;
private ComboBox<ColumnData> comboAttachToColumn;
private ColumnData attachColumn;
private FieldLabel attachToColumnField;
private FieldLabel comboAttachToColumnLabel;
public ExtractCodelistDetailsCard(
final ExtractCodelistSession extractCodelistSession) {
super("Codelist Detail", "");
super(msgs.extractCodelistDetailCardHead(), "");
this.extractCodelistSession = extractCodelistSession;
thisCard = this;
attachColumn = null;
initMessages();
create();
}
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
}
protected void create() {
tableDetailPanel = new VerticalPanel();
tableDetailPanel.setSpacing(4);
@ -79,39 +90,40 @@ public class ExtractCodelistDetailsCard extends WizardCard {
tableDetailPanel.setHeight(TABLEDETAILPANELHEIGHT);
FramedPanel form = new FramedPanel();
form.setHeadingText("Details");
form.setHeadingText(msgs.extractCodelistDetailsCardFormHead());
form.setWidth(FORMWIDTH);
FieldSet fieldSet = new FieldSet();
fieldSet.setHeadingText("Information");
fieldSet.setCollapsible(false);
form.add(fieldSet);
FieldSet infoFieldSet = new FieldSet();
infoFieldSet.setHeadingText(msgs.infoFieldSetHead());
infoFieldSet.setCollapsible(false);
form.add(infoFieldSet);
p = new VerticalLayoutContainer();
fieldSet.add(p);
infoFieldSet.add(p);
name = new TextField();
name.setAllowBlank(false);
name.setEmptyText("Enter a name...");
name.setAllowBlank(false);
FieldLabel nameField=new FieldLabel(name, "Name");
nameField.setToolTip("Enter the name of new codelist extracted");
p.add(nameField, new VerticalLayoutData(1, -1,
new Margins(0)));
nameField = new TextField();
nameField.setAllowBlank(false);
nameField.setEmptyText(msgs.nameFieldEmptyText());
nameField.setAllowBlank(false);
FieldLabel nameFieldLabel = new FieldLabel(nameField,
msgs.nameFieldLabel());
nameFieldLabel.setToolTip(msgs.nameFieldToolTip());
p.add(nameFieldLabel, new VerticalLayoutData(1, -1, new Margins(0)));
// /
automaticallyAttachTrue = new Radio();
automaticallyAttachTrue.setBoxLabel("True");
automaticallyAttachTrue
.setBoxLabel(msgs.automaticallyAttachTrueLabel());
automaticallyAttachTrue.setValue(true);
automaticallyAttachFalse = new Radio();
automaticallyAttachFalse.setBoxLabel("False");
automaticallyAttachFalse.setBoxLabel(msgs
.automaticallyAttachFalseLabel());
ToggleGroup automaticallyAttachGroup = new ToggleGroup();
automaticallyAttachGroup.add(automaticallyAttachTrue);
automaticallyAttachGroup.add(automaticallyAttachFalse);
automaticallyAttachGroup
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
@ -120,9 +132,9 @@ public class ExtractCodelistDetailsCard extends WizardCard {
ValueChangeEvent<HasValue<Boolean>> event) {
try {
if (automaticallyAttachTrue.getValue()) {
attachToColumnField.setVisible(true);
comboAttachToColumnLabel.setVisible(true);
} else {
attachToColumnField.setVisible(false);
comboAttachToColumnLabel.setVisible(false);
}
thisCard.forceLayout();
@ -139,10 +151,10 @@ public class ExtractCodelistDetailsCard extends WizardCard {
automaticallyAttachPanel.add(automaticallyAttachTrue);
automaticallyAttachPanel.add(automaticallyAttachFalse);
FieldLabel fieldAttach = new FieldLabel(automaticallyAttachPanel,
"Attach");
fieldAttach.setToolTip("Select true if you want automatically attach the generated codelist");
p.add(fieldAttach, new VerticalLayoutData(-1, -1, new Margins(0)));
FieldLabel attachFieldLabel = new FieldLabel(automaticallyAttachPanel,
msgs.attachFieldLabel());
attachFieldLabel.setToolTip(msgs.attachFieldToolTip());
p.add(attachFieldLabel, new VerticalLayoutData(-1, -1, new Margins(0)));
// //
@ -159,16 +171,16 @@ public class ExtractCodelistDetailsCard extends WizardCard {
Log.trace("Combo AttachToColumn created");
addHandlersForComboAttachToColumn(propsColumnData.label());
comboAttachToColumn.setEmptyText("Select a column...");
comboAttachToColumn.setEmptyText(msgs.comboAttachToColumnEmptyText());
comboAttachToColumn.setWidth(191);
comboAttachToColumn.setTypeAhead(false);
comboAttachToColumn.setEditable(false);
comboAttachToColumn.setTriggerAction(TriggerAction.ALL);
attachToColumnField = new FieldLabel(comboAttachToColumn,
"Attach To Column");
attachToColumnField.setToolTip("Select the column to be attached to extraced codelist");
p.add(attachToColumnField,
new VerticalLayoutData(1, -1, new Margins(0)));
comboAttachToColumnLabel = new FieldLabel(comboAttachToColumn,
msgs.comboAttachToColumnLabel());
comboAttachToColumnLabel.setToolTip(msgs.comboAttachToColumnToolTip());
p.add(comboAttachToColumnLabel, new VerticalLayoutData(1, -1,
new Margins(0)));
// /
tableDetailPanel.add(form);
@ -186,13 +198,6 @@ public class ExtractCodelistDetailsCard extends WizardCard {
comboAttachToColumn
.addSelectionHandler(new SelectionHandler<ColumnData>() {
public void onSelection(SelectionEvent<ColumnData> event) {
Info.display(
"Column Selected",
"You selected "
+ (event.getSelectedItem() == null ? "nothing"
: label.getLabel(event
.getSelectedItem())
+ "!"));
Log.debug("ComboAttachToColumn selected: "
+ event.getSelectedItem());
ColumnData column = event.getSelectedItem();
@ -249,25 +254,26 @@ public class ExtractCodelistDetailsCard extends WizardCard {
}
};
if (name.getValue() == null || name.getValue().isEmpty()
|| !name.isValid()) {
d = new AlertMessageBox("Attention!", "Fill name fields");
if (nameField.getValue() == null || nameField.getValue().isEmpty()
|| !nameField.isValid()) {
d = new AlertMessageBox(msgsCommon.attention(),
msgs.attentionFillNameField());
d.addHideHandler(hideHandler);
d.show();
} else {
if (getAutomaticallyAttach()) {
attachColumn = comboAttachToColumn.getCurrentValue();
if (attachColumn == null) {
d = new AlertMessageBox("Attention!",
"Select column to attach codelist!");
d = new AlertMessageBox(msgsCommon.attention(),
msgs.attentionSelectColumnToAttachCodelist());
d.addHideHandler(hideHandler);
d.show();
} else {
name.setReadOnly(true);
nameField.setReadOnly(true);
goNext();
}
} else {
name.setReadOnly(true);
nameField.setReadOnly(true);
goNext();
}
}
@ -284,7 +290,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
protected void goNext() {
try {
detail = new TabResource();
detail.setName(name.getCurrentValue());
detail.setName(nameField.getCurrentValue());
extractCodelistSession.setTabResource(detail);
extractCodelistSession
@ -297,7 +303,7 @@ public class ExtractCodelistDetailsCard extends WizardCard {
getWizardWindow().nextCard();
} catch (Exception e) {
Log.error("sayNextCard :" + e.getLocalizedMessage());
name.setReadOnly(false);
nameField.setReadOnly(false);
}
}

View File

@ -0,0 +1,139 @@
package org.gcube.portlets.user.td.extractcodelistwidget.client;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ExtractCodelistMessages extends Messages {
@DefaultMessage("Extract Codelist")
String extractCodelistWizardHead();
@DefaultMessage("Codelist Detail")
String extractCodelistDetailCardHead();
@DefaultMessage("Details")
String extractCodelistDetailsCardFormHead();
@DefaultMessage("Information")
String infoFieldSetHead();
@DefaultMessage("Enter a name...")
String nameFieldEmptyText();
@DefaultMessage("Name")
String nameFieldLabel();
@DefaultMessage("Enter the name of new codelist extracted")
String nameFieldToolTip();
@DefaultMessage("True")
String automaticallyAttachTrueLabel();
@DefaultMessage("False")
String automaticallyAttachFalseLabel();
@DefaultMessage("Attach")
String attachFieldLabel();
@DefaultMessage("Select true if you want automatically attach the generated codelist")
String attachFieldToolTip();
@DefaultMessage("Select a column...")
String comboAttachToColumnEmptyText();
@DefaultMessage("Attach To Column")
String comboAttachToColumnLabel();
@DefaultMessage("Select the column to be attached to extracted codelist")
String comboAttachToColumnToolTip();
@DefaultMessage("Fill name fields!")
String attentionFillNameField();
@DefaultMessage("Select column to attach codelist!")
String attentionSelectColumnToAttachCodelist();
@DefaultMessage("Source Column")
String sourceColumnsSelectionCardHead();
@DefaultMessage("No column selected!")
String attentionNoColumnSelected();
@DefaultMessage("Target Column")
String targetColumnsSelectionCardHead();
@DefaultMessage("Connect Codelist")
String btnConnectTitle();
@DefaultMessage("Disconnect Codelist")
String btnDisconnectTitle();
@DefaultMessage("Select a Column...")
String comboDefNewColumnEmptyText();
@DefaultMessage("Select a new column...")
String comboReferenceDefColumnEmptyText();
@DefaultMessage("Select from Codelist...")
String comboColumnEmptyText();
@DefaultMessage("New")
String checkNewLabel();
@DefaultMessage("Error retrieving columns on server.")
String errorRetrievingColumnsFixed();
@DefaultMessage("Error creating form!")
String errorCreatingForm();
@DefaultMessage("Error creating form for check radio!")
String errorCreatingFormForCheckRadio();
@DefaultMessage("Fill all column!")
String attentionFillAllColumn();
@DefaultMessage("An error occurred in extract codelist.")
String errorInExtractCodelistFixed();
@DefaultMessage("An error occurred setting collateral table final.")
String errorAnErrorOccurredSettingCollateralTableFinalFixed();
@DefaultMessage("No collateral id retrieved")
String errorNoCollateralIdRetrieved();
@DefaultMessage("Collateral id is null")
String errorCollateralIdIsNull();
@DefaultMessage("An error occurred retrieving column on collateral table.")
String errorAnErrorOccurredRetrievingColumnOnCollateralTableFixed();
@DefaultMessage("An error occured no label retrieved for attach column")
String errorAnErrorOccurredNoLabelRetrievedForAttachColumnFixed();
@DefaultMessage("No label retrieved for attach column")
String errorNoLabelRetrievedForAttachColumn();
@DefaultMessage("An error occurred no attach column match")
String errorAnErrorOccurredNoAttachColumnMatchFixed();
@DefaultMessage("No attach column match")
String errorNoAttachColumnMatch();
@DefaultMessage("An error occurred on start change column type.")
String errorAnErrorOccurredOnStartChangeColumnTypeFixed();
@DefaultMessage("The Codelists is available in the list of yours tabular resources")
String codelistAvailableInResources();
@DefaultMessage("Columns")
String columns();
@DefaultMessage("No column loaded: ")
String errorNoColumnLoadedFixed();
}

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistTarge
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.widgetcommonevent.shared.OperationResult;
@ -22,6 +23,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeC
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.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -40,6 +42,8 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*/
public class ExtractCodelistOperationInProgressCard extends WizardCard
implements MonitorDialogListener {
private static CommonMessages msgsCommon = GWT.create(CommonMessages.class);
private ExtractCodelistMessages msgs;
@SuppressWarnings("unused")
private ExtractCodelistOperationInProgressCard thisCard;
@ -52,12 +56,14 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public ExtractCodelistOperationInProgressCard(
final ExtractCodelistSession extractCodelistSession) {
super("Operation In Progress", "");
super(msgsCommon.operationInProgress(), "");
this.extractCodelistSession = extractCodelistSession;
thisCard = this;
automaticallyAttached = false;
initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.LEFT);
@ -71,6 +77,11 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
}
protected void initMessages() {
msgs = GWT.create(ExtractCodelistMessages.class);
}
public void extractCodelist() {
TDGWTServiceAsync.INSTANCE.startExtractCodelist(extractCodelistSession,
new AsyncCallback<String>() {
@ -87,8 +98,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide("Error in extract codelist",
"An error occured in extract codelist.",
showErrorAndHide(msgsCommon.error(),
msgs.errorInExtractCodelistFixed(),
caught.getLocalizedMessage(), caught);
return;
}
@ -99,22 +110,24 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void setCollateralTRIdFinal(ArrayList<TRId> collateralIds) {
if (collateralIds == null || collateralIds.isEmpty()) {
monitorDialog.hide();
showErrorAndHide("Error in extract codelist",
"An error occured setting collateral table final.",
"No collateral id retrieved", new Throwable(
"No collateral id retrieved"));
showErrorAndHide(
msgsCommon.error(),
msgs.errorAnErrorOccurredSettingCollateralTableFinalFixed(),
msgs.errorNoCollateralIdRetrieved(),
new Throwable(msgs.errorNoCollateralIdRetrieved()));
return;
}
collateralTRId = collateralIds.get(0);
if (collateralTRId == null) {
monitorDialog.hide();
showErrorAndHide("Error in extract codelist",
"An error occured setting collateral table final.",
"Collateral id is null", new Throwable(
"Collateral id is null"));
showErrorAndHide(
msgsCommon.error(),
msgs.errorAnErrorOccurredSettingCollateralTableFinalFixed(),
msgs.errorCollateralIdIsNull(),
new Throwable(msgs.errorCollateralIdIsNull()));
return;
}
@ -136,8 +149,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide(
"Error in extract codelist",
"An error occured setting collateral table final.",
msgsCommon.error(),
msgs.errorAnErrorOccurredSettingCollateralTableFinalFixed(),
caught.getLocalizedMessage(), caught);
}
}
@ -158,8 +171,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide(
"Error in extract codelist",
"An error occured retrieving column on collateral table.",
msgsCommon.error(),
msgs.errorAnErrorOccurredRetrievingColumnOnCollateralTableFixed(),
caught.getLocalizedMessage(), caught);
}
}
@ -193,8 +206,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
labelOfAttachColumn = targetCol.getTargetColumn()
.getLabel();
typeCodeOfColumnAttach = ColumnTypeCode
.getColumnTypeCodeFromId(targetCol.getTargetColumn()
.getTypeCode());
.getColumnTypeCodeFromId(targetCol
.getTargetColumn().getTypeCode());
}
break;
}
@ -203,17 +216,18 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
ColumnData codelistColumnReference = null;
if (labelOfAttachColumn == null) {
showErrorAndHide("Error in extract codelist",
"An error occured no label retrieved for attach column",
"No label retrieved for attach column", new Throwable(
"No label retrieved for attach column"));
showErrorAndHide(
msgsCommon.error(),
msgs.errorAnErrorOccurredNoLabelRetrievedForAttachColumnFixed(),
msgs.errorNoLabelRetrievedForAttachColumn(), new Throwable(
msgs.errorNoLabelRetrievedForAttachColumn()));
return;
} else {
for (ColumnData refColumn : refColumns) {
if (refColumn.getLabel().compareTo(labelOfAttachColumn) == 0) {
if (ColumnTypeCode
.getColumnTypeCodeFromId(refColumn.getTypeCode())
.compareTo(typeCodeOfColumnAttach) == 0) {
if (ColumnTypeCode.getColumnTypeCodeFromId(
refColumn.getTypeCode()).compareTo(
typeCodeOfColumnAttach) == 0) {
codelistColumnReference = refColumn;
break;
} else {
@ -231,10 +245,10 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
columnTypeCodeTarget, null, codelistColumnReference);
callChangeColumnType(changeColumnTypeSession);
} else {
showErrorAndHide("Error in extract codelist",
"An error occured no attach column match",
"No attach column match", new Throwable(
"No attach column match"));
showErrorAndHide(msgsCommon.error(),
msgs.errorAnErrorOccurredNoAttachColumnMatchFixed(),
msgs.errorNoAttachColumnMatch(),
new Throwable(msgs.errorNoAttachColumnMatch()));
}
}
@ -250,8 +264,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide(
"Error in extract codelist",
"An error occured on start change column type.",
msgsCommon.error(),
msgs.errorAnErrorOccurredOnStartChangeColumnTypeFixed(),
caught.getLocalizedMessage(), caught);
}
}
@ -300,8 +314,11 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
protected void updateOnComplete() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>"
+ "<div style='display:block;margin:auto; margin-top:30px;left:0;text-align:center;font-size:medium;font-weight:bold; color:black;'>The Codelists is available in the list of yours tabular resources</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold; color:#009900;'>"
+ msgsCommon.operationCompleted()
+ "</div>"
+ "<div style='display:block;margin:auto; margin-top:30px;left:0;text-align:center;font-size:medium;font-weight:bold; color:black;'>"
+ msgs.codelistAvailableInResources() + "</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
@ -329,7 +346,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color:red;'>"
+ msgsCommon.operationFailed() + "</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) {
@ -338,8 +356,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide("Error in Extract Codelist", reason, details,
caught);
showErrorAndHide(msgsCommon.error(), reason, details, caught);
}
forceLayout();
@ -351,7 +368,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Problems in the Operation</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>"
+ msgsCommon.operationProblem() + "</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -382,7 +400,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='diplay:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>");
.appendHtmlConstant("<div style='diplay:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>"
+ msgsCommon.operationAborted() + "</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -412,7 +431,8 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;left:0;text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>"
+ msgsCommon.operationInBackground() + "</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);

View File

@ -1,44 +1,33 @@
package org.gcube.portlets.user.td.extractcodelistwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.google.web.bindery.event.shared.EventBus;
/**
*
*/
public class ExtractCodelistWizardTD extends WizardWindow {
public class ExtractCodelistWizardTD extends WizardWindow {
protected ExtractCodelistSession exportSession;
protected TRId trId;
private ExtractCodelistSession exportSession;
/**
*
* @param title
* @param eventBus
*/
public ExtractCodelistWizardTD(TRId trId,String title, EventBus eventBus) {
super(title,eventBus);
this.trId=trId;
exportSession= new ExtractCodelistSession();
public ExtractCodelistWizardTD(TRId trId, String title, EventBus eventBus) {
super(title, eventBus);
exportSession = new ExtractCodelistSession();
exportSession.setTrId(trId);
SourceColumnsSelectionCard sourceColumnsSelectionCard=new SourceColumnsSelectionCard(exportSession);
SourceColumnsSelectionCard sourceColumnsSelectionCard = new SourceColumnsSelectionCard(
exportSession);
addCard(sourceColumnsSelectionCard);
sourceColumnsSelectionCard.setup();
}
}

View File

@ -4,20 +4,30 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.SimpleEventBus;
/**
*
* @author "Giancarlo Panichi"
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ExtractCodelistWizardTDEntry implements EntryPoint {
public class ExtractCodelistWizardTDEntry implements EntryPoint {
private ExtractCodelistMessages msgs;
public void onModuleLoad() {
SimpleEventBus eventBus=new SimpleEventBus();
TRId trId=new TRId("10");
ExtractCodelistWizardTD extractWizard= new ExtractCodelistWizardTD(trId,"ExtractCodelist",eventBus);
initMessages();
SimpleEventBus eventBus = new SimpleEventBus();
TRId trId = new TRId("10");
ExtractCodelistWizardTD extractWizard = new ExtractCodelistWizardTD(
trId, msgs.extractCodelistWizardHead(), eventBus);
Log.info(extractWizard.getId());
}
protected void initMessages() {
msgs = GWT.create(ExtractCodelistMessages.class);
}
}

View File

@ -1,14 +1,15 @@
package org.gcube.portlets.user.td.extractcodelistwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.extractcodelistwidget.client.grid.ColumnDataGridPanel;
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
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.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.Command;
@ -19,33 +20,37 @@ 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.FormPanel;
/**
*
* @author "Giancarlo Panichi"
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class SourceColumnsSelectionCard extends WizardCard {
private static ExtractCodelistMessages msgs = GWT
.create(ExtractCodelistMessages.class);
private CommonMessages msgsCommon;
private ExtractCodelistSession extractCodelistSession;
private ColumnDataGridPanel columnsGridPanel;
protected ExtractCodelistSession extractCodelistSession;
protected ColumnDataGridPanel columnsGridPanel;
public SourceColumnsSelectionCard(final ExtractCodelistSession extractCodelistSession) {
super("Source Column", "");
public SourceColumnsSelectionCard(
final ExtractCodelistSession extractCodelistSession) {
super(msgs.sourceColumnsSelectionCardHead(), "");
if (extractCodelistSession == null) {
Log.error("ExtractCodelistSession is null");
}
this.extractCodelistSession = extractCodelistSession;
FormPanel panel = createPanel();
setContent(panel);
initMessages();
createPanel();
}
protected FormPanel createPanel() {
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
}
protected void createPanel() {
FormPanel panel = new FormPanel();
panel.setLabelWidth(90);
panel.getElement().setPadding(new Padding(5));
@ -66,10 +71,9 @@ public class SourceColumnsSelectionCard extends WizardCard {
content.add(columnsGridPanel);
return panel;
}
setContent(panel);
}
@Override
public void setup() {
@ -85,7 +89,9 @@ public class SourceColumnsSelectionCard extends WizardCard {
getWizardWindow().setNextButtonCommand(sayNextCard);
setEnableBackButton(false);
setBackButtonVisible(false);
setEnableNextButton(true);
setNextButtonVisible(true);
}
protected void checkData() {
@ -103,7 +109,8 @@ public class SourceColumnsSelectionCard extends WizardCard {
ArrayList<ColumnData> columns = columnsGridPanel.getSelectedItems();
if (columns.size() == 0) {
d = new AlertMessageBox("Attention", "No columns selected");
d = new AlertMessageBox(msgsCommon.attention(),
msgs.attentionNoColumnSelected());
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
@ -122,6 +129,7 @@ public class SourceColumnsSelectionCard extends WizardCard {
getWizardWindow().nextCard();
} catch (Exception e) {
Log.error("sayNextCard :" + e.getLocalizedMessage());
e.printStackTrace();
}
}
@ -131,4 +139,3 @@ public class SourceColumnsSelectionCard extends WizardCard {
}
}

View File

@ -4,22 +4,33 @@ import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistSessi
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.user.client.Command;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TargetColumnsSelectionCard extends WizardCard {
private TargetColumnsSelectionCard thisCard;
protected ExtractCodelistSession extractCodelistSession;
protected TargetColumnsSelectionPanel targetColumnsSelectionPanel;
private static ExtractCodelistMessages msgs = GWT
.create(ExtractCodelistMessages.class);
public TargetColumnsSelectionCard(final ExtractCodelistSession extractCodelistSession) {
super("Target Column", "");
thisCard=this;
private TargetColumnsSelectionCard thisCard;
private ExtractCodelistSession extractCodelistSession;
private TargetColumnsSelectionPanel targetColumnsSelectionPanel;
public TargetColumnsSelectionCard(
final ExtractCodelistSession extractCodelistSession) {
super(msgs.targetColumnsSelectionCardHead(), "");
thisCard = this;
if (extractCodelistSession == null) {
Log.error("ExtractCodelistSession is null");
}
this.extractCodelistSession = extractCodelistSession;
targetColumnsSelectionPanel =new TargetColumnsSelectionPanel(this);
targetColumnsSelectionPanel = new TargetColumnsSelectionPanel(this);
setContent(targetColumnsSelectionPanel);
}
@ -36,8 +47,7 @@ public class TargetColumnsSelectionCard extends WizardCard {
};
getWizardWindow().setNextButtonCommand(sayNextCard);
Command sayPreviousCard = new Command() {
public void execute() {
try {
@ -51,15 +61,18 @@ public class TargetColumnsSelectionCard extends WizardCard {
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
setEnableBackButton(true);
setBackButtonVisible(true);
setEnableNextButton(true);
setNextButtonVisible(true);
}
protected void checkData() {
getWizardWindow().setEnableNextButton(false);
getWizardWindow().setEnableBackButton(false);
if(targetColumnsSelectionPanel.updateExtractCodelistSession()){
if (targetColumnsSelectionPanel.updateExtractCodelistSession()) {
goNext();
} else {
getWizardWindow().setEnableNextButton(true);
@ -69,10 +82,12 @@ public class TargetColumnsSelectionCard extends WizardCard {
protected void goNext() {
try {
ExtractCodelistDetailsCard destCard= new ExtractCodelistDetailsCard(
ExtractCodelistDetailsCard destCard = new ExtractCodelistDetailsCard(
extractCodelistSession);
/*ExtractCodelistOperationInProgressCard destCard = new ExtractCodelistOperationInProgressCard(
extractCodelistSession);*/
/*
* ExtractCodelistOperationInProgressCard destCard = new
* ExtractCodelistOperationInProgressCard( extractCodelistSession);
*/
Log.info("NextCard ExtractCodelistOperationInProgressCard");
getWizardWindow().addCard(destCard);
getWizardWindow().nextCard();
@ -86,5 +101,12 @@ public class TargetColumnsSelectionCard extends WizardCard {
}
/**
*
* @return
*/
public ExtractCodelistSession getExtractCodelistSession() {
return extractCodelistSession;
}
}

View File

@ -15,6 +15,7 @@ import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectio
import org.gcube.portlets.user.td.columnwidget.client.properties.ExtractCodelistDefColumnPropertiesCombo;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.widgetcommonevent.shared.tr.TableType;
@ -70,6 +71,9 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
private static final int LABEL_SIZE_IN_CHAR = 17;
private static final int COMBOWIDTH = 270;
private CommonMessages msgsCommon;
private ExtractCodelistMessages msgs;
private TargetColumnsSelectionCard parent;
private TabResource connection;
private ArrayList<ColumnData> connectionColumns;
@ -90,11 +94,17 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
this.parent = parent;
connection = null;
Log.debug("Create TargetColumnsSelectionPanel()");
initMessages();
init();
create();
}
protected void initMessages() {
msgs = GWT.create(ExtractCodelistMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -109,7 +119,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
btnConnect = new TextButton();
btnConnect.setIcon(ResourceBundle.INSTANCE.codelistLink24());
btnConnect.setIconAlign(IconAlign.TOP);
btnConnect.setTitle("Connect Codelist");
btnConnect.setTitle(msgs.btnConnectTitle());
btnConnect.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -127,7 +137,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
btnDisconnect = new TextButton();
btnDisconnect.setIcon(ResourceBundle.INSTANCE.codelistLinkBreak24());
btnDisconnect.setIconAlign(IconAlign.TOP);
btnDisconnect.setTitle("Disconnect Codelist");
btnDisconnect.setTitle(msgs.btnDisconnectTitle());
btnDisconnect.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -148,7 +158,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
form.setHeight(FIELDSHEIGHT);
formLayout = new VerticalLayoutContainer();
//formLayout.setScrollMode(ScrollMode.AUTO);
// formLayout.setScrollMode(ScrollMode.AUTO);
formLayout.setAdjustForScroll(true);
ArrayList<FieldLabel> fields = generateFields();
@ -160,8 +170,8 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
form.add(formLayout);
VerticalLayoutContainer v = new VerticalLayoutContainer();
//v.setHeight(HEIGHT);
//v.setWidth(WIDTH);
// v.setHeight(HEIGHT);
// v.setWidth(WIDTH);
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
v.add(form, new VerticalLayoutData(1, -1, new Margins(0)));
@ -178,7 +188,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
protected ArrayList<FieldLabel> generateFields() {
ArrayList<FieldLabel> fields = new ArrayList<FieldLabel>();
int i = 0;
for (ColumnData sourceCol : parent.extractCodelistSession
for (ColumnData sourceCol : parent.getExtractCodelistSession()
.getSourceColumns()) {
String label = new String();
if (sourceCol != null && sourceCol.getLabel() != null) {
@ -186,7 +196,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
if (label.length() > LABEL_SIZE_IN_CHAR + 2) {
label = label.substring(0, LABEL_SIZE_IN_CHAR);
label += "...";
}
}
}
if (connection == null) {
@ -213,14 +223,14 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
// comboDefColumn
ExtractCodelistDefColumnPropertiesCombo props = GWT
.create(ExtractCodelistDefColumnPropertiesCombo.class);
ListStore<ColumnMockUp> storeComboDefColumn = new ListStore<ColumnMockUp>(
ListStore<ColumnMockUp> storeComboDefNewColumn = new ListStore<ColumnMockUp>(
props.id());
final ComboBox<ColumnMockUp> comboDefColumn = new ComboBox<ColumnMockUp>(
storeComboDefColumn, props.label());
final ComboBox<ColumnMockUp> comboDefNewColumn = new ComboBox<ColumnMockUp>(
storeComboDefNewColumn, props.label());
Log.debug("ComboDefColumn created");
final CreateDefColumnListener createDefColumnListener = new CreateDefColumnListener() {
final CreateDefColumnListener createDefNewColumnListener = new CreateDefColumnListener() {
@Override
public void failedDefColumnCreation(String reason, String details) {
@ -230,7 +240,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
@Override
public void completedDefColumnCreation(ColumnMockUp columnMockUp) {
comboDefColumn.setValue(columnMockUp, true);
comboDefNewColumn.setValue(columnMockUp, true);
}
@ -241,47 +251,49 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
}
};
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
comboDefNewColumn.addTriggerClickHandler(new TriggerClickHandler() {
@Override
public void onTriggerClick(TriggerClickEvent event) {
Log.debug("ComboDefColumn TriggerClickEvent");
comboDefColumn.collapse();
comboDefNewColumn.collapse();
CreateDefColumnDialog createDefColumnDialog = new CreateDefColumnDialog(
CreateDefColumnDialog createDefNewColumnDialog = new CreateDefColumnDialog(
TableType.CODELIST, parent.getEventBus());
createDefColumnDialog.addListener(createDefColumnListener);
createDefColumnDialog.show();
createDefNewColumnDialog
.addListener(createDefNewColumnListener);
createDefNewColumnDialog.show();
}
});
comboDefColumn.setEmptyText("Select a Column...");
comboDefColumn.setWidth(COMBOWIDTH);
comboDefColumn.setEditable(false);
comboDefColumn.setTriggerAction(TriggerAction.ALL);
comboDefNewColumn.setEmptyText(msgs.comboDefNewColumnEmptyText());
comboDefNewColumn.setWidth(COMBOWIDTH);
comboDefNewColumn.setEditable(false);
comboDefNewColumn.setTriggerAction(TriggerAction.ALL);
FieldLabel columnLabel = new FieldLabel(comboDefColumn, label);
columnLabel.setId(col.getColumnId());
return columnLabel;
FieldLabel comboDefNewColumnLabel = new FieldLabel(comboDefNewColumn,
label);
comboDefNewColumnLabel.setId(col.getColumnId());
return comboDefNewColumnLabel;
}
protected FieldLabel retrieveReferenceColumnLabel(int index,
final ColumnData col, String label) {
// comboDefColumn
// comboReferenceDefColumn
ExtractCodelistDefColumnPropertiesCombo props = GWT
.create(ExtractCodelistDefColumnPropertiesCombo.class);
ListStore<ColumnMockUp> storeComboDefColumn = new ListStore<ColumnMockUp>(
ListStore<ColumnMockUp> storeComboReferenceDefColumn = new ListStore<ColumnMockUp>(
props.id());
final ComboBox<ColumnMockUp> comboDefColumn = new ComboBox<ColumnMockUp>(
storeComboDefColumn, props.label());
comboDefColumn.setItemId(COMBO_DEF_COLUMN);
final ComboBox<ColumnMockUp> comboReferenceDefColumn = new ComboBox<ColumnMockUp>(
storeComboReferenceDefColumn, props.label());
comboReferenceDefColumn.setItemId(COMBO_DEF_COLUMN);
Log.debug("ComboDefColumn created");
final CreateDefColumnListener createDefColumnListener = new CreateDefColumnListener() {
final CreateDefColumnListener createReferenceDefColumnListener = new CreateDefColumnListener() {
@Override
public void failedDefColumnCreation(String reason, String details) {
@ -291,7 +303,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
@Override
public void completedDefColumnCreation(ColumnMockUp columnMockUp) {
comboDefColumn.setValue(columnMockUp, true);
comboReferenceDefColumn.setValue(columnMockUp, true);
}
@ -302,26 +314,29 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
}
};
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
comboReferenceDefColumn
.addTriggerClickHandler(new TriggerClickHandler() {
@Override
public void onTriggerClick(TriggerClickEvent event) {
Log.debug("ComboDefColumn TriggerClickEvent");
comboDefColumn.collapse();
@Override
public void onTriggerClick(TriggerClickEvent event) {
Log.debug("ComboDefColumn TriggerClickEvent");
comboReferenceDefColumn.collapse();
CreateDefColumnDialog createDefColumnDialog = new CreateDefColumnDialog(
TableType.CODELIST, parent.getEventBus());
createDefColumnDialog.addListener(createDefColumnListener);
createDefColumnDialog.show();
CreateDefColumnDialog createReferenceDefColumnDialog = new CreateDefColumnDialog(
TableType.CODELIST, parent.getEventBus());
createReferenceDefColumnDialog
.addListener(createReferenceDefColumnListener);
createReferenceDefColumnDialog.show();
}
}
});
});
comboDefColumn.setEmptyText("Select a new column...");
comboDefColumn.setWidth(COMBOWIDTH);
comboDefColumn.setEditable(false);
comboDefColumn.setTriggerAction(TriggerAction.ALL);
comboReferenceDefColumn.setEmptyText(msgs
.comboReferenceDefColumnEmptyText());
comboReferenceDefColumn.setWidth(COMBOWIDTH);
comboReferenceDefColumn.setEditable(false);
comboReferenceDefColumn.setTriggerAction(TriggerAction.ALL);
// comboColumn
ColumnDataPropertiesCombo propsCod = GWT
@ -336,7 +351,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
Log.debug("ComboColumn created");
comboColumn.setEmptyText("Select from Codelist...");
comboColumn.setEmptyText(msgs.comboColumnEmptyText());
comboColumn.setWidth(COMBOWIDTH);
comboColumn.setEditable(false);
comboColumn.setTriggerAction(TriggerAction.ALL);
@ -344,18 +359,18 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
CheckBox checkNew = new CheckBox();
checkNew.setItemId(CHECK_NEW);
checkNew.setEnabled(true);
checkNew.setBoxLabel("New");
checkNew.setBoxLabel(msgs.checkNewLabel());
checkNew.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
if (event.getValue()) {
comboColumn.setVisible(false);
comboDefColumn.setVisible(true);
comboReferenceDefColumn.setVisible(true);
forceLayout();
} else {
comboColumn.setVisible(true);
comboDefColumn.setVisible(false);
comboReferenceDefColumn.setVisible(false);
forceLayout();
}
@ -365,16 +380,16 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
flowButton.setPack(BoxLayoutPack.START);
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
BoxLayoutData boxLayoutData = new BoxLayoutData(new Margins(2, 4, 2, 4));
flowButton.add(checkNew, boxLayoutData);
flowButton.add(comboColumn, boxLayoutData);
flowButton.add(comboDefColumn, boxLayoutData);
flowButton.add(comboReferenceDefColumn, boxLayoutData);
FieldLabel columnLabel = new FieldLabel(flowButton, label);
columnLabel.setId(col.getColumnId());
comboDefColumn.setVisible(false);
comboReferenceDefColumn.setVisible(false);
return columnLabel;
}
@ -416,7 +431,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
@Override
public void failed(String reason, String detail) {
Log.debug("Connection Failed: " + reason + " " + detail);
UtilsGXT3.alert("Error on connect", reason);
UtilsGXT3.alert(msgsCommon.error(), reason);
btnConnect.enable();
}
@ -435,13 +450,16 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
parent.showErrorAndHide("Error Locked",
caught.getLocalizedMessage(), "", caught);
parent.showErrorAndHide(
msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "",
caught);
} else {
Log.debug("Error retrieving columns: "
+ caught.getLocalizedMessage());
parent.showErrorAndHide("Error retrieving columns",
"Error retrieving columns on server.",caught.getLocalizedMessage(), caught);
parent.showErrorAndHide(msgsCommon.error(),
msgs.errorRetrievingColumnsFixed(),
caught.getLocalizedMessage(), caught);
}
}
}
@ -470,7 +488,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
protected void updatedForm() {
form.clear();
formLayout = new VerticalLayoutContainer();
//formLayout.setScrollMode(ScrollMode.AUTO);
// formLayout.setScrollMode(ScrollMode.AUTO);
formLayout.setAdjustForScroll(true);
ArrayList<FieldLabel> fields = generateFields();
@ -494,7 +512,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
String columnId = fieldLabel.getId();
Log.debug("Field id:" + columnId);
ColumnData colCurrent = null;
for (ColumnData col : parent.extractCodelistSession
for (ColumnData col : parent.getExtractCodelistSession()
.getSourceColumns()) {
if (col.getColumnId().compareTo(columnId) == 0) {
colCurrent = col;
@ -503,7 +521,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
}
}
if (colCurrent == null) {
UtilsGXT3.alert("Error creating form", "Error creating form!");
UtilsGXT3.alert(msgsCommon.error(), msgs.errorCreatingForm());
return false;
}
@ -524,8 +542,8 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
CheckBox checkNew = (CheckBox) flowButton
.getItemByItemId(CHECK_NEW);
if (checkNew == null) {
UtilsGXT3.alert("Error creating form",
"Error creating form for check radio!");
UtilsGXT3.alert(msgsCommon.error(),
msgs.errorCreatingFormForCheckRadio());
return false;
}
@ -545,7 +563,8 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
.getItemByItemId(COMBO_COLUMN);
ColumnData columnData = comboColumn.getCurrentValue();
if (columnData == null) {
UtilsGXT3.alert("Attention", "Fill all column!");
UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionFillAllColumn());
return false;
} else {
ExtractCodelistTargetColumn extractCodelistTargetC = new ExtractCodelistTargetColumn(
@ -559,7 +578,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
}
Log.debug("UpdateExtractCodelistSession:" + targetColumns);
parent.extractCodelistSession.setTargetColumns(targetColumns);
parent.getExtractCodelistSession().setTargetColumns(targetColumns);
return true;
}

View File

@ -3,9 +3,11 @@ package org.gcube.portlets.user.td.extractcodelistwidget.client.grid;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistMessages;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.widgetcommonevent.shared.tr.column.ColumnData;
@ -49,20 +51,21 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
public class ColumnDataGridPanel extends ContentPanel implements
HasSelectionHandlers<ColumnData> {
private static final int GRIDHEIGHT = 360;
private static final ColumnDataProperties props = GWT
.create(ColumnDataProperties.class);
private final CheckBoxSelectionModel<ColumnData> sm;
private final Grid<ColumnData> grid;
private ExtractCodelistMessages msgs;
private CommonMessages msgsCommon;
private WizardCard parent;
public ColumnDataGridPanel(WizardCard parent) {
this.parent = parent;
Log.debug("ColumnDataGridPanel");
setHeadingText("Columns");
initMessages();
setHeadingText(msgs.columns());
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
props.label());
@ -125,7 +128,12 @@ public class ColumnDataGridPanel extends ContentPanel implements
setWidget(con);
}
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
msgs = GWT.create(ExtractCodelistMessages.class);
}
public Grid<ColumnData> getGrid() {
return grid;
}
@ -144,12 +152,12 @@ public class ColumnDataGridPanel extends ContentPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
Log.error("No columns loaded: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error", "No columns loaded: "
UtilsGXT3.alert(msgsCommon.error(), msgs.errorNoColumnLoadedFixed()
+ caught.getLocalizedMessage());
}

View File

@ -1,35 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='ExtractCodelistWizardTD'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- <inherits name="com.google.gwt.i18n.I18N" /> -->
<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />
<!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard' /> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
<inherits
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
<inherits
name='org.gcube.portlets.user.td.expressionwidget.ExpressionWidget' />
<inherits name='org.gcube.portlets.user.td.columnwidget.ColumnWidget' />
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
<!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry' /> -->
<inherits name='org.gcube.portlets.user.td.columnwidget.ColumnWidget' />
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
<!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry'
/> -->
<!-- <set-configuration-property name="locale.cookie" value="TDLangCookie"
/> <set-configuration-property name="locale.queryparam" value="TDLang" />
<set-configuration-property name="locale.usemeta" value="Y" /> <set-configuration-property
name="locale.useragent" value="Y" /> <set-configuration-property name="locale.searchorder"
value="cookie,queryparam,meta,useragent" /> <extend-property name="locale"
values="en" /> <extend-property name="locale" values="it" /> <extend-property
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <source path='org.gcube.data.analysis.tabulardata.operation.worker'/> -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
<!-- <source path='org.gcube.data.analysis.tabulardata.operation.worker'/> -->
</module>

View File

@ -0,0 +1,42 @@
extractCodelistWizardHead = Extract Codelist
extractCodelistDetailCardHead = Codelist Detail
extractCodelistDetailsCardFormHead = Details
infoFieldSetHead = Information
nameFieldEmptyText = Enter a name...
nameFieldLabel = Name
nameFieldToolTip = Enter the name of new codelist extracted
automaticallyAttachTrueLabel = True
automaticallyAttachFalseLabel = False
attachFieldLabel = Attach
attachFieldToolTip = Select true if you want automatically attach the generated codelist
comboAttachToColumnEmptyText = Select a column...
comboAttachToColumnLabel = Attach To Column
comboAttachToColumnToolTip = Select the column to be attached to extracted codelist
attentionFillNameField = Fill name fields!
attentionSelectColumnToAttachCodelist = Select column to attach codelist!
sourceColumnsSelectionCardHead = Source Column
attentionNoColumnSelected = No column selected!
targetColumnsSelectionCardHead = Target Column
btnConnectTitle = Connect Codelist
btnDisconnectTitle = Disconnect Codelist
comboDefNewColumnEmptyText = Select a Column...
comboReferenceDefColumnEmptyText = Select a new column...
comboColumnEmptyText = Select from Codelist...
checkNewLabel = New
errorRetrievingColumnsFixed = Error retrieving columns on server.
errorCreatingForm = Error creating form!
errorCreatingFormForCheckRadio = Error creating form for check radio!
attentionFillAllColumn = Fill all column!
errorInExtractCodelistFixed = An error occurred in extract codelist.
errorAnErrorOccurredSettingCollateralTableFinalFixed = An error occurred setting collateral table final.
errorNoCollateralIdRetrieved = No collateral id retrieved
errorCollateralIdIsNull = Collateral id is null
errorAnErrorOccurredRetrievingColumnOnCollateralTableFixed = An error occurred retrieving column on collateral table.
errorAnErrorOccurredNoLabelRetrievedForAttachColumnFixed = An error occured no label retrieved for attach column
errorNoLabelRetrievedForAttachColumn = No label retrieved for attach column
errorAnErrorOccurredNoAttachColumnMatchFixed = An error occurred no attach column match
errorNoAttachColumnMatch = No attach column match
errorAnErrorOccurredOnStartChangeColumnTypeFixed = An error occurred on start change column type.
codelistAvailableInResources = The Codelists is available in the list of yours tabular resources
columns = Columns
errorNoColumnLoadedFixed = No column loaded:

View File

@ -0,0 +1,42 @@
extractCodelistWizardHead = Estrai Codelist
extractCodelistDetailCardHead = Codelist Dettaglio
extractCodelistDetailsCardFormHead = Dettagli
infoFieldSetHead = Info
nameFieldEmptyText = Inserisci un nome...
nameFieldLabel = Nome
nameFieldToolTip = Inserisci il nome della nuova codelist estratta
automaticallyAttachTrueLabel = Vero
automaticallyAttachFalseLabel = Falso
attachFieldLabel = Aggancia
attachFieldToolTip = Seleziona vero se vuoi automaticamente agganciare la codelist generata
comboAttachToColumnEmptyText = Seleziona una colonna...
comboAttachToColumnLabel = Aggancia alla Colonna
comboAttachToColumnToolTip = Seleziona la colonna per essere agganciata alla codelist estratta
attentionFillNameField = Riempi il campo nome!
attentionSelectColumnToAttachCodelist = Seleziona la colonna per essere agganciata alla codelist!
sourceColumnsSelectionCardHead = Colonna Sorgente
attentionNoColumnSelected = Nessuna colonna selezionata!
targetColumnsSelectionCardHead = Colonna Target
btnConnectTitle = Connetti Codelist
btnDisconnectTitle = Disconnetti Codelist
comboDefNewColumnEmptyText = Seleziona una colonna...
comboReferenceDefColumnEmptyText = Seleziona una nuova colonna...
comboColumnEmptyText = Seleziona dalla codelist...
checkNewLabel = Nuovo
errorRetrievingColumnsFixed = Errore recuperando le colonne sul server.
errorCreatingForm = Errore creando la form!
errorCreatingFormForCheckRadio = Errore creando la form per i radio check!
attentionFillAllColumn = Riempi tutte le colonne!
errorInExtractCodelistFixed = Un errore è stato generato nell''estrazione della codelist.
errorAnErrorOccurredSettingCollateralTableFinalFixed = Un errore è stato generato settando la collateral table a finale.
errorNoCollateralIdRetrieved = Nessun collateral id recuperato
errorCollateralIdIsNull = Collateral id è null
errorAnErrorOccurredRetrievingColumnOnCollateralTableFixed = Un errore è stato generato recuperando la colonna su collateral table.
errorAnErrorOccurredNoLabelRetrievedForAttachColumnFixed = Errore nessuna etichetta recuperata per agganciare la colonna
errorNoLabelRetrievedForAttachColumn = Nessuna etichetta recuperata per agganciare la colonna
errorAnErrorOccurredNoAttachColumnMatchFixed = Errore nessuna colonna di aggancio combacia
errorNoAttachColumnMatch = Nessuna colonna di aggancio combacia
errorAnErrorOccurredOnStartChangeColumnTypeFixed = Un errore è stato generato nel cambio tipo di colonna.
codelistAvailableInResources = La Codelist è disponibile nella lista delle tabular resources
columns = Colonne
errorNoColumnLoadedFixed = Nessuna colonna caricata:

View File

@ -0,0 +1,42 @@
extractCodelistWizardHead = Extract Codelist
extractCodelistDetailCardHead = Codelist Detail
extractCodelistDetailsCardFormHead = Details
infoFieldSetHead = Information
nameFieldEmptyText = Enter a name...
nameFieldLabel = Name
nameFieldToolTip = Enter the name of new codelist extracted
automaticallyAttachTrueLabel = True
automaticallyAttachFalseLabel = False
attachFieldLabel = Attach
attachFieldToolTip = Select true if you want automatically attach the generated codelist
comboAttachToColumnEmptyText = Select a column...
comboAttachToColumnLabel = Attach To Column
comboAttachToColumnToolTip = Select the column to be attached to extracted codelist
attentionFillNameField = Fill name fields!
attentionSelectColumnToAttachCodelist = Select column to attach codelist!
sourceColumnsSelectionCardHead = Source Column
attentionNoColumnSelected = No column selected!
targetColumnsSelectionCardHead = Target Column
btnConnectTitle = Connect Codelist
btnDisconnectTitle = Disconnect Codelist
comboDefNewColumnEmptyText = Select a Column...
comboReferenceDefColumnEmptyText = Select a new column...
comboColumnEmptyText = Select from Codelist...
checkNewLabel = New
errorRetrievingColumnsFixed = Error retrieving columns on server.
errorCreatingForm = Error creating form!
errorCreatingFormForCheckRadio = Error creating form for check radio!
attentionFillAllColumn = Fill all column!
errorInExtractCodelistFixed = An error occurred in extract codelist.
errorAnErrorOccurredSettingCollateralTableFinalFixed = An error occurred setting collateral table final.
errorNoCollateralIdRetrieved = No collateral id retrieved
errorCollateralIdIsNull = Collateral id is null
errorAnErrorOccurredRetrievingColumnOnCollateralTableFixed = An error occurred retrieving column on collateral table.
errorAnErrorOccurredNoLabelRetrievedForAttachColumnFixed = An error occured no label retrieved for attach column
errorNoLabelRetrievedForAttachColumn = No label retrieved for attach column
errorAnErrorOccurredNoAttachColumnMatchFixed = An error occurred no attach column match
errorNoAttachColumnMatch = No attach column match
errorAnErrorOccurredOnStartChangeColumnTypeFixed = An error occurred on start change column type.
codelistAvailableInResources = The Codelists is available in the list of yours tabular resources
columns = Columns
errorNoColumnLoadedFixed = No column loaded:

View File

@ -1,2 +0,0 @@
sendButton = Send
nameField = Enter your name

View File

@ -1,2 +0,0 @@
sendButton = Envoyer
nameField = Entrez votre nom