Get all Components Under a Certain Portal Folder

Your rating: None Average: 3 (1 vote)

Use this SQL snippet to return all components plus sub-folders (if any) under a specific portal folder.

For example, lets say you have a folder called "Workforce Admin". Under Job Information, you have a sub-folder called "Job Information" and few components.

Run the SQL against the Workforce Admin folder and you should get a row for the sub-folder, and a row for each of the components.

-- Get all sub-folders and components under a certain folder name --
SELECT PORTAL_NAME,
   PORTAL_PRNTOBJNAME AS FOLDER,
   PORTAL_OBJNAME AS CONTENT_REFRENCE,
   PORTAL_LABEL,
   PORTAL_URI_SEG1 AS MENU,
   PORTAL_URI_SEG2 AS COMPONENT,
   PORTAL_URI_SEG3 AS MARKET,
   portal_reftype
FROM psprsmdefn
 WHERE portal_name = 'EMPLOYEE'
 START WITH PORTAL_LABEL = ':1' CONNECT BY PRIOR portal_objname = portal_prntobjname
 GROUP BY PORTAL_NAME,
 portal_reftype,
   PORTAL_PRNTOBJNAME,
   PORTAL_OBJNAME,
   PORTAL_LABEL,
   PORTAL_URI_SEG1,
   PORTAL_URI_SEG2,
   PORTAL_URI_SEG3
   ORDER BY portal_reftype DESC;
-- PORTAL_NAME is your folder name
-- You might get better results if you know the portal object name. Replace "START WITH PORTAL_LABEL = ':1'" with "START WITH PORTAL_OBJNAME = ':1'"
 

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!

Comments

Have a question? Please ask it on the forum instead.
war gold's picture
war gold (not verified)
Re: Get all Components Under a Certain Portal Folder

Thanks for the tip mate, was getting a little frustrated with this one!

warhammer's picture
warhammer (not verified)
Re: Get all Components Under a Certain Portal Folder

yeps, this was indeed starting to become a handful. thanks for the tip