Index: openacs-4/packages/new-portal/sql/oracle/datasource-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/datasource-sc-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/new-portal/sql/oracle/datasource-sc-create.sql 29 Mar 2002 18:48:28 -0000 1.5 +++ openacs-4/packages/new-portal/sql/oracle/datasource-sc-create.sql 9 May 2002 04:04:05 -0000 1.6 @@ -15,295 +15,174 @@ -- -- 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). -- -- arjun@openforce.net -- started November, 2001 -- -- $Id$ declare - sc_dotlrn_contract integer; - foo integer; + sc_dotlrn_contract integer; + foo integer; begin - sc_dotlrn_contract := acs_sc_contract.new ( - contract_name => 'portal_datasource', - contract_desc => 'Portal Datasource interface' - ); + sc_dotlrn_contract := acs_sc_contract.new ( + contract_name => 'portal_datasource', + contract_desc => 'Portal Datasource interface' + ); + + -- Get my name - not to be confused with the pretty_name + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.GetMyName.InputType', + msg_type_spec => '' + ); + + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.GetMyName.OutputType', + msg_type_spec => 'my_name:string' + ); + + foo := 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 a pretty name + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.GetPrettyName.InputType', + msg_type_spec => '' + ); + + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.GetPrettyName.OutputType', + msg_type_spec => 'pretty_name:string' + ); + + foo := 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? + -- ** not currently implimented *** + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.Link.InputType', + msg_type_spec => '' + ); + + foo := acs_sc_msg_type.new ( + msg_type_name => 'portal_datasource.Link.OutputType', + msg_type_spec => 'pretty_name:string' + ); + + foo := 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' + ); - -- Get my name - not to be confused with the pretty_name - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.MyName.InputType', - msg_type_spec => '' - ); + -- AddSelfToPage: Tell the datasource to add itself to a portal + -- The "args" string is an ns_set of extra arguments + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.AddSelfToPage.InputType', + msg_type_spec => 'page_id:integer,args:string' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.AddSelfToPage.OutputType', + msg_type_spec => 'element_id:integer' + ); + + foo := acs_sc_operation.new ( + 'portal_datasource', + 'AddSelfToPage', + 'Adds itself to the given page returns an element_id', + 'f', -- not cacheable + 2, -- n_args + 'portal_datasource.AddSelfToPage.InputType', + 'portal_datasource.AddSelfToPage.OutputType' + ); - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.MyName.OutputType', - msg_type_spec => 'my_name:string' - ); + -- RemoveSelfFromPage: Tell the PE to remove itself from a page + -- The "args" string is an ns_set of extra arguments + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.RemoveSelfFromPage.InputType', + msg_type_spec => 'page_id:integer,args:string' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.RemoveSelfFromPage.OutputType', + msg_type_spec => '' + ); + + foo := 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' + ); - foo := acs_sc_operation.new ( - 'portal_datasource', - 'MyName', - 'Get the name', - 't', -- not cacheable - 0, -- n_args - 'portal_datasource.MyName.InputType', - 'portal_datasource.MyName.OutputType' - ); + -- Show: the portal element's display proc + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.Show.InputType', + msg_type_spec => 'cf:string' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.Show.OutputType', + msg_type_spec => 'output:string' + ); + + foo := 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' + ); + -- Edit: the datasources' edit html + -- ** not currently implimented ** + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.Edit.InputType', + msg_type_spec => 'element_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'portal_datasource.Edit.OutputType', + msg_type_spec => 'output:string' + ); + + foo := 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' + ); end; / show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Get a pretty name - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.GetPrettyName.InputType', - msg_type_spec => '' - ); - - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.GetPrettyName.OutputType', - msg_type_spec => 'pretty_name:string' - ); - - foo := 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' - ); - - -end; -/ -show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Link: Where is the href target for this PE? - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.Link.InputType', - msg_type_spec => '' - ); - - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_datasource.Link.OutputType', - msg_type_spec => 'pretty_name:string' - ); - - foo := 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' - ); - - -end; -/ -show errors - - -declare - sc_dotlrn_contract integer; - foo integer; -begin - -- Tell the datasource to add itself to a portal page - -- add_self_to_page - -- The "args" string is an ns_set of extra arguments - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.AddSelfToPage.InputType', - msg_type_spec => 'page_id:integer,instance_id:integer,args:string' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.AddSelfToPage.OutputType', - msg_type_spec => 'element_id:integer' - ); - - foo := 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' - ); - -end; -/ -show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Edit: the datasources' edit html - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.Edit.InputType', - msg_type_spec => 'element_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.Edit.OutputType', - msg_type_spec => 'output:string' - ); - - foo := 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' - ); - - -end; -/ -show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Show: the portal element's display proc - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.Show.InputType', - msg_type_spec => 'cf:string' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.Show.OutputType', - msg_type_spec => 'output:string' - ); - - foo := 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' - ); - - -end; -/ -show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - -- Tell the PE to remove itself from a page - -- remove_self_from_page - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.RemoveSelfFromPage.InputType', - msg_type_spec => 'page_id:integer,instance_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.RemoveSelfFromPage.OutputType', - msg_type_spec => '' - ); - - foo := 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' - ); - - -end; -/ -show errors - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Make self available - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.MakeSelfAvailable.InputType', - msg_type_spec => 'portal_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.MakeSelfAvailable.OutputType', - msg_type_spec => '' - ); - - foo := acs_sc_operation.new ( - 'portal_datasource', - 'MakeSelfAvailable', - 'Makes this PE available to this portal page', - 'f', -- not cacheable - 1, -- n_args - 'portal_datasource.MakeSelfAvailable.InputType', - 'portal_datasource.MakeSelfAvailable.OutputType' - ); - -end; -/ -show errors - - -declare - sc_dotlrn_contract integer; - foo integer; -begin - - -- Make self unavailable - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.MakeSelfUnavailable.InputType', - msg_type_spec => 'portal_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_datasource.MakeSelfUnavailable.OutputType', - msg_type_spec => '' - ); - - foo := acs_sc_operation.new ( - 'portal_datasource', - 'MakeSelfUnavailable', - 'Makes this PE UNavailable to this portal page', - 'f', -- not cacheable - 1, -- n_args - 'portal_datasource.MakeSelfUnavailable.InputType', - 'portal_datasource.MakeSelfUnavailable.OutputType' - ); - -end; -/ -show errors Index: openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql 29 Mar 2002 18:48:28 -0000 1.5 +++ openacs-4/packages/new-portal/sql/oracle/datasource-sc-drop.sql 9 May 2002 04:04:05 -0000 1.6 @@ -31,33 +31,33 @@ op_id integer; begin - -- drop MyName + -- drop GetMyName op_id := acs_sc_operation.get_id ( contract_name => 'portal_datasource', - operation_name => 'MyName' + operation_name => 'GetMyName' ); acs_sc_operation.delete ( operation_id => op_id, contract_name => 'portal_datasource', - operation_name => 'MyName' + operation_name => 'GetMyName' ); msg_type_id := acs_sc_msg_type.get_id ( - msg_type_name => 'portal_datasource.MyName.InputType' + msg_type_name => 'portal_datasource.GetMyName.InputType' ); acs_sc_msg_type.delete ( - msg_type_name => 'portal_datasource.MyName.InputType', + msg_type_name => 'portal_datasource.GetMyName.InputType', msg_type_id => msg_type_id ); msg_type_id := acs_sc_msg_type.get_id ( - msg_type_name => 'portal_datasource.MyName.OutputType' + msg_type_name => 'portal_datasource.GetMyName.OutputType' ); acs_sc_msg_type.delete ( - msg_type_name => 'portal_datasource.MyName.OutputType', + msg_type_name => 'portal_datasource.GetMyName.OutputType', msg_type_id => msg_type_id ); Index: openacs-4/packages/new-portal/sql/oracle/portal-element-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/Attic/portal-element-sc-create.sql,v diff -u -N --- openacs-4/packages/new-portal/sql/oracle/portal-element-sc-create.sql 29 Mar 2002 18:48:28 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,192 +0,0 @@ --- --- Copyright (C) 2001, 2002 OpenForce, Inc. --- --- This file is part of dotLRN. --- --- 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 for more --- details. --- - --- 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). --- --- arjun@openforce.net --- started November, 2001 --- - -declare - sc_dotlrn_contract integer; - foo integer; -begin - sc_dotlrn_contract := acs_sc_contract.new ( - contract_name => 'portal_datasource', - contract_desc => 'Portal Datasource interface' - ); - - -- Get my name - not to be confused with the pretty_name - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_element.MyName.InputType', - msg_type_spec => '' - ); - - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_element.MyName.OutputType', - msg_type_spec => 'my_name:string' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'MyName', - 'Get the name', - 't', -- not cacheable - 0, -- n_args - 'portal_element.MyName.InputType', - 'portal_element.MyName.OutputType' - ); - - -- Get a pretty name - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_element.GetPrettyName.InputType', - msg_type_spec => '' - ); - - foo := acs_sc_msg_type.new ( - msg_type_name => 'portal_element.GetPrettyName.OutputType', - msg_type_spec => 'pretty_name:string' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'GetPrettyName', - 'Get the pretty name', - 't', -- not cacheable - 0, -- n_args - 'portal_element.GetPrettyName.InputType', - 'portal_element.GetPrettyName.OutputType' - ); - - - -- Tell the portal element to add itself to a portal page - -- add_self_to_page - -- The "args" string is an ns_set of extra arguments - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.AddSelfToPage.InputType', - msg_type_spec => 'page_id:integer,instance_id:integer,args:string' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.AddSelfToPage.OutputType', - msg_type_spec => 'element_id:integer' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'AddSelfToPage', - 'Tells the given portal element to add itself to the given page', - 'f', -- not cacheable - 3, -- n_args - 'portal_element.AddSelfToPage.InputType', - 'portal_element.AddSelfToPage.OutputType' - ); - - -- Show: the portal element's display proc - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.Show.InputType', - msg_type_spec => 'cf:string' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.Show.OutputType', - msg_type_spec => 'output:string' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'Show', - 'Render the portal element returning a chunk of HTML', - 'f', -- not cacheable - 1, -- n_args - 'portal_element.Show.InputType', - 'portal_element.Show.OutputType' - ); - - -- Tell the PE to remove itself from a page - -- remove_self_from_page - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.RemoveSelfFromPage.InputType', - msg_type_spec => 'page_id:integer,instance_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.RemoveSelfFromPage.OutputType', - msg_type_spec => '' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'RemoveSelfFromPage', - 'Tells the given portal element to remove itself from the given page', - 'f', -- not cacheable - 2, -- n_args - 'portal_element.RemoveSelfFromPage.InputType', - 'portal_element.RemoveSelfFromPage.OutputType' - ); - - - - -- Make self available - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.MakeSelfAvailable.InputType', - msg_type_spec => 'portal_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.MakeSelfAvailable.OutputType', - msg_type_spec => '' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'MakeSelfAvailable', - 'Makes this PE available to this portal page', - 'f', -- not cacheable - 1, -- n_args - 'portal_element.MakeSelfAvailable.InputType', - 'portal_element.MakeSelfAvailable.OutputType' - ); - - -- Make self unavailable - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.MakeSelfUnavailable.InputType', - msg_type_spec => 'portal_id:integer' - ); - - foo := acs_sc_msg_type.new( - msg_type_name => 'portal_element.MakeSelfUnavailable.OutputType', - msg_type_spec => '' - ); - - foo := acs_sc_operation.new ( - 'portal_element', - 'MakeSelfUnavailable', - 'Makes this PE UNavailable to this portal page', - 'f', -- not cacheable - 1, -- n_args - 'portal_element.MakeSelfAvailable.InputType', - 'portal_element.MakeSelfAvailable.OutputType' - ); - - -end; -/ -show errors