Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql,v
diff -u -r1.21 -r1.22
--- openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql	12 Mar 2004 18:48:47 -0000	1.21
+++ openacs-4/packages/acs-content-repository/sql/postgresql/content-keyword.sql	20 Mar 2005 13:41:51 -0000	1.22
@@ -8,6 +8,7 @@
 -- License.  Full text of the license is available from the GNU Project:
 -- http://www.fsf.org/copyleft/gpl.html
 
+select define_function_args ('content_keyword__get_heading','keyword_id');
 create or replace function content_keyword__get_heading (integer)
 returns text as '
 declare
@@ -24,6 +25,7 @@
 
 
 -- function get_description
+select define_function_args ('content_keyword__get_description','keyword_id');
 create or replace function content_keyword__get_description (integer)
 returns text as '
 declare
@@ -40,6 +42,7 @@
 
 
 -- procedure set_heading
+select define_function_args ('content_keyword__set_heading','keyword_id,heading');
 create or replace function content_keyword__set_heading (integer,varchar)
 returns integer as '
 declare
@@ -61,6 +64,7 @@
 
 
 -- procedure set_description
+select define_function_args ('content_keyword__set_description','keyword_id,description');
 create or replace function content_keyword__set_description (integer,varchar)
 returns integer as '
 declare
@@ -78,6 +82,7 @@
 
 
 -- function is_leaf
+select define_function_args ('content_keyword__is_leaf','keyword_id');
 create or replace function content_keyword__is_leaf (integer)
 returns boolean as '
 declare
@@ -166,7 +171,8 @@
 end;' language 'plpgsql';
 
 -- procedure delete
-create or replace function content_keyword__delete (integer)
+select define_function_args ('content_keyword__del','keyword_id');
+create or replace function content_keyword__del (integer)
 returns integer as '
 declare
   delete__keyword_id             alias for $1;  
@@ -183,8 +189,19 @@
   return 0; 
 end;' language 'plpgsql';
 
+create or replace function content_keyword__delete (integer)
+returns integer as '
+declare
+  delete__keyword_id             alias for $1;  
+  v_rec                          record; 
+begin
+  perform content_keyword__del(delete__keyword_id);
+  return 0; 
+end;' language 'plpgsql';
 
+
 -- procedure item_assign
+select define_function_args ('content_keyword__item_assign','item_id,keyword_id,context_id;null,creation_user;null,creation_ip;null');
 create or replace function content_keyword__item_assign (integer,integer,integer,integer,varchar)
 returns integer as '
 declare
@@ -216,6 +233,7 @@
 
 
 -- procedure item_unassign
+select define_function_args ('content_keyword__item_unassign','item_id,keyword_id');
 create or replace function content_keyword__item_unassign (integer,integer)
 returns integer as '
 declare
@@ -232,6 +250,7 @@
 
 
 -- function is_assigned
+select define_function_args ('content_keyword__is_assigned','item_id,keyword_id,recurse;none');
 create or replace function content_keyword__is_assigned (integer,integer,varchar)
 returns boolean as '
 declare
@@ -287,6 +306,7 @@
 
 
 -- function get_path
+select define_function_args ('content_keyword__get_path','keyword_id');
 create or replace function content_keyword__get_path (integer)
 returns text as '
 declare
@@ -325,47 +345,6 @@
     return v_path;
   end if;
  
-end;' language 'plpgsql';
-
-
-create or replace function content_keyword__get_path (integer)
-returns text as '
-declare
-  get_path__keyword_id             alias for $1;  
-  v_path                          text default '''';
-  v_is_found                      boolean default ''f'';   
-  v_heading                       cr_keywords.heading%TYPE;
-  v_rec                           record;
-begin
---               select
---                 heading 
---               from (
---                  select 
---                    heading, level as tree_level
---                  from cr_keywords
---                    connect by prior parent_id = keyword_id
---                    start with keyword_id = get_path.keyword_id) k 
---                order by 
---                  tree_level desc 
-
-  for v_rec in select heading 
-               from (select k2.heading, tree_level(k2.tree_sortkey) as tree_level
-                     from cr_keywords k1, cr_keywords k2
-                     where k1.keyword_id = get_path__keyword_id
-                       and k1.tree_sortkey between k2.tree_sortkey and tree_right(k2.tree_sortkey)) k
-                order by tree_level desc 
-  LOOP
-      v_heading := v_rec.heading;
-      v_is_found := ''t'';
-      v_path := v_path || ''/'' || v_heading;
-  end LOOP;
-
-  if v_is_found = ''f'' then
-    return null;
-  else
-    return v_path;
-  end if;
- 
 end;' language 'plpgsql' stable strict;
 
 
