[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: |
|
||||||||
| 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);
}
############################################ 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. 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 |