

create function inline_0 ()
returns integer as '
declare
    ds_id portal_datasources.datasource_id%TYPE;
    foo integer;
begin
    ds_id := portal_datasource__new(
        null,
        ''tlf_assignment_portlet'',
        ''Displays the homework'',
        ''portal_datasource'',
        now(),
        null,
        null,
        null
    );

    --  the standard 4 params

    -- shadeable_p
    perform portal_datasource__set_def_param(
        ds_id, ''t'', ''t'', ''shadeable_p'', ''t''
    );

    -- hideable_p
    perform portal_datasource__set_def_param(
        ds_id, ''t'', ''t'', ''hideable_p'', ''t''
    );

    -- user_editable_p
    perform portal_datasource__set_def_param(
        ds_id, ''t'', ''t'', ''user_editable_p'', ''f''
    );

    -- shaded_p
    perform portal_datasource__set_def_param(
        ds_id, ''t'', ''t'', ''shaded_p'', ''f''
    );

    -- link_hideable_p
    perform portal_datasource__set_def_param(
        ds_id, ''t'', ''t'', ''link_hideable_p'', ''t''
    );
    
    -- package_id
    perform portal_datasource__set_def_param (
        ds_id, ''t'', ''f'', ''package_id'', ''''
    );

    -- create the implementation
    perform acs_sc_impl__new(
        ''portal_datasource'',
        ''tlf_assignment_portlet'',
        ''tlf_assignment_portlet''
    );

        -- add all the hooks
    perform acs_sc_impl_alias__new (
           ''portal_datasource'',
           ''tlf_assignment_portlet'',
           ''GetMyName'',
           ''tlf_assignment_portlet::get_my_name'',
           ''TCL''
    );

    perform acs_sc_impl_alias__new (
           ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''GetPrettyName'',
               ''tlf_assignment_portlet::get_pretty_name'',
               ''TCL''
        );

        perform acs_sc_impl_alias__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''Link'',
               ''tlf_assignment_portlet::link'',
               ''TCL''
        );

        perform acs_sc_impl_alias__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''AddSelfToPage'',
               ''tlf_assignment_portlet::add_self_to_page'',
               ''TCL''
        );

        perform acs_sc_impl_alias__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''RemoveSelfFromPage'',
               ''tlf_assignment_portlet::remove_self_from_page'',
               ''TCL''
        );

        perform acs_sc_impl_alias__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''Show'',
               ''tlf_assignment_portlet::show'',
               ''TCL''
        );

        perform acs_sc_impl_alias__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet'',
               ''Edit'',
               ''tlf_assignment_portlet::edit'',
               ''TCL''
        );

        -- Add the binding
        perform acs_sc_binding__new (
               ''portal_datasource'',
               ''tlf_assignment_portlet''
        );

    return 0;

end;
' language 'plpgsql';

select inline_0();
drop function inline_0();
