On Thu, 7 Apr 2011, Charles Gutjahr wrote:
* Add properties to XWPFDocument that store the base RSID, all RSIDs in use the document, and a RSID being used for the current revision
XWPFDocument will have a XWPFSettings object if there is a settings part. This is probably the right place for the RSID generation / fetching / listing code. Depending on how the code looks, we can either expose these methods through XWPFDocument, or provide public access to the XWPFSettings object.
We'd probably also need a bit of code to create a XWPFSettings if the user tries to do RSID stuff and there isn't one. Well, if the settings part is option (I'm not sure on this one) - can you check the .docx specification and see if the settings part must be there or not?
* Add appropriate methods to get, set and clear those XWPFDocument properties * The base RSID and other RSIDs in XWPFDocument will be populated from word/settings.xml when an existing document is loaded
(Covered above)
* The current session RSID will be randomly generated automatically when a XWPFDocument object is constructed. This means that a 'revision' will be defined as the lifetime of that instance.
We could maybe do this as a lazy thing. Probably depends on if the settings part must be there or not. If it's optional, we'll want to make it a lazy thing where we add the settings when first requested, then generate the RSID. Otherwise, maybe just have the XWPFSettings constructor generate a new RSID each time, but maybe only add it to the list if it gets used?
* Paragraphs, runs and other content will have appropriate methods to get, set and clear the RSID
Yup. Are you able to look at the specs to see what exactly can have an RSID set on it? I guess paragraph and character run can have, from example files I've seen, but what about tables? Can the overall table have it set on, or only rows/cells, or only paragraphs within there?
* Add a boolean property (and associated methods) that enables and disables automatic assignment of an RSID to new paragrams, runs, etc added by POI This will probably be disabled by default.
This may need a bit of thought, as there are quite a few different ways at the moment for a paragraph, run or table to be added. Probably best to leave this one towards the end, until the rest of the API is clearer
* When that boolean is enabled, any method that creates new context will automatically assign the current RSID to that content (for example XWPFDocument.createParagraph(), XWPFParagraph.createRun(), XWPFRun.setText() etc)
(See above)
Does anyone have any comments on or objections to that plan? And should I put this in bugzilla?
Please open a new bug in bugzilla to track this, and the post patches when you've got something ready for review. Please do try to include unit tests too, both so we can be sure it works, and so we can check we don't accidently break it later!
Thanks Nick
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
