• Download a document's notes using a worklfow

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
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.
 #18304  by noxious
 
Hello,
I want to create a worklfow which, when called, will firstly create a text file with the notes of the selected document and secondly will download this file to the web client.
The first part is easy for me but the second seems really difficult. Can I call the DownloadServlet Class or use WebUtils.sendFile() inside an ActionHandler? How?
Sorry if my question seems stupid, I am comfortable with OpenKM classes for handling documents but I have no experience with Java Servlets and any hint would be appreciated :D .
 #18318  by jllort
 
I want understanding better:
1- User start document workflow. Do you want the same user after starting workflow automatically download the document or a user who has asigned the next workflow task ?
 #18325  by noxious
 
I want to create this workflow so that the user's will be able to download a document's notes.
The document will be downloaded from the iniator of the workflow. No task assignment to other user.
I have created an ActionHandler that reads the document's notes and then creates a txt file with the notes inside the repository.
My problem is that I dont'n know how to call DownloadServlet inside this ActionHandler so that the txt file will be sent for download at the user's browser.
I thought I could do something like that:
Code: Select all
String pathParam=URLEncoder.encode(path, "UTF-8");
String uuidParam=URLEncoder.encode(uuid, "UTF-8");
String tokenParam=URLEncoder.encode(token, "UTF-8"); 
URL url = new URL("http://localhost:8080/OpenKM/frontend/DownloadServlet?path="+pathParam+"&uuid="+uuidParam+"&token="+tokenParam);
URLConnection conn = url.openConnection();
but it didn't work.
How can I download the file?Can I do it without a servlet?
 #18335  by jllort
 
I suppose which was your problem but I want to be sure about it. Actually at starting workflow task this can not be done with the actual workflow, will need to make some changes to return some UI action after workflow has been started ( that can be done more easy with assigned task, but is more difficult with starting process ).
This kind of feature need source code changes. The most easiest solution I can give to you is sending some mail address with notes attachment.
 #18348  by noxious
 
Ok so,
Let's suppose that I create a task node and I assign it to a user. Then, this user enters the task node, inserts the path of a document in the task form and presses the submit button.
If all the above take place, can I then create an ActionHandler or a script that on submit will download the selected document's notes?
Can you please show me the code that I would need inside this ActionHandler to make the download?
 #18410  by jllort
 
Actions has only visibility in code execution but not in UI ( here I think is not where should be done ). In UI only has effects formElements, here we got a formElement called Download ( http://www.openkm.com/dtd/workflow-forms-2.1.dtd ) but need end user action ( click button ). Otherside should be implemented something when is getting pending task, indicating this task needs inmediate action ( evaluating something within formelements will be the most easiest way for doing it ).

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.