Return-Path: Delivered-To: apmail-poi-dev-archive@www.apache.org Received: (qmail 70095 invoked from network); 7 Apr 2011 13:13:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2011 13:13:52 -0000 Received: (qmail 79336 invoked by uid 500); 7 Apr 2011 13:13:52 -0000 Delivered-To: apmail-poi-dev-archive@poi.apache.org Received: (qmail 79314 invoked by uid 500); 7 Apr 2011 13:13:52 -0000 Mailing-List: contact dev-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Developers List" Delivered-To: mailing list dev@poi.apache.org Delivered-To: moderator for dev@poi.apache.org Received: (qmail 70295 invoked by uid 99); 7 Apr 2011 13:07:07 -0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of SRS0=jtehi2=W7=charlesgutjahr.com=me@eigbox.net designates 66.96.189.7 as permitted sender) X-EN-OrigOutIP: 10.20.18.4 X-EN-IMPSID: Ud6e1g00405GATN01d6eeQ To: POI Developers List From: Charles Gutjahr Subject: Proposed RSID patch for XWPF Date: Thu, 07 Apr 2011 13:06:35 GMT X-Mailer: MobileMe Mail (1C3224) Message-id: <6953dab3-89a0-e2d1-b2b5-d06575cd2bb7@me.com> Content-Type: multipart/alternative; boundary=Apple-Webmail-42--099cce52-996d-4878-ca5e-c87bddf09886 MIME-Version: 1.0 In-Reply-To: <3c8a5d36-eaca-4c0e-db9b-d14918a231d4@me.com> X-EN-UserInfo: 8208b01fe00c7dce141a8ed36c110099:be19e14234fbb434e98611f8873f51b1 X-EN-AuthUser: email@charlesgutjahr.com Sender: Charles Gutjahr X-EN-OrigIP: 17.148.16.122 X-EN-OrigHost: webms.mac.com X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Webmail-42--099cce52-996d-4878-ca5e-c87bddf09886 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8; format=flowed =0ASorry, I completely messed up that last email by mixing up HWPF and XWP= F. I meant only XWPF =E2=80=94 not HWPF!=0A=0AIgnore the HWPF references, = read them as XWPF instead.=0A=C2=A0=0A=C2=A0=0A=0AOn 07 Apr, 2011,at 11:01= PM, Charles Gutjahr wrote:=0A=0A=0AHi= =0A=0AI'm just starting to use POI for generating HWPF Word documents Ther= e are two features that I need which I think should be included in POI; an= d since I need them I figure I might as well build them and contribute pat= ches. I'd like to get some advice and a yea or nay before I go ahead=C2=A0= =0A=0A=0AThe first one is about RSIDs. This started with my question at=C2= =A0http://stackoverflow.com/questions/4966087/how-to-generate-rsid-attribu= tes-correctly-in-word-docx-files-using-apache-poi=0A=0AMy application is g= enerating HWPF documents which a number of user will download, edit using = Word, then upload back into the system. At the moment we simply overwrite = the generated document with user's changes; but it would be more useful if= the application could identify what has changed. That's exactly why Word = has revision identifiers (RSIDs): they identify all the changes made in on= e session thus making it easy to identify changes. A document created by W= ord is full of RSIDs, whereas a document created by POI doesn't have any.=0A= =0A=0AI'd like to add the ability for POI to automatically assign RSIDs to= HWPF documents. Here's a rough plan of what I'm thinking about implementi= ng:=0A=C2=A0* Add properties to XWPFDocument that store the base RSID, all= RSIDs in use the document, and a RSID being used for the current revision= =0A=C2=A0* Add appropriate methods to get, set and clear those=C2=A0XWPFD= ocument=C2=A0properties=0A=C2=A0* The base RSID and other RSIDs in XWPFDoc= ument will be populated from word/settings.xml when an existing document i= s loaded=0A=C2=A0* The current session RSID will be randomly generated aut= omatically when a XWPFDocument object is constructed. This means that a 'r= evision' will be defined as the lifetime of that instance.=0A=C2=A0* Parag= raphs, runs and other content will have appropriate methods to get, set an= d clear the RSID=0A=C2=A0* Add a boolean property (and associated methods)= that enables and disables automatic assignment of an RSID to new paragram= s, runs, etc added by POI This will probably be disabled by default.=0A=C2= =A0* When that boolean is enabled, any method that creates new context wil= l automatically assign the current RSID to that content (for example=C2=A0= XWPFDocument.createParagraph(),=C2=A0XWPFParagraph.createRun(), XWPFRun.se= tText() etc)=0A=0A=0ADoes anyone have any comments on or objections to tha= t plan? And should I put this in bugzilla?=0A=0A=0AI have another need for= POI, I will write that one up in my next email...=0A=0ACheers=0ACharlie=0A= =0A --Apple-Webmail-42--099cce52-996d-4878-ca5e-c87bddf09886 Content-Type: multipart/related; type="text/html"; boundary=Apple-Webmail-86--099cce52-996d-4878-ca5e-c87bddf09886 --Apple-Webmail-86--099cce52-996d-4878-ca5e-c87bddf09886 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8;

Sorry, I completely messed up that last email by mixin= g up HWPF and XWPF. I meant only XWPF =E2=80=94 not HWPF!

Ignore the HWPF references, read them as XWPF instead.
=  
 

On 07 Apr, 2011,at 11:01 PM, Charles= Gutjahr <org.apache.poi@charlesgutjahr.com> wrote:


<= div style=3D"font-family: Helvetica; font-size: medium; " _mce_style=3D"fo= nt-family: Helvetica; font-size: medium;">Hi

I'm just st= arting to use POI for generating HWPF Word documents There are two feature= s that I need which I think should be included in POI; and since I need th= em I figure I might as well build them and contribute patches. I'd like to= get some advice and a yea or nay before I go ahead 


The first o= ne is about RSIDs. This started with my question at http://stackoverf= low.com/questions/4966087/how-to-generate-rsid-attributes-correctly-in-wor= d-docx-files-using-apache-poi

My application is = generating HWPF documents which a number of user will download, edit using= Word, then upload back into the system. At the moment we simply overwrite= the generated document with user's changes; but it would be more useful i= f the application could identify what has changed. That's exactly why Word= has revision identifiers (RSIDs): they identify all the changes made in o= ne session thus making it easy to identify changes. A document created by = Word is full of RSIDs, whereas a document created by POI doesn't have any.=


I'd like to add the ability for POI to automatically assign RSIDs to= HWPF documents. Here's a rough plan of what I'm thinking about implementi= ng:
 * Add properties to XWPFDocument that store the base RSID, a= ll RSIDs in use the document, and a RSID being used for the current revisi= on.
 * Add appropriate methods to get, set and clear those&= nbsp;XWPFDocument properties
 * The base RSID a= nd other RSIDs in XWPFDocument will be populated from word/settings.xml wh= en an existing document is loaded
 * The current session RSID wil= l be randomly generated automatically when a XWPFDocument object is constr= ucted. This means that a 'revision' will be defined as the lifetime of tha= t instance.
 * Paragraphs, runs and other content will have appro= priate methods to get, set and clear the RSID
 * Add a boolean pr= operty (and associated methods) that enables and disables automatic assign= ment of an RSID to new paragrams, runs, etc added by POI This will probabl= y be disabled by default.
 * 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)


Does anyone have= any comments on or objections to that plan? And should I put this in bugz= illa?


I have another need for POI, I will write that one up in my nex= t email...

Cheers
Charlie
<= div>
<= /span> --Apple-Webmail-86--099cce52-996d-4878-ca5e-c87bddf09886-- --Apple-Webmail-42--099cce52-996d-4878-ca5e-c87bddf09886--