Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Available Application Types

Geert edited this page Jun 14, 2017 · 1 revision

As of Roxy 1.4, you can use the --app-type parameter to specify what kind of application you want. Use this with the "ml new" command when setting up a new project, or follow the tips on this page to update an existing project for the different app types.

Available Types

MVC

ml new my-app --app-type=mvc --server-version=[version-number]

This is the default kind of application. Use this to build a Roxy MVC application that does not use the MarkLogic REST API. URL rewriting is controlled by the Roxy rewriter.

REST

ml new my-app --app-type=rest --server-version=[version-number]

This type of application uses the MarkLogic REST API but not MVC. With this type of application, you can use the deployer with Application Builder. The new application will not have anything under the src directory, but will have a rest-api directory. Add your source and put your REST API options under $project/rest-api. The deployer will put the options where they need to be. URL rewriting is controlled by the MarkLogic REST rewriter.

Hybrid

ml new my-app --app-type=hybrid --server-version=[version-number]

Deprecated: don't use this. It's a crutch from when the REST API was introduced. Choose REST, MVC, or bare instead. With this application type, you can use the REST API and Roxy MVC together. URL rewriting is controlled by the Roxy rewriter.

Bare

ml new my-app --app-type=bare --server-verion=[version-number]

An application that uses neither the REST API nor the Roxy MVC framework. Use this to deploy applications where you're providing your own application structure.

Differences between types

Once a project is generated, you can find the project's app-type property in deploy/build.properties. You can change it, but beware that you will need to change other properties accordingly, and may even need to download extra code from the Roxy git repository. Below a summary of the main differences:

MVC

app-type=mvc
url-rewriter=/roxy/rewrite.xqy
error-handler=/roxy/error.xqy
rewrite-resolves-globally=
application-conf-file=src/app/config/config.xqy

No rest-api/, and src/ which contains the MVC framework as well as the unit testing.

Hybrid

(Deprecated)

app-type=hybrid
url-rewriter=/roxy/rewrite.xqy
error-handler=/roxy/error.xqy
rewrite-resolves-globally=true
application-conf-file=src/app/config/config.xqy

rest-api/ as well as src/, containing the MVC framework and unit testing.

You likely need to provide rest roles or privileges to the app-role in ml-config.

REST

A change occurred with the introduction of the Declarative XML Rewriter in MarkLogic 8.

MarkLogic 6/7:

app-type=rest
url-rewriter=/MarkLogic/rest-api/rewriter.xqy
error-handler=/MarkLogic/rest-api/error-handler.xqy
rewrite-resolves-globally=true
application-conf-file=src/config/config.xqy

MarkLogic 8+:

app-type=rest
url-rewriter=/MarkLogic/rest-api/rewriter.xml
error-handler=/MarkLogic/rest-api/error-handler.xqy
rewrite-resolves-globally=true
application-conf-file=src/config/config.xqy

Both come with rest-api/, and a src/ only containing a sample app-config, also available at deploy/sample/custom-config.xqy.

You likely need to provide rest roles or privileges to the app-role in ml-config.

Bare

app-type=bare
url-rewriter= # you are expected to fill this in yourself
error-handler= # you are expected to fill this in yourself
rewrite-resolves-globally=
application-conf-file=src/config/config.xqy

No rest-api/, and a src/ only containing a sample app-config, also available at deploy/sample/custom-config.xqy.