Index: openacs-4/packages/theme-selva/sql/postgresql/theme-selva-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/sql/postgresql/theme-selva-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/theme-selva/sql/postgresql/theme-selva-create.sql	18 Sep 2005 11:43:28 -0000	1.3
+++ openacs-4/packages/theme-selva/sql/postgresql/theme-selva-create.sql	8 Aug 2006 21:27:18 -0000	1.4
@@ -1,3 +1,32 @@
-UPDATE apm_parameter_values SET attr_value = '/packages/theme-selva/www/selva-master' WHERE parameter_id IN (SELECT parameter_id FROM apm_parameters WHERE parameter_name='DefaultMaster');
+-- Creating theme Selva
+
 SELECT portal_element_theme__new ('selva','Selva Theme','../../theme-selva/www/themes/selva-theme','../../theme-selva/www/themes/selva-theme');
-UPDATE portals SET theme_id = (SELECT theme_id FROM portal_element_themes WHERE name='selva');
\ No newline at end of file
+
+-- Adding site templates 
+
+create function inline_0()
+returns integer as '
+declare 
+	v_site_template_id	dotlrn_site_templates.site_template_id%TYPE;
+	v_theme_id		portal_element_themes.theme_id%TYPE;
+begin
+	select theme_id into v_theme_id 
+        from portal_element_themes 
+	where name = ''selva''; 
+	
+	select acs_object_id_seq.nextval 
+        into v_site_template_id 
+        from dual;
+
+	insert into dotlrn_site_templates
+	(site_template_id, pretty_name, site_master, portal_theme_id ) 
+	values 
+	(v_site_template_id, ''Selva Theme'',''/packages/theme-selva/www/selva-master'', v_theme_id);
+
+	return v_site_template_id;
+
+end;' language 'plpgsql';
+
+select inline_0();
+
+drop function inline_0();
