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-codelistmapping-import-widget@120173 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
12d5b9202f
commit
5ad6df5ea4
|
@ -39,7 +39,7 @@ Documentation
|
|||
tabular-data-codelistmapping-import-widget allows import from url, file and workspace of maps for codelist
|
||||
|
||||
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
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.gcube.portlets.user.td.codelistmappingimportwidget.client.progress.Fi
|
|||
import org.gcube.portlets.user.td.codelistmappingimportwidget.client.progress.FileUploadProgressListener;
|
||||
import org.gcube.portlets.user.td.codelistmappingimportwidget.client.progress.FileUploadProgressUpdater;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
|
||||
import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -36,34 +37,42 @@ import com.sencha.gxt.widget.core.client.form.FormPanel;
|
|||
*/
|
||||
public class CodelistMappingFileUploadPanel extends FormPanel {
|
||||
|
||||
protected static final String UPLOAD_SERVLET = "CodelistMappingUploadServlet";
|
||||
private static final String UPLOAD_SERVLET = "CodelistMappingUploadServlet";
|
||||
private static final int STATUS_POLLING_DELAY = 1000;
|
||||
|
||||
public static final int STATUS_POLLING_DELAY = 1000;
|
||||
private FileUploadField fileUploadField;
|
||||
private TextButton btnUpload;
|
||||
|
||||
protected ResourceBundle res;
|
||||
protected FileUploadField fileUploadField;
|
||||
protected TextButton uploadButton;
|
||||
private FileUploadProgressUpdater progressUpdater;
|
||||
|
||||
protected FileUploadProgressUpdater progressUpdater;
|
||||
private ProgressBar uploadProgressBar;
|
||||
|
||||
protected ProgressBar uploadProgressBar;
|
||||
private TextButton btnCancel;
|
||||
|
||||
protected TextButton cancelButton;
|
||||
private CodelistMappingMessages msgs;
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
public CodelistMappingFileUploadPanel(ResourceBundle res, final CodelistMappingUploadFileCard card,
|
||||
public CodelistMappingFileUploadPanel(ResourceBundle res,
|
||||
final CodelistMappingUploadFileCard card,
|
||||
final CodelistMappingSession codelistMappingSession) {
|
||||
this.res = res;
|
||||
initMessages();
|
||||
initForm();
|
||||
create(card, codelistMappingSession);
|
||||
}
|
||||
|
||||
protected void initMessages() {
|
||||
msgs = GWT.create(CodelistMappingMessages.class);
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
protected void initForm() {
|
||||
setId("CodelistMappingUploadPanel");
|
||||
setLabelAlign(LabelAlign.TOP);
|
||||
getElement().setPadding(new Padding(5));
|
||||
|
||||
addShowHandler(new ShowHandler() {
|
||||
|
||||
|
||||
public void onShow(ShowEvent event) {
|
||||
doLayout();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -72,7 +81,10 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
|
||||
setEncoding(Encoding.MULTIPART);
|
||||
setMethod(Method.POST);
|
||||
}
|
||||
|
||||
protected void create(final CodelistMappingUploadFileCard card,
|
||||
final CodelistMappingSession codelistMappingSession) {
|
||||
VerticalLayoutContainer content = new VerticalLayoutContainer();
|
||||
content.setWidth("100%");
|
||||
add(content);
|
||||
|
@ -81,25 +93,25 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
fileUploadField.setName("uploadFormElement");
|
||||
fileUploadField.setWidth("100%");
|
||||
|
||||
content.add(new FieldLabel(fileUploadField,
|
||||
"Select the file to import"),
|
||||
content.add(
|
||||
new FieldLabel(fileUploadField, msgs.selectTheFileToImport()),
|
||||
new VerticalLayoutData(-2, -1));
|
||||
|
||||
uploadButton = new TextButton("Upload");
|
||||
content.add(uploadButton, new VerticalLayoutData(-1, -1));
|
||||
btnUpload = new TextButton(msgs.btnUploadText());
|
||||
content.add(btnUpload, new VerticalLayoutData(-1, -1));
|
||||
|
||||
fileUploadField.addChangeHandler(new ChangeHandler() {
|
||||
|
||||
public void onChange(ChangeEvent event) {
|
||||
uploadButton.setEnabled(fileUploadField.isValid());
|
||||
btnUpload.setEnabled(fileUploadField.isValid());
|
||||
String path = fileUploadField.getValue();
|
||||
int punto = path.lastIndexOf(".");
|
||||
if(punto<0){
|
||||
punto=path.length();
|
||||
if (punto < 0) {
|
||||
punto = path.length();
|
||||
}
|
||||
int slash = path.lastIndexOf("/");
|
||||
int backslash = path.lastIndexOf("\\");
|
||||
String filename="";
|
||||
String filename = "";
|
||||
if (slash > backslash) {
|
||||
if (slash != -1) {
|
||||
filename = path.substring(slash + 1, punto);
|
||||
|
@ -108,8 +120,7 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
if (backslash != -1) {
|
||||
filename = path.substring(backslash + 1, punto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
codelistMappingSession.setLocalFileName(filename);
|
||||
}
|
||||
|
@ -121,11 +132,11 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
content.add(uploadProgressBar, new VerticalLayoutData(-2, -1));
|
||||
uploadProgressBar.hide();
|
||||
|
||||
cancelButton = new TextButton("Cancel");
|
||||
cancelButton.hide();
|
||||
content.add(cancelButton, new VerticalLayoutData(-1, -1));
|
||||
btnCancel = new TextButton(msgs.btnCancelText());
|
||||
btnCancel.hide();
|
||||
content.add(btnCancel, new VerticalLayoutData(-1, -1));
|
||||
|
||||
uploadButton.addSelectHandler(new SelectHandler() {
|
||||
btnUpload.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.info("request upload");
|
||||
|
@ -134,7 +145,7 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
|| fileUploadField.getValue().equals("")) {
|
||||
Log.info("fileUploadField is null or empty");
|
||||
AlertMessageBox alertMessageBox = new AlertMessageBox(
|
||||
"XML file missing", "Please specify a XML file.");
|
||||
msgsCommon.attention(), msgs.attentionSpecifyAXmlFile());
|
||||
alertMessageBox.show();
|
||||
return;
|
||||
} else {
|
||||
|
@ -156,19 +167,18 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
}
|
||||
|
||||
public void operationInitializing() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void operationFailed(Throwable caught, String reason,
|
||||
String failureDetails) {
|
||||
card.showErrorAndHide("Error uploading the xml file", reason,
|
||||
card.showErrorAndHide(msgs.errorUploadingTheXMLFileHead(), reason,
|
||||
"", caught);
|
||||
}
|
||||
|
||||
public void operationComplete() {
|
||||
card.setEnableNextButton(true);
|
||||
cancelButton.disable();
|
||||
btnCancel.disable();
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -190,10 +200,10 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
|
||||
protected void disableUpload() {
|
||||
fileUploadField.disable();
|
||||
uploadButton.disable();
|
||||
btnUpload.disable();
|
||||
|
||||
uploadProgressBar.show();
|
||||
cancelButton.show();
|
||||
btnCancel.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface CodelistMappingMessages extends Messages {
|
|||
@DefaultMessage("Would you like to delete this tabular resource without table?")
|
||||
String wouldYouLikeToDeleteThisTabularResourceWithoutTable();
|
||||
|
||||
@DefaultMessage("Error on delete TabResource: ")
|
||||
@DefaultMessage("Error on delete Tabular Resource: ")
|
||||
String errorOnDeleteTabularResourceFixed();
|
||||
|
||||
@DefaultMessage("Select The Code Column")
|
||||
|
@ -58,7 +58,7 @@ public interface CodelistMappingMessages extends Messages {
|
|||
@DefaultMessage("XML map")
|
||||
String fieldDescriptionDefaultValue();
|
||||
|
||||
@DefaultMessage("Fill in all fields")
|
||||
@DefaultMessage("Fill in all fields!")
|
||||
String attentionFillInAllFields();
|
||||
|
||||
@DefaultMessage("Document: ")
|
||||
|
@ -78,6 +78,72 @@ public interface CodelistMappingMessages extends Messages {
|
|||
|
||||
@DefaultMessage("Error in Codelist Mapping Import")
|
||||
String errorInCodelistMappingImportHead();
|
||||
|
||||
@DefaultMessage("Select the file to import")
|
||||
String selectTheFileToImport();
|
||||
|
||||
@DefaultMessage("Upload")
|
||||
String btnUploadText();
|
||||
|
||||
@DefaultMessage("Cancel")
|
||||
String btnCancelText();
|
||||
|
||||
@DefaultMessage("Please specify a XML file!")
|
||||
String attentionSpecifyAXmlFile();
|
||||
|
||||
@DefaultMessage("Error uploading the xml file")
|
||||
String errorUploadingTheXMLFileHead();
|
||||
|
||||
@DefaultMessage("Codelist Mapping Url Selection")
|
||||
String codelistMappingUrlSelectionCardHead();
|
||||
|
||||
@DefaultMessage("Insert a valid url...")
|
||||
String urlFieldEmptyText();
|
||||
|
||||
@DefaultMessage("Url")
|
||||
String urlFieldLabel();
|
||||
|
||||
@DefaultMessage("CSV Import From Workspace")
|
||||
String codelistMappingWorkSpaceSelectionCardHead();
|
||||
|
||||
@DefaultMessage("Workspace Selection")
|
||||
String workspaceExplorerSelectPanelHead();
|
||||
|
||||
@DefaultMessage("Error retrieving the file from the workspace: ")
|
||||
String errorRetrievingTheFileFromWorkspaceFixed();
|
||||
|
||||
@DefaultMessage("Name")
|
||||
String nameColumn();
|
||||
|
||||
@DefaultMessage("Type")
|
||||
String typeColumn();
|
||||
|
||||
@DefaultMessage("Table Type")
|
||||
String tableTypeColumn();
|
||||
|
||||
@DefaultMessage("Agency")
|
||||
String agencyColumn();
|
||||
|
||||
@DefaultMessage("Owner")
|
||||
String ownerColumn();
|
||||
|
||||
@DefaultMessage("Creation Date")
|
||||
String creationDateColumn();
|
||||
|
||||
@DefaultMessage("Delete")
|
||||
String deleteItem();
|
||||
|
||||
@DefaultMessage("Error retrieving tabular resources on server: ")
|
||||
String errorRetrievingTabularResourceFixed();
|
||||
|
||||
@DefaultMessage("Would you like to delete this tabular resource?")
|
||||
String wouldYouLikeToDeleteThisTabularResource();
|
||||
|
||||
@DefaultMessage("Column")
|
||||
String labelColumn();
|
||||
|
||||
@DefaultMessage("No load columns:")
|
||||
String errorNoLoadColumnsFixed();
|
||||
|
||||
|
||||
}
|
|
@ -4,9 +4,11 @@
|
|||
package org.gcube.portlets.user.td.codelistmappingimportwidget.client;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
|
||||
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;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
|
@ -24,15 +26,16 @@ import com.sencha.gxt.widget.core.client.form.TextField;
|
|||
*
|
||||
*/
|
||||
public class CodelistMappingUrlSelectionCard extends WizardCard {
|
||||
private static CodelistMappingMessages msgs= GWT.create(CodelistMappingMessages.class);
|
||||
private CodelistMappingSession codelistMappingSession;
|
||||
private CodelistMappingUrlSelectionCard thisCard;
|
||||
|
||||
protected CodelistMappingSession codelistMappingSession;
|
||||
protected CodelistMappingUrlSelectionCard thisCard;
|
||||
|
||||
protected TextField urlField;
|
||||
private TextField urlField;
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
public CodelistMappingUrlSelectionCard(
|
||||
final CodelistMappingSession codelistMappingSession) {
|
||||
super("Codelist Mapping Url Selection", "");
|
||||
super(msgs.codelistMappingUrlSelectionCardHead(), "");
|
||||
this.thisCard = this;
|
||||
this.codelistMappingSession = codelistMappingSession;
|
||||
|
||||
|
@ -45,15 +48,19 @@ public class CodelistMappingUrlSelectionCard extends WizardCard {
|
|||
|
||||
urlField = new TextField();
|
||||
urlField.setAllowBlank(false);
|
||||
urlField.setEmptyText("Insert a valid url...");
|
||||
urlField.setEmptyText(msgs.urlFieldEmptyText());
|
||||
urlField.setValue(codelistMappingSession.getUrl());
|
||||
urlField.setAllowBlank(false);
|
||||
v.add(new FieldLabel(urlField, "Url"), new VerticalLayoutData(1, -1));
|
||||
v.add(new FieldLabel(urlField, msgs.urlFieldLabel()), new VerticalLayoutData(1, -1));
|
||||
|
||||
setContent(form);
|
||||
|
||||
}
|
||||
|
||||
protected void initMessages(){
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
protected void checkUrl() {
|
||||
getWizardWindow().setEnableNextButton(false);
|
||||
getWizardWindow().setEnableBackButton(false);
|
||||
|
@ -69,7 +76,7 @@ public class CodelistMappingUrlSelectionCard extends WizardCard {
|
|||
|
||||
if (urlField.getValue() == null || urlField.getValue().isEmpty()
|
||||
|| !urlField.isValid()) {
|
||||
d = new AlertMessageBox("Attention!", "Fill in all fields");
|
||||
d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionFillInAllFields());
|
||||
d.addHideHandler(hideHandler);
|
||||
d.show();
|
||||
} else {
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappi
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
|
||||
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.wizardwidget.client.WizardCard;
|
||||
|
@ -23,6 +24,7 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
|||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.Command;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
|
@ -36,14 +38,9 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
*
|
||||
*/
|
||||
public class CodelistMappingWorkSpaceSelectionCard extends WizardCard {
|
||||
|
||||
/*
|
||||
* public interface HtmlLayoutContainerTemplate extends XTemplates {
|
||||
*
|
||||
* @XTemplate(
|
||||
* "<div class=\"wspaceSelectionCard\" style=\"margin:auto;padding:auto;\"></div>"
|
||||
* ) SafeHtml getTemplate(); }
|
||||
*/
|
||||
private static CodelistMappingMessages msgs = GWT
|
||||
.create(CodelistMappingMessages.class);
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
private CodelistMappingSession codelistMappingSession;
|
||||
private CodelistMappingWorkSpaceSelectionCard thisCard;
|
||||
|
@ -53,20 +50,18 @@ public class CodelistMappingWorkSpaceSelectionCard extends WizardCard {
|
|||
|
||||
public CodelistMappingWorkSpaceSelectionCard(
|
||||
final CodelistMappingSession codelistMappingSession) {
|
||||
super("CSV Import From Workspace", "");
|
||||
|
||||
super(msgs.codelistMappingWorkSpaceSelectionCardHead(), "");
|
||||
this.codelistMappingSession = codelistMappingSession;
|
||||
thisCard = this;
|
||||
initMessages();
|
||||
create();
|
||||
}
|
||||
|
||||
/*
|
||||
* HtmlLayoutContainerTemplate templates = GWT
|
||||
* .create(HtmlLayoutContainerTemplate.class);
|
||||
*
|
||||
* HtmlLayoutContainer htmlLayoutContainer = new HtmlLayoutContainer(
|
||||
* templates.getTemplate()); htmlLayoutContainer.add(button1, new
|
||||
* HtmlData(".wspaceSelectionCard"));
|
||||
*/
|
||||
protected void initMessages() {
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
protected void create() {
|
||||
p = new VerticalLayoutContainer();
|
||||
|
||||
Log.debug("Set Workspace Panel");
|
||||
|
@ -84,8 +79,8 @@ public class CodelistMappingWorkSpaceSelectionCard extends WizardCard {
|
|||
FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,
|
||||
allowedFileExtensions, new HashMap<String, String>());
|
||||
|
||||
wpanel = new WorkspaceExplorerSelectPanel(new String(
|
||||
"Workspace Selection"), filterCriteria, selectableTypes);
|
||||
wpanel = new WorkspaceExplorerSelectPanel(
|
||||
msgs.workspaceExplorerSelectPanelHead(), filterCriteria, selectableTypes);
|
||||
|
||||
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||
|
||||
|
@ -139,7 +134,6 @@ public class CodelistMappingWorkSpaceSelectionCard extends WizardCard {
|
|||
p.add(wpanel, new VerticalLayoutData(1, 1, new Margins(0, 0, 0, 44)));
|
||||
|
||||
setContent(p);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -193,19 +187,19 @@ public class CodelistMappingWorkSpaceSelectionCard extends WizardCard {
|
|||
} else {
|
||||
if (caught instanceof TDGWTIsLockedException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
showErrorAndHide("Error Locked",
|
||||
showErrorAndHide(msgsCommon.errorLocked(),
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
if (caught instanceof TDGWTIsFinalException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
showErrorAndHide("Error Final",
|
||||
showErrorAndHide(msgsCommon.errorFinal(),
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
showErrorAndHide(
|
||||
"Error",
|
||||
"Error retrieving the file from the workspace: ",
|
||||
msgsCommon.error(),
|
||||
msgs.errorRetrievingTheFileFromWorkspaceFixed(),
|
||||
caught.getLocalizedMessage(),
|
||||
caught);
|
||||
}
|
||||
|
|
|
@ -36,11 +36,12 @@ public class SourceSelectionCard extends WizardCard {
|
|||
private final WorkspaceSource workspaceSource = WorkspaceSource.INSTANCE;
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
public SourceSelectionCard(final CodelistMappingSession codelistMappingSession) {
|
||||
public SourceSelectionCard(
|
||||
final CodelistMappingSession codelistMappingSession) {
|
||||
super(msgs.sourceSelectionCardHead(), "");
|
||||
this.codelistMappingSession = codelistMappingSession;
|
||||
initMessages();
|
||||
|
||||
|
||||
// Default
|
||||
codelistMappingSession.setSource(urlSource);
|
||||
|
||||
|
@ -50,8 +51,8 @@ public class SourceSelectionCard extends WizardCard {
|
|||
|
||||
Radio radioUrlSource = new Radio();
|
||||
radioUrlSource.setBoxLabel("<p style='display:inline-table;'><b>"
|
||||
+ msgsCommon.urlSourceName() + "</b><br>" + msgsCommon.urlSourceDescription()
|
||||
+ "</p>");
|
||||
+ msgsCommon.urlSourceName() + "</b><br>"
|
||||
+ msgsCommon.urlSourceDescription() + "</p>");
|
||||
radioUrlSource.setName(urlSource.getName());
|
||||
radioUrlSource.setStylePrimaryName(res.wizardCSS()
|
||||
.getImportSelectionSource());
|
||||
|
@ -120,10 +121,10 @@ public class SourceSelectionCard extends WizardCard {
|
|||
|
||||
}
|
||||
|
||||
protected void initMessages(){
|
||||
protected void initMessages() {
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
Log.debug("Setup Card");
|
||||
|
@ -174,13 +175,12 @@ public class SourceSelectionCard extends WizardCard {
|
|||
};
|
||||
|
||||
getWizardWindow().setNextButtonCommand(sayNextCard);
|
||||
|
||||
|
||||
setEnableNextButton(true);
|
||||
setNextButtonVisible(true);
|
||||
setEnableBackButton(false);
|
||||
setBackButtonVisible(false);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -146,17 +146,6 @@ public class TabResourcesSelectionCard extends WizardCard {
|
|||
protected void deleteTRWithLastTableNull() {
|
||||
final ConfirmMessageBox mb = new ConfirmMessageBox(msgs.delete(),
|
||||
msgs.wouldYouLikeToDeleteThisTabularResourceWithoutTable());
|
||||
/*
|
||||
* GXT 3.0.1 mb.addHideHandler(new HideHandler() { public void
|
||||
* onHide(HideEvent event) { if (mb.getHideButton() ==
|
||||
* mb.getButtonById(PredefinedButton.YES .name())) {
|
||||
* callDeleteLastTable(); } else if (mb.getHideButton() == mb
|
||||
* .getButtonById(PredefinedButton.NO.name())) {
|
||||
* setEnableNextButton(true);
|
||||
* setEnableBackButton(true); } } });
|
||||
*/
|
||||
|
||||
// Next in GXT 3.1.1
|
||||
|
||||
mb.addDialogHideHandler(new DialogHideHandler() {
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalExcept
|
|||
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.gwtservice.shared.tr.TabResource;
|
||||
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.wizardwidget.client.WizardCard;
|
||||
|
@ -60,8 +61,13 @@ import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|||
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
||||
//Next in GXT 3.1.1
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TabResourcesSelectionPanel extends ContentPanel implements
|
||||
HasSelectionHandlers<TabResource> {
|
||||
private static final DateTimeFormat sdf = DateTimeFormat
|
||||
|
@ -75,11 +81,16 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
|
||||
private WizardCard parent;
|
||||
|
||||
private CodelistMappingMessages msgs;
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
public TabResourcesSelectionPanel(WizardCard parent, ResourceBundle res) {
|
||||
this.res = res;
|
||||
this.parent = parent;
|
||||
Log.debug("TabResourcesSelectionPanel");
|
||||
initMessages();
|
||||
init();
|
||||
|
||||
try {
|
||||
createContextMenu();
|
||||
buildPanel();
|
||||
|
@ -90,23 +101,29 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
}
|
||||
}
|
||||
|
||||
protected void initMessages(){
|
||||
msgs = GWT.create(CodelistMappingMessages.class);
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
setHeaderVisible(false);
|
||||
// new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void buildPanel() {
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(new LabelToolItem("Search: "));
|
||||
toolBar.add(new LabelToolItem(msgsCommon.toolItemSearchLabel()));
|
||||
final TextField searchField = new TextField();
|
||||
toolBar.add(searchField);
|
||||
|
||||
TextButton btnReload = new TextButton();
|
||||
// btnReload.setText("Reload");
|
||||
btnReload.setIcon(res.refresh16());
|
||||
btnReload.setToolTip("Reload");
|
||||
btnReload.setToolTip(msgsCommon.toolItemReloadLabel());
|
||||
toolBar.add(btnReload);
|
||||
|
||||
IdentityValueProvider<TabResource> identity = new IdentityValueProvider<TabResource>();
|
||||
|
@ -117,19 +134,19 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
.create(TabResourceProperties.class);
|
||||
|
||||
ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(
|
||||
properties.name(), 90, "Name");
|
||||
properties.name(), 90, msgs.nameColumn());
|
||||
ColumnConfig<TabResource, String> typeColumn = new ColumnConfig<TabResource, String>(
|
||||
properties.tabResourceType(), 30, "Type");
|
||||
properties.tabResourceType(), 30, msgs.typeColumn());
|
||||
ColumnConfig<TabResource, String> tableTypeNameColumn = new ColumnConfig<TabResource, String>(
|
||||
properties.tableTypeName(), 30, "Table Type");
|
||||
properties.tableTypeName(), 30, msgs.tableTypeColumn());
|
||||
ColumnConfig<TabResource, String> agencyColumn = new ColumnConfig<TabResource, String>(
|
||||
properties.agency(), 60, "Agency");
|
||||
properties.agency(), 60, msgs.agencyColumn());
|
||||
ColumnConfig<TabResource, String> ownerColumn = new ColumnConfig<TabResource, String>(
|
||||
properties.ownerLogin(), 70, "Owner");
|
||||
ColumnConfig<TabResource, Date> dateColumn = new ColumnConfig<TabResource, Date>(
|
||||
properties.date(), 50, "Creation Date");
|
||||
properties.ownerLogin(), 70, msgs.ownerColumn());
|
||||
ColumnConfig<TabResource, Date> creationDateColumn = new ColumnConfig<TabResource, Date>(
|
||||
properties.date(), 50, msgs.creationDateColumn());
|
||||
|
||||
dateColumn.setCell(new DateCell(sdf));
|
||||
creationDateColumn.setCell(new DateCell(sdf));
|
||||
|
||||
List<ColumnConfig<TabResource, ?>> columns = new ArrayList<ColumnConfig<TabResource, ?>>();
|
||||
columns.add(nameColumn);
|
||||
|
@ -137,7 +154,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
columns.add(tableTypeNameColumn);
|
||||
columns.add(agencyColumn);
|
||||
columns.add(ownerColumn);
|
||||
columns.add(dateColumn);
|
||||
columns.add(creationDateColumn);
|
||||
|
||||
ColumnModel<TabResource> cm = new ColumnModel<TabResource>(columns);
|
||||
|
||||
|
@ -223,7 +240,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
|
||||
protected void createContextMenu() {
|
||||
contextMenu = new Menu();
|
||||
MenuItem deleteTRItem = new MenuItem("Delete");
|
||||
MenuItem deleteTRItem = new MenuItem(msgs.deleteItem());
|
||||
deleteTRItem.setId("DeleteTR");
|
||||
deleteTRItem
|
||||
.setIcon(org.gcube.portlets.user.td.codelistmappingimportwidget.client.dataresource.ResourceBundle.INSTANCE
|
||||
|
@ -277,21 +294,21 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
} else {
|
||||
if (caught instanceof TDGWTIsLockedException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
parent.showErrorAndHide("Error Locked",
|
||||
parent.showErrorAndHide(msgsCommon.errorLocked(),
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
if (caught instanceof TDGWTIsFinalException) {
|
||||
Log.error(caught.getLocalizedMessage());
|
||||
parent.showErrorAndHide("Error Final",
|
||||
parent.showErrorAndHide(msgsCommon.errorFinal(),
|
||||
caught.getLocalizedMessage(), "",
|
||||
caught);
|
||||
} else {
|
||||
Log.debug("Error retrieving tabular resource: "
|
||||
+ caught.getLocalizedMessage());
|
||||
parent.showErrorAndHide(
|
||||
"Error",
|
||||
"Error retrieving tabular resources on server: ",
|
||||
msgsCommon.error(),
|
||||
msgs.errorRetrievingTabularResourceFixed(),
|
||||
caught.getLocalizedMessage(),
|
||||
caught);
|
||||
}
|
||||
|
@ -336,19 +353,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
|
||||
protected void deleteTR(TabResource tabResource) {
|
||||
removableTR = tabResource;
|
||||
final ConfirmMessageBox mb = new ConfirmMessageBox("Delete",
|
||||
"Would you like to delete this tabular resource?");
|
||||
/*
|
||||
* GXT 3.0.1 mb.addHideHandler(new HideHandler() { public void
|
||||
* onHide(HideEvent event) { if (mb.getHideButton() ==
|
||||
* mb.getButtonById(PredefinedButton.YES .name())) {
|
||||
* callDeleteTabularResource(); } else if (mb.getHideButton() == mb
|
||||
* .getButtonById(PredefinedButton.NO.name())) {
|
||||
*
|
||||
* } } });
|
||||
*/
|
||||
|
||||
// Next in GXT 3.1.1
|
||||
final ConfirmMessageBox mb = new ConfirmMessageBox(msgs.delete(),
|
||||
msgs.wouldYouLikeToDeleteThisTabularResource());
|
||||
|
||||
|
||||
mb.addDialogHideHandler(new DialogHideHandler() {
|
||||
|
||||
|
@ -380,8 +387,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
|
|||
|
||||
public void onFailure(Throwable caught) {
|
||||
UtilsGXT3.alert(
|
||||
"Error",
|
||||
"Error on delete TabResource: "
|
||||
msgsCommon.error(),
|
||||
msgs.errorOnDeleteTabularResourceFixed()
|
||||
+ caught.getLocalizedMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,12 @@ package org.gcube.portlets.user.td.codelistmappingimportwidget.client.grid;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.td.codelistmappingimportwidget.client.CodelistMappingMessages;
|
||||
import org.gcube.portlets.user.td.codelistmappingimportwidget.client.ColumnSelectionCard;
|
||||
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.TRId;
|
||||
|
@ -39,20 +41,28 @@ import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
|||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class ColumnDataGridPanel extends ContentPanel implements
|
||||
HasSelectionHandlers<ColumnData> {
|
||||
protected static final int GRIDHEIGHT = 360;
|
||||
|
||||
protected static final ColumnDataProperties props = GWT
|
||||
private static final int GRIDHEIGHT = 360;
|
||||
private static final ColumnDataProperties props = GWT
|
||||
.create(ColumnDataProperties.class);
|
||||
|
||||
protected final CheckBoxSelectionModel<ColumnData> sm;
|
||||
private CheckBoxSelectionModel<ColumnData> sm;
|
||||
private Grid<ColumnData> grid;
|
||||
|
||||
protected final Grid<ColumnData> grid;
|
||||
|
||||
protected TRId trId;
|
||||
private CodelistMappingMessages msgs;
|
||||
private CommonMessages msgsCommon;
|
||||
|
||||
private TRId trId;
|
||||
private ColumnSelectionCard parent;
|
||||
|
||||
|
||||
public ColumnDataGridPanel(ColumnSelectionCard parent, TRId trId) {
|
||||
Log.debug("ColumnDataGridPanel");
|
||||
if (trId == null) {
|
||||
|
@ -61,12 +71,25 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
|||
Log.debug("ColumnDataGridPanel: " + trId.toString());
|
||||
this.parent = parent;
|
||||
this.trId = trId;
|
||||
initMessages();
|
||||
initPanel();
|
||||
create();
|
||||
|
||||
}
|
||||
|
||||
protected void initMessages(){
|
||||
msgs = GWT.create(CodelistMappingMessages.class);
|
||||
msgsCommon = GWT.create(CommonMessages.class);
|
||||
}
|
||||
|
||||
protected void initPanel(){
|
||||
setHeaderVisible(false);
|
||||
// setHeadingText("Columns");
|
||||
}
|
||||
|
||||
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
||||
props.label(), 120, "Column");
|
||||
protected void create() {
|
||||
ColumnConfig<ColumnData, String> labelColumn = new ColumnConfig<ColumnData, String>(
|
||||
props.label(), 120, msgs.labelColumn());
|
||||
|
||||
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
||||
|
||||
|
@ -74,7 +97,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
|||
|
||||
List<ColumnConfig<ColumnData, ?>> l = new ArrayList<ColumnConfig<ColumnData, ?>>();
|
||||
|
||||
l.add(labelCol);
|
||||
l.add(labelColumn);
|
||||
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(l);
|
||||
|
||||
ListStore<ColumnData> store = new ListStore<ColumnData>(props.id());
|
||||
|
@ -122,8 +145,9 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
|||
con.setScrollMode(ScrollMode.AUTO);
|
||||
con.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
setWidget(con);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Grid<ColumnData> getGrid() {
|
||||
return grid;
|
||||
|
@ -143,12 +167,14 @@ public class ColumnDataGridPanel extends ContentPanel 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.error("No load columns: "
|
||||
+ caught.getLocalizedMessage());
|
||||
parent.showErrorAndHide("Error","No load columns:",
|
||||
parent.showErrorAndHide(msgsCommon.error(),
|
||||
msgs.errorNoLoadColumnsFixed(),
|
||||
caught.getLocalizedMessage(), caught);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package org.gcube.portlets.user.td.codelistmappingimportwidget.client.progress;
|
||||
|
||||
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 FileUploadProgressMessages extends Messages {
|
||||
|
||||
//
|
||||
@DefaultMessage("Please Wait...")
|
||||
String pleaseWait();
|
||||
|
||||
@DefaultMessage("File upload completed.")
|
||||
String fileUploadCompleted();
|
||||
|
||||
@DefaultMessage("File Upload Failed")
|
||||
String fileUploadFailedHead();
|
||||
|
||||
@DefaultMessage("File upload failed.")
|
||||
String fileUploadFailed();
|
||||
|
||||
@DefaultMessage("Initializing...")
|
||||
String initializing();
|
||||
|
||||
@DefaultMessage("% Uploading...")
|
||||
String percUploading();
|
||||
|
||||
@DefaultMessage("Completing...")
|
||||
String completing();
|
||||
|
||||
@DefaultMessage("Failed getting operation updates")
|
||||
String failedGettingOperarionUpdateds();
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue