Is it possible to add a "hidden" attribute to a profile in profiles.zcml?

This just hit my head, so I'll put here for some brainstorming.

After @mauritsvanrees did an amazing job in https://github.com/plone/Products.CMFPlone/issues/1070 (removing the txt in profiles folders and creating pre_handler and post_handler in genericsetup profiles, a dream becoming reality :cry:), we just created a new addon for internal projects using bobtemplates.plone, and as you see, we now have this snippet of code as a good practice:

   <utility                                                                      
       factory=".setuphandlers.HiddenProfiles"                                   
       name="my.package-hiddenprofiles" />

Do you think it's feasible, or if it makes sense (don't even know if it's possible) to have a new attribute, for example "hidden", in genericsetup profiles, that would hide the profile instead of adding this snippet of code we now add to all packages?

   <genericsetup:registerProfile                                                 
       name="uninstall"
       hidden="true"
       title="my.package (uninstall)"
       directory="profiles/uninstall"
       description="Uninstalls the my.package add-on."
       provides="Products.GenericSetup.interfaces.EXTENSION"
       post_handler=".setuphandlers.uninstall"
       />
2 Likes

Problem is that the INonInstallable interface is in Products.CMFPlone and the zcml is handled in Products.GenericSetup. GenericSetup can also be used outside of Plone, and INonInstallable only has meaning within Plone.

Technically we could override the zcml handler and support this in Plone, but I don't like that.

Idea: enhance genericsetup by an attribute "condition" with expression as value like "installed: collective.someaddon:default" (or alike). This is general useful and not plone specific. We just need to have recorded which profiles were installed already, not sure if this is the case.

If this magic of multiple interfaces in "provides" was real... :laughing:

   <genericsetup:registerProfile                                                 
       name="uninstall"
       title="my.package (uninstall)"
       directory="profiles/uninstall"
       description="Uninstalls the my.package add-on."
       provides="Products.GenericSetup.interfaces.EXTENSION
                 Products.CMFPlone.interfaces.INonInstallable"
       post_handler=".setuphandlers.uninstall"
       />