App descriptor - 5 UI
Deprecated
This app descriptor has been deprecated since Magnolia 6.0. It is part of the Magnolia 5 UI framework. For the updated implementation, see App descriptor for Magnolia 6 UI instead. |
An app descriptor 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:
/content-type-examples/apps/tourGuides-app.yaml
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.
tourGuides-app.yaml (with additional configuration)
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:
Property | Description |
---|---|
|
required Node containing subapps. |
|
required Fully qualified name of the Java class that contains the app business
logic. The class must implement the |
|
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. |
|
optional, default is App descriptor class that reads the configuration. The class must
implement the Examples:
|
|
optional Describes the app with a content type. For this to work, you have to:
The following stock apps have a contentType class assigned so that they can be easily referenced:
Use the Definitions app to check the name of the content type. |
|
optional, default is Enables and disables the app. |
|
optional The name of an SVG app icon. See How to add SVG icons for apps. |
|
optional Message bundle for localized labels. |
|
optional Label displayed on the app icon in the app launcher. |
|
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