acj_3rd - Wednesday, May 12, 2010 4:29 PM:
In searching the archives, I found a great post by Rob McAveney on how to add a file to a document using the Vault Server. The post is here: www.aras.comhttp:/.../648.aspx
Rather than add a new file to the vault for the document, I would like to "update" or "edit" an existing file with the Document File relation already established. I tried to modify Rob's Java code but I received an InnovatorFault error indicating the Vault Server does not support "edit" function of "Files".
I don't want to continuously add an edited file as a new Document File relationship each time the user edits the file. If someones edits the file 5 times, then that would mean there are 6 total entries seen on File tab of the Document. (The original plus the 5 edited versions).
Is there an alternative solution to this that can be implemented without writing a C#/VB app using the IOM.dll and Vault.dll? I need this to be java so it can be incorporated into a java web service.
Drew Jenkins
RobMcAveney - Thursday, May 13, 2010 12:19 PM:
Adding a new File each time is the correct way to do this. It's the actions you use on the other items that matter. After running the original sample code once, do the following and run it again:
- Change the action on the Document and Document File items from 'add' to 'edit'
- Change the ids of the File and Located items, but leave the actions as 'add'
- You should see the original File id in the line beginning with "content = "--"+boundary". Change that string to the new id.
Depending on the lock status of the Document, you will either end up with a new generation of the Document with a new Document File relationship or an edit of the original generation. Both the original and the new File will be in the vault. Old or orphaned files in the vault can be removed later during vault maintenance.