forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: skinconf text elements in group.svg
Date Thu, 07 Apr 2005 11:26:07 GMT
Nice to hear you have got it working. :)

salu2

On Tue, 2005-04-05 at 18:13 +0100, Kevin wrote:
> 
> Kevin wrote:
> > Thorsten Scherler wrote:
> > 
> >> Hi Kevin,
> >>
> >> http://svn.apache.org/viewcvs?view=rev&rev=159868
> >>
> >> Rick commited some code to make
> >> forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl more
> >> generic.
> > 
> > 
> > Thank you for your help. I'll look at how project2text.xsl is
> > called so I understand things correctly. I appreciate your ideas
> > below and will use the new svn version.
> > 
> > Kevin.
> > 
> >> If you make an svn up your problem may be already solved. ;-)
> >>
> >> Changing the stopping color may be easier to change directly in the
> >> *.svg code.
> >>
> >> HTH
> >> thorsten
> 
> 
> Hi Thorsten,
> 
> I have looked at project2text.xsl and if I understand right it
> outputs the values of document (skinconf.xml) children not all
> descendants? I couldn't implement the suggested idea below:
> 
> <svg-stop>
>    <stop style="stop-color:white" offset="0"/>
>    <stop style="stop-color:lightgreen" offset="1"/>
> </svg-stop>
> 
> instead, knowing I can access top level text elements:
> 
> <svg-color1>white</svg-color1>
> <svg-color2>darkblue</svg-color2>
> 
> --
> 
> Also I am confused to how project2text.xsl works. I understand
> the xml file is group.svg and transformed with project2text.xsl
> replacing <for:element /> in the svg somehow with elements from
> another xml ie. skinconf.xml possibly after it's own transform
> with skin and common skinconf.xsl files. It's this:
> 
> <xsl:variable name="config" select="//skinconfig"/>
> 
> how does it hook into the <skinconf> tree. "//skinconfig" means
> all "skinconfig" descendants of the document element? I'm wrong
> in my understanding :( but anyway I have completed a solution :)
> 
> --
> 
> 1) Change group.svg and project.svg:
> 
> ....
> 
> <style type="text/css">
> .c1 { stop-color: <for:svg-color1 />; }
> .c2 { stop-color: <for:svg-color2 />; }
> </style>
> 
> <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
>    <stop class="c1" offset="0"/>
>    <stop class="c2" offset="0.5"/>
> </linearGradient>
> 
> ....
> 
> 2) Change forrest/main/webapp/skins/common/skinconf.xsl
> 
>      <xsl:template match="skinconfig">
>        <xsl:copy>
> 
>        <xsl:if test="not(svg-color1)">
>          <xsl:choose>
>            <xsl:when test="colors/color[@name='tab-unselected']">
>              <svg-color1><xsl:value-of 
> select="colors/color[@name='tab-unselected']/@value"/></svg-color1>
>            </xsl:when>
>            <xsl:otherwise>
>              <svg-color1>white</svg-color1>
>            </xsl:otherwise>
>          </xsl:choose>
>        </xsl:if>
> 
>        <xsl:if test="not(svg-color2)">
>          <xsl:choose>
>            <xsl:when test="colors/color[@name='tab-selected']">
>              <svg-color2><xsl:value-of 
> select="colors/color[@name='tab-selected']/@value"/></svg-color2>
>            </xsl:when>
>            <xsl:otherwise>
>              <svg-color2>darkblue</svg-color2>
>            </xsl:otherwise>
>          </xsl:choose>
>        </xsl:if>
> 
> ....
> 
> 3) Change forrest/main/webapp/resources/schema/dtd/skinconfig-v06-3.dtd
> 
> ....
>     svg-color1?, svg-color2?,
> ....
>    <!ELEMENT svg-color1 (#PCDATA)>
>    <!ELEMENT svg-color2 (#PCDATA)>
> ....
> 
> --
> 
> Well not a very elegant solution but anyway thanks again for
> your help.
> 
> Kevin.
> 
> 
> >>
> >> On Sat, 2005-04-02 at 21:45 +0200, Thorsten Scherler wrote:
> >>
> >>> On Sat, 2005-04-02 at 14:04 +0100, Kevin wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> I'm using 0.7-dev and wondered if it was possible
> >>>> to use other text elements from processed skinconf
> >>>> as done in group.svg and project.svg.
> >>>>
> >>>> ie. from
> >>>>
> >>>> forrest run
> >>>>
> >>>> http://localhost:port/images/group.png
> >>>>
> >>>> shows the skinconf text in group.svg:
> >>>>
> >>>> <for:group-name />
> >>>>
> >>>> -- 
> >>>>
> >>>> The 'for' namespace allowed <for:project-name />
> >>>> but not <for:year /> which was in skinconf too?
> >>>>
> >>>
> >>> Yes and no.
> >>> The for:group-name will be matches later on in
> >>> {forrest-trunk}/main/webapp/resources/stylesheets/project2text.xsl
> >>>
> >>> Here you find:
> >>> <xsl:template match="for:project-name">
> >>>    <xsl:value-of select="$config/project-name"/>
> >>>  </xsl:template>
> >>>
> >>> <xsl:template match="for:group-name">
> >>>    <xsl:value-of select="$config/group-name"/>
> >>>  </xsl:template>
> >>> </xsl:stylesheet>
> >>>
> >>> ...and no <for:year />!
> >>>
> >>> You would need to add new matches here if you want to extend the
> >>> functionality.
> >>>
> >>>
> >>>> After a refresh I expected group.png to show the
> >>>> year as it did changing group-name to project-name?
> >>>>
> >>>
> >>> Yes and no.
> >>>
> >>> Actually for project-name the match was on the project.svg which has
> >>> <for:project-name/>
> >>>
> >>>> Could someone help with my understanding of how
> >>>> this works. Thanks.
> >>>>
> >>>
> >>> You will need into the above xsl's and where we match them to really
> >>> understand what is going on. ;-)
> >>>
> >>> HTH
> >>>
> >>>
> >>>> -- 
> >>>>
> >>>> My aim was to get the svg linearGradient stop-colors
> >>>> in skinconf (from colors.color.tab-selected etc.) eg.
> >>>> <svg-stop-color-1>#4c6c8f</svg-stop-color-1>
> >>>> <svg-stop-color-2>#e5e4d9</svg-stop-color-2>
> >>>> so the project and group logo colors would match the
> >>>> skin.
> >>>>
> >>>
> >>> An easy way would be (I had no time to test!) but it gives you the idea
> >>> (I hope ;-)):
> >>>
> >>> a) extend the skinconf.dtd to allow and add to skinconf.xml:
> >>> <svg-stop>
> >>>  <stop style="stop-color:white" offset="0"/>
> >>>  <stop style="stop-color:lightgreen" offset="1"/>
> >>> </svg-stop>
> >>>
> >>> b) change project.svg and group.svg and change:
> >>>    <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
> >>>      <stop style="stop-color:white" offset="0"/>
> >>>      <stop style="stop-color:lightgreen" offset="1"/>
> >>>    </linearGradient>
> >>>
> >>> to:
> >>>    <linearGradient id="gradient" x1="0" y1="0" x2="0" y2="1">
> >>>      <for:stop />
> >>>    </linearGradient>
> >>>
> >>> c) change project2text.xsl and add
> >>>  <xsl:template match="for:stop">
> >>>    <xsl:copy-of select="$config/svg-stop/*"/>
> >>>  </xsl:template>
> >>>
> >>> This solution would change the project and group logo the same way. If
> >>> you want to have it different you need to do something like :
> >>>
> >>> in skinconf.xml
> >>> <project-svg-stop>
> >>>  <stop style="stop-color:white" offset="0"/>
> >>>  <stop style="stop-color:lightgreen" offset="1"/>
> >>> </project-svg-stop>
> >>>
> >>> ...and change all above to match the new situation. ;-)
> >>>
> >>>
> >>>> Used in an an svg <style> element:
> >>>>
> >>>> <style type="text/css">
> >>>> .svg-stop-color2 {
> >>>>               stop-color: <for:svg-stop-color-2 />;
> >>>> }
> >>>> .svg-stop-color1 {
> >>>>               stop-color: <for:svg-stop-color-1 />;
> >>>> }
> >>>> </style>
> >>>>
> >>> That is as well possible but will cost a wee bit much work.
> >>>
> >>>
> >>>> The above shows the idea probably need CDATA tags.
> >>>>
> >>>
> >>> HTH and if it is working please create a patch, add it to our issue
> >>> tracker and we will apply the patch.
> >>>
> >>>
> >>>> -- 
> >>>>
> >>>> Kevin.
> >>>>
> >>>
> >>> salu2
> > 
> > 
> > 
-- 
thorsten

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


Mime
View raw message