Monday, 28 July 2014

23. Query to Fetch Page Details (Using JDR tables)

Below query can be used to fetch all the items/regions, their ID and name & value of each attribute used on a page
@:PAGE_NAME - takes name of the page as parameter (like HelloWorldPG)

   1. If there is no REGION_ITEM_TYPE of type 'customization', then there are no personalization/customization on the page.
   2. If 'customization' type is present, query would show data for standard page as well as data of personalization file. To see data of any one type, just filter out using a unique path_docid from JDR_PATHS for the particular page_name.

SELECT jc.comp_element region_item_type,
jc.comp_id region_item_id,
ja.att_name attribute_name,
ja.att_value attribute_value

FROM   jdr_attributes ja,
jdr_components jc,
jdr_paths jp

WHERE 1           =1
AND     jp.path_docid = jc.comp_docid
AND     jc.comp_docid = ja.att_comp_docid
AND     jc.comp_seq   = ja.att_comp_seq
AND     path_name     = :PAGE_NAME
ORDER BY jc.comp_seq;

Below is result for HelloWorldPG:

No comments:

Post a Comment