Skip to content

Instantly share code, notes, and snippets.

plugin:register(feed:capabilities(),"collector-feed.xqy")
let $_ := infodev:ticket-set-status($ticket-id, "completed")
declare function feed:process-file(
$document as node(),
$source-location as xs:string,
$ticket-id as xs:string,
$policy-deltas as element(info:options)?,
$context as item()?
)
{
infodev:ingest($document,$source-location,$ticket-id,$policy-deltas,())
};
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
let $set-total := infodev:ticket-set-total-documents($ticket-id, $entry-count)
let $set-trans := infodev:ticket-set-total-transactions($ticket-id,$total-transactions)
let $name := fn:data(info:ticket($ticket-id)/info:policy-name)
let $max := fn:data(infodev:effective-policy($name,())/info:max-docs-per-transaction)
declare function feed:cancel($ticket-id as xs:string)
as empty-sequence()
{
infodev:ticket-set-status($ticket-id,"cancelled")
};
<label for="uri">{ feed:string("uri-label", $model, $lang) }</label>
<input type="text" name="uri" id="uri" style="width: 400px" value="{$model/plugin:data/*:uri}"/>
declare function feed:model()
as element(plugin:plugin-model)
{
<plugin:plugin-model>
<plugin:data>
<uri>Enter URI here</uri>
<sincedate>Enter Since Date here. MM/DD/YYYY</sincedate>
</plugin:data>
</plugin:plugin-model>
};
declare function feed:capabilities()
as map:map