refs 6548: TDM - Migrate TabMan to new PortalContext
Task-Url: https://support.d4science.org/issues/6548 Updated CodelistMappingUploadServlet git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-codelistmapping-import-widget@141736 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
54b31eea81
commit
a0bd7d29a0
|
@ -16,6 +16,7 @@ import com.allen_sauer.gwt.log.client.Log;
|
|||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||
import com.google.gwt.user.client.ui.Hidden;
|
||||
import com.sencha.gxt.core.client.Style.HideMode;
|
||||
import com.sencha.gxt.core.client.util.Padding;
|
||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||
|
@ -39,7 +40,6 @@ import com.sencha.gxt.widget.core.client.form.FormPanel;
|
|||
*/
|
||||
public class CodelistMappingFileUploadPanel extends FormPanel {
|
||||
|
||||
private static final String UPLOAD_SERVLET = "CodelistMappingUploadServlet";
|
||||
private static final int STATUS_POLLING_DELAY = 1000;
|
||||
|
||||
private FileUploadField fileUploadField;
|
||||
|
@ -77,10 +77,19 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
doLayout();
|
||||
}
|
||||
});
|
||||
|
||||
setAction(GWT.getModuleBaseURL() + UPLOAD_SERVLET);
|
||||
|
||||
StringBuilder actionUrl = new StringBuilder();
|
||||
actionUrl.append(GWT.getModuleBaseURL());
|
||||
actionUrl.append(Constants.CODELIST_MAPPING_UPLOAD_SERVLET);
|
||||
setAction(actionUrl.toString());
|
||||
|
||||
Log.info("Start Upload action Url " + actionUrl.toString());
|
||||
|
||||
|
||||
setWidth("100%");
|
||||
|
||||
|
||||
|
||||
|
||||
setEncoding(Encoding.MULTIPART);
|
||||
setMethod(Method.POST);
|
||||
}
|
||||
|
@ -89,8 +98,13 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
final CodelistMappingSession codelistMappingSession) {
|
||||
VerticalLayoutContainer content = new VerticalLayoutContainer();
|
||||
content.setWidth("100%");
|
||||
add(content);
|
||||
|
||||
|
||||
Hidden currGroupID = new Hidden();
|
||||
currGroupID.setName(Constants.CURR_GROUP_ID);
|
||||
currGroupID.setValue(GCubeClientContext.getCurrentContextId());
|
||||
|
||||
content.add(currGroupID);
|
||||
|
||||
fileUploadField = new FileUploadField();
|
||||
fileUploadField.setName("uploadFormElement");
|
||||
fileUploadField.setWidth("100%");
|
||||
|
@ -137,7 +151,10 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
btnCancel = new TextButton(msgs.btnCancelText());
|
||||
btnCancel.hide();
|
||||
content.add(btnCancel, new VerticalLayoutData(-1, -1));
|
||||
|
||||
add(content);
|
||||
|
||||
|
||||
btnUpload.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
|
@ -190,13 +207,6 @@ public class CodelistMappingFileUploadPanel extends FormPanel {
|
|||
|
||||
protected void startUpload() {
|
||||
disableUpload();
|
||||
|
||||
StringBuilder actionUrl = new StringBuilder();
|
||||
actionUrl.append(GWT.getModuleBaseURL());
|
||||
actionUrl.append(UPLOAD_SERVLET + "?" + Constants.CURR_GROUP_ID + "="
|
||||
+ GCubeClientContext.getCurrentContextId());
|
||||
setAction(actionUrl.toString());
|
||||
Log.info("Start Upload action Url " + actionUrl.toString());
|
||||
submit();
|
||||
|
||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||
|
|
Loading…
Reference in New Issue