This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xquery version "1.0-ml"; | |
| (: Copyright 2002-2010 Mark Logic Corporation. All Rights Reserved. :) | |
| declare namespace feed = "http://marklogic.com/extension/plugin/feed"; | |
| import module namespace plugin = "http://marklogic.com/extension/plugin" at "/MarkLogic/plugin/plugin.xqy"; | |
| import module namespace info="http://marklogic.com/appservices/infostudio" at "/MarkLogic/appservices/infostudio/info.xqy"; | |
| import module namespace infodev="http://marklogic.com/appservices/infostudio/dev" at "/MarkLogic/appservices/infostudio/infodev.xqy"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare function feed:capabilities() | |
| as map:map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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}"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare function feed:cancel($ticket-id as xs:string) | |
| as empty-sequence() | |
| { | |
| infodev:ticket-set-status($ticket-id,"cancelled") | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let $name := fn:data(info:ticket($ticket-id)/info:policy-name) | |
| let $max := fn:data(infodev:effective-policy($name,())/info:max-docs-per-transaction) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let $set-total := infodev:ticket-set-total-documents($ticket-id, $entry-count) | |
| let $set-trans := infodev:ticket-set-total-transactions($ticket-id,$total-transactions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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,()) | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let $_ := infodev:ticket-set-status($ticket-id, "completed") |
OlderNewer