Index: openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 21 Dec 2004 18:22:33 -0000 1.7.2.1 +++ openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 30 Dec 2004 21:01:26 -0000 1.7.2.2 @@ -40,7 +40,9 @@ revision. There are procedures for each other base content item. This procdedure uses package_instantiate object. Under PostgreSQL the object_type new function must be registered with - define_function_args. + define_function_args. If title, description, text, or data are + specified a content revision will also be created. + @param name @param item_id - item_id of this content_item. If this is not @@ -54,7 +56,9 @@ @param creation_date - defaults to current date and time @param storage_type - file, lob, or text (postgresql only) @param locale - - + @param title - title of content_revision to be created + @param description of content_revision to be created + @param text - text of content revision to be created @param attributes - A list of pairs of additional attributes and their values to pass to the constructor. Each pair is a list of two elements: key => value @return item_id of the new content item Index: openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 21 Dec 2004 18:22:33 -0000 1.2.2.1 +++ openacs-4/packages/acs-content-repository/tcl/test/content-item-test-procs.tcl 30 Dec 2004 21:01:26 -0000 1.2.2.2 @@ -45,9 +45,21 @@ set returned_first_item_id [content::item::new \ -name "test_item_one" \ -item_id $first_item_id \ - -parent_id $first_folder_id] + -parent_id $first_folder_id \ + -title "Title" + ] aa_true "First item created" [expr $first_item_id == $returned_first_item_id] + aa_true "First item exists" [expr $first_item_id == \ + [db_string get_item \ + "select item_id from + cr_items where item_id=:first_item_id"]] + aa_true "First item's revision exists" \ + [expr \ + {![string equal "" \ + [db_string get_revision "select + latest_revision + from cr_items, cr_revisions where latest_revision=revision_id and cr_items.item_id=:first_item_id" -default ""]]}] # check the folder is not empty now. set is_empty [content::folder::is_empty -folder_id $first_folder_id]