• Adding a dialog box in Download Servlet

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #47713  by sickboy8388
 
Hi, I'm working with OpenKM-6.3.7-DEV for the last 2 months. My goal was to integrate OpenKM with a Key Management Platform. I achieved my goal very quickly.
Now I'm facing a very simple problem (I hope :) ), when I decrypt a file, it depends on file dimension, I want to show an alert/popup with a simple text message until the operations is not over.

I spent last 5 days to find a solution, but I think that I'm very poor with GWT framework.

To add this new alert I performed the following operations:

1-I create a class DownloadPopup.java as any other popup in the soruce code(e.g. AboutPopup.java)

2-Later I declared the new popup in /openkm/src/main/java/com/openkm/frontend/client/Main.java and I initialize my new popup as the others general panels that are initialiize in onModuleLoad2 in the same class.

What is still obscure for me is the way to mapping the action of showing the popup when a specific class is called?

thx in advance :)
 #47743  by sickboy8388
 
Jllort thanks for your suggests. I'm able to create and show the now popup after I select the dowload button.

I saw that the function fireEvent notify the actual action, I'm tryin' to remove the popup when the download is over, but unfortunately I still try to understand when the operations is over, to invoke the method that hide the popup
Attachments
popup.jpg
popup.jpg (144.57 KiB) Viewed 2069 times
 #47780  by sickboy8388
 
Hi Jllort, I'm still facing the problem of hiding the popup after download is complete.

I'm trying to follow your hint, but I think I'm getting a little bit lost.

I look at the point when the UPLOADED_STATE is set, from this starting point I'm trying to use this solution, but It's still not so clear:

For me is still obscure the interaction between the 3 classes: FileUploadPopup, FancyFileUpload, FileUploadForm.

I try to develop my solution for the download popup:

- I create a FancyFileDownload.java that use a nested class (DownloadDisplay) to update the widget state.

- GWTFileDownloadStatus.java and GWTFileDownloadResponse.java but I'm not sure about how the popup interacts with these 2 classes.

-DownloadAlertPopup that use the FancyFileDownload class to show/hide the popup through the widget state.


-I modified OKMGeneralService.java and OKMGeneralServiceAsync.java and add the method getFileDownloadStatus()

-I'm stuck in the GeneralServlet, trying to add the method getFileDownloadStatus, I should develop the DownlodFileListener ?

It's been now a week that I worked for this simple popup, I was wondering if there is a way more simple, to do that. For example is possible to pass as argument of the show method in the popup the dimension of the downloading file? I could use the dimension to give an input to a TIMER object that hide the popup ? GWT is really tricky, specially in this case when I need to modify an UI that is not develop with my two own hands.
 #47789  by jllort
 
The GWTFileDownloadStatus.java and GWTFileDownloadResponse.java are controlled in the FileUploadServer.

Anyway, I think I have focus the problem in uploading and really you talked me for downloading?

The class what takes control of downloading is com.openkm.frontend.client.util.Util. Take a look for a method named downloadXXXX.

Timer might be an option but will be better if you add some new servlet or method in GWT servlet connected with the popup to take control the current document status ( 1 second timer to update information until be finished and then close the popup ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.