-
Notifications
You must be signed in to change notification settings - Fork 8
CLI Quick Reference
shiryaeva edited this page Dec 8, 2018
·
8 revisions
-
help
- prints CUBA CLI help. -
version
- prints current CUBA CLI version, -
cd
- changes the current directory, if specified. Otherwise, prints the current one, -
exit
- exits CUBA CLI.
-
enable-premium-repo
- adds premium CUBA repository to projects build script. -
create-app
- guides through the required steps to create a new CUBA project:-
project name
, -
namespace
, -
root package
, platform version
- and a
database
used in the project. The project will contain global (accessible from both core and web modules), core (server side layer for business logic) and web (server side layer for screen controllers and other GUI logic) modules.
-
-
create-polymer-module
- adds a new client to the application, based on the Polymer library developed by Google. It modifiessettings.gradle
and build.gradle by adding the configuration and tasks for the new module. It also creates files of required image resources and generates login, menu, and other useful web-components for your Polymer front-end application. -
extend-theme
- generates a theme extension, i.e., a special structure of folders under themodules/web
directory, a few images to brand the application (login icon, menu icon and favicon) and a few SCSS files, where you can modify the default scheme. It also adds thewebThemesModule
module and its configuration to thesettings.gradle
andbuild.gradle
files. Finally, this command adds thedeployThemes
gradle task to be able to see changes without server restart. -
add-component
- plugs an existing application component into your application. It adds a new line into the dependencies block of yourbuild.gradle
and modifiesweb.xml
of the web module adding the main package of the application component to the appComponents context parameter.
-
create-entity
- generates a stub for JPA entity and its DDL script. This entity will be also registered in persistence.xml or metadata.xml, depending on the entity type - if it is persistent or not. Finally, CLI will generate a message pack to provide localizations for entity attributes. -
create-enumeration
- generates an Enum implementing theEnumClass
interface, its fields with localization messages and a usefulfromId()
method.
-
create-entity-listener
- scaffolds a Spring component implementing Entity Listeners interfaces and declares it in the correspondingEntity
class. Such listeners are hooked when an entity changes its state. -
create-service
- scaffolds a service interface in the global module and its implementation in core. To be usable from the web module it gets registered in theWebRemoteProxyBeanCreator
bean definition inweb-spring.xml
. -
create-bean
- simply generates a Spring component. -
create-config
- scaffolds a stub for a CUBA configuration interface in the specified module with the specified source type (System, DB or App).
-
create-screen
- scaffolds a GUI screen. The command supports creating:- new browse screen - a screen with a list of entities, CRUD actions over them and a filter,
- new edit screen - a screen for creating or editing a single entity.
- new blank screen,
- extend login and main screens, The command scaffolds XML screen descriptor and its Java controller with its localization message pack. Optionally, it can also add a screen to the main menu.
-
change-modules-prefix
- changes modules prefix (see below). -
create-app-component-xml
- turns your CUBA application to be embeddable (pluggable) into another CUBA application. This command generates the app-component.xml file that defines the dependencies on other components, describes the existing application modules, generated artifacts and exposed application properties. While running the command it will prompt to change your current module prefix to a unique one in order to avoid conflicts. If you change the prefix it will also adjustsettings.gradle
andbuild.gradle
files. -
create-update-script
- creates an SQL update script file, meeting CUBA conventions for its place and name. CUBA Platform includes the mechanism of applying update scripts on application start. These scripts should be executed in the historical order, from oldest to newest. To ensure such ordering update scripts should be placed under themodules/core/db/update/{USED DATABASE}/{yy}/
directory and named as{yyMMdd}-{INCREMENT}-{SCRIPT NAME}.sql
. -
use-template
- generates project files from velocity templates, defined by a developer. Templating mechanism allows extending CLI command set declaratively and without compilation. -
create-task
- Gradle tasks creation commands. It lets you setup WAR and UberJAR deployment options.