• Upload and Download Form Element In Workflow

  • 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.
 #40664  by jllort
 
From FileUploadServlet at line 291 you have the line Document doc = OKMDocument.getInstance().getProperties(null, path); I want to know here which is the value of the path variable

after this line, for example add
Code: Select all
log.info("DESTINATION PATH:"+path); 
//or
System.out.println("DESTINATION PATH:"+path);
 #40691  by jllort
 
You should see in log the data, or debugging set a break point in that line to see the value of "path" variable.
 #40715  by alexwgordon
 
Hi Jllort

So after some digging it doesn't look as though the servlet utilizes that part of the code based on the IF statement above it. I placed the debugging near the catch (PathNotFoundException) and it has the path as blank —this only happens when the mismatch check is not checked. When it is checked, I get nothing in the log either.

Where do we go from here?
 #40722  by jllort
 
In FileUploadServlet.java yould be set the path otherwise you get the error pathNotFound exception. Well path comes from frontend, should debug formManager ( the method I explained before where the data is injected into GWTDocument ) and also the class FileUploadPopup ( for it you need execute shell and debug with gwt ) the code where to set the break point should be
Code: Select all
protected void executeSend() {
 #40743  by alexwgordon
 
I apologize for my lack of knowledge, I'm still learning the portable dev environment and Eclipse, but how can do I debug with GWT? When I run GWT dev I get an "Unable to Connect - site unavailable." And am I launching shell from Remote Shell > Local > Local Shell? Sorry for the newbie questions, but I'm still learning :) Thanks jllort!
 #41049  by alexwgordon
 
So I've tried attempting to get into the GWT environment by running the "GWT 6.3 DEV" config from Run as... and opening the shell by right clicking on my project, going to "Show in Remote Systems View" then right-click on the project folder and going to "Launch Shell", but still am getting a Unable to Connect in my browser.
 #41050  by alexwgordon
 
Is there any updated examples/documentation on the upload and/or download workflow elements? I think if there was something that works that I could look at, I could troubleshoot this a bit better.
 #41065  by jllort
 
OpenKM portable ( http://sourceforge.net/projects/openkmportabledev/ ) comes with GWT dev environment yet configured and firefox portable with GWT plugin too.

About sample we will try to explain more clear on next documentation version, we are still working on it.
uuid is a valid document uuid.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.6//EN"
                                "http://www.openkm.com/dtd/workflow-forms-2.6.dtd">
<workflow-forms>
  <workflow-form task="download test">
    <download name="download" label="Download document">
      <node label="download" uuid="afb8ac33-912d-4515-e29b-1c01b693809a" />
    </download>
  </workflow-form>
</workflow-forms>
folderUuid is a valid folder uuid.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.6//EN"
                                "http://www.openkm.com/dtd/workflow-forms-2.6.dtd">
<workflow-forms>
  <workflow-form task="upload test">
    <upload name="upload" label="Upload document" folderUuid="fca2d85e-0e01-418d-b699-c0dd0f8190da" />
  </workflow-form>
</workflow-forms>
or
data is a valid mapping variable . This variable is used to dynamically set documentUuid attribute.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.6//EN"
                                "http://www.openkm.com/dtd/workflow-forms-2.6.dtd">
<workflow-forms>
  <workflow-form task="upload test">
    <upload name="upload" label="Upload document" type="update" data="dynamic" />
  </workflow-form>
</workflow-forms>
 #41106  by alexwgordon
 
I have yet to be able to get the portable edition of OKM to get GWT to work correctly. What settings need to be tweaked in order for it to be setup in the portable edition?

When using the upload or download in the form, how do you use the dynamic "data" parameter to assign the current file's uuid? I'm assuming this is done via another class that can assign it? I feel like this portion of the documentation was not clear.
 #41112  by alexwgordon
 
So, I was able to get the download working with a dynamic uuid. See my code below:
Code: Select all
String uuid = (String) context.getContextInstance().getVariable("uuid");
      Download downloadFile = new Download();
      List<Node> nodeList = new ArrayList<Node>();
      Node node = new Node();
      
      node.setUuid(uuid);
      node.setLabel("Download File");
      nodeList.add(node);
      downloadFile.setNodes(nodeList);
      context.getContextInstance().setVariable("downloadFile", downloadFile);
Now I'm just working on the upload portion.
 #41113  by alexwgordon
 
Still getting a OKM: 005015. With the steps from above Destination Path is " " and still unable to get GWT functioning.
Code: Select all
2015-12-23 12:54:24,119 [http-bio-127.0.0.1-8080-exec-1] INFO  com.openkm.servlet.frontend.FileUploadServlet- DESTINATION PATH:
Where should the event be triggered in the workflow for my upload.java to work correctly? (i.e. node-enter, process-start, task-create, etc)?
 #41305  by alexwgordon
 
Hi jllort,

I've been on a break from OpenKM hoping I would find some clarity, but am coming back confused as ever. I feel like I'm running into one problem after the next, but I'm still trying to get the Upload element to update still. I've been unsuccessful at setting up the GWT from the portable OpenKM which is another issue altogether so I haven't been able to do any further troubleshooting there.

1. Is there any documentation on setting up GWT with portable OpenKM?
2. And I have been still getting the 005015 error. Is there any new documentation on implementing the Upload form element?
3. Does it matter what type of node the Upload Handler is used on? And does it matter when the action is executed? (I'm assuming that both of the answers are "yes" and I'm doing something wrong with those - I hope).


Thank jllort

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.