Monday, September 12th, 2011

PeopleSoft Quick-Tip: Find navigationpath of a component

Getting lost while searching for the correct navigation path of a (custom) page or component?
Here is a quick tip to get a a breadcrumbs description of the navigation path of a specific component:


DECLARE

CURSOR c_comp
(p_comp IN VARCHAR2)
IS
SELECT DISTINCT portal_prntobjname
FROM psprsmdefn
WHERE portal_uri_seg2 = p_comp
AND portal_cref_usgt = 'TARG';

CURSOR c_object
( p_comp IN VARCHAR2
, p_object IN VARCHAR2)
IS
SELECT portal_objname
FROM psprsmdefn
WHERE portal_uri_seg2 = p_comp
AND portal_cref_usgt = 'TARG'
AND portal_prntobjname = p_object
AND portal_objname 'PORTAL_ROOT_OBJECT';

g_pad VARCHAR2(20000);
g_lan ps_portal_obj_lng.LANGUAGE_CD%TYPE := 'DUT';
g_object psprsmdefn.portal_objname%TYPE := 'RC_CASE_HD_SS_RPT'; --Replace component name...

l_object psprsmdefn.portal_objname%TYPE;

FUNCTION find_portal_name(p_portal IN VARCHAR2)
RETURN VARCHAR2
IS
CURSOR c_object_name
(p_object IN VARCHAR2)
IS
SELECT *
FROM ps_portal_objects
WHERE portal_objname = p_object;
CURSOR c_object_name_lng
( p_object IN VARCHAR2
, p_lan IN VARCHAR2)
IS
SELECT *
FROM ps_portal_obj_lng
WHERE portal_objname = p_object
AND language_cd = p_lan;
l_portal_name ps_portal_objects.portal_label%TYPE;
BEGIN
FOR r_object_name_lng IN c_object_name_lng(p_portal, g_lan)
LOOP
l_portal_name := r_object_name_lng.portal_label;
END LOOP;

IF l_portal_name IS NULL THEN
FOR r_object_name IN c_object_name(p_portal)
LOOP
l_portal_name := r_object_name.portal_label;
END LOOP;
END IF;

RETURN(l_portal_name);
END;

PROCEDURE search_and_find
(p_object IN VARCHAR2)
IS
CURSOR c_object
(p_object IN VARCHAR2)
IS
SELECT DISTINCT portal_objname
, portal_prntobjname
FROM psprsmdefn
WHERE portal_objname = p_object
AND portal_objname 'PORTAL_ROOT_OBJECT';
BEGIN
FOR r_object IN c_object(p_object)
LOOP
IF g_pad IS NULL THEN
g_pad := find_portal_name(r_object.portal_objname);
ELSE
g_pad := find_portal_name(r_object.portal_objname) || ' - ' || g_pad;
END IF;

search_and_find(r_object.portal_prntobjname);
END LOOP;

END;
BEGIN

DBMS_OUTPUT.PUT_LINE('Path(s) found for component: ' || g_object || ', Language: ' || g_lan);

FOR r_comp IN c_comp(g_object)
LOOP
g_pad := NULL;

OPEN c_object(g_object, r_comp.portal_prntobjname);
FETCH c_object
INTO l_object;
CLOSE c_object;
search_and_find(l_object);
DBMS_OUTPUT.PUT_LINE('Root - ' || g_pad);
END LOOP;

END;

Just note the following line and replace it with the desired component name

g_object psprsmdefn.portal_objname%TYPE := 'RC_CASE_HD_SS_RPT'; --Replace component name...

Note: We’re using this code for PopelTools 8.47 and it’s working fine. For PeopleSoft 9.1 and above you can use the vanilla feature as described here: Path to in PeopleSoft 9.1 with tools 8.50 and higher

 Viewed 4541 times by 1283 visitors


Category: Technical
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.