roelc
committed
on 15 Jun 06
Added 'Who's this?' above +
/postgresql/datamanager-admin-portlet-create.sql (+179)
  1 --
  2 -- Copyright (C) 2004 University XYZ
  3 --
  4 --  This file is part of dotLRN.
  5 --
  6 --  dotLRN is free software; you can redistribute it and/or modify it under the
  7 --  terms of the GNU General Public License as published by the Free Software
  8 --  Foundation; either version 2 of the License, or (at your option) any later
  9 --  version.
  10 --
  11 --  dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
  12 --  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13 --  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  14 --  details.
  15 --
  16 --
  17 --   Procedures to support the datamanager portlet
  18 --
  19 --   @author YYY ZZZ (YYY.ZZZ@xx.yy)
  20 --   @creation-date 2004-10-10
  21 --   @version $Id: datamanager-admin-portlet-create.sql,v 0.1 2004/10/10
  22
  23 create function inline_0()
  24 returns integer as '
  25 declare
  26   ds_id portal_datasources.datasource_id%TYPE;
  27 begin
  28
  29   ds_id  = portal_datasource__new( ''datamanager_admin_portlet'', ''Datamanager Admin portlet'');
  30
  31
  32   --  the standard 4 params
  33
  34   -- shadeable_p
  35   perform portal_datasource__set_def_param (
  36         ds_id,
  37         ''t'',
  38         ''t'',
  39         ''shadeable_p'',
  40         ''f''
  41 );     
  42
  43
  44   -- hideable_p
  45   perform portal_datasource__set_def_param (
  46         ds_id,
  47         ''t'',
  48         ''t'',
  49         ''hideable_p'',
  50         ''f''
  51 );     
  52
  53   -- user_editable_p
  54   perform portal_datasource__set_def_param (
  55         ds_id,
  56         ''t'',
  57         ''t'',
  58         ''user_editable_p'',
  59         ''f''
  60 );     
  61
  62   -- shaded_p
  63   perform portal_datasource__set_def_param (
  64         ds_id,
  65         ''t'',
  66         ''t'',
  67         ''shaded_p'',
  68         ''f''
  69 );     
  70
  71   -- link_hideable_p
  72   perform portal_datasource__set_def_param (
  73         ds_id,
  74         ''t'',
  75         ''t'',
  76         ''link_hideable_p'',
  77         ''t''
  78 ); 
  79
  80 -- datamanager_admin-specific params
  81
  82   -- package_id must be configured
  83   perform portal_datasource__set_def_param (
  84         ds_id,
  85         ''t'',
  86         ''f'',
  87         ''package_id'',
  88         ''''
  89 );
  90
  91   return 0;
  92
  93 end;' language 'plpgsql';
  94
  95 select inline_0();
  96 drop function inline_0();
  97
  98
  99 create function inline_1()
  100 returns integer as '
  101 begin
  102
  103         -- create the implementation
  104         perform acs_sc_impl__new (
  105                 ''portal_datasource'',
  106                 ''datamanager_admin_portlet'',
  107                 ''datamanager_admin_portlet''
  108         );
  109
  110         -- add all the hooks
  111         perform acs_sc_impl_alias__new(
  112                ''portal_datasource'',
  113                ''datamanager_admin_portlet'',
  114                ''GetMyName'',
  115                ''datamanager_admin_portlet::get_my_name'',
  116                ''TCL''
  117         );
  118
  119         perform acs_sc_impl_alias__new (
  120                ''portal_datasource'',
  121                ''datamanager_admin_portlet'',
  122                ''GetPrettyName'',
  123                ''datamanager_admin_portlet::get_pretty_name'',
  124                ''TCL''
  125         );
  126
  127         perform acs_sc_impl_alias__new (
  128                ''portal_datasource'',
  129                ''datamanager_admin_portlet'',
  130                ''Link'',
  131                ''datamanager_admin_portlet::link'',
  132                ''TCL''
  133         );
  134
  135         perform acs_sc_impl_alias__new (
  136                ''portal_datasource'',
  137                ''datamanager_admin_portlet'',
  138                ''AddSelfToPage'',
  139                ''datamanager_admin_portlet::add_self_to_page'',
  140                ''TCL''
  141         );
  142
  143         perform acs_sc_impl_alias__new (
  144                ''portal_datasource'',
  145                ''datamanager_admin_portlet'',
  146                ''Show'',
  147                ''datamanager_admin_portlet::show'',
  148                ''TCL''
  149         );
  150
  151         perform acs_sc_impl_alias__new (
  152                ''portal_datasource'',
  153                ''datamanager_admin_portlet'',
  154                ''Edit'',
  155                ''datamanager_admin_portlet::edit'',
  156                ''TCL''
  157         );
  158
  159         perform acs_sc_impl_alias__new (
  160                ''portal_datasource'',
  161                ''datamanager_admin_portlet'',
  162                ''RemoveSelfFromPage'',
  163                ''datamanager_admin_portlet::remove_self_from_page'',
  164                ''TCL''
  165         );
  166
  167         -- Add the binding
  168         perform acs_sc_binding__new (
  169             ''portal_datasource'',
  170             ''datamanager_admin_portlet''
  171         );
  172
  173         return 0;
  174 end;' language 'plpgsql';
  175
  176 select inline_1();
  177 drop function inline_1();
  178
  179