Index: openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet-drop.sql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet-drop.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet-drop.sql 19 Aug 2014 17:11:30 -0000 1.2.22.1 @@ -35,18 +35,24 @@ -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN select datasource_id into ds_id from portal_datasources - where name = ''static_admin_portlet''; + where name = 'static_admin_portlet'; if not found then - RAISE EXCEPTION '' No datasource id found '', ds_id; + RAISE EXCEPTION ' No datasource id found ', ds_id; ds_id := null; end if; @@ -56,62 +62,63 @@ -- drop the hooks perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''GetMyName'' + 'portal_datasource', + 'static_admin_portlet', + 'GetMyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''GetPrettyName'' + 'portal_datasource', + 'static_admin_portlet', + 'GetPrettyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Link'' + 'portal_datasource', + 'static_admin_portlet', + 'Link' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''AddSelfToPage'' + 'portal_datasource', + 'static_admin_portlet', + 'AddSelfToPage' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Show'' + 'portal_datasource', + 'static_admin_portlet', + 'Show' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Edit'' + 'portal_datasource', + 'static_admin_portlet', + 'Edit' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_admin_portlet'', - ''RemoveSelfFromPage'' + 'portal_datasource', + 'static_admin_portlet', + 'RemoveSelfFromPage' ); -- Drop the binding perform acs_sc_binding__delete ( - ''portal_datasource'', - ''static_admin_portlet'' + 'portal_datasource', + 'static_admin_portlet' ); -- drop the impl perform acs_sc_impl__delete ( - ''portal_datasource'', - ''static_admin_portlet'' + 'portal_datasource', + 'static_admin_portlet' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); drop function inline_1(); Index: openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet.sql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-admin-portlet.sql 19 Aug 2014 17:11:31 -0000 1.2.22.1 @@ -33,61 +33,67 @@ -- PostGreSQL port samir@symphinity.com 11 July 2002 -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN ds_id := portal_datasource__new( - ''static_admin_portlet'', -- name - ''Displays the admin interface for the static data portlets'' -- Description + 'static_admin_portlet', -- name + 'Displays the admin interface for the static data portlets' -- Description ); -- 4 defaults procs -- shadeable_p perform portal_datasource__set_def_param ( ds_id, -- datasource_id - ''t'', -- config_required_p - ''t'', -- configured_p - ''shadeable_p'', -- key - ''f'' -- value + 't', -- config_required_p + 't', -- configured_p + 'shadeable_p', -- key + 'f' -- value ); -- shaded_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''shaded_p'', - ''f'' + 't', + 't', + 'shaded_p', + 'f' ); -- hideable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''hideable_p'', - ''t'' + 't', + 't', + 'hideable_p', + 't' ); -- user_editable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''user_editable_p'', - ''f'' + 't', + 't', + 'user_editable_p', + 'f' ); -- link_hideable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''link_hideable_p'', - ''t'' + 't', + 't', + 'link_hideable_p', + 't' ); @@ -96,94 +102,95 @@ -- package_id must be configured perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''f'', - ''package_id'', - '''' + 't', + 'f', + 'package_id', + '' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_1() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''static_admin_portlet'' + 'portal_datasource', + 'static_admin_portlet', + 'static_admin_portlet' ); -- add all the hooks perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''GetMyName'', - ''static_admin_portlet::get_my_name'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'GetMyName', + 'static_admin_portlet::get_my_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''GetPrettyName'', - ''static_admin_portlet::get_pretty_name'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'GetPrettyName', + 'static_admin_portlet::get_pretty_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Link'', - ''static_admin_portlet::link'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'Link', + 'static_admin_portlet::link', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''AddSelfToPage'', - ''static_admin_portlet::add_self_to_page'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'AddSelfToPage', + 'static_admin_portlet::add_self_to_page', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Show'', - ''static_admin_portlet::show'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'Show', + 'static_admin_portlet::show', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''Edit'', - ''static_admin_portlet::edit'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'Edit', + 'static_admin_portlet::edit', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_admin_portlet'', - ''RemoveSelfFromPage'', - ''static_admin_portlet::remove_self_from_page'', - ''TCL'' + 'portal_datasource', + 'static_admin_portlet', + 'RemoveSelfFromPage', + 'static_admin_portlet::remove_self_from_page', + 'TCL' ); -- Add the binding perform acs_sc_binding__new ( - ''portal_datasource'', -- contract_name - ''static_admin_portlet'' -- impl_name + 'portal_datasource', -- contract_name + 'static_admin_portlet' -- impl_name ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); Index: openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql,v diff -u -r1.3 -r1.3.18.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql 29 May 2003 18:05:59 -0000 1.3 +++ openacs-4/packages/static-portlet/sql/postgresql/static-core-drop.sql 19 Aug 2014 17:11:31 -0000 1.3.18.1 @@ -32,18 +32,25 @@ delete from acs_permissions where object_id in (select content_id from static_portal_content); --drop objects -create function inline_0 () -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE object_rec record; -begin - for object_rec in select object_id from acs_objects where object_type=''static_portal_content'' +BEGIN + for object_rec in select object_id from acs_objects where object_type='static_portal_content' loop perform acs_object__delete( object_rec.object_id ); end loop; return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); @@ -61,16 +68,16 @@ -- -create function inline_1() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_1() RETURNS integer AS $$ +BEGIN perform acs_object_type__drop_type ( - ''static_portal_content'', -- object_type - ''t'' + 'static_portal_content', -- object_type + 't' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); @@ -90,35 +97,35 @@ -- perms -- -create function inline_2() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_2() RETURNS integer AS $$ +BEGIN -- unbindbind privileges to global names - perform acs_privilege__remove_child(''create'',''static_portal_create''); - perform acs_privilege__remove_child(''read'',''static_portal_read''); - perform acs_privilege__remove_child(''delete'',''static_portal_delete''); - perform acs_privilege__remove_child(''write'',''static_portal_modify''); - perform acs_privilege__remove_child(''admin'',''static_portal_admin''); + perform acs_privilege__remove_child('create','static_portal_create'); + perform acs_privilege__remove_child('read','static_portal_read'); + perform acs_privilege__remove_child('delete','static_portal_delete'); + perform acs_privilege__remove_child('write','static_portal_modify'); + perform acs_privilege__remove_child('admin','static_portal_admin'); -- set up the admin priv - perform acs_privilege__remove_child(''static_portal_admin'', ''static_portal_create''); - perform acs_privilege__remove_child(''static_portal_admin'', ''static_portal_read''); - perform acs_privilege__remove_child(''static_portal_admin'', ''static_portal_delete''); - perform acs_privilege__remove_child(''static_portal_admin'', ''static_portal_modify''); + perform acs_privilege__remove_child('static_portal_admin', 'static_portal_create'); + perform acs_privilege__remove_child('static_portal_admin', 'static_portal_read'); + perform acs_privilege__remove_child('static_portal_admin', 'static_portal_delete'); + perform acs_privilege__remove_child('static_portal_admin', 'static_portal_modify'); - perform acs_privilege__drop_privilege(''static_portal_create''); - perform acs_privilege__drop_privilege(''static_portal_read''); - perform acs_privilege__drop_privilege(''static_portal_delete''); - perform acs_privilege__drop_privilege(''static_portal_modify''); - perform acs_privilege__drop_privilege(''static_portal_admin''); + perform acs_privilege__drop_privilege('static_portal_create'); + perform acs_privilege__drop_privilege('static_portal_read'); + perform acs_privilege__drop_privilege('static_portal_delete'); + perform acs_privilege__drop_privilege('static_portal_modify'); + perform acs_privilege__drop_privilege('static_portal_admin'); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_2(); Index: openacs-4/packages/static-portlet/sql/postgresql/static-core.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-core.sql,v diff -u -r1.6 -r1.6.8.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-core.sql 8 Aug 2006 21:27:12 -0000 1.6 +++ openacs-4/packages/static-portlet/sql/postgresql/static-core.sql 19 Aug 2014 17:11:31 -0000 1.6.8.1 @@ -32,24 +32,24 @@ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_object_type__create_type ( - ''static_portal_content'', -- object_type - ''Static Content'', -- pretty_name - ''Static Content'', -- pretty_plural - ''acs_object'', -- supertype - ''static_portal_content'', -- table_name - ''content_id'', -- id_column + 'static_portal_content', -- object_type + 'Static Content', -- pretty_name + 'Static Content', -- pretty_plural + 'acs_object', -- supertype + 'static_portal_content', -- table_name + 'content_id', -- id_column null, -- package_name - ''f'', -- abstract_p + 'f', -- abstract_p null, -- type_extension_table null -- name_method ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); @@ -82,14 +82,21 @@ -- API -- -create function static_portal_content_item__new (integer, varchar, varchar, varchar) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_format alias for $4; -begin + + +-- added + +-- +-- procedure static_portal_content_item__new/4 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_format varchar +) RETURNS integer AS $$ +DECLARE +BEGIN return static_portal_content_item__new( p_package_id, p_pretty_name, @@ -101,36 +108,35 @@ null, null ); -end; -' language 'plpgsql'; +END; -create function static_portal_content_item__new ( - integer, -- package_id in static_portal_content.package_id%TYPE default null, - varchar, -- pretty_name in static_portal_content.pretty_name%TYPE default null, - varchar, -- content in static_portal_content.content%TYPE default null, - varchar, -- format in static_portal_content.format%TYPE default text/html, - varchar, -- object_type in acs_objects.object_type%TYPE default [static_portal_content], - timestamptz, -- creation_date in acs_objects.creation_date%TYPE default sysdate, - integer, -- creation_user in acs_objects.creation_user%TYPE default null, - varchar, -- creation_ip in acs_objects.creation_ip%TYPE default null, - integer -- context_id in acs_objects.context_id%TYPE default null -) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_format alias for $4; - p_object_type alias for $5; - p_creation_date alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; - p_context_id alias for $9; +$$ LANGUAGE plpgsql; + + + +-- added +select define_function_args('static_portal_content_item__new','package_id,pretty_name,content,format,object_type,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure static_portal_content_item__new/9 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_format varchar, + p_object_type varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ +DECLARE v_content_id static_portal_content.content_id%TYPE; v_object_type varchar; -begin +BEGIN if p_object_type is null then - v_object_type := ''static_portal_content''; + v_object_type := 'static_portal_content'; else v_object_type := p_object_type; end if; @@ -151,7 +157,8 @@ (v_content_id, p_package_id, p_pretty_name, p_content, p_format); return v_content_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; create function static_portal_content_item__delete ( integer -- content_id in static_portal_content.content_id%TYPE @@ -170,33 +177,33 @@ -- perms -- -create function inline_1() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_1() RETURNS integer AS $$ +BEGIN - perform acs_privilege__create_privilege(''static_portal_create''); - perform acs_privilege__create_privilege(''static_portal_read''); - perform acs_privilege__create_privilege(''static_portal_delete''); - perform acs_privilege__create_privilege(''static_portal_modify''); - perform acs_privilege__create_privilege(''static_portal_admin''); + perform acs_privilege__create_privilege('static_portal_create'); + perform acs_privilege__create_privilege('static_portal_read'); + perform acs_privilege__create_privilege('static_portal_delete'); + perform acs_privilege__create_privilege('static_portal_modify'); + perform acs_privilege__create_privilege('static_portal_admin'); -- set up the admin priv - perform acs_privilege__add_child(''static_portal_admin'', ''static_portal_create''); - perform acs_privilege__add_child(''static_portal_admin'', ''static_portal_read''); - perform acs_privilege__add_child(''static_portal_admin'', ''static_portal_delete''); - perform acs_privilege__add_child(''static_portal_admin'', ''static_portal_modify''); + perform acs_privilege__add_child('static_portal_admin', 'static_portal_create'); + perform acs_privilege__add_child('static_portal_admin', 'static_portal_read'); + perform acs_privilege__add_child('static_portal_admin', 'static_portal_delete'); + perform acs_privilege__add_child('static_portal_admin', 'static_portal_modify'); -- bind privileges to global names - perform acs_privilege__add_child(''create'',''static_portal_create''); - perform acs_privilege__add_child(''read'',''static_portal_read''); - perform acs_privilege__add_child(''delete'',''static_portal_delete''); - perform acs_privilege__add_child(''write'',''static_portal_modify''); - perform acs_privilege__add_child(''admin'',''static_portal_admin''); + perform acs_privilege__add_child('create','static_portal_create'); + perform acs_privilege__add_child('read','static_portal_read'); + perform acs_privilege__add_child('delete','static_portal_delete'); + perform acs_privilege__add_child('write','static_portal_modify'); + perform acs_privilege__add_child('admin','static_portal_admin'); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); Index: openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql 19 Aug 2014 17:11:31 -0000 1.2.22.1 @@ -34,18 +34,24 @@ -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN select datasource_id into ds_id from portal_datasources - where name = ''static_portlet''; + where name = 'static_portlet'; if not found then - RAISE EXCEPTION '' No datasource id found '', ds_id; + RAISE EXCEPTION ' No datasource id found ', ds_id; ds_id := null; end if; @@ -55,62 +61,63 @@ -- drop the hooks perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''GetMyName'' + 'portal_datasource', + 'static_portlet', + 'GetMyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''GetPrettyName'' + 'portal_datasource', + 'static_portlet', + 'GetPrettyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Link'' + 'portal_datasource', + 'static_portlet', + 'Link' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''AddSelfToPage'' + 'portal_datasource', + 'static_portlet', + 'AddSelfToPage' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Show'' + 'portal_datasource', + 'static_portlet', + 'Show' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Edit'' + 'portal_datasource', + 'static_portlet', + 'Edit' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''RemoveSelfFromPage'' + 'portal_datasource', + 'static_portlet', + 'RemoveSelfFromPage' ); -- Drop the binding perform acs_sc_binding__delete ( - ''portal_datasource'', - ''static_portlet'' + 'portal_datasource', + 'static_portlet' ); -- drop the impl perform acs_sc_impl__delete ( - ''portal_datasource'', - ''static_portlet'' + 'portal_datasource', + 'static_portlet' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); drop function inline_1(); Index: openacs-4/packages/static-portlet/sql/postgresql/static-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-portlet.sql,v diff -u -r1.2 -r1.2.22.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-portlet.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-portlet.sql 19 Aug 2014 17:11:31 -0000 1.2.22.1 @@ -33,61 +33,67 @@ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN ds_id := portal_datasource__new( - ''static_portlet'', -- name - ''Displays static data portlet'' -- description + 'static_portlet', -- name + 'Displays static data portlet' -- description ); -- 4 defaults procs -- shadeable_p perform portal_datasource__set_def_param ( ds_id, -- datasource_id - ''t'', -- config_required_p - ''t'', -- configured_p - ''shadeable_p'', -- key - ''t'' -- value + 't', -- config_required_p + 't', -- configured_p + 'shadeable_p', -- key + 't' -- value ); -- shaded_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''shaded_p'', - ''f'' + 't', + 't', + 'shaded_p', + 'f' ); -- hideable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''hideable_p'', - ''t'' + 't', + 't', + 'hideable_p', + 't' ); -- user_editable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''user_editable_p'', - ''f'' + 't', + 't', + 'user_editable_p', + 'f' ); -- link_hideable_p perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''t'', - ''link_hideable_p'', - ''t'' + 't', + 't', + 'link_hideable_p', + 't' ); @@ -96,105 +102,106 @@ -- package_id must be configured perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''f'', - ''package_id'', - '''' + 't', + 'f', + 'package_id', + '' ); perform portal_datasource__set_def_param ( ds_id, - ''t'', - ''f'', - ''content_id'', - '''' + 't', + 'f', + 'content_id', + '' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_1() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new ( - ''portal_datasource'', - ''static_portlet'', - ''static_portlet'' + 'portal_datasource', + 'static_portlet', + 'static_portlet' ); -- add all the hooks perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''GetMyName'', - ''static_portlet::get_my_name'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'GetMyName', + 'static_portlet::get_my_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''GetPrettyName'', - ''static_portlet::get_pretty_name'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'GetPrettyName', + 'static_portlet::get_pretty_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''Link'', - ''static_portlet::link'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'Link', + 'static_portlet::link', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''AddSelfToPage'', - ''static_portlet::add_self_to_page'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'AddSelfToPage', + 'static_portlet::add_self_to_page', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''Show'', - ''static_portlet::show'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'Show', + 'static_portlet::show', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''Edit'', - ''static_portlet::edit'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'Edit', + 'static_portlet::edit', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''static_portlet'', - ''RemoveSelfFromPage'', - ''static_portlet::remove_self_from_page'', - ''TCL'' + 'portal_datasource', + 'static_portlet', + 'RemoveSelfFromPage', + 'static_portlet::remove_self_from_page', + 'TCL' ); -- Add the binding perform acs_sc_binding__new ( - ''portal_datasource'', -- contract_name - ''static_portlet'' -- impl_name + 'portal_datasource', -- contract_name + 'static_portlet' -- impl_name ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); Index: openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql,v diff -u -r1.2 -r1.2.12.1 --- openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql 29 Jun 2004 10:18:47 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql 19 Aug 2014 17:11:31 -0000 1.2.12.1 @@ -2,31 +2,30 @@ update static_portal_content set body = content; alter table static_portal_content drop column content; -create or replace function static_portal_content_item__new ( - integer, -- package_id in static_portal_content.package_id%TYPE default null, - varchar, -- pretty_name in static_portal_content.pretty_name%TYPE default null, - varchar, -- content in static_portal_content.content%TYPE default null, - varchar, -- object_type in acs_objects.object_type%TYPE default [static_portal_content], - timestamptz, -- creation_date in acs_objects.creation_date%TYPE default sysdate, - integer, -- creation_user in acs_objects.creation_user%TYPE default null, - varchar, -- creation_ip in acs_objects.creation_ip%TYPE default null, - integer -- context_id in acs_objects.context_id%TYPE default null -) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_object_type alias for $4; - p_creation_date alias for $5; - p_creation_user alias for $6; - p_creation_ip alias for $7; - p_context_id alias for $8; + + +-- added +select define_function_args('static_portal_content_item__new','package_id,pretty_name,content,object_type,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure static_portal_content_item__new/8 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_object_type varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ +DECLARE v_content_id static_portal_content.content_id%TYPE; v_object_type varchar; -begin +BEGIN if p_object_type is null then - v_object_type := ''static_portal_content''; + v_object_type := 'static_portal_content'; else v_object_type := p_object_type; end if; @@ -47,4 +46,5 @@ (v_content_id, p_package_id, p_pretty_name, p_content); return v_content_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; Index: openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.1.2d1-2.1.2d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.1.2d1-2.1.2d2.sql,v diff -u -r1.2 -r1.2.8.1 --- openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.1.2d1-2.1.2d2.sql 8 Aug 2006 21:27:12 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.1.2d1-2.1.2d2.sql 19 Aug 2014 17:11:31 -0000 1.2.8.1 @@ -43,14 +43,21 @@ -- API modifications drop function static_portal_content_item__new (integer, varchar, varchar); -create function static_portal_content_item__new (integer, varchar, varchar, varchar) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_format alias for $4; -begin + + +-- added + +-- +-- procedure static_portal_content_item__new/4 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_format varchar +) RETURNS integer AS $$ +DECLARE +BEGIN return static_portal_content_item__new( p_package_id, p_pretty_name, @@ -62,37 +69,36 @@ null, null ); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + drop function static_portal_content_item__new (integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer); -create function static_portal_content_item__new ( - integer, -- package_id in static_portal_content.package_id%TYPE default null, - varchar, -- pretty_name in static_portal_content.pretty_name%TYPE default null, - varchar, -- content in static_portal_content.content%TYPE default null, - varchar, -- format in static_portal_content.format%TYPE default text/html, - varchar, -- object_type in acs_objects.object_type%TYPE default [static_portal_content], - timestamptz, -- creation_date in acs_objects.creation_date%TYPE default sysdate, - integer, -- creation_user in acs_objects.creation_user%TYPE default null, - varchar, -- creation_ip in acs_objects.creation_ip%TYPE default null, - integer -- context_id in acs_objects.context_id%TYPE default null -) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_format alias for $4; - p_object_type alias for $5; - p_creation_date alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; - p_context_id alias for $9; + + +-- added +select define_function_args('static_portal_content_item__new','package_id,pretty_name,content,format,object_type,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure static_portal_content_item__new/9 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_format varchar, + p_object_type varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ +DECLARE v_content_id static_portal_content.content_id%TYPE; v_object_type varchar; -begin +BEGIN if p_object_type is null then - v_object_type := ''static_portal_content''; + v_object_type := 'static_portal_content'; else v_object_type := p_object_type; end if; @@ -113,4 +119,5 @@ (v_content_id, p_package_id, p_pretty_name, p_content, p_format); return v_content_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql;