Giter Site home page Giter Site logo

pink-slipper's Introduction

Pink Slipper

Pink Slipper is a MarkLogic tool to execute CoRB code entirely within MarkLogic. No command line. No Java. Simply kick your job off and wait. Job status tracking allows you to check if your job is complete. Pink Slipper gives you all the familiarity of CoRB with the piece of mind provided through job status.

The main goals of Pink Slipper are:

  • CoRB compatability - Write your code just like you would for CoRB
  • Status tracking - Track your job, to confirm successful completion
  • Simplicity and ease of use - Copy a single XQuery module into your project

How to use Pink Slipper:

  1. Copy src/main/ml-modules/root/pink-slipper.xqy into your project
  2. Write your CoRB modules
  3. Import Pink Slipper into your module
  4. Create a map containing your CoRB options (eg URIS-MODULE)
  5. Call ps:run()
  6. Check job status as needed with ps:get-job-status()

Code example to start job:

xquery version "1.0-ml";
import module namespace ps = "http://marklogic.com/pink-slipper" at "/pink-slipper.xqy";

let $corb-properties := map:map()
let $_ := map:put($corb-properties, "URIS-MODULE", "/path/to/uris/module.xqy")
let $_ := map:put($corb-properties, "PROCESS-MODULE", "/path/to/process/module.xqy")
let $job-id := ps:run($corb-properties)

Code example to check job status (MAKE SURE YOU DON'T DO THIS IN THE SAME TRANSACTION)

xquery version "1.0-ml";
import module namespace ps = "http://marklogic.com/pink-slipper" at "/pink-slipper.xqy";

let $job-status := ps:get-job-status($job-id)
let $_ :=
  if ($job-status = $ps:status-incomplete) then "keep waiting"
  else if ($job-status = $ps:status-unsuccessful) then "uh-oh, better look into this"
  else if ($job-status = $ps:status-successful) then "woo-hoo!"
  else () (: this should never happen :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.