Friday, August 14, 2009

Navigation for a Component

Hi Folks,
Sometimes you may register a component without giving proper information.So the content reference may be in registered to some other place. To find it
or
You may have a component name, which you get in functional spec and you do not know the navigation for the component.
That time you can use the below query to find the navigation of the component.

SELECT PORTAL_NAME,
PORTAL_OBJNAME AS CONTENT_REFERENCE,
PORTAL_LABEL,
PORTAL_URI_SEG1 AS MENU,
PORTAL_URI_SEG2 AS COMPONENT,
PORTAL_URI_SEG3 AS MARKET
FROM psprsmdefn
WHERE PORTAL_NAME = 'EMPLOYEE'
AND PORTAL_URI_SEG2 = 'Component name';

You will get the content reference and fill that in the below query you will get the navigation.

WITH portal_registry AS
(SELECT RTRIM(REVERSE(SYS_CONNECT_BY_PATH(REVERSE(portal_label), ' >> ')), ' >> ') path,
LEVEL lvl
FROM psprsmdefn
WHERE portal_name = 'EMPLOYEE' START WITH PORTAL_OBJNAME = 'content reference' CONNECT BY PRIOR portal_prntobjname = portal_objname)
SELECT path
FROM portal_registry
WHERE lvl =
(SELECT MAX(lvl)
FROM portal_registry);

No comments: