Skip to content

stephen-gehring-ml/slush-marklogic-node

 
 

Repository files navigation

MarkLogic-Node Generator

This is a Slush generator that produces a skeleton application with the following components:

  • AngularJS
  • Gulp
  • node.js: very thin layer, hosting the Angular code and proxying MarkLogic REST API requests
  • Roxy Deployer: bootstrap MarkLogic databases, application servers, etc; scaffolding for MarkLogic REST API service extensions

Use

Required

  • node

  • npm

  • gulp

  • slush

    $ npm install -g slush

Install the generator

$ npm install -g slush-marklogic-node

Run the generator

Go to the directory where your new project will be created (the parent). Then:

$ slush marklogic-node <app-name>

When the generator is finished, start up your application by:

  • $ cd {app-name}
  • edit deploy/build.properties; set the -port properties to available ports (defaults: 8040, 8041)
  • $ ./ml local bootstrap
  • $ ./ml local deploy modules
  • edit gulpfile.js. In the options section near the top, set your desired ports
  • $ gulp # this will watch the .less file for changes and compile them to .css
  • $ gulp server

Data

Sample Data

The application comes with 25 JSON documents generated by json-generator.com. You can load them with MLCP like this:

$ /path/to/mlcp.sh import  -username admin -password admin -host localhost -port 8041 -input_file_path sample-data -document_type text -transform_module /transform/from-json.xqy  -transform_namespace "http://marklogic.com/transform/from-json"  -transform_function transform

Replace the username and password if needed. The from-json.xqy module is provided in the sample application under the src/transform directory.

General Data Information

The application assumes that you're storing JSON data. This shows up in the default format request for the MLRest service's searchContext, the detailController's (detail-ctrl.js) request to get a document, and in the out-of-the-box detail view.

About

Slush generator for a MarkLogic/node project

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 49.3%
  • XQuery 29.9%
  • HTML 12.2%
  • XSLT 7.6%
  • CSS 1.0%