Andreas Hartmann wrote:
Andreas Hartmann wrote:
According to an early idea, the NodeCreatorInterface should be replaced
by post-processing of the created document in the corresponding "create"
usecase.

But there are some difficulties:

- Until now, Lenya doesn't support usecase polymorphism based on
  resource types, that's why we couldn't remove the interface yet.

BTW, even that wouldn't help, because the creating process would depend
on the resource type of the resulting document and not on the resource
type of the document the usecase was called on (this wouldn't even have
to be a document).
I've read through the threads from last year, it seems this issue is having a birthday this month :)

I'm not sure I understand the Document Creation usecase completely. So I'll try and describe what I think is happening, could you point me in the right direction if I'm completely lost?

org.apache.lenya.cms.site.usecases.Create is ultimately responsible for creating new documents right? It is abstract and it has concrete classes for different doctypes. Is this what you mean by polymorphic usecases?

What I understand of the Create Usecase so far...

- get the document manager
- get a document with an identifier
- then getinitialdocument which is returned by the concrete extension of the Create usecase
- we then go into documentManager.add
- this does nice stuff with metadata
- locks the repository node
- then calls the magical nodecreator thingo
- it seems to me the node creator just copies data from one sourceURI to another... with an optional transformation which is never used?

I assume the transformation inside the nodecreatorinterface is what is meant to do the postprocessing?

Is it possible to make this post processing a part of the Create usecase extension?

Would it be possible to define a post processing interface, then look up the class name which implements this from the resource type metadata?

Why is there a need for such post processing anyway? What possible functions could it provide?

Now, from my perspective, and the EJB work I've been doing, I've created a Content interface, which gives me OutputStream, mimetype and stuff a normal file would have. I'm then going to make extensions of this interface for various types of data. Eg, forums, products in an online store. I'm going to make a usecase to create, and edit these content objects through their own interface, eg setPrice etc. I think this is similar to making a DTD for a custom XML content, and then defining usecases to edit it. Does a 'content' interface offer any advantages in the document creation problem?

Michael

Michael

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

Reply via email to