XP Applications

Contents

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 started, 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 four ways, by default, to get your applications running on Enonic XP:

Via Admin Interface

Applications can be manually installed through the admin tool "Applications", packaged with Enonic XP. The applications will be available for all nodes in an XP cluster.

Via Management API

Applications can be installed, in an automated way, through the Management API. The applications 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. These applications will only be available on the local node and overrides already existing applications

XP XP 7.11.0 7.11.0

Via API

Virtual applications can be created with applications API. A virtual application can co-exist with a bundled application with the same key (AUGMENTED mode) or be stand-alone. For more details, check out the virtual applications documentation.

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 themselves 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.

Stopping

Before uninstalled, applications are automatically stopped on all nodes. During the stopping, if it exists, the disposer of the application’s main.js script will be executed.

Configuration

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

Configuration files may be updated and will be accessible by the application, without restarting the XP nodes or even the applications.

More info can be found under Application configuration in Configuration Files.

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.

Virtual Applications

XP XP 7.11.0 7.11.0

For more details, check out the virtual applications documentation.

Languages

XP apps are powered by the XP runtime.

Applications are primarily created with JavaScript. Server-side 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. 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.

Libraries

Enonic XP provides the concept of libraries in order to speed up development and re-use of functionality and code. Technically, libraries are very similar to applications, but the main difference is that a library cannot be installed and started by itself. So, a library may consist of all the same objects you find in applications - such as Assets, Content Types and HTTP Controllers - things you may need in an application.

A number of standard libraries are available with the core XP release, check out: Standard Libraries. You will also find a wide range of libraries on the Enonic Market

Libraries are added to your application by simply referring to them in your build script. Read more about this on our Build system documentation.

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 to serve web applications.

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 HTTP engine

Learn more about the Content Management System and the site engine.

ID providers

XP apps may also be used by ID providers. Once installed and configured, an ID provider application 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 and the task engine

Admin tools

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 tools. Admin tools are created by adding one or more JavaScript controllers to your project.

Read more about Admin tools


Contents