Yeoman generator for MarkLogic MLJS Workplace app now available!…

Think MLJS Workplace is hard to get started with? No longer!…

WARNING: These instructions have been superseded by the Getting Started with MLJS tutorial on this site.

MLJS Workplace is a web app that enables rapid drag-drop configuration of a web app on MarkLogic Server.

It’s very useful, but the install instructions are very involved… or were until now!

The problem

MLJS Workplace uses elements of MLJS’ Node.js support, third party Node.js libraries, the Roxy deploy tool (and thus Ruby) and MLCP (and thus Java).

This leads to a lot of complexity to learn to get started building MLJS Workplace based apps.

The solution

I’ve created a Yeoman Generator for the MarkLogic Workplace app to make installing MLJS Workplace a breeze!

Yeoman is a web application scaffolding and modular code install tools. It’s pluggable. I’ve written a Yeoman generator that installs a full end-to-end MLJS

Workplace app you can start customising in just a few steps.

Getting started

You’ll of course need Node and npm installed. Pretty obvious really. Less dependencies than before.

You’ll need to install Yeoman: sudo npm install -g yo

Install the MLJS Workplace generator: sudo npm install -g generator-mljsworkplace

Now create a new application folder: mkdir myworkplaceapp ; cd myworkplaceapp

And now run Yeoman: yo mljsworkplace

This will run a whole bunch of commands for you, and ask you about your ML environment. Answer the questions and keep hitting enter.

You now have all the files for a full MLJS Workplace app… but you need to install Workplace! Oh no!

Thankfully I’ve integrated the mlnodetools project in to this app, so you just need to: ./mljsadmin install ; ./mljsadmin update ; ./mljsadmin load

Now run the Node.js web server: ./mljsserve

And point your browser at: http://localhost:5001/index.html5

What next

Now login and click the ‘edit application’ link in the top right. Add new pages, edit them, and drag and drop widgets to your heart’s content!!!

Have a look at my MLJS Workplace Youtube video playlist for details on the widgets available, and how to configure them.

Merry Christmas!!! Enjoy!!!


  1. Hi Adam,

    I’m getting a 404 error for flat-xmldom package when I install the MLJS Workplace generator.

    npm WARN peerDependencies The peer dependency yo@>=1.0.0 included from generator-mljsworkplace will no
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
    npm WARN deprecated lodash@2.4.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.
    npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
    npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
    npm ERR! Darwin 15.0.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "generator-mljsworkplace"
    npm ERR! node v4.2.2
    npm ERR! npm v2.14.7
    npm ERR! code E404

    npm ERR! 404 Registry returned 404 for GET on
    npm ERR! 404
    npm ERR! 404 'flat-xmldom' is not in the npm registry.
    npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
    npm ERR! 404 It was specified as a dependency of 'mljs'
    npm ERR! 404
    npm ERR! 404 Note that you can also install from a
    npm ERR! 404 tarball, folder, http url, or git url.

    1. Hi Joe!

      Yes this is correct. It appears someone in the last few months has removed an NPM from the registry, hence you now getting the above problem. I’m working on a longer term fix, but below is a temporary fix from a colleague:-

      “I had to install cnpm first:

      npm install cnpm -g

      Then used cnpm to install flat-xmldom:

      cnpm install flat-xmldom

      Let me know how that goes. I’ll fix in the next release (mid January)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.