--
-- Copyright (C) 2001, 2002 MIT
--
-- 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.
--
--
-- create portal layouts package
--
-- @author arjun@openforce.net
-- @author yon@openforce.net
-- @creation-date 2001-10-01
-- @version $Id: layout-package-create.sql,v 1.1.1.1 2002/10/25 21:29:17 yon Exp $
--
select define_function_args('portal_layout__new', 'layout_id,name,description,filename,resource_dir,object_type;portal_layout,creation_date,creation_user,creation_ip,context_id');
create or replace function portal_layout__new (integer,varchar,varchar,varchar,varchar,varchar,timestamp,integer,varchar,integer)
returns integer as '
declare
p_layout_id alias for $1;
p_name alias for $2;
p_description alias for $3;
p_filename alias for $4;
p_resource_dir alias for $5;
p_object_type alias for $6;
p_creation_date alias for $7;
p_creation_user alias for $8;
p_creation_ip alias for $9;
p_context_id alias for $10;
v_layout_id portal_layouts.layout_id%TYPE;
begin
v_layout_id := acs_object__new(
p_layout_id,
p_object_type,
p_creation_date,
p_creation_user,
p_creation_ip,
p_context_id,
''t''
);
insert into portal_layouts
(layout_id, name, description, filename, resource_dir)
values
(v_layout_id, p_name, p_description, p_filename, p_resource_dir);
return v_layout_id;
end;' language 'plpgsql';
select define_function_args('portal_layout__delete', 'layout_id');
create or replace function portal_layout__delete (integer)
returns integer as '
p_layout_id alias for $1;
begin
delete
from portal_layouts
where layout_id = p_layout_id;
perform acs_object__delete(p_layout_id);
return 0;
end;' language 'plpgsql';