Benutzer-Werkzeuge

Webseiten-Werkzeuge


prog:oracle_apex_show_my_user_information

Oracle Apex 5 - Wer bin ich? Dialog

Ziel: Info Dialog über den angemeldeten User und seine Rechte, den Status der Session und den Wert der Session Items der aktuellen Seite

PL/SQL Block für ein Region mit „PLSQL Content“ erstellen und einbinden:

DECLARE
 
cursor c_role(p_username varchar2) 
   IS 
   SELECT  USERNAME
         , rtrim ( xmlagg (xmlelement (c,GRANTED_ROLE || ',') ORDER BY GRANTED_ROLE).extract ('//text()'), ',' ) AS role_list      
     FROM user_role_privs 
    WHERE USERNAME=p_username
    GROUP BY  USERNAME;    
 
BEGIN
 
  htp.p('You are :: <span style="font-weight: bold; color : #0080ff" >'
         ||APEX_UTIL.GET_FIRST_NAME(p_username => APEX_CUSTOM_AUTH.GET_USERNAME ) 
         ||' '
         ||APEX_UTIL.GET_LAST_NAME(p_username => APEX_CUSTOM_AUTH.GET_USERNAME )  
         ||'</span> <br/> <br/>');
 
 
  htp.p('You are the APEX user :: <span style="font-weight: bold; color : #0080ff" >'||APEX_CUSTOM_AUTH.GET_USERNAME ||'</span>');
 
 
 
  FOR rec IN c_role(p_username  => APEX_CUSTOM_AUTH.GET_USERNAME)
  loop
         htp.p(' with this roles :: <span style="font-weight: bold; color : green">'||rec.role_list||'</span><br/>');
  END loop;
 
 
END;

Welchen Wert haben meine Page Items geraden:

SELECT  page_name
      , page_id
      , item_name
      , display_as
      , component_comment
      , apex_util.get_session_state(item_name) session_value      
FROM  apex_application_page_items
WHERE application_id = :APP_ID
AND   page_id        = :APP_PAGE_ID
ORDER BY page_id,page_name

Informationen über meine Session:

BEGIN 
    htp.p('<table>');
 
    htp.p('<tr>');
    htp.p('<td>');
    htp.p('APP_USER');
    htp.p('</td>');
    htp.p('<td>');
    htp.p(SYS_CONTEXT('APEX$SESSION','APP_USER'));
    htp.p('</td>');
    htp.p('</tr>');
    ---
    htp.p('<tr>');
    htp.p('<td>');
    htp.p('APP_SESSION');
    htp.p('</td>');
    htp.p('<td>');
    htp.p(SYS_CONTEXT('APEX$SESSION','APP_SESSION'));
    htp.p('</td>');
    htp.p('</tr>');
    ---
    htp.p('<tr>');
    htp.p('<td>');
    htp.p('WORKSPACE_ID');
    htp.p('</td>');
    htp.p('<td>');
    htp.p(SYS_CONTEXT('APEX$SESSION','WORKSPACE_ID'));
    htp.p('</td>');
    htp.p('</tr>');
    ---    
    htp.p('</table>');
    ---
   htp.p('<HR/>');
   htp.p('<p>');
   htp.p('Request='||v('REQUEST'));
   htp.p('</p>');
   ----
   htp.p('<HR/>');
   htp.p('<pre>');
   FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP 
        htp.p('element '||I||' has a value of '||APEX_APPLICATION.G_F01(i)); 
   END LOOP;
   htp.p('</pre>');
   htp.p('<HR/>');
    ----
END;   
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
prog/oracle_apex_show_my_user_information.txt · Zuletzt geändert: 2017/04/24 09:34 von gpipperr