forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: FW: Re: common+skins document2html.xsl questions
Date Mon, 23 Jan 2006 00:10:37 GMT
El dom, 22-01-2006 a las 17:27 -0500, Helena Edelson escribió:
> Thorsten -
> I won't get into the Dispatcher here, so I'm sending it to user@FAO.

;-) I thought so. 

>  Thank you for the feedback:
> Thorsten Scherler wrote:
> >   El dom, 22-01-2006 a las 12:32 -0500, Helena escribiÃ3:
> >   
> > > I am confused on getting data into xdocs content.
> > >     
> > does it has to be *in* the xdocs? Or is it that is coming just
> > afterward? Is it xdocs itself, if so did you try a "simple" cinclude on
> > the xdocs (before skining)?
> >   
> 
> 
> Do you mean implement a c_include on the xdocs (before skining)?

Yes, I thought about that, but since you need to add stuff that is not
valid xdocs 2.0, what I understood from what you describe further down,
you can not use it. 

>  in the skin?

That seems to be the only possibility.

> Would need to set up some control since the content I'm trying to get
> into a document is different or not needed for each. 

Yeah, you end up adding transformers with custom xsl that control when
to cinclude stuff and override core pipes in your project. Real messy to
maintain and not trivial to do.

> >   
> > > I've been testing some of my own hacks (manglings) for getting meta data 
> > > into sections of xdoc xml content files(document 2.0 dtd)
> > > 
> > >     
> > 
> > 
> > What is this meta data can you give an example?
> >   
> meta data ranges from simple xml files of things like 
> <foo
> some_id="xy"><lots_of_nested_stuff>stuff</lots_of_nested_stuff></foo>
> to other xml files of code snippets from affiliate trackers and links
> with scary things the dtd won't accept
> ( tried to customize my own dtd for greater flexibility).
> Why an organization would use html <iframe>  (amazon.com) for
> rendering in a multitude of browsers is a mystery.
> <product product_id="1" author_id="">
>         <title>Expedition Medicine</title>
>         <type>book</type><subtype>pulse</subtype>
>         <affilliate> 
> <iframe
> src="http://rcm.amazon.com/e/cm?t=ourid&#38;o=1&#38;p=8&#38;l=as1&#38;asins=1861974345&#38;nou=1&#38;fc1=cccccc&#38;IS2=1&#38;lt1=_blank&#38;lc1=ffffff&#38;bc1=5555555&#38;bg1=444444&#38;f=ifr"
style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
>     </affilliate>
>     </product> 

So actually it would not be possible to transform this into xdocs prior
the inclusion right? Then you need to implement it in the
document-to-html.xsl but like said above and already noticed by yourself
it will become the maintenance hell. 

> > 
> >   
> > > This is simple with xslt files, jsp/servlets, php  where aspects are 
> > > easily split so one can set in say a language file
> > > the messages to output (Forrest has this but..) in various areas of the 
> > > Content (xdocs/*.xml).
> > >     
> > 
> > 
> > That sounds like you want to include another language in the content,
> > right? 
> >   
> Well, not in this instance. I was thinking about a php app, or some
> java things where there is a string config file for instance,
> allowing you to get fields into the content area (xdocs), but there is
> code controling what goes where when, which xdocs content won't.
>  

Yeah, that exact problem is addressed by the dispatcher but I cannot
think about an easy way to imitate this behavior. Further the dispatcher
focus not so much on xdocs but rather react on requests. Meaning you can
generate a html file for a request where no xdocs can be found.

>     
> > > The only way I see is to customize both common document2html.xsl and 
> > > skins document2html.xsl
> > > (very messy:reusability rather sad)
> > > 
> > >     
> > 
> > 
> > Yes, that is why I started the work on the dispatcher aka views. Here
> > you can easily define custom business services that you can include and
> > process in your output.
> >   
> > > class="fork" is being stripped by my editor and <link> not allowed.
> > >     
> > link is xdocs < 2.0 and in =>2.0  it is <a/>.
> > http://forrest.apache.org/dtdx/document-v20.html#changes-20
> >   
> I tried both link and a to be sure, neither worked for me, must be an
> editor issue.

Please try either with "notepad" when on windows or vi (any very simple
text editor will do) and try to edit. It should work.

> > Seems you need to configure your editor that @class does not get
> > stripped. Try with "vi", that will not strip it. ;-)
> > 
> > 
> >   
> > > tested a custom template for matching <a> to implement class fork but
it 
> > > kept being stripped.
> > > did a bunch of (starts-with...) to catch "http:" and if found, do <a 
> > > href="{@href} target="_blank"> just like "fork"
> > > with no luck either on like ten tries at template variations. Anyone 
> > > have any ideas?
> > >     
> > 
> > 
> > Hmm, I have just tested it on the lenya docu and it is working like a
> > charm.
> > <p> The server <a href="ext:lenya-zone"
> > class="fork">lenya.zones.apache.org</a> provides our testing and
> > demonstration area. It is managed by Apache Lenya committers. </p>
> > 
> >   
> I get  error:ext:lenya-zone for the resulting URL.  
> <a href="ext:lenya-zone"
> class="fork">lenya.zones.apache.org</a> 
>  
> ?

jeje, sorry, like I stated it is the lenya docu so if you want to use
the exact markup you would need to add (to your site.xml):
<external-refs>
 <lenya-zone href="http://lenya.zones.apache.org"/>
</external-refs>

Otherwise just try:
<a href="http://lenya.zones.apache.org"
class="fork">lenya.zones.apache.org</a>


> 
> Is it worth waiting on this and helping to test the Dispatcher? 

IMO that is the best you could do. You have reached a point that I had
when I decided that we need something more powerful then skins. 

> I've been trying everything off an on for a while now.
> no luck yet.

Yeah, because it is not trivial at all. 

...but the good news is that I want to release the dispatcher before
14.02.2006 out of the whiteboard. 

sorry for not being a bigger help, but skins are way too inflexible to
give you useful code tips about your problem.

salu2  
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Mime
View raw message