Detecting child apps

@bravenel @mike.maxwell

Guys, it there a way to detect what child apps are installed on a hub?
Not ‘in use’ just detect where the code is added.

I have a parent app which contains about 12 different children.
I use this as a ‘room’ parent with each child doing a different job.
The parent contains links to create each different kind of child app.

What I would really like to do is not have the link for a particular child app visible if the child app code is not installed on the hub.

So, I need a way to detect if the child code is installed
This would also be useful for newbies installing any parent/child app to confirm that they had both parts installed
I have noticed that if you try to install a child app it looks for the parent and can detect it it is not installed - what I need is a way to do it the other way.

Is this possible?

Andy

Yes, there is a way you could do this.

There is a method addChildApp(String namespace, String name, String label, Map properties = null).

What you'd do is wrap that in a try-catch. Run through your list of possible children, figure out which exist and which don't, removing ones that are added as you go. Then you could prune the list that offers ui for adding a child to only offer ones that are installed.

@bravenel
Thanks for this Bruce .
I'm not sure why I missed your reply until now! :slight_smile:
I'll give it a try

Andy