Changeset b346236
- Timestamp:
- 22/04/2012 18:56:15 (10 years ago)
- Branches:
- master
- Children:
- 51c2058
- Parents:
- 3bcb813
- git-author:
- Eric van der Vlist <vdv@dyomedea.com> (22/04/2012 18:56:15)
- git-committer:
- Eric van der Vlist <vdv@dyomedea.com> (22/04/2012 18:56:15)
- Location:
- archiver/pipelines
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
archiver/pipelines/actions/heritrix-archive-set.xpl
r3bcb813 rb346236 7 7 8 8 <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xforms="http://www.w3.org/2002/xforms" 9 xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns: exist="http://exist.sourceforge.net/NS/exist" xmlns:saxon="http://saxon.sf.net/"9 xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:exist="http://exist.sourceforge.net/NS/exist" xmlns:saxon="http://saxon.sf.net/" 10 10 xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"> 11 11 12 12 <p:param name="data" type="input"/> 13 13 14 <p:processor name="oxf:unsafe-xslt">15 <p:input name="data" href="#data"/>16 <p:input name="config">17 <config xsl:version="2.0">18 <relpath>queue.xml</relpath>19 <operation>write</operation>20 <type>xquery</type>21 <parameter name="directory" type="string">22 <xsl:value-of select="translate(/action/@uuid, '-', '/')"/>23 <xsl:text>/</xsl:text>24 </parameter>25 <parameter name="filename" type="string">26 <xsl:value-of select="saxon:string-to-hexBinary(/action/@url, 'utf-8')"/>27 <xsl:text>.xml</xsl:text>28 </parameter>29 <parameter name="uuid" type="string">30 <xsl:value-of select="/action/@uuid"/>31 </parameter>32 <parameter name="url" type="string">33 <xsl:value-of select="/action/@url"/>34 </parameter>35 <parameter name="priority-resource" type="string">36 <xsl:value-of select="/action/@priority + 2"/>37 </parameter>38 <parameter name="priority-package" type="string">39 <xsl:value-of select="/action/@priority + 1"/>40 </parameter>41 </config>42 </p:input>43 <p:output name="data" id="data-access-data"/>44 </p:processor>45 46 <!-- <p:processor name="oxf:pipeline">47 <p:input name="config" href="/data-access.xpl"/>48 <p:input name="data" href="#data-access-data"/>49 <p:input name="param">50 <xquery><![CDATA[51 declare namespace util = "http://exist-db.org/xquery/util";52 53 for $q in /queue return54 update55 insert (<action priority=$(priority-resource) uuid="{util:uuid()}" type="archive-resource" url=$(url) directory=$(directory) filename=$(filename)/>,56 <action priority=$(priority-package) uuid="{util:uuid()}" type="package-archive" directory=$(directory)/>)57 into $q,58 59 for $a in /queue/action where $a/@uuid = $(uuid) return60 update61 delete $a62 63 ]]></xquery>64 </p:input>65 <p:output name="data" id="response" debug="response"/>66 </p:processor>67 68 <p:processor name="oxf:null-serializer">69 <p:input name="data" href="#response"/>70 </p:processor>71 -->72 <p:processor name="oxf:pipeline">73 <p:input name="config" href="/data-access.xpl"/>74 <p:input name="data" transform="oxf:xslt" href="#data-access-data">75 <config xsl:version="2.0">76 <relpath>77 <xsl:value-of select="/config/parameter[@name='directory']"/>78 <xsl:text>index.xml</xsl:text>79 </relpath>80 <operation>write</operation>81 <type>document</type>82 </config>83 </p:input>84 <p:input name="param" transform="oxf:xslt" href="#data">85 <archive-set xsl:version="2.0">86 <xsl:copy-of select="/action/@url|/action/@uuid"/>87 </archive-set>88 </p:input>89 <p:output name="data" id="response2" debug="response2"/>90 </p:processor>91 92 <p:processor name="oxf:null-serializer">93 <p:input name="data" href="#response2"/>94 </p:processor>95 14 96 15 <!-- Create a new Heritrix job--> … … 152 71 <p:output name="response" id="heritrix-built" debug="heritrix-built"/> 153 72 </p:processor> 154 73 155 74 <!-- Launch the job --> 156 75 <p:processor name="oxf:xforms-submission"> … … 171 90 <p:output name="response" id="heritrix-launched" debug="heritrix-launched"/> 172 91 </p:processor> 173 92 174 93 <!-- Unpause the job --> 175 94 <p:processor name="oxf:xforms-submission"> … … 190 109 <p:output name="response" id="heritrix-unpaused" debug="heritrix-unpaused"/> 191 110 </p:processor> 111 112 113 <p:processor name="oxf:unsafe-xslt"> 114 <p:input name="data" href="aggregate('root', #data, #heritrix-engine, #heritrix-unpaused)"/> 115 <p:input name="config"> 116 <config xsl:version="2.0"> 117 <relpath>queue.xml</relpath> 118 <operation>write</operation> 119 <type>xquery</type> 120 <parameter name="directory" type="string"> 121 <xsl:value-of select="translate(/root/action/@uuid, '-', '/')"/> 122 <xsl:text>/</xsl:text> 123 </parameter> 124 <parameter name="uuid" type="string"> 125 <xsl:value-of select="/root/action/@uuid"/> 126 </parameter> 127 <parameter name="url" type="string"> 128 <xsl:value-of select="/root/action/@url"/> 129 </parameter> 130 <parameter name="priority-warc" type="string"> 131 <xsl:value-of select="/root/action/@priority + 1"/> 132 </parameter> 133 <parameter name="next-time" type="string"> 134 <xsl:value-of select="current-dateTime() + xs:dayTimeDuration('PT1M')"/> 135 </parameter> 136 <parameter name="heritrix-job-url" type="string"> 137 <xsl:value-of select="/root/engine/jobs/value[shortName=/root/action/@uuid]/url"/> 138 </parameter> 139 </config> 140 </p:input> 141 <p:output name="data" id="data-access-data"/> 142 </p:processor> 192 143 193 144 145 <p:processor name="oxf:pipeline"> 146 <p:input name="config" href="/data-access.xpl"/> 147 <p:input name="data" transform="oxf:xslt" href="#data-access-data"> 148 <config xsl:version="2.0"> 149 <relpath> 150 <xsl:value-of select="/config/parameter[@name='directory']"/> 151 <xsl:text>index.xml</xsl:text> 152 </relpath> 153 <operation>write</operation> 154 <type>document</type> 155 </config> 156 </p:input> 157 <p:input name="param" transform="oxf:xslt" href="#data-access-data"> 158 <archive-set xsl:version="2.0" url="{/config/parameter[@name='url']}" uuid="{/config/parameter[@name='uuid']}"> 159 <heritrix-job url="{/config/parameter[@name='heritrix-job-url']}"/> 160 </archive-set> 161 </p:input> 162 <p:output name="data" id="response2" debug="response2"/> 163 </p:processor> 164 194 165 <p:processor name="oxf:null-serializer"> 195 <p:input name="data" href="#heritrix-unpaused"/> 166 <p:input name="data" href="#response2"/> 167 </p:processor> 168 169 170 <p:processor name="oxf:pipeline"> 171 <p:input name="config" href="/data-access.xpl"/> 172 <p:input name="data" href="#data-access-data"/> 173 <p:input name="param"> 174 <xquery><![CDATA[ 175 declare namespace util = "http://exist-db.org/xquery/util"; 176 177 for $q in /queue return 178 update 179 insert <action priority=$(priority-warc) uuid="{util:uuid()}" type="get-heritrix-warc" url=$(url) directory=$(directory) heritrix-job-url=$(heritrix-job-url) after=$(next-time)/> 180 into $q, 181 182 for $a in /queue/action where $a/@uuid = $(uuid) return 183 update 184 delete $a 185 186 ]]></xquery> 187 </p:input> 188 <p:output name="data" id="response" debug="response"/> 196 189 </p:processor> 197 190 191 <p:processor name="oxf:null-serializer"> 192 <p:input name="data" href="#response"/> 193 </p:processor> 194 195 198 196 </p:config> -
archiver/pipelines/scheduler.xpl
r11027c0 rb346236 7 7 8 8 <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xforms="http://www.w3.org/2002/xforms" 9 xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns: exist="http://exist.sourceforge.net/NS/exist" xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary">9 xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:exist="http://exist.sourceforge.net/NS/exist" xmlns:pipeline="java:org.orbeon.oxf.processor.pipeline.PipelineFunctionLibrary"> 10 10 11 11 <p:processor name="oxf:pipeline"> … … 21 21 <xquery><![CDATA[ 22 22 23 /queue/action[ @priority=max(/queue/action/@priority)]23 /queue/action[not(@after) or xs:dateTime(@after) < current-dateTime()][@priority=max(/queue/action[not(@after) or xs:dateTime(@after) < current-dateTime()]/@priority)] 24 24 25 25 ]]></xquery>
Note: See TracChangeset
for help on using the changeset viewer.