Andreas Hartmann wrote:
Joern Nettingsmeier schrieb:

[...]

andreas, where should the actual saving be implemented? my gut feeling
says that our editor code should just throw an xml tree somewhere and
not be concerned with file operations or streams.
What do you mean with "throw somewhere"?
sorry for the sloppy language. i mean that an editor handler should not
be concerned with the gory details of storing the edited document. all
it should have to do is pass the final, validated and post-processed XML
DOM tree to someone who takes care of it.

I guess the problem boils down to "pass".
Is it possible to find a least common denominator here?
What options are there?

- PUT request
- POST request parameter (text)
- POST request parameter (application/x-www-form-urlencoded)

no, i'm not talking about passing the data from a client browser. we won't find a common denominator for that, since every editor is doing it's own thing here.
i'm assumning the data is already on the server.
all i want to do is have a generic "save this stuff" method that my usecase handler can call after it has mogrified the incoming data into a form that's fit to be stored. imho file handling (or even ModifiableSource handling) does not really belong in a usecase handler class - it should be delegated to the repository or whatever other layers of decoupling there are.


that means that the saveXML method should vanish from
FooEditorUsecase.java altogether. the question is: who will do the job?
what is the correct method of saving a previously checked-out document?

The EditDocument usecase offers the service of saving the document.
You have to provide the source, e.g. a temporary file, a StreamGenerator
pipeline etc.

i see. but i don't want to invoke another usecase from my TinyMce.java (that would be wasteful). i want to wrap up my document and call an external method to store it.

and while we're at it: what is the correct way of checking out a
document? we currently have an action to do that, but i think it's quite
unintuitive to do the checkout in a sitemap, and almost everything else
in a usecase handler.

- set the transaction policy of the usecase to "pessimistic"
- return the document's repository node in getNodesToLock()

hmm. that's all there is to it? then tinymce should already do the right thing - but apparently it doesn't. more investigating to do...

--
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

if you are a free (as in "free speech") software developer
and you happen to be travelling near my home, drop me a line
and come round for a free (as in "free beer") beer. :-D

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to