With this enhancement I was able to provide methods to insert custom properties in DOCX and XLSX file types. In addition these classes also include the methods already working for DOC and XLS files. Powerpoint case is not handled. In addition in case the properties are being used in the body text of the DOCX document, the properties are also updated in the text. This propagation funcionality has not been treted for DOC, XLS and XLSX formats (I don't even know if it is possible to provide this kind of functionality in Excel. Again, Powerpoint hasn't got any of the previous enhancements. So to summarize it should be possible for: DOCX -> update or insert custom properties; also propagate the updated propeties into the body text. XLSX -> update or insert custom properties. XLS -> update or insert custom properties. DOC -> update or insert custom properties.
Any chance you could upload the patch for this?
(In reply to comment #1) > Any chance you could upload the patch for this? Hi Nick, I'd gladly do so, but my authentication doesn't work when svn client (Tortoise) asks for it. Have you got any indication? This is my first commit with the project... Regards
(In reply to comment #1) > Any chance you could upload the patch for this? I just saw I got this message in permissions tab: You have the following permission bits set on your account: canconfirm Can confirm a bug. editbugs Can edit all aspects of any bug. So I guess I can't commit due to permission restrictions or something related.
You won't be able to commit, instead please run a "svn diff" and post the patch for review. (Add it as an attachment to this bug)
Created attachment 27702 [details] new classes to provide the described enhancement Source code patch only. Needs some review. I left a few comments tha could be deleted and I'm not sure anbout the logging...
Let me know what you think of the patch. If necessary I can spend a couple of hours during this weekend to fine-tune according to indications you might provide. Regards, Sérgio
If it were me, I'd probably have this all work on an open document, rather than copying files about the place. That way, someone could do open file make changes have custom properties tweaked save where they want Rather than having to do the custom properties in a whole separate step I'd probably also be tempted to try to push a lot of the logic into POIDocument / POIXMLDocument, and then have a hook point where specific file formats can do special things (eg word update fields in the document). That may help reduce code duplication too, and keep things working in a common way
Created attachment 27748 [details] updated the patch according to previous indications Here's my patch updated. I've done it according to your indications regading Docx and Xlsx; I've also changed logging to be close to the POI standards (I hope). Main classes afected are: POIXMLDocument and XWPFDocument. I didn't have time to go for the Doc and Xls cases, because the code I have uses slightly different hooks to start processing the files. If you see that changing POIDocument class is a major addition let me know, I'll try to find some more time for that upgrade. But I couldn't get to the POIDocument derived class that handles the Doc file (I think I found the one for Xls though). Any comments are most welcome. Sorry for having done only for the Docx and Xlsx but it seems to me that those 2 are the most critical for the project I guess and Doc and Xls already have examples etc. Regards, Sérgio
*** Bug 61547 has been marked as a duplicate of this bug. ***