cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [midgard-dev] Formatting engine for Midgard
Date Wed, 14 Jun 2000 22:50:38 GMT
Henri Bergius wrote:
> Greetings!
> There has been some discussion for including a
> more flexible formatting engine for Midgard content.

Hmmmm, very sorry to appear so ignorant but... what is Midgard? :)

> The current :f modifier is OK, but it still isn't
> anywhere near the requirements of professional
> publishing.
> I met Jukka some weeks ago, and we discussed the
> Cocoon XML publishing environment. Cocoon is
> practically just a formatting engine that passes
> XML documents through a pipe of different stylesheets,
> and handles cacheing of the generated content.

Well, some might argue with that :)
> When thinking about this, it was quite clear,
> that this is very near the formatting functionality
> we wanted for Midgard.

> If we could set up Midgard to interface with Cocoon
> so that it would throw documents (article contents,
> etc.) needing formatting to Cocoon, and let Cocoon
> then come up with the correctly formatted content,
> either from its cache, or by running the content
> through a stylesheet pipe. Then Cocoon would return
> the generated contents back to Midgard for serving.
> >From PHP end, this could be something like:
> <?php
>         $article = mgd_get_article(123);
>         $formatted_content = mgd_format_cocoon($article->content,
>                                         'options to Cocoon');
>         echo $formatted_content;
> ?>
> What do you think? 

Hmmm, this is a pattern that I generally consider very bad.... because
it breaks the inversion of control principle. It should be Cocoon to
call you and to know how to format your stuff. Your concern is only that
of creating a dynamic XML document.

So, it should be Cocoon calling your PHP page, not the other way around.

But this is for a perfect world and I'm perfectly aware that normally
things don't work out as expected or planned, this is why Cocoon can be
used like that.

> This would give us a very flexible
> formatting engine for Midgard, without having to
> reinvent the wheel anywhere. It would also give us
> more options for cooperating with other Apache-related
> projects.

That would be cool, yes.
> Cocoon is built with Java, so we could develop some
> kind of JNI interface between Midgard and Cocoon that
> would enable Midgard to pass documents to Cocoon, and
> enable Cocoon to store its stylesheets in Midgard
> database.

well, this starts to get tricky.... expecially since I don't know what
Midgard is... but I'm very happy to discuss any non-standard
integration, expecially from such different worlds as PHP.

(Sam, wake up, we'll need you here pretty soon, I'd guess)

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message