Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Upload file code deprecation (Problem to use org.eclipse.rwt.widgets.Upload and UploadItem)
Upload file code deprecation [message #938260] Tue, 09 October 2012 18:10 Go to next message
Lily Ye is currently offline Lily Ye
Messages: 3
Registered: October 2012
Junior Member
Hi,
We bought a production from a vendor many years ago, who used eclipse to develop the application. But the vendor is no longer support this application. Right now we have to make some changes to the applications, although we don't have any expertise in eclipse/java. Anyway, we imported the application to eclipse workspace (we are using
Eclipse for RCP and RAP developers; version Indigo Service Release 2, Build id 20120216-1857). We were able to compile the application (although we do see some warning messages) and created a war file and deployed it to tomcat on linux server. And we were able to upload a file. BUT the name of the upload file was changed to 'upload.1508403605239944151.tmp' instead of keeping the original file name (i.e. tran1009.xml). This caused problem to the application to continue processing. We realize/understand "org.eclipse.rwt.widgets.Upload" and "org.eclipse.rwt.widgets.UploadItem" are obsolete or no longer valid in new eclipse. We are wondering if it's still possible we can use the old code (upload function) by including some some lib/jar/patch... So we don't have to change the program if we could avoid. OR if we have to change our programs, would you please give us some guideline or sample to convert the old upload codes to new upload function.
Thank you so much for your help!
Lily
=======
private void createUploadWidget1(Composite parent) {

final Upload upload = new Upload(parent, SWT.BORDER, SWT.NONE);
upload.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

Label l = new Label(parent, SWT.WRAP);
l.setText("");

ClassLoader classLoader = getClass().getClassLoader();
Image buttonImage = Graphics.getImage(BUTTON_IMAGE_PATH, classLoader);

final Button btnStartUpload = new Button(parent, SWT.PUSH);
btnStartUpload.setText("Upload selected file");
btnStartUpload.setImage(buttonImage);
btnStartUpload.setEnabled(false);
btnStartUpload.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
upload.performUpload();
handleUploadFinished(upload);
}
});

upload.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
if (!"".equals(upload.getPath())) {
btnStartUpload.setEnabled(true);
}
}

});

}
Re: Upload file code deprecation [message #938283 is a reply to message #938260] Tue, 09 October 2012 18:33 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1815
Registered: July 2009
Senior Member
Hi,
this has been fixed with bug:
358248: File upload handler does not return actual selected filename
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358248
the file name is preserved when uploading. You should use the FileUpload
for RAP 1.5.
Best,
Ivan

On 10/9/2012 9:10 PM, Lily Ye wrote:
> Hi,
> We bought a production from a vendor many years ago, who used eclipse
> to develop the application. But the vendor is no longer support this
> application. Right now we have to make some changes to the
> applications, although we don't have any expertise in eclipse/java.
> Anyway, we imported the application to eclipse workspace (we are using
> Eclipse for RCP and RAP developers; version Indigo Service Release 2,
> Build id 20120216-1857). We were able to compile the application
> (although we do see some warning messages) and created a war file and
> deployed it to tomcat on linux server. And we were able to upload a
> file. BUT the name of the upload file was changed to
> 'upload.1508403605239944151.tmp' instead of keeping the original file
> name (i.e. tran1009.xml). This caused problem to the application to
> continue processing. We realize/understand
> "org.eclipse.rwt.widgets.Upload" and
> "org.eclipse.rwt.widgets.UploadItem" are obsolete or no longer valid
> in new eclipse. We are wondering if it's still possible we can use the
> old code (upload function) by including some some lib/jar/patch... So
> we don't have to change the program if we could avoid. OR if we have
> to change our programs, would you please give us some guideline or
> sample to convert the old upload codes to new upload function.
> Thank you so much for your help!
> Lily
> ======= private void createUploadWidget1(Composite parent) {
>
> final Upload upload = new Upload(parent, SWT.BORDER, SWT.NONE);
> upload.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
> true));
>
> Label l = new Label(parent, SWT.WRAP);
> l.setText("");
>
> ClassLoader classLoader = getClass().getClassLoader();
> Image buttonImage = Graphics.getImage(BUTTON_IMAGE_PATH,
> classLoader);
>
> final Button btnStartUpload = new Button(parent, SWT.PUSH);
> btnStartUpload.setText("Upload selected file");
> btnStartUpload.setImage(buttonImage);
> btnStartUpload.setEnabled(false);
> btnStartUpload.addSelectionListener(new SelectionAdapter() {
> @Override
> public void widgetSelected(SelectionEvent e) {
> upload.performUpload();
> handleUploadFinished(upload);
> }
> });
>
> upload.addModifyListener(new ModifyListener() {
> public void modifyText(ModifyEvent event) {
> if (!"".equals(upload.getPath())) {
> btnStartUpload.setEnabled(true);
> }
> }
>
> });
>
> }

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Upload file code deprecation [message #938505 is a reply to message #938283] Tue, 09 October 2012 23:43 Go to previous messageGo to next message
Lily Ye is currently offline Lily Ye
Messages: 3
Registered: October 2012
Junior Member
Hi Ivan,

Thank you so much for your quick response. We really appreciate it.
We downloaded RAP 1.5 tooling and runtime. Now how can we install the fix into Eclipse (Version: Indigo Serivce Rel 2)?

Thanks again.
Lily
Re: Upload file code deprecation [message #938671 is a reply to message #938505] Wed, 10 October 2012 03:54 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1815
Registered: July 2009
Senior Member
Hi,
you need the FileUpload bundles from the incubator:
http://www.eclipse.org/rap/incubator/
Best,
Ivan

On 10/10/2012 2:43 AM, Lily Ye wrote:
> Hi Ivan,
>
> Thank you so much for your quick response. We really appreciate it. We
> downloaded RAP 1.5 tooling and runtime. Now how can we install the fix
> into Eclipse (Version: Indigo Serivce Rel 2)?
>
> Thanks again.
> Lily

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Upload file code deprecation [message #959711 is a reply to message #938671] Fri, 26 October 2012 23:20 Go to previous messageGo to next message
Lily Ye is currently offline Lily Ye
Messages: 3
Registered: October 2012
Junior Member
Hi Ivan,

Because of lack of our resources to make changes in the existing java programs for "fileupload" in JUNO/RAP1.5, we are wondering if we still can use "org.eclipse.rwt.widgets.Upload" and "import org.eclipse.rwt.widgets.UploadItem" in any previous version of eclipse (the latest is better) which we still can download from eclipse website, so we can work around this upload problem and move forward.

Thanks for your advise,
Lily
Re: Upload file code deprecation [message #960117 is a reply to message #959711] Sat, 27 October 2012 07:21 Go to previous message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1815
Registered: July 2009
Senior Member
Hi,
the source code of the old deprecated Upload widget is still available
in the read-only RAP CVS repository
dev.eclipse.org:/cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rwt.widgets.upload
You could try to fix the problem yourself. I'm not sure if this old
widget is still working with RAP 1.5 - probably not. I strongly
recommend to use FileUpload bundles from the incubator instead.
[1]

Best,
Ivan

On 10/27/2012 2:20 AM, Lily Ye wrote:
> Hi Ivan,
>
> Because of lack of our resources to make changes in the existing java
> programs for "fileupload" in JUNO/RAP1.5, we are wondering if we still
> can use "org.eclipse.rwt.widgets.Upload" and "import
> org.eclipse.rwt.widgets.UploadItem" in any previous version of eclipse
> (the latest is better) which we still can download from eclipse
> website, so we can work around this upload problem and move forward.
> Thanks for your advise,
> Lily

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Tab-Icons in Fancy/Business-Theme?
Next Topic:Needes Plugins/Features for a WAR file
Goto Forum:
  


Current Time: Tue Sep 16 15:43:59 GMT 2014

Powered by FUDForum. Page generated in 0.01724 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software