Skip to content

Instantly share code, notes, and snippets.

@wpaven
Created December 5, 2010 19:44
Show Gist options
  • Save wpaven/729396 to your computer and use it in GitHub Desktop.
Save wpaven/729396 to your computer and use it in GitHub Desktop.
let $transactions :=
for $i at $index in 1 to $total-transactions
let $map := map:map()
let $start := (($i -1) *$transaction-size) + 1
let $finish := min((($start - 1 + $transaction-size),$entry-count))
let $put :=
for $entry in ($entries)[$start to $finish]
let $id := fn:concat(fn:string($entry/atom:id),".xml")
return map:put($map,$id,$entry)
return $map
(: the callback function for ingest :)
let $function := xdmp:function(xs:QName("feed:process-file"))
let $ingestion :=
for $transaction at $index in $transactions
return
try {
infodev:transaction($transaction,$ticket-id,$function,$policy-deltas,$index,(),())
} catch($e) {
infodev:handle-error($ticket-id, concat("transaction ",$index), $e)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment