Index: openacs-4/packages/file-storage/sql/oracle/file-storage-simple-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/Attic/file-storage-simple-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/file-storage/sql/oracle/file-storage-simple-create.sql 4 Apr 2002 17:37:24 -0000 1.3 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-simple-create.sql 17 Jul 2002 20:09:47 -0000 1.4 @@ -44,7 +44,8 @@ pretty_name => 'File Storage Simple Object', pretty_plural => 'File Storage Simple Objects', table_name => 'fs_simple_objects', - id_column => 'object_id' + id_column => 'object_id', + name_method => 'fs_simple_object.name' ); -- links Index: openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/Attic/file-storage-simple-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql 29 May 2002 23:02:19 -0000 1.4 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql 17 Jul 2002 20:09:47 -0000 1.5 @@ -12,6 +12,7 @@ create or replace package fs_simple_object as + function new ( object_id in fs_simple_objects.object_id%TYPE default NULL, object_type in acs_objects.object_type%TYPE default 'fs_simple_object', @@ -27,12 +28,18 @@ procedure delete ( object_id in fs_simple_objects.object_id%TYPE ); + + function name ( + object_id in fs_simple_objects.object_id%TYPE + ) return fs_simple_objects.name%TYPE; + end fs_simple_object; / show errors create or replace package body fs_simple_object as + function new ( object_id in fs_simple_objects.object_id%TYPE default NULL, object_type in acs_objects.object_type%TYPE default 'fs_simple_object', @@ -45,7 +52,7 @@ context_id in acs_objects.context_id%TYPE ) return fs_simple_objects.object_id%TYPE is - v_object_id acs_objects.object_id%TYPE; + v_object_id acs_objects.object_id%TYPE; begin v_object_id:= acs_object.new ( object_id => object_id, @@ -73,12 +80,27 @@ acs_object.delete(object_id); end delete; + function name ( + object_id in fs_simple_objects.object_id%TYPE + ) return fs_simple_objects.name%TYPE + is + v_name fs_simple_objects.name%TYPE; + begin + select name + into v_name + from fs_simple_objects + where object_id = fs_simple_object.name.object_id; + + return v_name; + end name; + end fs_simple_object; / show errors create or replace package fs_url as + function new ( url_id in fs_urls.url_id%TYPE default NULL, object_type in acs_objects.object_type%TYPE default 'fs_url', @@ -107,6 +129,7 @@ create or replace package body fs_url as + function new ( url_id in fs_urls.url_id%TYPE default NULL, object_type in acs_objects.object_type%TYPE default 'fs_url', Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/Attic/file-storage-simple-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-create.sql 4 Apr 2002 03:01:06 -0000 1.2 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-create.sql 17 Jul 2002 20:09:47 -0000 1.3 @@ -46,7 +46,7 @@ NULL, 'f', NULL, - NULL + 'fs_simple_object.name' ); -- links Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/Attic/file-storage-simple-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 29 May 2002 23:02:19 -0000 1.4 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql 17 Jul 2002 20:09:47 -0000 1.5 @@ -10,12 +10,8 @@ -- @cvs-id $Id$ -- - select define_function_args('fs_simple_object__new','object_id,object_type;fs_simple_object,folder_id,name,description,creation_date,creation_user,creation_ip,context_id'); -select define_function_args('fs_simple_object__delete','object_id'); - - create function fs_simple_object__new(integer,varchar,integer,varchar,varchar,timestamp,integer,varchar,integer) returns integer as ' DECLARE @@ -42,16 +38,16 @@ insert into fs_simple_objects (object_id, folder_id, name, description) values (v_object_id, p_folder_id, p_name, p_description); - + acs_object__update_last_modified(p_folder_id); return v_object_id; - + END; ' language 'plpgsql'; +select define_function_args('fs_simple_object__delete','object_id'); - create function fs_simple_object__delete(integer) returns integer as ' DECLARE @@ -63,15 +59,25 @@ END; ' language 'plpgsql'; +select define_function_args('fs_simple_object__name', 'object_id'); +create function fs_simple_object__name(integer) +returns integer as ' +declare + p_object_id alias from $1; +begin + return name + from fs_simple_objects + where object_id = p_object_id; +end; +' language 'plpgsql'; select define_function_args('fs_url__new','url_id,object_type;fs_url,url,folder_id,name,description,creation_date,creation_user,creation_ip,context_id'); select define_function_args('fs_url__delete','url_id'); select define_function_args('fs_url__copy','url_id;target_object_id'); - create function fs_url__new(integer,varchar,varchar,integer,varchar,varchar,timestamp,integer,varchar,integer) returns integer as ' DECLARE @@ -98,7 +104,7 @@ p_creation_ip, p_context_id ); - + insert into fs_urls (url_id, url) values (v_url_id, p_url); @@ -171,7 +177,7 @@ v_creation_ip, p_target_folder_id ); - + return v_new_url_id; END; ' language 'plpgsql';