[ZDP] How-tos mirror links

Maik Röder mroe@axion-gmbh.de
Wed, 12 Apr 2000 11:01:40 +0100


Hi Kamon !

> I propose myself for working on the Zope.org how-tos links system.
> I will come back later with some proposal.

I already have something which you may want to use. It is an HTML
and XML view of the Tips on Zope.org. This can be easily
adapted to the How-Tos. I had been thinking about parsing the
XML file and uploading it to ZDP via ZClient.

You can try the scripts out live on the Zope.org site:

http://www.zope.org/Members/roeder/tips_in_html
http://www.zope.org/Members/roeder/tips_in_xml

I have also pasted the scripts below ...

Greetings,

Maik

------------------------------------------------------------------
tips_in_html:
------------------------------------------------------------------

<HTML>
<BODY>
<dtml-with "PARENTS[-1].SiteIndex">
 <dtml-call "REQUEST.set('meta_type', 'Tip')">
 <dtml-call "REQUEST.set('sort_on', 'date')">
 <dtml-call "REQUEST.set('sort_order', 'reverse')">
  <!--#with "_(results = searchResults(REQUEST=REQUEST))"-->

<HR>
<UL>
<dtml-in results>
<dtml-with "getobject(data_record_id_)">
<LI><A HREF="#<dtml-var url>"><dtml-var title_or_id></A>
</dtml-with>
</dtml-in>
</UL>

<dtml-in results>

<dtml-with "getobject(data_record_id_)">
<A NAME="<dtml-var url>">
<HR>
<B><dtml-var title html_quote></B>
</dtml-with>
<P>
<A HREF="http://www.zope.org/<dtml-var SCRIPT_NAME>/<dtml-var url>">
http://www.zope.org/<dtml-var SCRIPT_NAME>/<dtml-var url>
</A>
<P>
Date: <dtml-var date fmt="Date">
<P>
Author: <dtml-var creator html_quote>
<P>
<dtml-with "getobject(data_record_id_)">
<B>Tip:</B>
<P>
<dtml-var "_.getitem('tip')">
<P>
<B>Details:</B>
<P>
<dtml-var "_.getitem('details')">
<P>
</dtml-with>
</dtml-in>
</dtml-with>
</dtml-with>
</BODY>
</HTML>


------------------------------------------------------------------
tips_in_xml:
------------------------------------------------------------------

<?xml version="1.0"?>
<tips>
<dtml-with "PARENTS[-1].SiteIndex">
 <dtml-call "REQUEST.set('meta_type', 'Tip')">
 <dtml-call "REQUEST.set('sort_on', 'date')">
 <dtml-call "REQUEST.set('sort_order', 'reverse')">
  <!--#with "_(results = searchResults(REQUEST=REQUEST))"-->

<!--#in results-->
<tip>
   <url>
      <dtml-var SCRIPT_NAME>/<dtml-var url>
   </url>
   <date>
      <dtml-var date fmt="Date">
   </date>
   <Maintainer>
      <dtml-var creator html_quote>
   </Maintainer>
   <dtml-with "getobject(data_record_id_)">
   <id>
      <dtml-var id html_quote>
   </id>
   <name>
      <dtml-var title html_quote>
   </name>
   <abstract>
      <dtml-var tip html_quote>
   </abstract>  
   <content>
      <dtml-var details html_quote>
   </content>
   </dtml-with>
</dtml-in>
</tips>
</dtml-with>
</dtml-with>
</tips>

<dtml-call "RESPONSE.setHeader('Content-Type', 'text/xml')">

------------------------------------------------------------------