ConcourseSuite Support

Support
Corporate
PUBLIC PROFILE

Back to topics

Discuss Development

Upload document to Ticket: ProcessDocument.do problem

You need to be logged in to post messages

Upload document to Ticket: ProcessDocument.do problem

3/11/2008 1:42 AM EDT

After getting support we added a XML API client (clientid=1 code =TEST) to our document upload code. When we did this ProcessDocument did not return an error page which is a small step forward. However documents are still not uploaded to Ticket documents. I have tried a number of combinations with tid and folderid

writeTo(out, "--" + boundary + "\r\n");
writeParam("clientId", "1", out);
writeParam("code", "TEST", out); // unset
writeParam("systemId", "4", out);
writeParam("type", "ticket", out);
writeParam("subject", "Testing msword", out);
writeParam("tid", "1", out); // tid 50 =110 503=1
writeParam("enteredBy", "2", out);
writeParam("folderId", "6", out); // 50 = 317 503=1 or 4
writeFile("/.........../Example-thunderverse.doc", out, "application/msword", "Example.doc");

when we remove clientid we get the standard error page html see below. This is how I know that the clientid bit is sort of working.
.. img src="images/error.gif" border="0" align="absmiddle" ..
.. font color='red .... dhv:label name="errors.anErrorHasOccured"... An Error Has Occurred ....

Jol (cusa)

1. 3/11/2008 1:48 AM EDT

This is our version:
Concourse Suite 5.0.4 Enterprise (2008-01-31)
Enterprise Edition (5 seats) Licensed to: Concursive ANZ

2. 3/11/2008 1:54 AM EDT

More info: the project_files database table is empty. There should have been about 15 documents uploaded. Obviously the Ticket 1 > Documents > <folder> area was also empty.

3. 3/13/2008 5:46 AM EDT

Hi Jol,

There are a few more parameters that need to be provided as well. "id" which refers to the hostname, and the file is expected to be mapped to the attribute name "file1."

I created a wiki entry that lists all the parameters that ProcessDocument.do accepts, and in that entry I also put a link to an html form you can download for testing uploads to your ConcourseSuite application (it is currently set to use "localhost" in the form action so the html source will need to be updated if you'd llike to test against a different hostname)

http://www.concursive.com/ProjectManagement.do?command=ProjectCenter&section=Wiki&pid=70&subject=Uploading+Documents+Outside+the+ConcourseSuite+Web+Interface

Also, there is a bug in 5.0.4 that causes the folderId to currently be ignored, but I think the fix for this will be in the upcoming point release 5.0.5.

Post back if you run into any more issues.

4. 5/5/2008 12:27 AM EDT

I added the extra auth fields as mentioned, but there is a separate issue when ProcessDocument tries to get error messages from session. I had to modify the java class (and rebuild) and add a new fake class to replicate object missing from session. Here is my code and comments: Please fix this and let us know.

ProcessDocument.java

// Try retrieve system status from session, but session is invalidated. there is a TODO above that might fix this.
// there is no session or system status does not exist in session for a scripting xml-rpc-http raw-post like we do from Thunderverse
// Therefore we need to substitute systemStatus to stop a runtime exception
// We keep error label keys to minumise code change in this class
// Commented line:
// SystemStatus systemStatus = this.getSystemStatus(context);

SystemStatusWorkaroundForProcessDocument systemStatus = new SystemStatusWorkaroundForProcessDocument();

Also this is a defect. I think this was fixed in comunity. not sure why the fix is not here. Without this we cant upload a doc to folder:

// This line should not be commented. We need to save doc in a folder
thisItem.setFolderId(Integer.parseInt(folderId));

public class SystemStatusWorkaroundForProcessDocument

private static final String ENCOUNTERED_A_PROBLEM = "ProcessDocument encountered a problem. Please check all the post parameters.";
private HashMap<String, String> map;

protected SystemStatusWorkaroundForProcessDocument()

this.map = new HashMap<String, String>();

putKeyValue("object.validation.noAuthorization");
putKeyValue("object.validation.objectTypeRequired");
putKeyValue("object.validation.objectIdNotSpecified");
putKeyValue("object.validation.required");
putKeyValue("object.validation.incorrectFileName");

}

private void putKeyValue (String keyAndValue)
this.map.put(keyAndValue, keyAndValue);
}

protected String getLabel(String key)
String value = map.get(key);
return (value == null) ? ENCOUNTERED_A_PROBLEM : value;
}

}

5. 5/5/2008 12:33 AM EDT

Lorraine, sorry I just saw your folder id comment. thanks. The session issue above is a real problem. when posting from a script (httpxml..), we cannot assume that the session will have objects expected by the java class.

5 results found