etp::create_search_impl (public)

 etp::create_search_impl -content_type content_type

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

Creates and registers a service contract implementation alias for an ETP custom application type if it does not already exist. This will define the datasource proc for the type as etp::revision_datasource. That proc will attempt to call a specially named tcl proc of the form etp::content_type where content_type is the acs_object type of the content type. If the proc does not exist only the attributes of the default type will be used to create the datasource.

Switches:
-content_type
(required)
Author:
Dave Bauer

Partial Call Graph (max 5 caller/called nodes):
%3 etp::define_content_type etp::define_content_type (public) etp::create_search_impl etp::create_search_impl etp::define_content_type->etp::create_search_impl acs_sc_binding_exists_p acs_sc_binding_exists_p (public) etp::create_search_impl->acs_sc_binding_exists_p db_exec_plsql db_exec_plsql (public) etp::create_search_impl->db_exec_plsql db_transaction db_transaction (public) etp::create_search_impl->db_transaction etp::search_impl_exists_p etp::search_impl_exists_p (public) etp::create_search_impl->etp::search_impl_exists_p

Testcases:
No testcase defined.
Source code:
     db_transaction {
        # create the implementation if it does not exist
        if {![etp::search_impl_exists_p -content_type $content_type]} {
            db_exec_plsql create_search_impl {}
            db_exec_plsql create_datasource_alias {}
            db_exec_plsql create_url_alias {}
        }
        # install the binding if it does not exist
        if {[acs_sc_binding_exists_p "FtsContentProvider" $content_type] != 1} {
            db_exec_plsql install_binding {}
        }
    } on_error {
        ns_log Error "etp::create_search_impl: Service contract implementation for content type \"${content_type}\" is not valid"
    }
XQL Not present:
Oracle
Generic XQL file:
packages/edit-this-page/tcl/etp-sc-procs.xql

PostgreSQL XQL file:
<fullquery name="etp::create_search_impl.create_search_impl">
    <querytext>
	select acs_sc_impl__new(
		'FtsContentProvider',		-- impl_contract_name
		:content_type,			-- impl_name
		'edit-this-page'			-- impl_owner.name
	);
    </querytext>
</fullquery>

<fullquery name="etp::create_search_impl.create_datasource_alias">
    <querytext>
	select acs_sc_impl_alias__new(
		'FtsContentProvider',		-- impl_contract_name
		:content_type,			-- impl_name
		'datasource',			-- impl_operation_name
		'etp::revision_datasource',	-- impl_alias
		'TCL'				-- impl_pl
	)
    </querytext>
</fullquery>

<fullquery name="etp::create_search_impl.create_url_alias">
    <querytext>
	select acs_sc_impl_alias__new(
		'FtsContentProvider',		-- impl_contract_name
		:content_type,		-- impl_name
		'url',				-- impl_operation_name
		'etp::revision_url',	-- impl_alias
		'TCL'				-- impl_pl
	);
   </querytext>
</fullquery>

<fullquery name="etp::create_search_impl.install_binding">
    <querytext>
	select acs_sc_binding__new(
		'FtsContentProvider', 	-- contract_name
		:content_type		-- impl_name
	);
    </querytext>
</fullquery>
packages/edit-this-page/tcl/etp-sc-procs-postgresql.xql

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