Component, Content Reference, and Menu

Your rating: None Average: 4 (3 votes)

Ok, so we all know that a component needs to be attached to a menu before you are able to register it to the portal structure. Once a component is registered using Application Designer, then a content reference is created and your component will be available under the folder and path you specified during the registration process.

But consider this scenario, you have registered a component in your development environment and migrated the needed objects to your testing environment. Now, few days later, another developer deleted your component from that menu thinking it is not needed as part of an upgrade project and moved that menu to the test environment.

So now, we have a registered component sitting in the test environment without a menu. You go to test the page and you just can't get to it because the path doesn't exist anymore! It could be quite frustrating to trouble shoot this. Your content reference is still showing the component name and the menu, your permissions look right, but you still can't see the page!

This is exactly what happened during an upgrade project I'm working on, so here is an SQL that will help you identify components that have a content references but are not sitting on any menu.

-- What component has a content reference but is not sitting on menu?
SELECT pnlgrpname FROM PSPNLGROUP comp
WHERE NOT EXISTS (SELECT 'X' FROM PSMENUITEM menu
             WHERE menu.pnlgrpname = comp.pnlgrpname)
AND EXISTS (SELECT 'X' FROM psprsmdefn
       WHERE PORTAL_NAME = 'EMPLOYEE'
       AND PORTAL_URI_SEG2 = comp.pnlgrpname)
GROUP BY pnlgrpname
ORDER BY pnlgrpname;

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!