Hi Tobia,

Me again...

I now that you understood what I said, but only for clarify, all the steps
that I need to develop are:

1. Read a template file in any type of Office (like .DOC, .PPT and .XLS-->
for the last one, I got success with jxls.sourceforge.net);

2. When I find some key (someword between delimiters like "[" and "]" or in
expression language like ${xyz} --> the last one has been used in tht jXLS
project), I select for that key in a database and get the correspondent
value;

3. With all the values found, a new file is generated changing the keys by
the values, with the same format of the original file (template file).

In the following, I comment

On 10/9/07, Tobia Conforto <[EMAIL PROTECTED]> wrote:
>
> Luiz Antonio Falaguasta Barbosa wrote:
> > Is it possible to use Cocoon to change keys by values into .DOC and
> > .PPT file types? Does anybody could give me some example?
>
> I don't have first-hand experience with it, but here are a few ideas.
>
> If the file is not too big, you can load it into memory as a string and
> perform string replacement on it, then write it back to disk or stream
> it to the user.  You can accomplish this with a number of Cocoon
> technologies, for example with a custom Reader or with a piece of
> Flowscript.  Actually you can do the same with any other web language or
> web application framework: string substitution is pretty basic stuff.


You should check whether those file formats store strings in plain text,
> which encoding they use, and how well they tolerate string substitution.
> For example, any substitution will break the format if it employs a CRC
> or another integrity check; variable-length substitutions will fail if
> they break record lengths or offsets.  It's a hack in any case, and it
> should be treated as such.


Yeah, I took a look at .DOC, .PPT and .XLS file type and it seems that all
that I have been typed into .DOC and .PPT files are in text plain, but not
in .XLS type.

I have had good results with the RTF format, which is well understood by
> most word processing applications, is text-based and allows arbitrary
> substitutions.
>
> On the other hand, the newer office productivity file formats are all
> XML-based (both OpenDocument and that other Microsoft equivalent) and
> Cocoon excels at handling XML.


Yeah man! That's point for me now!
My client told me that I can consider the usage of Office 2003 for the
users. So, all the office types are XML-based, right?

Now, I have to know how to do it with Cocoon.
Could you give me some examples?

You could create (or convert) your document templates into such a format,
> using specific tags or element IDs as placeholders, or anything else that
> can easily be replaced with an XSLT stylesheet.  Then have Cocoon perform
> the substitution, zip the resulting XML with other needed resources (such
> as images) using the ZipArchiveSerializer, and serve it to users.


Yes, the image insertion. Sometimes, I have to change a text key by an
image. So, if I have a file create by the Microsoft Office, that is
XML-based, how could I change a text by an image? May I have to know
something about the spec of file to know how to change it or not?

If anybody could help with these issues, I thank you in advance!

Luiz

Just a few ideas.
>
>
> Tobia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to