[DOCU-2288] DEV DOC: Update Programming an app page Created: 15/Nov/21  Updated: 10/Mar/22

Status: Open
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Michiel Meeuwissen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: external
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-6888 DEV DOC: Content app example for M6 UI Closed
Documentation page URL: https://docs.magnolia-cms.com/product-docs/6.2/Apps/Developing-an-app/Programming-an-app.html

 Description   

Update Java code and context on https://docs.magnolia-cms.com/product-docs/6.2/Apps/Developing-an-app/Programming-an-app.html.

Original Description by Michiel: The example uses deprecated constructor

public class HelloWorldApp extends BaseApp {
    @Inject
    public HelloWorldApp(AppContext appContext, AppView view) {
        super(appContext, view);
    }
    ... 

 

The used constructor 


/**
 * since 6.2 use {@link #BaseApp(AppContext, AppView, SimpleTranslator)} instead
 */
@Deprecated
protected BaseApp(AppContext appContext, AppView view) {
    this(appContext, view, Components.getComponent(SimpleTranslator.class));
}
 

Is deprecated. This is silly. 

The way to go would be this version of the constructor:

    @Inject
    public HelloWorldApp(AppContext appContext, AppView view, SimpleTranslator i18n) {
        super(appContext, view, i18n);
    }

 ############################################
A second topic on this page merged from DOCU-2293:

I think it would be really helpful as the last step of this documentation to explain how to use this app. One customer complained that they didn't understand it and I think it's because the last step of the app definition is missing.

 
../resources/<your-module-name>/apps/hello-world-app.yaml (maven)
<your-light-module-name>/apps/hello-world-app.yaml (light-module)

label: Helloworld
name: helloworld
appClass: info.magnolia.ui.app.helloworld.HelloWorldApp
icon: icon-items
class: info.magnolia.ui.api.app.AppDescriptor
subApps: 
  main: 
    label: Helloworld
    subAppClass: info.magnolia.ui.app.helloworld.main.HelloWorldMainSubApp
    class: info.magnolia.ui.api.app.registry.ConfiguredSubAppDescriptor
  greeter: 
    subAppClass: info.magnolia.ui.app.helloworld.greeter.HelloWorldGreeterSubApp
    class: info.magnolia.ui.api.app.registry.ConfiguredSubAppDescriptor
 

Generated at Mon Feb 12 01:25:45 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.