Tuesday, July 01, 2008

Dynamic 'My Favorites' Links in your APEX Application

For a (even more) Web 2.0 like look-and-feel in your APEX application you can define a dynamic region 'My Favorite Tasks', that shows links to the pages you visit most frequently.
For these favorites we can query the APEX repository. Follow these steps to get this thing working:

  1. Enable logging on Application Level. Enabling the logging will result in records in the view apex_workspace_activity_log.
  2. Create a Report Page with a region based on a SQL Query.
  3. Enter the query to show the links for the three most visited pages:
select htf.anchor( 'f?p='||:APP_ID||':'||page_id||':'||:APP_SESSION
, page_name ) Task
from

(
select page_name
, page_id
, count(*)
from apex_workspace_activity_log
where application_id = :APP_ID
and apex_user = :APP_USER
and page_id <> :APP_PAGE_ID
group by page_name, page_id
order by 3 desc
)
where rownum <= 3
In a next post I will show how you can embed this report page in any other page in your application.
Post a Comment