-- sql/defaults.sql
--
-- The data that distributes with portal.
--
-- Ian Baker <ibaker@arsdigita.com>
-- $Id: defaults.sql,v 1.1 2002/07/09 17:35:10 rmello Exp $
--

-- populate the portal_content_types table.
insert
    into portal_mime_types (name, pretty_name, sort_key)
    values ('text/html', 'HTML', 1);

insert
    into portal_mime_types (name, pretty_name, sort_key)
    values ('text/plain', 'Plain Text', 2);

insert
    into portal_mime_types (name, pretty_name, sort_key)
    values ('application/x-ats', 'ATS Template Ref', 3);

-- populate the portal_data_types table.
--
-- the difference between tcl_proc and tcl_raw is that
-- it's possible to pass parameters to a procedure, so
-- element attributes can be sent to it.

insert
    into portal_data_types (name, pretty_name, sort_key)
    values ('tcl_proc', 'Tcl Procedure', 1);

insert
    into portal_data_types (name, pretty_name, sort_key)
    values ('tcl_raw', 'Raw Tcl', 2);

insert
    into portal_data_types (name, pretty_name, sort_key)
    values ('plsql', 'Oracle PL/SQL Procedure', 4);

insert
    into portal_data_types (name, pretty_name, sort_key)
    values ('adp', 'AOLserver ADP', 3);

insert
    into portal_data_types (name, pretty_name, sort_key, secure_p)
    values ('raw', 'Raw Data', 5, 't');

insert
    into portal_data_types (name, pretty_name, sort_key)
    values ('url', 'URL', 6);



-- ampersands break if I don't do this.
set scan off

-- Insert some default templates.

declare
	template_id	portal_templates.template_id%TYPE;
begin

-- two-column template, without a header.
	template_id := portal_template.new (
		name => 'Simple 2-Column',
		description => 'A simple 2-column layout',
		type => 'layout',
		filename => 'templates/simple2',
		resource_dir => 'templates/components/simple2');

-- the supported regions for that template.
	portal_template.add_region (template_id => template_id, region => '1');
	portal_template.add_region (template_id => template_id, region => '2');

-- same as above, only, three columns.
	template_id := portal_template.new (
		name => 'Simple 3-Column',
		description => 'A simple 3-column layout',
		type => 'layout',
		filename => 'templates/simple3',
		resource_dir => 'templates/components/simple3');

	portal_template.add_region (template_id => template_id, region => '1');
	portal_template.add_region (template_id => template_id, region => '2');
	portal_template.add_region (template_id => template_id, region => '3');

-- three columns with a header.
	template_id := portal_template.new (
		name => '3-column w/ Header',
		description => 'A 3-column layout with a header area.',
		type => 'layout',
		filename => 'templates/header3',
		resource_dir => 'templates/components/header3');

	portal_template.add_region (template_id => template_id, region => '1');
	portal_template.add_region (template_id => template_id, region => '2');
	portal_template.add_region (template_id => template_id, region => '3');
	portal_template.add_region (template_id => template_id, region => 'i1', immutable_p => 't');

-- Now, some element themes.

	template_id := portal_template.new (
		name => 'Simple table-based thing',
		description => 'A test template.  Pretty crappy overall',
		type => 'theme',
		filename => 'templates/simple-element',
		resource_dir => 'templates/components/simple-element');

	portal_template.add_type ( template_id => template_id, mime_type => 'text/html' );
	portal_template.add_type ( template_id => template_id, mime_type => 'text/plain' );
	portal_template.add_type ( template_id => template_id, mime_type => 'application/x-ats' );
end;
/


-- create a test ds.
declare
	datasource_id	portal_datasources.datasource_id%TYPE;
begin
	datasource_id := portal_datasource.new (
		data_type => 'raw',
		mime_type => 'application/x-ats',
		name => 'Portal Connector',
		description => 'Connects the current portal with others at the same level on the site-map.',
		content_varchar => '/packages/portal/www/datasources/connector/connector'
	);

end;
/

commit;
