Changeset 01a6690


Ignore:
Timestamp:
13/04/2012 19:08:04 (10 years ago)
Author:
Eric van der Vlist <vdv@dyomedea.com>
Branches:
master
Children:
9d99928
Parents:
5ac9ea9
git-author:
Eric van der Vlist <vdv@dyomedea.com> (13/04/2012 19:08:04)
git-committer:
Eric van der Vlist <vdv@dyomedea.com> (13/04/2012 19:08:04)
Message:

First version that can produce a packaged archive.

Location:
archiver/pipelines/actions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • archiver/pipelines/actions/archive-resource.xpl

    r3d18e9d r01a6690  
    133133          </p:processor> 
    134134 
     135          <!-- It's a hack so that the document is not submitted as text through the xforms:submit processor... --> 
     136          <p:processor name="oxf:xslt"> 
     137            <p:input name="config"> 
     138              <document xsl:version="2.0"> 
     139                <xsl:copy-of select="/"/> 
     140              </document> 
     141            </p:input> 
     142            <p:input name="data" href="#rewritten"/> 
     143            <p:output name="data" id="rewritten-embedded"/> 
     144          </p:processor> 
    135145 
    136146          <!-- Store the rewritten document in the database --> 
     
    148158              </config> 
    149159            </p:input> 
    150             <p:input name="param" href="#rewritten"/> 
     160            <p:input name="param" href="#rewritten-embedded"/> 
    151161            <p:output name="data" id="response3"/> 
    152162          </p:processor> 
  • archiver/pipelines/actions/mediatypes/css.xpl

    rcf97a98 r01a6690  
    2424          <xsl:value-of select="/*"/> 
    2525        </url> 
     26        <content-type>text/css</content-type> 
    2627        <mode>text</mode> 
    2728      </config> 
     
    9899      </xsl:stylesheet> 
    99100    </p:input> 
    100     <p:output name="data" id="rewritten-local" debug="rewritten"/> 
     101    <p:output name="data" ref="rewritten" debug="rewritten"/> 
    101102  </p:processor> 
    102103 
    103   <!-- It's a hack so that the document is not submitted as text through the xforms:submit processor... --> 
    104   <p:processor name="oxf:xslt"> 
    105     <p:input name="config"> 
    106       <document xsl:version="2.0"> 
    107         <xsl:copy-of select="/"/> 
    108       </document> 
    109     </p:input> 
    110     <p:input name="data" href="#rewritten-local"/> 
    111     <p:output name="data" ref="rewritten"/> 
    112   </p:processor> 
     104  
    113105 
    114106</p:config> 
  • archiver/pipelines/actions/mediatypes/html.xpl

    r16cc943 r01a6690  
    106106      </xsl:stylesheet> 
    107107    </p:input> 
    108     <p:output name="data" ref="rewritten" debug="rewritten"/> 
     108    <p:output name="data" id="html-rewritten" debug="rewritten"/> 
     109  </p:processor> 
     110 
     111  <p:processor name="oxf:xml-converter"> 
     112    <p:input name="config"> 
     113      <config> 
     114        <content-type>application/xml</content-type> 
     115        <encoding>utf-8</encoding> 
     116        <version>1.0</version> 
     117      </config> 
     118    </p:input> 
     119    <p:input name="data" href="#html-rewritten"/> 
     120    <p:output name="data" ref="rewritten"/> 
    109121  </p:processor> 
    110122 
  • archiver/pipelines/actions/package-archive.xpl

    r5ac9ea9 r01a6690  
    229229    <p:choose href="current()"> 
    230230      <p:when test="/archive/@href-rewritten"> 
    231         <p:processor name="oxf:identity"> 
    232           <p:input name="data"> 
    233             <none/> 
     231        <!-- Read the rewritten document --> 
     232        <p:processor name="oxf:pipeline"> 
     233          <p:input name="config" href="/data-access.xpl"/> 
     234          <p:input name="data" transform="oxf:xslt" href="aggregate('root', #data, current())"> 
     235            <config xsl:version="2.0"> 
     236              <relpath> 
     237                <xsl:value-of select="/root/action/@directory"/> 
     238                <xsl:value-of select="/root/archive/@href-rewritten"/> 
     239              </relpath> 
     240              <operation>read</operation> 
     241              <type>document</type> 
     242            </config> 
    234243          </p:input> 
     244          <p:input name="param"> 
     245            <empty/> 
     246          </p:input> 
     247          <p:output name="data" id="rewritten" debug="rewritten"/> 
     248        </p:processor> 
     249        <!-- Store this document --> 
     250        <p:processor name="oxf:file-serializer"> 
     251          <p:input name="config"> 
     252            <config> 
     253              <scope>request</scope> 
     254            </config> 
     255          </p:input> 
     256          <p:input name="data" href="#rewritten#xpointer(/document/document)"/> 
    235257          <p:output name="data" id="file" debug="file"/> 
    236258        </p:processor> 
     
    271293        </file> 
    272294        <xsl:for-each select="/root/files/file[url]"> 
    273           <xsl:variable name="tokens" select="tokenize(archive/@url, '/')"/> 
    274           <xsl:variable name="last-token" select="$tokens[last()]"/> 
    275           <xsl:variable name="tokens2" select="tokenize($last-token, '\.')"/> 
    276           <xsl:variable name="extension" select="$tokens2[last()]"/> 
    277           <file name="rewritten/{saxon:string-to-hexBinary(substring(archive/@url, 1, string-length(archive/@url) - string-length($extension) - 1), 'utf-8')}.{$extension}"> 
    278             <xsl:value-of select="url"/> 
    279           </file> 
     295          <xsl:choose> 
     296            <xsl:when test="position()=1"> 
     297              <!-- TODO: support non HTML documents... --> 
     298              <file name="rewritten/index.html"> 
     299                <xsl:value-of select="url"/> 
     300              </file> 
     301            </xsl:when> 
     302            <xsl:otherwise> 
     303              <xsl:variable name="tokens" select="tokenize(archive/@url, '/')"/> 
     304              <xsl:variable name="last-token" select="$tokens[last()]"/> 
     305              <xsl:variable name="tokens2" select="tokenize($last-token, '\.')"/> 
     306              <xsl:variable name="extension" select="$tokens2[last()]"/> 
     307              <file name="rewritten/{saxon:string-to-hexBinary(substring(archive/@url, 1, string-length(archive/@url) - string-length($extension) - 1), 'utf-8')}.{$extension}"> 
     308                <xsl:value-of select="url"/> 
     309              </file> 
     310            </xsl:otherwise> 
     311          </xsl:choose> 
    280312        </xsl:for-each> 
    281313      </files> 
Note: See TracChangeset for help on using the changeset viewer.