Hello, I’m facing some misunderstanding in working with app components in 7.1. I’ve read some threads in forum and app component section of documentations, but none of them answer my questions. Let’s say i have projects Parent and Child. Child is an installed app component of Parent. I have two questions about them:
Child has it’s own database and entities. I created DD scripts, created an app-descriptor, uploaded archives into my local nexus, added a dependency to Parent. Do i need any more settings to create them (DB scripts) in Parent? I tried re-creating DB for Parent, but Child’s entities are still not there… can’t remember it to be a big deal in 6.9. What am i doing wrong?
If a have a Main Screen extension in Child, how do i make Parent to use it? do i need to extend Child’s screen? Can i make more than one Main screen extensions in Children, and how to apply them to Parent?
Thanks for your answer, Daniil!
1 somehow it worked, thank you, but still, where can i get more info about this process? What should i do if scripts are not found? or if they are found, but entities are still not there?
2 do i need to (and how do i) use package names in the cuba.web.mainScreenId option, cos all the extensions of main are called quite the same names. And when i use the name from the added component - it’s not found, and i cant get into application, it throws an exception - screen not defined?
As an option DB scriprts archive could be not installed or compiled correctly. In general, checking task logs is the simpliest way to track what’s happening.
No, just use screen id from @UiController annotation (or from screens.xml entry corresponding attribute)
1 thanks, i think i got the idea
2 if i don’t add Child’s main screen extension to web-screens.xml of a Parent, i get not defined. if i do, i get unable to create screen with type FRAGMENT. Child has an empty web-screens.xml, mainscreen extension is marked with @UIController. maybe i should create a sample project to show this behavior?
maybe the problem is that my appcmp is not installed locally, but is in the local network nexus. maybe it’s cos my appcmp has another namespace… but your example works, and the very same code in my project does not… Screen 'extMainScreen' is not defined. i add screenshots of my parent and my child that show proper component installation and my problem…
yes, it works as expected, it contains and extra component and some extra service invocations. Created a new clean project as a Parent. added a dependency for Child through CUBA - Marketplace menu, added mainScreenId property. mailing_main is still not defined.
I suggest you to debug a method that registers screens to check that required main screen is successfully found: WindowConfig#registerScreen(UiControllerDefinition, WindowInfo).
It seems that there is some problem with screen registration.
Sorry for the long time answer. As i enter the WindowConfig#registerScreen(UiControllerDefinition, WindowInfo) for the fourth time (first three screens were inputDialog, login and main, i have the following arguments for this method: definition = UiControllerDefinition{id='notFoundScreen', ...} windowInfo = WindowInfo{id='notFoundScreen', ...}
where should i make further research?
Thanks for keeping in touch with my problem, yes, screen extension works fine in child. web-screen.xml of both parent and child apps contain information about their own web package. I also noticed, that i can’t @Injectchild's service on my parent's screen, but it’s seen in project’s scope… maybe there is a problem adding a dependency in build.gradle / spring / anywhere else?
Thanks for the answer, maybe you should think about more detalized description of app component descriptor in docs or cookbook (what properties affect which functionality etc)
It depends on the case. Could you share some details?
So the case is that i still can’t @Inject the child's service into parent. Screen extension works fine, so i can guess, that the problem is in the app component descriptor, but spring.xml property exists in core section of it. i re-created app component descriptor after adding web-spring property manually, studio added 5 more rows and now it works fine. somehow…