views::record_view (public)

 views::record_view [ -object_id object_id ] [ -viewer_id viewer_id ] \
    [ -type type ]

Defined in packages/views/tcl/views-procs.tcl

Record an object view by viewer_id

Switches:
-object_id
(optional)
-viewer_id
(optional)
-type
(optional)
Returns:
the total view count for the user
Author:
Jeff Davis davis@xarg.net
Created:
2004-01-30

Partial Call Graph (max 5 caller/called nodes):
%3 test_view_api_test_with_type view_api_test_with_type (test views) views::record_view views::record_view test_view_api_test_with_type->views::record_view test_view_api_test_without_type view_api_test_without_type (test views) test_view_api_test_without_type->views::record_view db_exec_plsql db_exec_plsql (public) views::record_view->db_exec_plsql packages/views/lib/record-view.tcl packages/views/ lib/record-view.tcl packages/views/lib/record-view.tcl->views::record_view xowiki::Page instproc www-view xowiki::Page instproc www-view (public) xowiki::Page instproc www-view->views::record_view

Testcases:
view_api_test_without_type, view_api_test_with_type
Source code:
    if { $type ne "" } {
        if { $type in {views_count unique_views last_viewed} } {
        # if the type is on of the list it will conflict on the views::get procedure
            error "views::record_view type cannot be views_count, unique_views or last_viewed"
        }
        #TYPE is PL/SQL reserver word in ORACLE
        #set view_type $type
        set views_by_type [db_exec_plsql record_view_by_type {}]
    }

    if {[catch {set views [db_exec_plsql record_view {}]} views]} {
        set views 0
    }
    return $views
Generic XQL file:
packages/views/tcl/views-procs.xql

PostgreSQL XQL file:
<fullquery name="views::record_view.record_view">
    <querytext>
	select views__record_view(:object_id, :viewer_id)
	</querytext>
</fullquery>

<fullquery name="views::record_view.record_view_by_type">
    <querytext>
	select views_by_type__record_view(:object_id, :viewer_id, :type)
	</querytext>
</fullquery>
packages/views/tcl/views-procs-postgresql.xql

Oracle XQL file:
<fullquery name="views::record_view.record_view">
    <querytext>
	begin
        :1 := views_view.record_view(p_object_id => :object_id, 
        			     p_viewer_id => :viewer_id);
    end;
	</querytext>
</fullquery>

<fullquery name="views::record_view.record_view_by_type">
    <querytext>
	begin
        :1 := views_view_by_type.record_view(p_object_id => :object_id, 
        			     p_viewer_id => :viewer_id,
        			     p_view_type => :type);
    end;
	</querytext>
</fullquery>
packages/views/tcl/views-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: