Andreas Hartmann schrieb:
J. Wolfgang Kaltz wrote:
(...)
Maybe we can delegate that to DocumentManager.add() as well, which would return the instance when done


OK, that would be possible. But it is not unclean to work with
Document objects which are not represented by "real" documents
(XML, sitetree entry etc.). Passing the Document object leads to
a shorter signature than DocumentIdentityMap + publication + area + ...


I've committed a version of the document creation which has the following features:
- ensure that internal meta-data is created in all cases (including blog)
- remove usage of java.io.File in the creation process


In this version, DocumentManager.add() does in fact take care of everything. I found this better for the time being, pros and cons:
+ from a usecase's perspective, document creation is a one-liner
-> factorization of code is maximized
+ new Document instance retrieved via DocumentIdentityMap is in a pending state (no resource type, source URI not valid) so I thought it better to encapsulate that into DocumentManager
- parameter list for DocumentManager.add() is longer


I updated the Wiki page accordingly (note that is has been moved to http://wiki.apache.org/lenya/ProposalDocumentCreationAPI), added remarks raised in the mails as well. I don't claim the document creation process is now optimal, but I hope it's a step in the right direction ;)

On a related note, I was wondering about a couple of things and would appreciate any clarification:
- what is the purpose of o.a.l.cms.publication.util.CollectionImpl - is it to manage the list of children documents of a document ? Why is CollectionImpl a subclass of DefaultDocument ?
- I'm still confused by the DocumentIdentityMap. Is there one DocumentIdentityMap per publication, holding all instances of Document that were instantiated within the publication ? If that is the case, why is the map accessed via a Document instance and not via the publication instance ?


Thx
--
Wolfgang

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



Reply via email to