Details on the project and code structure in Enonic apps and libraries
|Get started running. Use one of our starters to bootstrap your development project.
XP apps are powered by the XP runtime.
Applications may also use of Java. Developers with special requirements can take advantage of advanced platform capabilities such as exposing and consuming services from other applications within the same platform instance.
Learn more about using Java in XP apps
The example structure below includes the standard files and folders for an Enonic application (or library).
Every file and folder has a specific function and purpose as described below:
Visit the build system section for more details.
Main build file
- gradlew | /gradlew.bat
Gradle wrapper file. Downloads and runs Gradle without having to install it manually.
Mandatory file to boostrap the build process
The majority of Enonic specific code is placed within
Admin tools are defined here. Tools are administrative apps listed in the admin console menu.
Admin widgets are essentially user interface components that can be embedded within other admin tools.
Application icon in SVG format. Should be in a square format.
Application information in XML format.
The application’s main controller. Executed when an application starts and stops.
Contains Http service controllers
Short for internationalization, this folder contains app localization files
The application may implement an ID Provider here.
May contain task controllers for running asynchronous and background processing.
Contains site configuration schema, and declaring that the app can be added to projects and sites
Contains Content type definitions.
For post processing of HTML response from pages built with the Enonic JS framework.
Layout components are placed here.
Reusable schemas are placed here.
Rich text Macro components are placed here.
Page components are placed here.
Part components are placed here.
X-data schemas are defined here
Webapp based on the Enonic JS framework are placed here.
Optionally place Java code here.
Optionally place Java tests here.
Enonic libraries are similar to applications, the main difference being that a library cannot be installed and started by itself.
|Check out the library starter if you are planning to build your own library.
A library may consist of the same files and functionality you would find in an application - such as Assets, Content Types and JS controllers.
Enonic libraries are added to your application by declaring a dependency in the build.