You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Florent André <fl...@4sengines.com> on 2009/02/19 14:02:31 UTC

Suggestion about the document & repository API (Re: LenyaDocWritingTransformer)


On Thu, 19 Feb 2009 12:49:57 +0100, Andreas Hartmann <an...@apache.org>
wrote:
> Florent André schrieb:
> 
> […]
> 
>>>> //Start site management ?? this code is usefull if I use the document
>>>>  manager ??
>>> Since you have already passed the path to the DocumentManager, you
> don't
>>> have to add the document to the site structure anymore.
>>
>> It seems me to understand that Lenya have 2 way to manage / create
> document
>> :
>> - the direct way throw DocumentManager
>> - the indirect way throw SiteStructure
>>
>> If I can do a suggestion, a documentation on "how to create document
> from
>> scratch" could be useful.
> 
> Yes, I also think this is too complex. The DocumentManager is the
> original approach, but now I think we should rather add the respective
> methods to the repository classes:
> 
> Area.addDocument(…)
> SiteStructure.addLink(Node node, Document document)

On the same subject, I think that it will be interesting to have this
getter/setter in the document API :

document.setVisibleInNav();

document.setMetadata();

document.setContent();

document.remove();

document.setNavTitle();

document.setTitle();

document.setParams();

This is just some ideas (without any knowledge about their possible
coding), but I think they could simplify the document creation/management.

++


> 
>> Have a cool sunny day !
> 
> Thanks, you too :)
> 
> -- Andreas
> 
> 
> --
> Andreas Hartmann, CTO
> BeCompany GmbH
> http://www.becompany.ch
> Tel.: +41 (0) 43 818 57 01
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Suggestion about the document & repository API (Re: LenyaDocWritingTransformer)

Posted by Andreas Hartmann <an...@apache.org>.
Hi André,

Florent André schrieb:

[…]

>>> If I can do a suggestion, a documentation on "how to create document
>> from
>>> scratch" could be useful.
>> Yes, I also think this is too complex. The DocumentManager is the
>> original approach, but now I think we should rather add the respective
>> methods to the repository classes:
>>
>> Area.addDocument(…)
>> SiteStructure.addLink(Node node, Document document)
> 
> On the same subject, I think that it will be interesting to have this
> getter/setter in the document API :

thanks a lot for your suggestions!

> document.setVisibleInNav();

IMO this would violate SoC – the visibility of the document itself isn't 
changed, but the visibility of the link in the site structure. I think 
the current API is sufficient:

   document.getLink().getNode().setVisible(boolean)

> document.setMetadata();

What would be the argument(s) of this method?

> document.setContent();

What would be the argument(s) of this method? IMO the methods 
Document.getIn/OutputStream() cover all i/o requirements. We should keep 
the API as orthogonal as possible, e.g. don't add type conversion 
methods (String/InputStream/…) to the Document interface.

> document.remove();

Hmm, would that be something different than Document.delete()?

> document.setNavTitle();

Same as with setVisibleInNav().

> document.setTitle();

I guess that would be an implicit mapping to the DC element "title"? I'm 
not sure if this can be generalized. What do the others think?

> document.setParams();

What params would that be?

Again, thanks for your suggestions – come clarifications would be much 
appreciated.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org