ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Online Bookstore
Date Wed, 25 May 2005 12:41:51 GMT
I tried a little bit ...
What do you think?

Ted, are that links ok?


Jan




docs/resources.html
- generated (test) page



xdocs/resources.xml (testversion, only two books)
- added "isbn" attribute to <subsection>
  <subsection name="Ant: The Definitive Guide, 2nd edition"
isbn="0596006098">



xdocs/stylesheets/site.vsl
- add´s marked with "##MAT-bookstore"
- new macro for inserting the link to external partners
- invocation of that macro from #subsection, only if there is an
"isbn"-attribute
  #macro ( subsection $subsection)
    ...
    #if ($subsection.getAttributeValue("isbn"))
      #set ($isbn = $subsection.getAttributeValue("isbn"))
      #isbn ($isbn)
    #end
  #end

  #macro ( isbn $isbn)
    <p><b>Available from:</b><br>
        <a href="... /$!isbn/apachesoftwar-20/"
target="_blank">Amazon.com</a>
      | <a href="... &amp;sourceid=41462544&amp;bfpid=$!isbn"
target="_blank">Barnes &amp; Noble</a>
      | <a href="... ?affiliateId=Apache&amp;isbn=$!isbn"
target="_blank">Book Sense</a>
      | <a href="... ?isbn=$!isbn&amp;partner_id=29693"
target="_blank">Powells.com</a>
    <br></p>
#end



xdocs/stylesheets/templates.vm
- add´s marked with "##MAT-bookstore"
- if that info (isbn) is present, why not show that in the table
  #macro ( table $table)
  ...
    #if ($table.getParent().getAttributeValue("isbn"))
      #set ($isbn = $table.getParent().getAttributeValue("isbn"))
      <tr><th>ISBN:</th><td>$!isbn</td></tr>
    #end
    </table>
  #end
  


> -----Ursprüngliche Nachricht-----
> Von: Stefan Bodewig [mailto:bodewig@apache.org]
> Gesendet am: Dienstag, 24. Mai 2005 14:46
> An: dev@ant.apache.org
> Betreff: Re: Online Bookstore
> 
> On Tue, 24 May 2005, Jan Materne <Jan.Materne@rzf.fin-nrw.de> wrote:
> 
> > The idea is
> > - store the ISBN in an extra tag in the xdoc
> >   <th>ISBN:</th>  <th id="isbn"> ... </th>
> > - use the VM makro to generate the link passage
> 
> Ahh, thanks.
> 
> +1
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


Mime
View raw message