forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: Dispatcher v3
Date Fri, 20 Jan 2006 09:00:27 GMT
El vie, 20-01-2006 a las 07:10 +0800, Gav.... escribió: 
> ----- Original Message ----- 
> From: "Thorsten Scherler" 
> 
> | El jue, 19-01-2006 a las 22:16 +0800, Gav.... escribió:
> | > I thought I would try following the new dispatcher quickstart and other 
> docs
> | > on v3.
> | >
> | > I get v3 to work no problem, enable pelt.fv in forrest.properties, works
> | > fine.
> | >

I just tried and for me the design is weird. The searchbox on the left
hand is not staying in the div. The nav-main contract is next to the
group logo. Besides I get in the console:
01:56:56.200 EVENT  Started org.mortbay.jetty.Server@6e70c7
[Fatal Error] :3:5: Content is not allowed in prolog.

...but yeah it works. ;-)

> | > Then I did :-
> | >
> | > copy /themes/pelt/* > /themes/pili/*
> | > copy /themes/pelt.fv > /themes/pili.fv
> | > change pelt.fv to pili.fv in forrest.properties
> | > forrest run
> | >
> | > The result is all the content but no CSS applied,
> | >
> |
> | Can I see the corresponding structurer part?
> 
> As I said above, the structurer is just pelt.fv renamed to pili.fv [*]
> I have altered nothing at all, just a straight copy, so I would have
> though that CSS would still be applied from one of :-
> 

Hmm, yeah me too. If you use firefox you can switch the theme to
default, which *relatively* renders fine.

>  <forrest:property name="branding-css-links-input">
>         <css url="common.css" media="screen" rel="alternate stylesheet" 
> theme="common"/>

http://localhost:8888/themes/common.css returns this stylesheet.

>         <css url="leather-dev.css" media="screen" rel="alternate stylesheet" 
> theme="common"/>

http://localhost:8888/themes/leather-dev.css returns Internal Server
Error -
cause: /home/thorsten/src/apache/forrest-trunk/build/plugins/org.apache.forrest.plugin.output.themer
(Is a directory)

I saw this error when something failed with the locationmap.
http://issues.apache.org/jira/browse/FOR-794 is similar, we need better
error reporting in this situations. 

Looking into the themer locationmap gives:
<!-- generic match for theme resources like css and js. -->
    <!-- 
      {1} name
      {2} extension (note we assume e.g. PATH/css/{1}.css)
      -->
    <match pattern="themes/**.*">
      <select type="exists">
        <location
src="{lm:themer.project.dir}/{project:theme}/{2}/{1}.{2}" />
        <location
src="{lm:themer.project.dir}/{defaults:theme}/{2}/{1}.{2}" />
        <location
src="{project:themer}/resources/themes/{project:theme}/{2}/{1}.{2}" />
        <location
src="{project:themer}/resources/themes/{defaults:theme}/{2}/{1}.{2}" />
        <location
src="{defaults:themer}/resources/themes/{project:theme}/{2}/{1}.{2}" />
        <location
src="{defaults:themer}/resources/themes/{defaults:theme}/{2}/{1}.{2}" />
      </select>
    </match>

Then looking into the v3 theme dir I found out that there was "just"
theme/pili/html and no css dir or others. So the first 2 location are
not meet.

The answer why common css is working in pili is because the last
fallback for "common.css" is 
<location
src="{defaults:themer}/resources/themes/{defaults:theme}/{2}/{1}.{2}" />
which will match themer/resources/themes/common/css/common.css.

Why pelt.fv is working before copying, can be found one line above
<location
src="{defaults:themer}/resources/themes/{project:theme}/{2}/{1}.{2}" />
which will match themer/resources/themes/pelt/css/

Now why the css for pili.fv is failing is that neither there is a pili
css dir in the project nor in the themer plugin. 

That is the reason why I do not recommend the copy approach in some
situations. Remember the idea of forrest is copyless. Now with the
structurer you do not have to copy themes, you override/extend them. Why
not using the pelt theme dir and add the project specific stuff to
there? 

This way you have your own customized pelt theme with minimal
maintenance cost in the future. Let forrest worry about maintaining
pelt/common and yourself about your custom contracts you added on top.

Remember with the structurer and css your resulting theme do not have to
even look close to the original pelt/common design. 

Actually something like 
themes
|--pelt.fv
|--common.fv
|--pili.fv
|--x.fv
`--common/*

Is possible if you only use common contracts in all of this structurer
definitions. Meaning the only thing you need to maintain are the
structurer defs. Assuming that you keep all the css in the common/css
dir.

If you do not want to store the css in common, you can create a theme
specific css dir x/css/ like for x.fv 


>         <css url="pelt.basic.css" media="screen" theme="Pelt"/>
>         <css url="pelt.screen.css" media="screen" theme="Pelt"/>
>         <css url="pelt.print.css" media="print"/>
>         <css>/* Extra css */
>     p.quote {
>       margin-left: 2em;
>       padding: .5em;
>       background-color: #f0f0f0;
>       font-family: monospace;
>     }</css>
>       </forrest:property>
> 
> I then changed project.theme=pili in the project.properties.
> pili.fv resides in the 'themes' directory not the 'themes/pili' directory
> - is this correct ?
> 

yes

salu2
-- 
thorsten

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


Mime
View raw message