The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.

app definition


App descriptor configuration describes an app. The descriptor assigns the app a name, icon and implementation class. The name of the app content node must be unique as it is used to refer to the app across the system. This means you cannot name your own app pages since a Pages app already exists.

Referring to a content type

Since the introduction of the Content Types module, you can refer to a content type definition within an app descriptor.

This approach keeps the app descriptor very short. There is no need to specify the below mentioned properties. The content types and content apps frameworks automatically generate and register an app description based on the content type definition. 

Example:

Error rendering macro 'code-pro'

Error 401 retrieving server data from URL. User is not authorized to perform the request.

(warning) 5.7.3+ Use the directive !content-type  to reference a content type. (With Magnolia 5.7.2, you must use !with-type.)

You can tailor the app descriptor within the same file by adding additional configuration which will overwrite any configuration with the same name coming from the !content-type directive. Alternatively create a decoration.

Error rendering macro 'code-pro'

Error 401 retrieving server data from URL. User is not authorized to perform the request.

For further details please see Using Magnolia Content Types - Creating a content app based on the content type.

Properties

Here is an example descriptor for a helloworld app.

ui-helloworld-app/apps/helloworld.yaml
appClass: info.magnolia.ui.app.helloworld.HelloWorldApp
class: info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor
icon: icon-app
label: Hello World
subApps:
Node nameValue

 
modules


 
ui-helloworld-app


 
apps


 
helloworld


 
subApps


 
appClass

info.magnolia.ui.app.helloworld.HelloWorldApp

 
class

info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor

 
icon

icon-app

 
label

Hello World

 
version

 1.0.0

Properties:

subapps

required

Node containing subapps.

appClass

required

Fully qualified name of the Java class that contains the app business logic. The class must implement the App interface.

name

optional

Name of the app.

If a value is not provided, either the file name (without the suffix .yaml) or the JCR node name is used.

class

optional, default is info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor

App descriptor class that reads the configuration. The class must implement the AppDescriptor interface.

Examples:

  • info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor
  • info.magnolia.ui.contentapp.ConfiguredContentAppDescriptor
enabled

optional , default is true

Enables and disables the app.

icon

optional

CSS class that identifies an icon font used on the app tile. For available names see Icons.

i18nBasename

optional

Message bundle for localized labels.

label

optional

Label displayed on the app icon in the app launcher.

theme

optional

Name of a custom app theme.


Permissions

The permission to use an app is granted in the permissions configuration. The subnodes are roles. This allows you to provision the app to certain users in your organization.

In this example the helloworld app is provisioned to travel-demo-editor and travel-demo-publisher roles. The role property name (editors, publishers) is arbitrary - use any name you like. The value must be a valid role name.

ui-helloworld-app/apps/helloworld.yaml
appClass: info.magnolia.ui.app.helloworld.HelloWorldApp
class: info.magnolia.ui.api.app.registry.ConfiguredAppDescriptor
icon: icon-app
label: Hello World
permissions:
  roles:
    editors: travel-demo-editor
    publishers: travel-demo-publisher
Node nameValue

 
modules


 
ui-helloworld-app


 
apps


 
helloworld


 
permissions


 
roles


 
editors

travel-demo-editor

 
publishers

travel-demo-publisher