The making of a download script
Based on the feedback on my little download script I'd like to share how I created it.
Step 1: Have a look at the database that hosts the downloads:
Step 2: Pick a view
Step 3: The same view as XML and all of it.Step 4: Whip up some XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="no"/>
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
<xsl:template match="viewentries">REM Fetch all the Files<xsl:apply-templates /></xsl:template>
<xsl:template match="viewentry">if not exist <xsl:value-of select="entrydata/text"/>.pdf wget --user=yourname --password=yourpwd www.ls08.net/confapps/pdf.nsf/ceda8c2d1ee3648785256e1c000e1a47/<xsl:value-of select="@unid"/>/$file/<xsl:value-of select="entrydata/text"/>.pdf</xsl:template>
</xsl:stylesheet>
Step 5: Transform the view using your favorite XML tool.
Step 1: Have a look at the database that hosts the downloads:
Step 2: Pick a view
Step 3: The same view as XML and all of it.Step 4: Whip up some XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" indent="no"/>
<xsl:template match="/"><xsl:apply-templates /></xsl:template>
<xsl:template match="viewentries">REM Fetch all the Files<xsl:apply-templates /></xsl:template>
<xsl:template match="viewentry">if not exist <xsl:value-of select="entrydata/text"/>.pdf wget --user=yourname --password=yourpwd www.ls08.net/confapps/pdf.nsf/ceda8c2d1ee3648785256e1c000e1a47/<xsl:value-of select="@unid"/>/$file/<xsl:value-of select="entrydata/text"/>.pdf</xsl:template>
</xsl:stylesheet>
Step 5: Transform the view using your favorite XML tool.
Posted by Stephan H Wissel on 28 January 2008 | Comments (1) | categories: Lotusphere Show-N-Tell Thursday