WeblogEntryFormAction is the Struts action that handles posts. You
can override save() method which is what actually saves a post to the
database. I haven't worked with Struts for a while and can't remember
if it automatically handles multipart requests. I am pretty sure it
does as I know it will populate forms with properties of FileItem
type automatically. Whether you choose to override
WeblogEntryFormAction or write a new servlet really depends on how
your Java client posts new entry. I assume the field names probably
don't match Roller's so WeblogEntryForm won't get populated properly.
I'd go with the Servlet approach.
Good luck!
Max
On Mar 29, 2006, at 5:54 PM, Tribley William-cwt010 wrote:
Hi Max,
Righto, in the spirit of reuse I was trying to avoid bloat (and being
lazy :-) ). Will follow the hints you gave and get this going. What
would be cool is to modify the action that handles posts to do this:
text/html multiparts with no filename directives get concatenated
Text/html parts with a filename get saved to the upload directory
Any binary part gets decoded and saved to the upload directory
The editor rewrites urls before posting the multipart message, so no
message tampering is needed. This way, no extra servlet would be
needed,
and the ftp upload could be avoided for editors that can supply a
multipart document.
However, if I can't figure out the present post handler then I will
just
write a servlet (and contribute to code bloat.....)
Many thanks for your help!
Bill
-----Original Message-----
From: Max Rudman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 4:40 PM
To: [email protected]
Subject: Re: Handling JavaScript Editor File Uploads
Roller does not support picture upload as part of
creating/editing blog entries. These are two separate steps:
first, you upload pictures (or any other file for that
matter) and then you create/edit entries to add <img> tag,
for example, that references uploaded resource. The action
that handles file upload does understand multipart content
but it will not touch weblog entries. Likewise, the action
that handles posts does not understand multipart requests.
Bottom line: you have to write code :)
Max
On Mar 29, 2006, at 4:59 PM, Tribley William-cwt010 wrote:
Hi Max,
What would happen if I just fed the multipart to Roller as
the edited
content? Would it be able to separate the parts and store the
non-text/html parts in the upload directory without any new
code? If
not, I will write a servlet based on your thoughts below.
Thanks,
Bill
-----Original Message-----
From: Max Rudman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 3:55 PM
To: [email protected]
Subject: Re: Handling JavaScript Editor File Uploads
stuff removed
Look in org.roller.xmlrpc for example on creating entry
from request
params. Look in UploadFileFormAction and/or FileManagerImpl for
example of how file uploads are handled.
Roller uses commons- fileupload library to parse multipart
form data
which is what you should use as well.
Hope this helps,
Max