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.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The Definitions app is the single place to find all definitions loaded by Magnolia through the Registry API.

The app displays active definitions from all sources - JCR and YAML - and origins - classpath, JCR and file system.

Light development introduced an additional configuration source in Magnolia and the app provides an overview of both JCR and file-based definitions. At a glance, back and front-end developers can see the definition sources. 

In the Definitions app users can:

The app also shows definition decorations and configuration errors.

Definition types

The app includes all definitions that are bound to a

$webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") Registry
 (for example 
$webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources") TemplateDefinitionRegistry
).

Definition types:

Searching, grouping and filtering definitions

The app offers numerous filtering options to allow you to quickly find what you are looking for. Options can be combined to filter within options and grouped by definition type.

Example: Definitions from 1. all sources and 2. all modules, of 3.all types, with 4. the word teaser, grouped by 5. definition type

You can refine the results displayed in the dropdown lists by typing the first letter(s) of the expected result in the field. For example in From modules type m for all module names starting with the letter m and ma for only the Mail and Marketing Tags modules

Options

From moduleOf typeWith nameGrouped by


optional

Select module. Field displays all modules. Default is any modules.

optional

Select definition type. Default is all types.

optional

Type search term.

required

Group results by type, name or source. Default is definition type.

optional

Select to display only invalid definitions. Default is all definitions.

optional

Select to display only YAML definitions. Default is all definitions.

optional

Select to display only decorated definitions. Default is all definitions.

Viewing definitions

You can expand any definition node to view a representation of the full configuration.

Example: File-based teaser component in the MTK module.


Accessing definitions 

Dedicated actions allow you to access a definition for editing in either the Resource files or Configuration app:

  • Show in Resources app displays for file-based definitions. The action opens the file in read only mode in the Resource files app. You can choose to hotfix the definition in the app or edit it on the file system.
     ExampletextImage component definition from the Travel demo in the Definitions and Resources apps.
       
  • Show in Configuration app displays for JCR-based definitions. The action opens the definition in the Configuration app where you can edit the definition in the JCR.
    Example: login component definition from the Public User Registration module in the Definitions and Configuration apps.
       

All YAML definitions display in the Source column as File. The origin of these definitions could be the file system or the classpath. You can see each origin in the Resource files app.

Decorated definitions

Decorated definitions are marked in the Is decorated? column. The Show definition decorators action opens the Applied definition decorators popup which shows the source file and the decorated path of each decorator. Click  to access the source file in the Resource files app.

Example: home template from the Travel Demo (EE Pro version).

  

Definition errors

The app makes it easy to find problematic definitions: 

  • Major errors are indicated with the  icon in the Definitions tab. 
     
  • In the Problems tab all problematic definitions display. You can search for a definition by name, and group and filter by module and error type
    •  indicates a major error that makes the definition unusable, for example a parse error.
    •  indicates a warning.
    •  indicates a deprecated definition.
    • The configuration path displays in the Location column.



The app also shows deprecated definitions:

  • Deprecated classes used by any definition.
  • Deprecated or non-existing templates used by block definitions.
  • Deprecated or non-existing page template definitions referenced from site definitions.
  • Deprecated or non-existing theme definitions referenced from site definitions.
  • Template references:
    • Deprecated or non-existing dialogs.
    • Deprecated or non-existing component definitions used in page definitions.
    • Non-existing template script paths.
    • Configured but non-existing renderer.

Configuration

The app is based on the content app framework and configured in YAML on the classpath at /src/main/resources/definitions-app/apps/definitions-app.yaml.

(warning) The app requires NO additional configuration and it is NOT advisable to make any changes to the configuration file.

appClass: info.magnolia.ui.contentapp.ContentApp
icon: icon-definitions-app
class: info.magnolia.ui.contentapp.ContentAppDescriptor
theme: definitions-app
subApps:
  overview:
    subAppClass: info.magnolia.ui.contentapp.browser.BrowserSubApp
    class: info.magnolia.ui.contentapp.browser.BrowserSubAppDescriptor
    contentConnector:
      implementationClass: info.magnolia.definitions.app.overview.DefinitionsContentConnector
      class: info.magnolia.ui.vaadin.integration.contentconnector.ContentConnectorDefinition
    workbench:
      contentTools:
        definitionsTools:
          class: info.magnolia.definitions.app.overview.toolbar.FilterToolbarDefinition
      contentViews:
        - name: views
          implementationClass: info.magnolia.definitions.app.overview.tree.DefinitionsTreePresenter
          class: info.magnolia.ui.workbench.tree.TreePresenterDefinition
          columns:
            - name: title
              expandRatio: 1
              class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
              sortable: false
            - name: value
              expandRatio: 1
              class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
              sortable: false
            - name: type
              expandRatio: 1
              class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
              sortable: false
            - name: module
              expandRatio: 1
              class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
              sortable: false
            - name: origin
              expandRatio: 1
              class: info.magnolia.ui.workbench.column.definition.PropertyColumnDefinition
              sortable: false
    actions:
      showFile:
        class: info.magnolia.definitions.app.overview.actions.OpenDefinitionActionDefinition
        implementationClass: info.magnolia.definitions.app.overview.actions.OpenResourceDefinitionAction
        appName: resources
        subAppId: detail
        icon: icon-resource-files-app
      showConfig:
        class: info.magnolia.definitions.app.overview.actions.OpenDefinitionActionDefinition
        appName: configuration
        subAppId: browser
        icon: icon-configuration-app
    actionbar:
      sections:
        group:
          availability:
            rules:
              IsDefinitionGroupRule:
                implementationClass: info.magnolia.definitions.app.overview.availability.IsDefinitionGroupRule
        file:
          groups:
            default:
              items:
                - name: showFile
          availability:
            rules:
              IsFileDefinitionRule:
                implementationClass: info.magnolia.definitions.app.overview.availability.IsFileBasedDefinitionRule
        config:
          groups:
            default:
              items:
                - name: showConfig
          availability:
            rules:
              IsConfigDefinitionRule:
                implementationClass: info.magnolia.definitions.app.overview.availability.IsJcrConfigWorkspaceDefinitionRule
  • No labels