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)
- ...


> 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.


> 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()


-- Andreas


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

Reply via email to