Index: openacs-4/packages/lors/sql/postgresql/lors-imscp-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/sql/postgresql/lors-imscp-package-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lors/sql/postgresql/lors-imscp-package-create.sql	22 Apr 2004 03:42:06 -0000	1.1
+++ openacs-4/packages/lors/sql/postgresql/lors-imscp-package-create.sql	4 Sep 2004 14:04:07 -0000	1.2
@@ -36,7 +36,9 @@
     timestamp with time zone, -- creation_date
     integer,   -- creation_user
     varchar,    -- creation_ip
-    integer    -- package_id
+    integer,    -- package_id
+    integer,    -- community_id
+    varchar     -- class_key
 )
 returns integer as '
 declare
@@ -49,11 +51,13 @@
     p_parent_man_id         alias for $7;
     p_isscorm               alias for $8;
     p_folder_id             alias for $9;
-    p_fs_package_id            alias for $10;
+    p_fs_package_id         alias for $10;
     p_creation_date         alias for $11;
     p_creation_user         alias for $12;
     p_creation_ip           alias for $13;
     p_package_id            alias for $14;
+    p_community_id          alias for $15;
+    p_class_key             alias for $16;
 
     v_man_id       integer;
 begin
@@ -72,6 +76,14 @@
         values
         (v_man_id, p_course_name, p_identifier, p_version, p_orgs_default, p_hasmetadata, p_parent_man_id, p_isscorm, p_folder_id, p_fs_package_id);
 
+	-- now we add it to the manifest_class relation table
+
+	insert into ims_cp_manifest_class
+	(man_id, lorsm_instance_id, community_id, class_key, isenabled, istrackable)
+	values
+	(v_man_id, p_package_id, p_community_id, p_class_key, ''t'', ''f'');
+
+
         return v_man_id;
 end;
 ' language 'plpgsql';
@@ -373,4 +385,34 @@
 
     return p_file_id;
 end;
-' language 'plpgsql';
\ No newline at end of file
+' language 'plpgsql';
+
+
+-- put in and correct some stuff for ims_cp_items
+
+-- function name
+create or replace function ims_item__name (integer)
+returns varchar as '
+declare
+  name__object_id        alias for $1;  
+  v_title                ims_cp_items.title%TYPE;  
+  v_object_id            integer;
+begin
+
+  select title 
+  into v_title
+  from ims_cp_items
+  where item_id = name__object_id;
+
+  return v_title;
+  
+end;' language 'plpgsql' stable strict;
+
+
+update acs_object_types
+set table_name = 'ims_cp_items',
+    name_method = 'ims_item__name',
+    pretty_name = 'IMS Item',
+    pretty_plural = 'IMS Items'
+where object_type = 'ims_item';
+
