Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ To run this generator, you need:
- [Bower](http://bower.io/): A package manager for front-end libraries (`npm
install -g bower`)
- [Git](https://git-scm.com/) - Roxy depends on this version control system
- [Ruby v1.9.3+](https://www.ruby-lang.org/en/documentation/installation/) - Roxy
depends on Ruby in order to run server configuration scripts

Note: the `node` command has been renamed to `nodejs`. Some dependencies still point to `node`, which is out of our control.
You may need to manually alias those commands, or install the `node-legacy` package.
Expand Down Expand Up @@ -62,17 +60,17 @@ On Mac or Linux:
npm install
bower install
gulp init-local
./ml local install
./ml local mlcp -options_file import-sample-data.options
./gradlew mlDeploy
./gradlew importSampleData

On Windows:

cd <app-name>
npm install
bower install
gulp init-local
ml.bat local install
ml.bat local mlcp -options_file import-sample-data.options
gradlew.bat mlDeploy
gradlew.bat importSampleData

## Prepare your Application

Expand All @@ -97,29 +95,25 @@ those files don't exist, then use the following command to create them:
Note: you can use `gulp init-dev` and `gulp init-prod` to setup properties for
the dev and prod environments.

Note: the deploy properties allow tweaking the MarkLogic side of the application
in great detail. Look inside `deploy/build.properties` or the documentation of
the [Roxy deployer](https://github.com/marklogic/roxy) to learn more about this.
Note: ml-gradle supports tweaking the MarkLogic side of the application
in great detail. Look at the documentation of ml-gradle
(https://github.com/marklogic-community/ml-gradle) to learn more about this.

Note: consider editing the `_loginMode` variable in `ui/app/login/login.service.js`
to change the login mode of the application. The default is set to `full`. The
other options are `top-right` or `modal`.

## Deploy your Application

Run the following Roxy commands to deploy the application to the chosen MarkLogic
Run the following ml-gradle commands to deploy the application to the chosen MarkLogic
installation. It will create and configure databases, REST servers, users, and
roles for you, and deploy the back-end application code.

./ml local bootstrap
./ml local deploy modules
./ml local deploy content
./gradlew mlDeploy -PenvironmentName=[local|dev|prod]

Or on Windows:

ml.bat local bootstrap
ml.bat local deploy modules
ml.bat local deploy content
gradlew.bat mlDeploy -PenvironmentName=[local|dev|prod]

## Launch your Application

Expand Down Expand Up @@ -148,29 +142,13 @@ and no browser tab will be opened automatically. In addition you have `--verbose
The application comes with 3000 JSON documents generated by json-generator.com. They
will allow you to explore all the features you get out of the box in a better way. You
can load them with (MLCP)[https://docs.marklogic.com/guide/ingestion/content-pump] using
Roxy.
ml-gradle.

Before you hit off, check if Roxy can find MLCP:

./ml local mlcp

Roxy will print the following message if it cannot find MLCP:

ERROR: MLCP not found or mis-configured, please check the mlcp-home setting.

Roxy looks for `/usr/local/mlcp/` (or `\usr\local\mlcp\`) by default. It can be
convenient to just install MLCP there, or create a symlink from `/usr/local/mlcp`
to where MLCP is installed. Alternatively, edit your `deploy/local.properties`, and
append a `mlcp-home=/path/to/your/mlcp/` to the end of it. Repeating above command
should show MLCP usage, not an ERROR.

Once MLCP works correctly, you can run:

./ml local mlcp -options_file import-sample-data.options
./gradlew importSampleData

Or on Windows:

ml.bat local mlcp -options_file import-sample-data.options
gradlew.bat importSampleData

Note: the detail controller, the part that handles showing your data, can not only
handle JSON, but also XML, Binary, and Text data out of the box.
Expand Down
7 changes: 0 additions & 7 deletions WINDOWS.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ Some required modules do not have native Windows modules available and require a

If your installation of node and npm required elevated priviledges, you will need to use an elevated command prompt to upgrade npm and perform all global `npm install -g` commands. When scaffolding your project using slush, a normal command prompt is sufficient.

## Configuring MLCP

The default location for MLCP is `/usr/local/mlcp`. This path is unlikely the appropriate location of your MLCP install. To specify the correct location of MLCP in Windows, edit/create `deploy\local.properties` and add
```
mlcp-home=C:\\path\\to\\mlcp
```
Please note that the backslash is being escaped by a second backslash. This inserts a literal backslash instead of inserting an escape character in Java.
15 changes: 3 additions & 12 deletions app/templates/INSTALL.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,14 @@ If dev or prod configuration does not exist yet, run:

Provide settings as needed. After that you follow the same steps as for deploying to your local MarkLogic, but with a different environment parameter:

./ml dev bootstrap
./ml dev clean content
./ml dev deploy modules
./ml dev deploy content
./ml dev mlcp -options_file import-sample-data.options

(Or ./ml prod .. depending on need. Check README.mdown to see if the deployment steps have been altered for this project.)
./gradlew mlDeploy -PenvironmentName=[environment]
./gradlew importSampleData -PenvironmentName=[environment]

## Deploying updates

Deploying updates is a matter of repeating part of the initial deployment. For fully updating the back-end you repeat:

./ml dev bootstrap
./ml dev clean content (Be careful with cleaning content on production!)
./ml dev deploy modules
./ml dev deploy content
./ml dev mlcp -options_file import-sample-data.options
./gradlew mlDeploy -PenvironmentName=[environment]

The middle-tier service is started on the server, and will not have to be stopped or restarted when deploying updates. pm2 will automatically restart the app if any of it's files are changed so all you need to do from your local machine is:

Expand Down
44 changes: 11 additions & 33 deletions app/templates/README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ generator, and uses the following components:
- [AngularJS](https://angularjs.org/)
- [Gulp](http://gulpjs.com/)
- [node.js](http://nodejs.org/): very thin layer, hosting the Angular code and proxying MarkLogic REST API requests
- [Roxy Deployer](https://github.com/marklogic/roxy): bootstrap MarkLogic databases, application servers, etc; scaffolding for MarkLogic REST API service extensions
- [ml-gradle](https://github.com/marklogic-community/ml-gradle): configure MarkLogic databases, app-servers, users & roles. Deploy rest extensions and modules.

## Install Required Dependencies

Expand All @@ -17,8 +17,6 @@ To deploy and run the application you need:
- [gulp](http://gulpjs.com/): Javascript task automation (`npm install -g gulp`)
- [Bower](http://bower.io/): A package manager for front-end libraries (`npm install -g bower`)
- [Git](https://git-scm.com/) - Roxy depends on this version control system
- [Ruby v1.9.3+](https://www.ruby-lang.org/en/documentation/installation/) - Roxy
depends on Ruby in order to run server configuration scripts

Note: the `node` command has been renamed to `nodejs`. Some dependencies still point to `node`, which is out of our control.
You may need to manually alias those commands, or install the `node-legacy` package.
Expand All @@ -32,16 +30,16 @@ On Mac or Linux:
npm install
bower install
gulp init-local
./ml local install
./ml local mlcp -options_file import-sample-data.options
./gradlew mlDeploy
./gradlew importSampleData

On Windows:

npm install
bower install
gulp init-local
ml.bat local install
ml.bat local mlcp -options_file import-sample-data.options
gradlew.bat mlDeploy
gradlew.bat importSampleData

## Prepare your Application

Expand Down Expand Up @@ -76,19 +74,15 @@ other options are `top-right` or `modal`.

## Deploy your Application

Run the following Roxy commands to deploy the application to the chosen MarkLogic
Run the following ml-gradle commands to deploy the application to the chosen MarkLogic
installation. It will create and configure databases, REST servers, users, and
roles for you, and deploy the back-end application code.

./ml local bootstrap
./ml local deploy modules
./ml local deploy content
./gradlew mlDeploy -PenvironmentName=[local|dev|prod]

Or on Windows:

ml.bat local bootstrap
ml.bat local deploy modules
ml.bat local deploy content
gradlew.bat mlDeploy -PenvironmentName=[local|dev|prod]

## Launch your Application

Expand Down Expand Up @@ -117,29 +111,13 @@ and no browser tab will be opened automatically. In addition you have `--verbose
The application comes with 3000 JSON documents generated by json-generator.com. They
will allow you to explore all the features you get out of the box in a better way. You
can load them with (MLCP)[https://docs.marklogic.com/guide/ingestion/content-pump] using
Roxy.
ml-gradle.

Before you hit off, check if Roxy can find MLCP:

./ml local mlcp

Roxy will print the following message if it cannot find MLCP:

ERROR: MLCP not found or mis-configured, please check the mlcp-home setting.

Roxy looks for `/usr/local/mlcp/` (or `\usr\local\mlcp\`) by default. It can be
convenient to just install MLCP there, or create a symlink from `/usr/local/mlcp`
to where MLCP is installed. Alternatively, edit your `deploy/local.properties`, and
append a `mlcp-home=/path/to/your/mlcp/` to the end of it. Repeating above command
should show MLCP usage, not an ERROR.

Once MLCP works correctly, you can run:

./ml local mlcp -options_file import-sample-data.options
./gradlew importSampleData

Or on Windows:

ml.bat local mlcp -options_file import-sample-data.options
gradlew.bat importSampleData

Note: the detail controller, the part that handles showing your data, can not only
handle JSON, but also XML, Binary, and Text data out of the box.
Expand Down
7 changes: 0 additions & 7 deletions app/templates/WINDOWS.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ Some required modules do not have native Windows modules available and require a

If your installation of node and npm required elevated priviledges, you will need to use an elevated command prompt to upgrade npm and perform all global `npm install -g` commands. When scaffolding your project using slush, a normal command prompt is sufficient.

## Configuring MLCP

The default location for MLCP is `/usr/local/mlcp`. This path is unlikely the appropriate location of your MLCP install. To specify the correct location of MLCP in Windows, edit/create `deploy\local.properties` and add
```
mlcp-home=C:\\path\\to\\mlcp
```
Please note that the backslash is being escaped by a second backslash. This inserts a literal backslash instead of inserting an escape character in Java.
38 changes: 38 additions & 0 deletions app/templates/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* The most minimal ml-gradle file just has one thing - the ml-gradle plugin declaration.
*
* Without a gradle.properties file with properties such as mlAppName and mlRestPort, ml-gradle will use some sensible
* defaults to generate a new application - an app name of my-app, port 8003, and a username/password combo of
* admin/admin.
*/

plugins {
id "net.saliman.properties" version "1.4.6"
id "com.marklogic.ml-gradle" version "3.6.0"
}

repositories {
jcenter()
maven { url "https://developer.marklogic.com/maven2/" }
}

configurations {
mlcp
}

dependencies {
mlcp "com.marklogic:mlcp:9.0.4"
mlcp files("lib")
}

task importSampleData(type: com.marklogic.gradle.task.MlcpTask) {
classpath = configurations.mlcp
command = "IMPORT"
database = mlAppConfig.contentDatabaseName
logOutputUri = "/mlcp-log.txt"
input_file_path = "sample-data.zip"
input_compressed = "true"
output_collections = "data,data/people"
output_permissions = "slush-demo-role,read,slush-demo-role,update"
output_uri_replace = ".*.zip,''"
}
1 change: 0 additions & 1 deletion app/templates/data/api/users/admin.json

This file was deleted.

Loading