struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hue Holleran" <>
Subject RE: [OT] RE: microsoft .doc struts
Date Tue, 18 Feb 2003 18:36:52 GMT
Hi Andy,

The (MS) reference was because this was using the regular expression syntax
used by Microsoft's VBScript RegEx object and I'm not sure if this is the
correct format for java regular expressions. I think jakarta-oro is a reg ex
library that is included with struts - but sorry I have no experience with
this - although someone on this group almost certainly will - so might be
worth a separate post - but the example will serve as a good start point. It
basically means:

  \[    - string to match begins with "["
          ("[" is escaped because it's a delimiter)
  \S    - match any non-whitespace
  [     - (delimiter)
    ^\[ - stop if you encounter another "["
          (to trap error with unclosed [] blocks)
  ]     - (delimiter)
  *     - match any character
  \]    - ends with "]"
          ("]" is escaped because it's a delimiter)

Images would be a different problem - if you look at an RTF file then it is
quite straightforward to extract the image from the rtf - but each image
would need to be converted in this way or find some way of doing this
on-the-fly - but I'm not aware of any tool to do this! If you have a limited
number of images, e.g. logos etc. then it would be possible to insert the
converted one of these at the appropriate point. Images begin with something

	{\*\shppict{\pict{\ ... }} with loads of hex digits in-between.

If you have loads of images stored as say gifs or jpgs then you will need to
find some way of doing this on-the-fly to rtf format.

Hope the above helps a bit more.


-----Original Message-----
From: Andy Richards []
Sent: 18 February 2003 15:53
To: 'Struts Users Mailing List'
Subject: Re: [OT] RE: microsoft .doc struts

Hi hue,

sounds great, i understand that you replace dynamic data into the
template where where ever you have a [oTb*.field]. but what is (MS) reg
ex,,,? some kind of regular expression api? if so i will have to do some
more research as i am yet to understand regular expressions, and how to
use them. (there is a jakarta api i think though). Also does this method
work with images?, if so i think this is the route i will have to take.



On Tue, 2003-02-18 at 15:36, Hue Holleran wrote:
> Hi Andy,
> I've looked through the thread and can't see specifically what you're
> to do but we had exactly the same problem and was solved using RTF, thus:
> (this was for submission of documents to a UK government body that needed
> be in MS Word .DOC format - they were able to open these documents with no
> problem in Word: edit, print, save etc.).
> We used RTF for the document - generated manually in MS Word and exported
> a .RTF - and used placeholders to hold active data that was to be inserted
> into the template of format "[oTbl.Field]" (allowable in RTF - and
> these using (MS) reg ex of format "\[\S[^\[]*\]").
> This then gave us an RTF format document which was then saved with the
> extension .DOC - which MS Word opens with no problem at all. This was in
> fact sent to the browser by adding a header "content-disposition" of type
> "attachment; filename=""WORD.DOC""" and also specifying the "ContentType"
> "application/rtf". Saving this document saves the document in "Word" .DOC
> although it is really an RTF.
> Not sure it's what you're after but after battling trying to open MS Word
> the server - which needs administrator privileges for the user running the
> web app (scary) or using vbscript/javascript in the browser (requires the
> site to be added to IE "Trusted Sites") - not ideal.
> The solution outlined, using RTF is not dependent on the browser used and
> the above solution is being used to generate around 200-300 (probably
> "MS Word" .DOC files a week which are emailed directly to the UK
> body.
> Let me know if this is an option for you - and if you need any more info
> BTW the above was implemented in MS ASP so I can only send you some
> ASP/VBScript code if that will help.
> H.
> -----Original Message-----
> From: Andy Richards []
> Sent: 18 February 2003 14:12
> To:
> Subject: microsoft .doc struts
> Hi,
> I have read with interest from the struts archives where a user posted
> the following question to do with producing microsoft .doc files for
> clients. See:
> Peter S. Hamlen: posted a follow up talking about using office 2000
> html, see:
> What i cant understand and i am hoping that someone will be able to help
> me, is that once you have parsed the .html template ie with velocity,
> then how do you convert the html back to a .doc file. I could provide
> for download the html pages, but the images i want to include would be
> seperate from the html file. I am trying to think of a tidier way?
> looking down the thread .rtf format is not the easiest, and POI is in a
> early release. Anyone know what i can do? or have any suggestions?
> dont worry i made my point about cross platform and proprietory .doc,
> doc is what the client wants, and therefor .doc is what i am having to
> try and give.
> Regards
> Andy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message