XP Applications

Contents

XP Applications

Similar to an Operating System, Enonic XP supports development and deployment of applications.

Introduction

Applications are standalone software executables that can be installed and run on top of Enonic XP. Applications are powered by the XP runtime, which also supports multiple applications running in the same instance. Once installed, applications get access to the platform services, such as the NoSQL storage.

A single application may offer many different capabilities, from web apps and cms specific functionality to low level OSGi services that can be used by other apps.

Enonic Market

Enonic market is the go-to place for official apps from Enonic, as well as 3rd party applications. The marketplace also offers starter kits and software libraries that help you create new apps better and faster.

Installation

There are essentially two ways getting your applications running with Enonic XP:

Via API

Applications installed through the API will be available for all nodes in an XP cluster.

Via file system

File system deployment is most commonly used in development phases, but it can also be applied for specialized deployments scenarios.

Consider a microservice style highly isolated and controlled deployment, you will bundle your app(s) together with the XP runtime and launch it as a separate instance.

Life Cycle

In addition to installing and uninstalling, XP applications may be started and stopped. This is referred to as the life cycle of the application. During the stop and start phases, applications themself may execute custom code.

Starting

Once installed, applications are automatically started on all nodes. During the startup, if it exists, the application’s main.js script will be executed. At a lower level, Java developers may utilize so-called OSGi lifecycle events for similar purposes.

Stopping

Before an application is stopped, a special event is thrown. Applications may also react to these events before they are shut down.

Configuration

Applications can be configured with deployment specific setting per node in the cluster. The configuration will automatically be injected when the applications starts.

Configuration files may be updated, and trigger a restart of the application, without restarting the XP nodes. This means that for instance sessions, or open websocket connections will not be recycled, even if an application is restarted.

TODO: Link to info about configuration management

Development

To create an application you need to setup a project. Projects contain all code and configuration required to build the application.

For more details, check out the project reference documentation.

Languages

XP apps are powered by the XP runtime.

Applications are primarily created with JavaScript. Serverside Javascript is made possible through our CommonJS based Javascript Framework

XP applications can also make use of Java.

Developers with special requirements may take advantage of advanced platform capabilities such as exposing and consuming services from other applications within the same instance. Learn more about using Java in XP apps

Build system

By default, XP projects use the Gradle build system, and with it the Maven package system. A range of XP specific libraries are also available on Enonic Market, in addition to the standard libraries, included in the release of Enonic XP. Front-end developers often make use of JavaScript specific build systems such as Webpack.

Use cases

There are endless use cases for the XP platform, but the typical scenarios are listed below:

Web apps

The JavaScript framework offers an easy way to build and is to serve web applications. An XP app may only contain a single web app.

Read more about webapps and the web engine

Sites

A unique feature of XP is the embedded Content Management capabilities.

You may build applications that go from serving content from an API (Headless CMS) via traditional web sites to Hybrid CMS - offering the best of both worlds.

The CMS offering essentially consist of three parts:

  • Content Studio - Editorial admin interface, available as an app on Enonic Market

  • Content API - Built on top of the NoSQL Storage

  • Site Engine - Built on top of the webapp engine

Learn more about the Content Management System and the site engine

ID providers

XP apps may also act as a so-called ID provider. Once installed and configured, an ID provider can join the request pipeline of other sites and applications, dynamically providing authentication and authorization when needed. There are multiple standard ID providers available on Enonic Market.

Learn more about the identity and access management

Tasks

The XP runtime also supports executing scripts running in the background. Unlike sites and web-applications, tasks are not exposed as an end-point. Tasks can be started and monitored via the the task API Tasks are made by adding one or more JavaScript controllers to your project.

Read more about Tasks

Admin apps

XP apps can also contribute to Enonic XP’s admin console. The platform comes with a standardized approach to extend the admin console with custom interfaces, called admin apps. Admin apps are created by adding one or more JavaScript controllers to your project.

Read more about Admin apps

Contents