Index: openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql	9 May 2002 23:59:53 -0000	1.3
+++ openacs-4/packages/new-portal/sql/postgresql/datasource-sc-create.sql	1 Jul 2002 20:03:25 -0000	1.4
@@ -1,182 +1,187 @@
--- The data source (portlet) contract
--- copyright 2001, OpenForce, Inc.
--- distributed under the GNU GPL v2
 --
--- for Oracle 8/8i. (We're guessing 9i works, too).
+--  Copyright (C) 2001, 2002 OpenForce, Inc.
 --
--- arjun@openforce.net
--- started November, 2001
+--  This file is part of dotLRN.
 --
--- $Id$
+--  dotLRN is free software; you can redistribute it and/or modify it under the
+--  terms of the GNU General Public License as published by the Free Software
+--  Foundation; either version 2 of the License, or (at your option) any later
+--  version.
+--
+--  dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+--  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+--  FOR A PARTICULAR PURPOSE.  See the GNU General Public License foreign key more
+--  details.
+--
 
-	  select acs_sc_contract__new (
-		    /* contract_name */ 'portal_datasource',
-		    /* contract_desc */ 'Portal Datasource interface'
-	  );
+--
+-- The data source (portlet) contract
+--
+-- @author arjun@openforce.net
+-- @version $Id$
+--
 
-	  -- Get my name - not to be confused with the pretty_name
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.GetMyName.InputType',
-		    /* msg_type_spec */ ''
-	  );
+create function inline_0 ()
+returns integer as '
+begin
 
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.GetMyName.OutputType',
-		    /* msg_type_spec */ 'get_my_name:string'
-	  );
+    perform acs_sc_contract__new(
+        ''portal_datasource'',
+        ''Portal Datasource interface''
+    );
 
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'GetMyName',
-		    'Get the name',
-		    't', -- not cacheable
-		    0,   -- n_args
-		    'portal_datasource.GetMyName.InputType',
-		    'portal_datasource.GetMyName.OutputType'
-	  );
+    -- Get my name - not to be confused with the pretty_name
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.GetMyName.InputType'',
+        ''''
+    );
 
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.GetMyName.OutputType'',
+        ''get_my_name:string''
+    );
 
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''GetMyName'',
+        ''Get the name'',
+        ''t'',
+        0,
+        ''portal_datasource.GetMyName.InputType'',
+        ''portal_datasource.GetMyName.OutputType''
+    );
 
+    -- Get a pretty name
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.GetPrettyName.InputType'',
+        ''''
+    );
 
-	-- Get a pretty name
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.GetPrettyName.InputType',
-		    /* msg_type_spec */ ''
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.GetPrettyName.OutputType'',
+        ''pretty_name:string''
+    );
 
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.GetPrettyName.OutputType',
-		    /* msg_type_spec */ 'pretty_name:string'
-	  );
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''GetPrettyName'',
+        ''Get the pretty name'',
+        ''t'',
+        0,
+        ''portal_datasource.GetPrettyName.InputType'',
+        ''portal_datasource.GetPrettyName.OutputType''
+    );
 
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'GetPrettyName',
-		    'Get the pretty name',
-		    't', -- not cacheable
-		    0,   -- n_args
-		    'portal_datasource.GetPrettyName.InputType',
-		    'portal_datasource.GetPrettyName.OutputType'
-	  );
+    -- Link: Where is the href target for this PE?
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Link.InputType'',
+        ''''
+    );
 
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Link.OutputType'',
+        ''pretty_name:string''
+    );
 
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''Link'',
+        ''Get the link ie the href target for this datasource'',
+        ''t'',
+        0,
+        ''portal_datasource.Link.InputType'',
+        ''portal_datasource.Link.OutputType''
+    );
 
+    -- Tell the datasource  to add itself to a portal page
+    -- add_self_to_page
+    -- The "args" string is an ns_set of extra arguments
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.AddSelfToPage.InputType'',
+        ''page_id:integer,instance_id:integer,args:string''
+    );
 
-	-- Link: Where is the href target for this PE?
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.Link.InputType',
-		    /* msg_type_spec */ ''
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.AddSelfToPage.OutputType'',
+        ''element_id:integer''
+    );
 
-	  select acs_sc_msg_type__new (
-		    /* msg_type_name */ 'portal_datasource.Link.OutputType',
-		    /* msg_type_spec */ 'pretty_name:string'
-	  );
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''AddSelfToPage'',
+        ''Adds itself to the given page returns an element_id'',
+        ''f'',
+        3,
+        ''portal_datasource.AddSelfToPage.InputType'',
+        ''portal_datasource.AddSelfToPage.OutputType''
+    );
 
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'Link',
-		    'Get the link ie the href target for this datasource',
-		    't', -- not cacheable
-		    0,   -- n_args
-		    'portal_datasource.Link.InputType',
-		    'portal_datasource.Link.OutputType'
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Edit.InputType'',
+        ''element_id:integer''
+    );
 
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Edit.OutputType'',
+        ''output:string''
+    );
 
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''Edit'',
+        ''Returns the edit html'',
+        ''f'',
+        1,
+        ''portal_datasource.Edit.InputType'',
+        ''portal_datasource.Edit.OutputType''
+    );
 
-	-- Tell the datasource  to add itself to a portal page
-	-- add_self_to_page
-	-- The "args" string is an ns_set of extra arguments 
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.AddSelfToPage.InputType',
-		    /* msg_type_spec */ 'page_id:integer,instance_id:integer,args:string'
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Show.InputType'',
+        ''cf:string''
+    );
 
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.AddSelfToPage.OutputType',
-		    /* msg_type_spec */ 'element_id:integer'
-	  );
-	  
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'AddSelfToPage',
-		    'Adds itself to the given page returns an element_id',
-		    'f', -- not cacheable
-		    3,   -- n_args
-		    'portal_datasource.AddSelfToPage.InputType',
-		    'portal_datasource.AddSelfToPage.OutputType'
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.Show.OutputType'',
+        ''output:string''
+    );
 
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''Show'',
+        ''Render the portal element returning a chunk of HTML'',
+        ''f'',
+        1,
+        ''portal_datasource.Show.InputType'',
+        ''portal_datasource.Show.OutputType''
+    );
 
+    -- Tell the PE to remove itself from a page
+    -- remove_self_from_page
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.RemoveSelfFromPage.InputType'',
+        ''page_id:integer,instance_id:integer''
+    );
 
-	-- Edit: the datasources' edit html
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.Edit.InputType',
-		    /* msg_type_spec */ 'element_id:integer'
-	  );
+    perform acs_sc_msg_type__new(
+        ''portal_datasource.RemoveSelfFromPage.OutputType'',
+        ''''
+    );
 
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.Edit.OutputType',
-		    /* msg_type_spec */ 'output:string'
-	  );
-	  
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'Edit',
-		    'Returns the edit html',
-		    'f', -- not cacheable
-		    1,   -- n_args
-		    'portal_datasource.Edit.InputType',
-		    'portal_datasource.Edit.OutputType'
-	  );
+    perform acs_sc_operation__new(
+        ''portal_datasource'',
+        ''RemoveSelfFromPage'',
+        '' remove itself from the given page'',
+        ''f'',
+        2,
+        ''portal_datasource.RemoveSelfFromPage.InputType'',
+        ''portal_datasource.RemoveSelfFromPage.OutputType''
+    );
 
+    return 0;
 
+end;' language 'plpgsql';
 
+select inline_0();
 
-	-- Show: the portal element's display proc
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.Show.InputType',
-		    /* msg_type_spec */ 'cf:string'
-	  );
-
-	  select acs_sc_msg_type__new(
-		    /* msg_type_name */ 'portal_datasource.Show.OutputType',
-		    /* msg_type_spec */ 'output:string'
-	  );
-	  
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'Show',
-		    'Render the portal element returning a chunk of HTML',
-		    'f', -- not cacheable
-		    1,   -- n_args
-		    'portal_datasource.Show.InputType',
-		    'portal_datasource.Show.OutputType'
-	  );
-
-
-
-
-
-	-- Tell the PE to remove itself from a page
-	-- remove_self_from_page
-	  select acs_sc_msg_type__new(
-	    /* msg_type_name */ 'portal_datasource.RemoveSelfFromPage.InputType',
-	    /* msg_type_spec */ 'page_id:integer,instance_id:integer'
-	  );
-
-	  select acs_sc_msg_type__new(
-	    /* msg_type_name */ 'portal_datasource.RemoveSelfFromPage.OutputType',
-	    /* msg_type_spec */ ''
-	  );
-	  
-	  select acs_sc_operation__new (
-		    'portal_datasource',
-		    'RemoveSelfFromPage',
-		    ' remove itself from the given page',
-		    'f', -- not cacheable
-		    2,   -- n_args
-		    'portal_datasource.RemoveSelfFromPage.InputType',
-		    'portal_datasource.RemoveSelfFromPage.OutputType'
-	  );
+drop function inline_0();
