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