Name: generator-nuxeo
Owner: Nuxeo
Description: Nuxeo Code Generator enables the bootstrapping of several Nuxeo elements like Operation, Service, Package, ...
Created: 2016-01-26 14:22:51.0
Updated: 2017-12-12 17:15:01.0
Pushed: 2018-05-24 03:08:37.0
Homepage: https://www.npmjs.com/package/generator-nuxeo
Size: 460
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Yeoman Generator for Nuxeo Platform
The generator-nuxeo
provides Nuxeo components scaffolding. It lets you easily scaffold common Nuxeo components like empty projects, Nuxeo Packages, Automation Operations, Nuxeo Services… This saves you time writing boilerplate code to focus on your code instead of the structure.
The generated components all come with unit tested sample code; for instance the Operation generator adds an Operation with some sample code that highlights how to inject context objects, how to specify a parameter and how to unit test that operation.
That tool is based on Yeoman (a scaffolding tool for the web).
We strongly recommend you to use our new tool Nuxeo CLI instead of the generator. It embbed all generator's features in a more friendly command line interface.
First, install Yeoman and generator-nuxeo:
obal NPM registry install
install -g yo generator-nuxeo
OR
stall from master
install -g yo nuxeo/generator-nuxeo
Using the generator let you have access to some ready to use Nuxeo Code Sample:
uxeo:sample
Using the generator let you trigger a Hot Reload on your Server which allows you to update the deployed bundles without restarting the Nuxeo Server. To be done, it requires to enable the sdk
template in your nuxeo.conf
file.
First step is to associate a Nuxeo Server with your project root. It will ask you the distribution path and if you want to let the generator-nuxeo
configure the file for you. Reexecute it to change the distribution path.
uxeo:hotreload configure
Then, you will be able to trigger it using:
uxeo:hotreload
Connect your Java project let you have your Studio Project exposed as a dependency and be able to tests anything declared in it, like your Automation Scripting, listeners, Document Types, …
Link your project to Studio:
uxeo:studio [link]
Unlink your project:
uxeo:studio unlink
Generate a Java Constant class with Studio's freatures
uxeo:studio import
Release your studio project
uxeo:studio release
To bootstrap an empty Nuxeo Project (based on a Maven multi-module project), execute the following lines:
r my-project
y-project
uxeo
Default values are fine for a quick start. You will have to specify at least your project group ID (for instance org.company
.)
You can generate several features at once like:
uxeo [options] [<generator>..]
, --help # Print the generator's options and usage
--skip-cache # Do not remember prompt answers Default: false
--skip-install # Do not automatically install dependencies Default: false
, --meta # Branch of `nuxeo/generator-nuxeo-meta` Default: stable
, --localPath # Path to a local clone of `nuxeo/generator-nuxeo-meta`
, --nologo # Disable welcome logo Default: false
, --type # Set module target's type Default: core
, --skipInstall # Skip external commands installation Default: false
, --force # Force conflict when generate an existing file Default: false
, --dirname # Set parent folder prefix name Default: <PWD>
--skipPomUpdate # Skip the pom(s) updates when attaching Studio project Default: false
The main Generator can render templates defined in https://github.com/nuxeo/generator-nuxeo-meta/.
Terminology
- ADD: Add a dedicated module to your project. For instance, in a
myapp
project, a Polymer Application will add amyapp-web
submodule.- CREATE: Create the files needed for the feature, without specifying a
--type
option, the generation will occurs in themyapp-core
submodule. When using the--type
option, files will be generated to a (new) module namedmyapp-{type}
;
Set up an empty Nuxeo Bundle using Maven multi module support.
uxeo multi-module
multi-module
is the default generator when none is given as a parameter to yo nuxeo
org.nuxeo.ecm.distribution:nuxeo-distribution
.Using a Maven multi module architecture is the recommended way to bootstrap a new project: it allows to generate a Nuxeo Package afterwards to easily deploy your code on a Nuxeo Platform instance. On the other hand, when a project has been generated using a single module architecture, the Nuxeo Package needs to be created manually.
Sets up an empty Nuxeo bundle.
uxeo single-module
multi-module
, having a parent artifact make project inheritance. If you are in a multi-module
, you must set your parent module. If not, you can use org.nuxeo.ecm.distribution:nuxeo-distribution
or org.nuxeo:nuxeo-addons-parent
This option should not be called directly to bootstrap a new project; use the multi-module option instead so that you can generate a Nuxeo Package later on.
Sets up an empty Nuxeo bundle using Kotlin instead of Java.
uxeo kotlin-module
multi-module
, having a parent artifact make project inheritance. If you are in a multi-module
, you must set your parent module. If not, you can use org.nuxeo.ecm.distribution:nuxeo-distribution
or org.nuxeo:nuxeo-addons-parent
This option should not be called directly to bootstrap a new project; you must use the multi-module with a Nuxeo Package as well to deploy this bundle as it requires additional runtime libraries to run.
Add an empty Unit Test
uxeo test-empty
Add an empty Contribution
uxeo contribution
Adds an empty Automation Operation along with a corresponding unit test.
uxeo operation
Adds an empty Automation Operation written in Kotlin.
uxeo kotlin-operation
Adds a listener with its test class, the events will be asked during the generation process. Both existing and custom events can be declared. You can create any listener type: pre-commit, post-commit, synchronous and asynchronous.
uxeo listener
Adds a Nuxeo component exposed as a Nuxeo service.
uxeo service
Creates a Content Enricher that enriches with more information a REST response.
uxeo enricher
Creates a Document Adapter that turn DocumentModel
object into business objects.
uxeo adapter
Add an application based on Polymer Starter Kit bundled as a Nuxeo Project.
uxeo polymer
m and bower install must be executed automatically, otherwise:
*-web && npm install && bower install
run the application in dev mode; with file changes watch:
-web && npm run serve
Common bundle's files like MANIFEST.MF
and OSGI-INF/*
are stored inside a nuxeo
folder.
Add an application using Angular2 bundled as a Nuxeo Project.
uxeo angular2
m and bower install must be executed automatically, otherwise:
*-web && npm install && bower install
run the application in dev mode; with file changes watch:
-web && npm run dev
Creates a module to handle a Nuxeo Package generation of your project. Can only be called in a Maven multi-module architecture, hence make sure to bootstrap your project using yo nuxeo
or yo nuxeo multi-module
. If you used yo nuxeo single-module
to bootstrap your project, you won't be able to call that option afterwards.
uxeo package
To test the generator; you should clone the repository and link it to your local NPM registry:
clone https://github.com/nuxeo/generator-nuxeo
enerator-nuxeo
link
It will install dependencies and symlink the module to your local registry. After that, you can use the generator as described below.
Nuxeo dramatically improves how content-based applications are built, managed and deployed, making customers more agile, innovative and successful. Nuxeo provides a next generation, enterprise ready platform for building traditional and cutting-edge content oriented applications. Combining a powerful application development environment with SaaS-based tools and a modular architecture, the Nuxeo Platform and Products provide clear business value to some of the most recognizable brands including Verizon, Electronic Arts, Sharp, FICO, the U.S. Navy, and Boeing. Nuxeo is headquartered in New York and Paris. More information is available at www.nuxeo.com.