You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2003/10/21 12:01:13 UTC

Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Hi Lenya users,

FYI: I replaced all occurences of DefaultDocumentBuilder.getInstance()
with publication.getDocumentBuilder() (which returns the
DefaultDocumentBuilder at the moment).

Of course this is just a first step, we have to discuss the
API. But for 1.2 it might be enough to make the DocumentBuilder
configurable in publication.xconf.

-- Andreas



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


RE: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Danny Bols <db...@osirion.be>.
Andreas Hartmann
> Sent: woensdag 22 oktober 2003 11:44
> To: lenya-user@cocoon.apache.org
> Subject: Re: Replaced DefaultDocumentBuilder references with
> publication.getDocumentBuilder()
> 
> 
> Danny Bols wrote:
> 
> [...]
> 
> > If this means that the DefaultDocument class is only used by the
> > DefaultDocumentBuilder and that the rest of the core code is using the
> > Document interface
> 
> Yes, it should be this way.
> 
> > it would indeed not be necesary to have it configurable
> > for 1.2.
> > Because making the
> > DocumentBuilder configurable would also mean one is able to 
> implement his
> > own Document class.
> 
> Yes, exactly.
> 
> > BTW in my local copy I saw this scary statement in the 
> Publication class:
> > private DocumentIdToPathMapper mapper = new 
> DefaultDocumentIdToPathMapper();
> 
> Thanks - it is now initialized to null.
> But calm down, it was replaced by the configured mapper in the c'tor :)

I stopped shivering when I saw the c'tor.

---

Danny

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


Re: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Andreas Hartmann <an...@apache.org>.
Danny Bols wrote:

[...]

> If this means that the DefaultDocument class is only used by the
> DefaultDocumentBuilder and that the rest of the core code is using the
> Document interface

Yes, it should be this way.

> it would indeed not be necesary to have it configurable
> for 1.2.
> Because making the
> DocumentBuilder configurable would also mean one is able to implement his
> own Document class.

Yes, exactly.

> BTW in my local copy I saw this scary statement in the Publication class:
> private DocumentIdToPathMapper mapper = new DefaultDocumentIdToPathMapper();

Thanks - it is now initialized to null.
But calm down, it was replaced by the configured mapper in the c'tor :)

-- Andreas



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


RE: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Danny Bols <db...@osirion.be>.
Andreas Hartmann
> Sent: woensdag 22 oktober 2003 10:55
> To: lenya-user@cocoon.apache.org
> Subject: Re: Replaced DefaultDocumentBuilder references with
> publication.getDocumentBuilder()
>
>
> Danny Bols wrote:
>
> [...]
>
> > Great to see this happening. Can't wait to use my own
> DocumentBuilder :-)
> > I hope you also think about configuring the Document class in 1.2?
>
> I'm not sure yet, what the responsibility of the Document class
> will be ... At the moment, it just stores some information. The
> logic is introduced by the builder and the path mapper.
> So I'm not sure if it will make sense to support different
> document classes. But probably many things will change if we
> reconsider the repository concept.

If this means that the DefaultDocument class is only used by the
DefaultDocumentBuilder and that the rest of the core code is using the
Document interface it would indeed not be necesary to have it configurable
for 1.2. Because making the
DocumentBuilder configurable would also mean one is able to implement his
own Document class.

BTW in my local copy I saw this scary statement in the Publication class:
private DocumentIdToPathMapper mapper = new DefaultDocumentIdToPathMapper();

---

Danny


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


Re: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Andreas Hartmann <an...@apache.org>.
Danny Bols wrote:

[...]

> Great to see this happening. Can't wait to use my own DocumentBuilder :-)
> I hope you also think about configuring the Document class in 1.2?

I'm not sure yet, what the responsibility of the Document class
will be ... At the moment, it just stores some information. The
logic is introduced by the builder and the path mapper.
So I'm not sure if it will make sense to support different
document classes. But probably many things will change if we
reconsider the repository concept.

-- Andreas




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


RE: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Danny Bols <d....@skynet.be>.
Andreas Hartmann
> Sent: woensdag 22 oktober 2003 10:16
> To: lenya-user@cocoon.apache.org
> Subject: Re: Replaced DefaultDocumentBuilder references with
> publication.getDocumentBuilder()
> 
> 
> Michael Wechner wrote:
> 
> >> Of course this is just a first step, we have to discuss the
> >> API. But for 1.2 it might be enough to make the DocumentBuilder
> >> configurable in publication.xconf.
> > 
> > How would the configuration look like?
> 
> <publication>
>    <languages>
>      <language default="true">en</language>
>      <language>de</language>
>    </languages>
>  
> <path-mapper>org.apache.lenya.cms.publication.DefaultDocumentIdToP
> athMapper</path-mapper>
> <document-builder>org.apache.lenya.cms.publication.DefaultDocument
> Builder</document-builder>
> </publication>
> 
> Actually I would prefer attributes:
> 
> <document-builder
>      class="org.apache.lenya.cms.publication.DefaultDocumentBuilder"/>
> 
> but the path mapper is already defined as text.
> 
> -- Andreas
> 

Great to see this happening. Can't wait to use my own DocumentBuilder :-)
I hope you also think about configuring the Document class in 1.2?

---

Danny

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


Re: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:

>> Of course this is just a first step, we have to discuss the
>> API. But for 1.2 it might be enough to make the DocumentBuilder
>> configurable in publication.xconf.
> 
> How would the configuration look like?

<publication>
   <languages>
     <language default="true">en</language>
     <language>de</language>
   </languages>
 
<path-mapper>org.apache.lenya.cms.publication.DefaultDocumentIdToPathMapper</path-mapper>
<document-builder>org.apache.lenya.cms.publication.DefaultDocumentBuilder</document-builder>
</publication>

Actually I would prefer attributes:

<document-builder
     class="org.apache.lenya.cms.publication.DefaultDocumentBuilder"/>

but the path mapper is already defined as text.

-- Andreas



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


Re: Replaced DefaultDocumentBuilder references with publication.getDocumentBuilder()

Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:

> Hi Lenya users,
> 
> FYI: I replaced all occurences of DefaultDocumentBuilder.getInstance()
> with publication.getDocumentBuilder() (which returns the
> DefaultDocumentBuilder at the moment).
> 
> Of course this is just a first step, we have to discuss the
> API. But for 1.2 it might be enough to make the DocumentBuilder
> configurable in publication.xconf.

How would the configuration look like?

Thanks

Michi


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


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org



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