etp::make_page (public)

 etp::make_page name [ title ] [ item_id ]

Defined in packages/edit-this-page/tcl/etp-procs.tcl

Parameters:
name (required)
the name of the page you wish to create in the current package Creates a new page (content item) with the given name by inserting a row into the cr_items table, and creates an initial revision by inserting a row into the cr_revisions table.
title (optional, defaults to "Untitled")
item_id (optional)
Author:
Luke Pond
Created:
2001-05-31

Partial Call Graph (max 5 caller/called nodes):
%3 packages/edit-this-page/www/etp-create-2.tcl packages/edit-this-page/ www/etp-create-2.tcl etp::make_page etp::make_page packages/edit-this-page/www/etp-create-2.tcl->etp::make_page packages/edit-this-page/www/etp-install-portlet.tcl packages/edit-this-page/ www/etp-install-portlet.tcl packages/edit-this-page/www/etp-install-portlet.tcl->etp::make_page packages/edit-this-page/www/etp-setup-2.tcl packages/edit-this-page/ www/etp-setup-2.tcl packages/edit-this-page/www/etp-setup-2.tcl->etp::make_page ad_conn ad_conn (public) etp::make_page->ad_conn db_0or1row db_0or1row (public) etp::make_page->db_0or1row db_exec_plsql db_exec_plsql (public) etp::make_page->db_exec_plsql etp::get_content_type etp::get_content_type (public) etp::make_page->etp::get_content_type

Testcases:
No testcase defined.
Source code:
        set package_id [ad_conn package_id]

        set content_type [etp::get_content_type $name]

        # ensure an entry in cr_items for this (package_id, name) combination

        if { ![db_0or1row page_exists ""] } {
            db_exec_plsql page_create ""
        }
Generic XQL file:
packages/edit-this-page/tcl/etp-procs.xql

PostgreSQL XQL file:
<fullquery name="etp::make_page.page_create">
    <querytext>
	select etp__create_page(
	  :item_id,
	  :package_id,
	  :name,
          :title,
	  :content_type
	)
</querytext>
</fullquery>

<fullquery name="etp::make_page.page_exists">
    <querytext>
	    select 1 from cr_items
	     where parent_id = etp__get_folder_id(:package_id)
	       and name = :name
</querytext>
</fullquery>
packages/edit-this-page/tcl/etp-procs-postgresql.xql

Oracle XQL file:
<fullquery name="etp::make_page.page_create">
    <querytext>
	begin
	  :1 := etp.create_page(
	           package_id     => :package_id,
	           name           => :name,
                   title          => :title,
	           content_type   => :content_type
	        );
	end;
</querytext>
</fullquery>

<fullquery name="etp::make_page.page_exists">
    <querytext>
	    select 1 from cr_items
	     where parent_id = etp.get_folder_id(:package_id)
	       and name = :name
</querytext>
</fullquery>
packages/edit-this-page/tcl/etp-procs-oracle.xql

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