Index: openacs-4/packages/news/sql/postgresql/news-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/sql/postgresql/news-package-create.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/news/sql/postgresql/news-package-create.sql	24 Feb 2005 18:03:04 -0000	1.1
+++ openacs-4/packages/news/sql/postgresql/news-package-create.sql	26 Mar 2005 13:49:55 -0000	1.2
@@ -7,6 +7,8 @@
 -- OpenACS Port: Robert Locke (rlocke@infiniteinfo.com)
 
 -- *** PACKAGE NEWS, plsql to create content_item ***
+select define_function_args ('news__new','item_id,locale,publish_date,text,nls_language,title,mime_type;text/plain,package_id,archive_date,approval_user,approval_date,approval_ip,relation_tag,creation_ip,creation_user,is_live_p;f,lead');
+
 create or replace function news__new (integer,varchar,timestamptz,text,varchar,varchar,
        varchar,integer,timestamptz,integer,timestamptz,varchar,varchar,
        varchar,integer,boolean, varchar)
@@ -37,7 +39,7 @@
     p_creation_user alias for $15; -- default null
     --
     p_is_live_p     alias for $16; -- default ''f''
-    p_lead          alias for $17; -- default ''f''
+    p_lead          alias for $17;
 
     v_news_id       integer;
     v_item_id       integer;
@@ -47,25 +49,23 @@
     v_name          varchar;
     v_log_string    varchar;
 begin
-    select content_item__get_id(''news'',null,''f'') 
-    into   v_parent_id 
-    from   dual;    
+    select content_item__get_id(''news'',null,''f'')
+    into   v_parent_id
+    from   dual;
     --
     -- this will be used for 2xClick protection
     if p_item_id is null then
-        select acs_object_id_seq.nextval 
-        into   v_id 
+        select acs_object_id_seq.nextval
+        into   v_id
         from   dual;
-    else 
+    else
         v_id := p_item_id;
-    end if; 
+    end if;
     --
-    select ''news'' || to_char(current_timestamp,''YYYYMMDD'') || v_id 
-    into   v_name 
-    from   dual;    
-    -- 
-    v_log_string := ''initial submission''; 
-    -- 
+    v_name := ''news-'' || to_char(current_timestamp,''YYYYMMDD'') || ''-'' || v_id;
+    --
+    v_log_string := ''initial submission'';
+    --
     v_item_id := content_item__new(
         v_name,               -- name
         v_parent_id,          -- parent_id
@@ -77,15 +77,18 @@
         p_creation_ip,        -- creation_ip
         ''content_item'',     -- item_subtype
         ''news'',             -- content_type
-	null,                 -- title
+        p_title,              -- title
 	null,                 -- description
         p_mime_type,          -- mime_type
         p_nls_language,       -- nls_language
+        null,                 -- text
 	null,                 -- data
-	''text''	      -- storage_type
-        -- relation tag is not used by any callers or any
-        -- implementations of content_item__new
+        null,                 -- relation_tag
+        p_is_live_p,          -- live_p
+	''text'',	      -- storage_type
+        p_package_id          -- package_id
     );
+
     v_revision_id := content_revision__new(
         p_title,           -- title
         v_log_string,      -- description
@@ -99,38 +102,41 @@
         p_creation_user,   -- creation_user
         p_creation_ip      -- creation_ip
     );
-    insert into cr_news 
-        (news_id, 
+
+    insert into cr_news
+        (news_id,
          lead,
-         package_id, 
+         package_id,
          archive_date,
-         approval_user, 
-         approval_date, 
+         approval_user,
+         approval_date,
          approval_ip)
     values
-        (v_revision_id, 
+        (v_revision_id,
          p_lead,
-         p_package_id, 
+         p_package_id,
          p_archive_date,
-         p_approval_user, 
-         p_approval_date, 
+         p_approval_user,
+         p_approval_date,
          p_approval_ip);
     -- make this revision live when immediately approved
     if p_is_live_p = ''t'' then
-        update 
+        update
             cr_items
         set
             live_revision = v_revision_id,
             publish_status = ''ready''
-        where 
+        where
             item_id = v_item_id;
     end if;
     v_news_id := v_revision_id;
+
     return v_news_id;
 end;
 ' language 'plpgsql';
 
 
+
 -- deletes a news item along with all its revisions and possible attachements
 create or replace function news__delete (integer)
 returns integer as '
