views::get (public)

 views::get [ -object_id object_id ]

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

Return an array (which you have to set with "array set your_array [views::get -object_id $object_id]") with the elements:

  • views_count
  • unique_views
  • last_viewed

Switches:
-object_id
(optional)
ID of the object for which you want to return the views

Partial Call Graph (max 5 caller/called nodes):
%3 test_view_api_test_with_type view_api_test_with_type (test views) views::get views::get test_view_api_test_with_type->views::get test_view_api_test_without_type view_api_test_without_type (test views) test_view_api_test_without_type->views::get db_0or1row db_0or1row (public) views::get->db_0or1row db_foreach db_foreach (public) views::get->db_foreach packages/file-storage/www/folder-chunk.tcl packages/file-storage/ www/folder-chunk.tcl packages/file-storage/www/folder-chunk.tcl->views::get xowiki::Page instproc www-view xowiki::Page instproc www-view (public) xowiki::Page instproc www-view->views::get

Testcases:
view_api_test_without_type, view_api_test_with_type
Source code:
    if {[db_0or1row views { } -column_array ret] } {
        db_foreach select_views_by_type { } {
            set ret($view_type$views_count
        }
        return [array get ret]
    }
    return {views_count {} unique_views {} last_viewed {}}
Generic XQL file:
<fullquery name="views::get.views">
    <querytext>
	select views_count, unique_views, to_char(last_viewed,'YYYY-MM-DD HH24:MI:SS') as last_viewed
    from view_aggregates
    where object_id = :object_id
	</querytext>
</fullquery>

<fullquery name="views::get.select_views_by_type">
    <querytext>
	select view_type, views_count
    from view_aggregates_by_type
    where object_id = :object_id
</querytext>
</fullquery>
packages/views/tcl/views-procs.xql

PostgreSQL XQL file:
packages/views/tcl/views-procs-postgresql.xql

Oracle XQL file:
packages/views/tcl/views-procs-oracle.xql

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