Index: openacs-4/packages/acs-bootstrap-installer/installer/install-data-model.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/Attic/install-data-model.tcl,v diff -u -r1.5.4.1 -r1.5.4.2 --- openacs-4/packages/acs-bootstrap-installer/installer/install-data-model.tcl 5 Mar 2003 14:41:49 -0000 1.5.4.1 +++ openacs-4/packages/acs-bootstrap-installer/installer/install-data-model.tcl 20 Mar 2003 22:09:52 -0000 1.5.4.2 @@ -72,7 +72,7 @@

-This might really take a few minutes, depending on your machine. Have a cup of coffee or beer or whatever and be patient. Thanks. +This might really take a few minutes, depending on your machine. Please be patient. Thanks.

Index: openacs-4/packages/acs-content-repository/acs-content-repository.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/acs-content-repository.info,v diff -u -r1.17.2.5 -r1.17.2.6 --- openacs-4/packages/acs-content-repository/acs-content-repository.info 5 Mar 2003 14:49:00 -0000 1.17.2.5 +++ openacs-4/packages/acs-content-repository/acs-content-repository.info 20 Mar 2003 22:10:07 -0000 1.17.2.6 @@ -6,168 +6,24 @@ ACS Content Repository Services t t - - - - oracle - postgresql - + + Karl Goldstein Dan Wickstrom

A canonical repository for all OpenACS content. 2002-10-27 OpenACS - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Index: openacs-4/packages/acs-content-repository/sql/oracle/content-extlink.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-extlink.sql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/acs-content-repository/sql/oracle/content-extlink.sql 24 Mar 2001 22:00:48 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-extlink.sql 20 Mar 2003 22:10:27 -0000 1.1.4.1 @@ -100,8 +100,62 @@ end is_extlink; +procedure copy ( + extlink_id in cr_extlinks.extlink_id%TYPE, + target_folder_id in cr_folders.folder_id%TYPE, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE default null +) is + v_current_folder_id cr_folders.folder_id%TYPE; + v_name cr_items.name%TYPE; + v_url cr_extlinks.url%TYPE; + v_label cr_extlinks.label%TYPE; + v_description cr_extlinks.description%TYPE; + v_extlink_id cr_extlinks.extlink_id%TYPE; +begin + + if content_folder.is_folder(copy.target_folder_id) = 't' then + select + parent_id + into + v_current_folder_id + from + cr_items + where + item_id = copy.extlink_id; + + -- can't copy to the same folder + if copy.target_folder_id ^= v_current_folder_id then + + select + i.name, e.url, e.label, e.description + into + v_name, v_url, v_label, v_description + from + cr_extlinks e, cr_items i + where + e.extlink_id = i.item_id + and + e.extlink_id = copy.extlink_id; + + if content_folder.is_registered(copy.target_folder_id, 'content_extlink') = 't' then + + v_extlink_id := content_extlink.new( + parent_id => copy.target_folder_id, + name => v_name, + label => v_label, + description => v_description, + url => v_url, + creation_user => copy.creation_user, + creation_ip => copy.creation_ip + ); + + end if; + end if; + end if; +end copy; + end content_extlink; / show errors - Index: openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql 27 Feb 2003 13:45:29 -0000 1.10.2.1 +++ openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql 20 Mar 2003 22:10:27 -0000 1.10.2.2 @@ -1286,6 +1286,14 @@ creation_user => copy2.creation_user, creation_ip => copy2.creation_ip ); + -- call content_extlink.copy if the item is a extlink + elsif content_extlink.is_extlink(copy2.item_id) = 't' then + content_extlink.copy( + extlink_id => copy2.item_id, + target_folder_id => copy2.target_folder_id, + creation_user => copy2.creation_user, + creation_ip => copy2.creation_ip + ); -- make sure the target folder is really a folder elsif content_folder.is_folder(copy2.target_folder_id) = 't' then Index: openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql 25 May 2002 14:30:02 -0000 1.7 +++ openacs-4/packages/acs-content-repository/sql/oracle/packages-create.sql 20 Mar 2003 22:10:27 -0000 1.7.2.1 @@ -1142,6 +1142,12 @@ item_id in cr_items.item_id%TYPE ) return char; +procedure copy ( + extlink_id in cr_extlinks.extlink_id%TYPE, + target_folder_id in cr_folders.folder_id%TYPE, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE default null +); end content_extlink; / Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/sql/oracle/upgrade/upgrade-4.6.4-4.6.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-extlink.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-extlink.sql,v diff -u -r1.7.4.2 -r1.7.4.3 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-extlink.sql 1 Mar 2003 21:21:20 -0000 1.7.4.2 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-extlink.sql 20 Mar 2003 22:11:07 -0000 1.7.4.3 @@ -10,8 +10,6 @@ -- License. Full text of the license is available from the GNU Project: -- http://www.fsf.org/copyleft/gpl.html --- create or replace package body content_extlink --- function new create function content_extlink__new (varchar,varchar,varchar,varchar,integer,integer,timestamptz,integer,varchar) returns integer as ' declare @@ -70,8 +68,6 @@ end;' language 'plpgsql'; - --- procedure delete create function content_extlink__delete (integer) returns integer as ' declare @@ -87,7 +83,6 @@ end;' language 'plpgsql'; --- function is_extlink create function content_extlink__is_extlink (integer) returns boolean as ' declare @@ -106,8 +101,66 @@ end;' language 'plpgsql'; +create function content_extlink__copy (integer,integer,integer,varchar) +returns integer as ' +declare + copy__extlink_id alias for $1; + copy__target_folder_id alias for $2; + copy__creation_user alias for $3; + copy__creation_ip alias for $4; -- default null + v_current_folder_id cr_folders.folder_id%TYPE; + v_name cr_items.name%TYPE; + v_url cr_extlinks.url%TYPE; + v_description cr_extlinks.description%TYPE; + v_label cr_extlinks.label%TYPE; + v_extlink_id cr_extlinks.extlink_id%TYPE; +begin + if content_folder__is_folder(copy__target_folder_id) = ''t'' then + select + parent_id + into + v_current_folder_id + from + cr_items + where + item_id = copy__extlink_id; --- show errors + -- can''t copy to the same folder + if copy__target_folder_id != v_current_folder_id then + select + i.name, e.url, e.description, e.label + into + v_name, v_url, v_description, v_label + from + cr_extlinks e, cr_items i + where + e.extlink_id = i.item_id + and + e.extlink_id = copy__extlink_id; + if content_folder__is_registered(copy__target_folder_id, + ''content_extlink'',''f'') = ''t'' then + + v_extlink_id := content_extlink__new( + v_name, + v_url, + v_label, + v_description, + copy__target_folder_id, + null, + current_timestamp, + copy__creation_user, + copy__creation_ip + ); + + end if; + end if; + end if; + + return 0; +end;' language 'plpgsql'; + + + Index: openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql,v diff -u -r1.39.2.3 -r1.39.2.4 --- openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 1 Mar 2003 21:21:20 -0000 1.39.2.3 +++ openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql 20 Mar 2003 22:11:07 -0000 1.39.2.4 @@ -26,17 +26,6 @@ else --- select --- item_id into v_folder_id --- from --- cr_items --- where --- parent_id = 0 --- connect by --- prior parent_id = item_id --- start with --- item_id = get_root_folder__item_id; - select i2.item_id into v_folder_id from cr_items i1, cr_items i2 where i2.parent_id = 0 @@ -52,8 +41,6 @@ end;' language 'plpgsql'; - --- function new create function content_item__new (varchar,integer,integer,varchar,timestamptz,integer,integer,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar,varchar) returns integer as ' declare @@ -73,8 +60,6 @@ new__nls_language alias for $14; -- default null new__text alias for $15; -- default null new__storage_type alias for $16; -- check in (''text'',''file'') --- relation_tag alias for $17; --- is_live alias for $18; new__relation_tag varchar default null; new__is_live boolean default ''f''; @@ -231,8 +216,6 @@ new__nls_language alias for $14; -- default null -- changed to integer for blob_id new__data alias for $15; -- default null --- relation_tag alias for $17; --- is_live alias for $18; new__relation_tag varchar default null; new__is_live boolean default ''f''; @@ -577,7 +560,6 @@ end;' language 'plpgsql'; --- function is_published create function content_item__is_published (integer) returns boolean as ' declare @@ -598,7 +580,6 @@ end;' language 'plpgsql'; --- function is_publishable create function content_item__is_publishable (integer) returns boolean as ' declare @@ -706,7 +687,6 @@ end;' language 'plpgsql'; --- function is_valid_child create function content_item__is_valid_child (integer,varchar) returns boolean as ' declare @@ -769,7 +749,7 @@ 5) delete all permissions associated with this item 6) delete keyword associations 7) delete all associated comments */ --- procedure delete + create function content_item__delete (integer) returns integer as ' declare @@ -895,7 +875,6 @@ end;' language 'plpgsql'; --- procedure rename create function content_item__rename (integer,varchar) returns integer as ' declare @@ -931,7 +910,6 @@ return 0; end;' language 'plpgsql'; --- function get_id create function content_item__get_id (varchar,integer,boolean) returns integer as ' declare @@ -1013,10 +991,6 @@ return child_id; --- exception --- when NO_DATA_FOUND then --- return null; - end;' language 'plpgsql'; create sequence content_item_gp_session_id; @@ -1284,7 +1258,6 @@ end;' language 'plpgsql'; --- function get_virtual_path create function content_item__get_virtual_path (integer,integer) returns varchar as ' declare @@ -1310,14 +1283,10 @@ end if; return v_path; --- exception --- when NO_DATA_FOUND then --- return null; end;' language 'plpgsql'; --- procedure write_to_file create function content_item__write_to_file (integer,varchar) returns integer as ' declare @@ -1345,7 +1314,6 @@ end;' language 'plpgsql'; --- procedure register_template create function content_item__register_template (integer,integer,varchar) returns integer as ' declare @@ -1378,7 +1346,6 @@ end;' language 'plpgsql'; --- procedure unregister_template create function content_item__unregister_template (integer,integer,varchar) returns integer as ' declare @@ -1419,7 +1386,6 @@ end;' language 'plpgsql'; --- function get_template create function content_item__get_template (integer,varchar) returns integer as ' declare @@ -1467,7 +1433,6 @@ end;' language 'plpgsql'; --- function get_content_type create function content_item__get_content_type (integer) returns varchar as ' declare @@ -1491,7 +1456,6 @@ end;' language 'plpgsql'; --- function get_live_revision create function content_item__get_live_revision (integer) returns integer as ' declare @@ -1544,7 +1508,6 @@ return 0; end;' language 'plpgsql'; --- procedure set_live_revision create function content_item__set_live_revision (integer,varchar) returns integer as ' declare @@ -1576,7 +1539,6 @@ end;' language 'plpgsql'; --- procedure unset_live_revision create function content_item__unset_live_revision (integer) returns integer as ' declare @@ -1604,7 +1566,6 @@ end;' language 'plpgsql'; --- procedure set_release_period create function content_item__set_release_period (integer, timestamptz, timestamptz) returns integer as ' declare @@ -1637,7 +1598,6 @@ end;' language 'plpgsql'; --- function get_revision_count create function content_item__get_revision_count (integer) returns integer as ' declare @@ -1657,7 +1617,6 @@ end;' language 'plpgsql'; --- function get_context create function content_item__get_context (integer) returns integer as ' declare @@ -1689,7 +1648,6 @@ -- to the target folder -- 3) update the parent_id for the item --- procedure move create function content_item__move (integer,integer) returns integer as ' declare @@ -1722,7 +1680,6 @@ end;' language 'plpgsql'; --- procedure copy create function content_item__copy (integer,integer,integer,varchar) returns integer as ' declare @@ -1747,7 +1704,6 @@ -- 3) create a new item with no revisions in the target folder -- 4) copy the latest revision from the original item to the new item (if any) --- function copy2 create function content_item__copy2 (integer,integer,integer,varchar) returns integer as ' declare @@ -1784,6 +1740,14 @@ copy2__creation_user, copy2__creation_ip ); + -- call content_extlink.copy if the item is an url + else if content_extlink__is_extlink(copy2__item_id) = ''t'' then + PERFORM content_extlink__copy( + copy2__item_id, + copy2__target_folder_id, + copy2__creation_user, + copy2__creation_ip + ); -- make sure the target folder is really a folder else if content_folder__is_folder(copy2__target_folder_id) = ''t'' then @@ -1859,14 +1823,13 @@ end if; - end if; end if; end if; + end if; end if; end if; end if; return v_item_id; end;' language 'plpgsql'; --- function get_latest_revision create function content_item__get_latest_revision (integer) returns integer as ' declare @@ -1899,7 +1862,6 @@ end;' language 'plpgsql' with (isstrict); --- function get_best_revision create function content_item__get_best_revision (integer) returns integer as ' declare @@ -1925,7 +1887,6 @@ end;' language 'plpgsql'; --- function get_title create function content_item__get_title (integer,boolean) returns varchar as ' declare @@ -1982,7 +1943,6 @@ end;' language 'plpgsql'; --- function get_publish_date create function content_item__get_publish_date (integer,boolean) returns timestamptz as ' declare @@ -2021,7 +1981,6 @@ end;' language 'plpgsql'; --- function is_subclass create function content_item__is_subclass (varchar,varchar) returns boolean as ' declare @@ -2033,15 +1992,6 @@ v_subclass_p := ''f''; --- select --- object_type --- from --- acs_object_types --- connect by --- prior object_type = supertype --- start with --- object_type = is_subclass__supertype - for v_inherit_val in select o.object_type from acs_object_types o, acs_object_types o2 where o2.object_type = is_subclass__supertype @@ -2058,7 +2008,6 @@ end;' language 'plpgsql'; --- function relate create function content_item__relate (integer,integer,varchar,integer,varchar) returns integer as ' declare @@ -2154,7 +2103,6 @@ end;' language 'plpgsql'; --- procedure unrelate create function content_item__unrelate (integer) returns integer as ' declare @@ -2171,7 +2119,6 @@ end;' language 'plpgsql'; --- function is_index_page create function content_item__is_index_page (integer,integer) returns boolean as ' declare @@ -2187,7 +2134,6 @@ end;' language 'plpgsql'; --- function get_parent_folder create function content_item__get_parent_folder (integer) returns integer as ' declare @@ -2217,7 +2163,6 @@ end;' language 'plpgsql'; --- show errors -- Trigger to maintain context_id in acs_objects @@ -2235,7 +2180,6 @@ create trigger cr_items_update_tr after update on cr_items for each row execute procedure cr_items_update_tr (); --- show errors -- Trigger to maintain publication audit trail create function cr_items_publish_update_tr () returns opaque as ' @@ -2261,6 +2205,3 @@ create trigger cr_items_publish_update_tr before update on cr_items for each row execute procedure cr_items_publish_update_tr (); --- show errors - - Index: openacs-4/packages/acs-content-repository/sql/postgresql/packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/packages-create.sql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/acs-content-repository/sql/postgresql/packages-create.sql 25 May 2002 14:30:02 -0000 1.4 +++ openacs-4/packages/acs-content-repository/sql/postgresql/packages-create.sql 20 Mar 2003 22:11:07 -0000 1.4.2.1 @@ -3,1755 +3,6 @@ -- \i content-util.sql \i content-update.sql --- create or replace package content_type AUTHID CURRENT_USER as --- --/** This package is used to manipulate content types and attributes --- -- --- --*/ --- --- procedure create_type ( --- --/** Create a new content type. Automatically create the attribute table --- -- for the type if the table does not already exist. --- -- @author Karl Goldstein --- -- @param content_type The name of the new type --- -- @param supertype The supertype, defaults to content_revision --- -- @param pretty_name Pretty name for the type, singular --- -- @param pretty_plural Pretty name for the type, plural --- -- @param table_name The name for the attribute table, defaults to --- -- the name of the supertype --- -- @param id_column The primary key for the table, defaults to 'XXX' --- -- @param name_method As in acs_object_type.create_type --- -- @see {acs_object_type.create_type} --- --*/ --- content_type in acs_object_types.object_type%TYPE, --- supertype in acs_object_types.object_type%TYPE --- default 'content_revision', --- pretty_name in acs_object_types.pretty_name%TYPE, --- pretty_plural in acs_object_types.pretty_plural%TYPE, --- table_name in acs_object_types.table_name%TYPE, --- id_column in acs_object_types.id_column%TYPE default 'XXX', --- name_method in acs_object_types.name_method%TYPE default null --- ); --- --- procedure drop_type ( --- --/** First drops all attributes related to a specific type, then drops type --- -- the given type. --- -- @author Simon Huynh --- -- @param content_type The content type to be dropped --- -- @param drop_children_p If 't', then the sub-types --- -- of the given content type and their associated tables --- -- are also dropped. --- --*/ --- content_type in acs_object_types.object_type%TYPE, --- drop_children_p in char default 'f', --- drop_table_p in char default 'f' --- --- ); --- --- --- function create_attribute ( --- --/** Create a new attribute for the specified type. Automatically create --- -- the column for the attribute if the column does not already exist. --- -- @author Karl Goldstein --- -- @param content_type The name of the type to alter --- -- @param attribute_name The name of the attribute to create --- -- @param pretty_name Pretty name for the new attribute, singular --- -- @param pretty_plural Pretty name for the new attribute, plural --- -- @param default_value The default value for the attribute, defaults to null --- -- @return The id of the newly created attribute --- -- @see {acs_object_type.create_attribute}, {content_type.create_type} --- --*/ --- content_type in acs_attributes.object_type%TYPE, --- attribute_name in acs_attributes.attribute_name%TYPE, --- datatype in acs_attributes.datatype%TYPE, --- pretty_name in acs_attributes.pretty_name%TYPE, --- pretty_plural in acs_attributes.pretty_plural%TYPE default null, --- sort_order in acs_attributes.sort_order%TYPE default null, --- default_value in acs_attributes.default_value%TYPE default null, --- column_spec in varchar2 default 'varchar2(4000)' --- ) return acs_attributes.attribute_id%TYPE; --- --- procedure drop_attribute ( --- --/** Drop an existing attribute. If you are using CMS, make sure to --- -- call cm_form_widget.unregister_attribute_widget before calling --- -- this function. --- -- @author Karl Goldstein --- -- @param content_type The name of the type to alter --- -- @param attribute_name The name of the attribute to drop --- -- @param drop_column If 't', will also alter the table and remove --- -- the column where the attribute is stored. The default is 'f' --- -- (leaves the table untouched). --- -- @see {acs_object.drop_attribute}, {content_type.create_attribute}, --- -- {cm_form_widget.unregister_attribute_widget} --- --*/ --- content_type in acs_attributes.object_type%TYPE, --- attribute_name in acs_attributes.attribute_name%TYPE, --- drop_column in varchar2 default 'f' --- ); --- --- procedure register_template ( --- --/** Register a template for the content type. This template may be used --- -- to render all items of that type. --- -- @author Karl Goldstein --- -- @param content_type The type for which the template is to be registered --- -- @param template_id The ID of the template to register --- -- @param use_context The context in which the template is appropriate, such --- -- as 'admin' or 'public' --- -- @param is_default If 't', this template becomes the default template for --- -- the type, default is 'f'. --- -- @see {content_item.register_template}, {content_item.unregister_template}, --- -- {content_item.get_template}, {content_type.unregister_template}, --- -- {content_type.set_default_template}, {content_type.get_template} --- --*/ --- content_type in cr_type_template_map.content_type%TYPE, --- template_id in cr_templates.template_id%TYPE, --- use_context in cr_type_template_map.use_context%TYPE, --- is_default in cr_type_template_map.is_default%TYPE default 'f' --- ); --- --- procedure set_default_template ( --- --/** Make the registered template a default template. The default template --- -- will be used to render all items of the type for which no individual --- -- template is registered. --- -- @author Karl Goldstein --- -- @param content_type The type for which the template is to be made default --- -- @param template_id The ID of the template to make default --- -- @param use_context The context in which the template is appropriate, such --- -- as 'admin' or 'public' --- -- @see {content_item.register_template}, {content_item.unregister_template}, --- -- {content_item.get_template}, {content_type.unregister_template}, --- -- {content_type.register_template}, {content_type.get_template} --- --*/ --- content_type in cr_type_template_map.content_type%TYPE, --- template_id in cr_templates.template_id%TYPE, --- use_context in cr_type_template_map.use_context%TYPE --- ); --- --- function get_template ( --- --/** Retrieve the appropriate template for rendering items of the specified type. --- -- @author Karl Goldstein --- -- @param content_type The type for which the template is to be retrieved --- -- @param use_context The context in which the template is appropriate, such --- -- as 'admin' or 'public' --- -- @return The ID of the template to use --- -- @see {content_item.register_template}, {content_item.unregister_template}, --- -- {content_item.get_template}, {content_type.unregister_template}, --- -- {content_type.register_template}, {content_type.set_default_template} --- --*/ --- content_type in cr_type_template_map.content_type%TYPE, --- use_context in cr_type_template_map.use_context%TYPE --- ) return cr_templates.template_id%TYPE; --- --- procedure unregister_template ( --- --/** Unregister a template. If the unregistered template was the default template, --- -- the content_type can no longer be rendered in the use_context, --- -- @author Karl Goldstein --- -- @param content_type The type for which the template is to be unregistered --- -- @param template_id The ID of the template to unregister --- -- @param use_context The context in which the template is to be unregistered --- -- @see {content_item.register_template}, {content_item.unregister_template}, --- -- {content_item.get_template}, {content_type.set_default_template}, --- -- {content_type.register_template}, {content_type.get_template} --- --*/ --- content_type in cr_type_template_map.content_type%TYPE default null, --- template_id in cr_templates.template_id%TYPE, --- use_context in cr_type_template_map.use_context%TYPE default null --- ); --- --- procedure refresh_view ( --- --/** Create a view for the type which joins all attributes of the type, --- -- including the inherited attributes. The view is named --- -- "X" --- -- Called by create_attribute and create_type. --- -- @author Karl Goldstein --- -- @param content_type The type for which the view is to be created. --- -- @see {content_type.create_type} --- --*/ --- content_type in cr_type_template_map.content_type%TYPE --- ); --- --- procedure register_relation_type ( --- --/** Register a relationship between a content type and another object --- -- type. This may then be used by the content_item.is_valid_relation --- -- function to validate any relationship between an item and another --- -- object. --- -- @author Karl Goldstein --- -- @param content_type The type of the item from which the relationship --- -- originated. --- -- @param target_type The type of the item to which the relationship --- -- is targeted. --- -- @param relation_tag A simple token used to identify a set of --- -- relations. --- -- @param min_n The minimun number of relationships of this type --- -- which an item must have to go live. --- -- @param max_n The minimun number of relationships of this type --- -- which an item must have to go live. --- -- @see {content_type.unregister_relation_type} --- --*/ --- content_type in cr_type_relations.content_type%TYPE, --- target_type in cr_type_relations.target_type%TYPE, --- relation_tag in cr_type_relations.relation_tag%TYPE default 'generic', --- min_n in integer default 0, --- max_n in integer default null --- ); --- --- procedure unregister_relation_type ( --- --/** Unregister a relationship between a content type and another object --- -- type. --- -- @author Karl Goldstein --- -- @param content_type The type of the item from which the relationship --- -- originated. --- -- @param target_type The type of the item to which the relationship --- -- is targeted. --- -- @param relation_tag A simple token used to identify a set of --- -- relations. --- -- @see {content_type.register_relation_type} --- --*/ --- content_type in cr_type_relations.content_type%TYPE, --- target_type in cr_type_relations.target_type%TYPE, --- relation_tag in cr_type_relations.relation_tag%TYPE default null --- ); --- --- procedure register_child_type ( --- --/** Register a parent-child relationship between a content type --- -- and another object --- -- type. This may then be used by the content_item.is_valid_relation --- -- function to validate the relationship between an item and a potential --- -- child. --- -- @author Karl Goldstein --- -- @param content_type The type of the item from which the relationship --- -- originated. --- -- @param child_type The type of the child item. --- -- @param relation_tag A simple token used to identify a set of --- -- relations. --- -- @param min_n The minimun number of parent-child --- -- relationships of this type --- -- which an item must have to go live. --- -- @param max_n The minimun number of relationships of this type --- -- which an item must have to go live. --- -- @see {content_type.register_relation_type}, {content_type.register_child_type} --- --*/ --- parent_type in cr_type_children.parent_type%TYPE, --- child_type in cr_type_children.child_type%TYPE, --- relation_tag in cr_type_children.relation_tag%TYPE default 'generic', --- min_n in integer default 0, --- max_n in integer default null --- ); --- --- procedure unregister_child_type ( --- --/** Register a parent-child relationship between a content type --- -- and another object --- -- type. This may then be used by the content_item.is_valid_relation --- -- function to validate the relationship between an item and a potential --- -- child. --- -- @author Karl Goldstein --- -- @param parent_type The type of the parent item. --- -- @param child_type The type of the child item. --- -- @param relation_tag A simple token used to identify a set of --- -- relations. --- -- @see {content_type.register_relation_type}, {content_type.register_child_type} --- --*/ --- parent_type in cr_type_children.parent_type%TYPE, --- child_type in cr_type_children.child_type%TYPE, --- relation_tag in cr_type_children.relation_tag%TYPE default null --- ); --- --- procedure register_mime_type ( --- content_type in cr_content_mime_type_map.content_type%TYPE, --- mime_type in cr_content_mime_type_map.mime_type%TYPE --- ); --- --- procedure unregister_mime_type ( --- content_type in cr_content_mime_type_map.content_type%TYPE, --- mime_type in cr_content_mime_type_map.mime_type%TYPE --- ); --- --- function is_content_type ( --- object_type in acs_object_types.object_type%TYPE --- ) return char; --- --- procedure rotate_template ( --- --/** Sets the default template for a content type and registers all the --- -- previously existing items of that content type to the original --- -- template --- -- @author Michael Pih --- -- @param template_id The template that will become the default --- -- registered template for the specified content type and use context --- -- @param v_content_type The content type --- -- @param use_context The context in which the template will be used --- --*/ --- template_id in cr_templates.template_id%TYPE, --- v_content_type in cr_items.content_type%TYPE, --- use_context in cr_type_template_map.use_context%TYPE --- ); --- --- --- end content_type; - --- show errors - --- create or replace package content_item --- as --- --- --/** --- --Content items store the overview of the content published on a --- --website. The actual content is stored in content revisions. It is --- --implemented this way so that there can be mulitple versions of the --- --actual content while the main idea remains constant. For example: If --- --there is a review for the movie "Terminator," there will exist a --- --content item by the name "terminator" with all the right parameters --- --(supertype, parent, etc), there will also exist at least one content --- --revision pointing to this item with the actual review content. --- --@see {content_revision}, {content_folder} --- --*/ --- --- c_root_folder_id constant integer := -100; --- --- function get_root_folder ( --- item_id in cr_items.item_id%TYPE default null --- ) return cr_folders.folder_id%TYPE; --- --- function new ( --- --/** Creates a new content item. If the data, title or text --- -- parameters are specified, also creates a revision for the item. --- -- @author Karl Goldstein --- -- @param name The name for the item, must be URL-encoded. --- -- If an item with this name already exists under the specified --- -- parent item, an error is thrown --- -- @param parent_id The parent of this item, defaults to null --- -- @param item_id The id of the new item. A new id will be allocated if this --- -- parameter is null --- -- @param locale The locale for this item, for use with Intermedia search --- -- @param item_subtype The type of the new item, defaults to 'content_item' --- -- This parameter is used to support inheritance, so that --- -- subclasses of content_item can call this function --- -- to initialize the parent class --- -- @param content_type The content type for the item, defaults to --- -- 'content_revision'. Only objects of this type --- -- may be used as revisions for the item --- -- @param title The user-readable title for the item, defaults to the item's --- -- name --- -- @param description A short description for the item (4000 characters maximum) --- -- @param mime_type The file type of the item, defaults to 'text/plain' --- -- @param nls_language The language for the item, used for Intermedia search --- -- @param text The text content of the new revision, 4000 charcters maximum. --- -- Cannot be specified simultaneously with the data --- -- parameter --- -- @param data The blob content of the new revision. Cannot be specified --- -- simultaneously with the text parameter --- -- @param relation_tag If a parent-child relationship is registered --- -- for these content types, use this tag to --- -- describe the parent-child relationship. Defaults --- -- to 'parent content type'-'child content type' --- -- @param is_live If 't', the new revision will become live --- -- @param context_id Security context id, as in acs_object.new --- -- If null, defaults to parent_id, and copies permissions --- -- from the parent into the current item --- -- @param others As in acs_object.new --- -- @return The id of the newly created item --- -- @see {acs_object.new} --- --*/ --- name in cr_items.name%TYPE, --- parent_id in cr_items.parent_id%TYPE default null, --- item_id in acs_objects.object_id%TYPE default null, --- locale in cr_items.locale%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- context_id in acs_objects.context_id%TYPE default null, --- creation_ip in acs_objects.creation_ip%TYPE default null, --- item_subtype in acs_object_types.object_type%TYPE --- default 'content_item', --- content_type in acs_object_types.object_type%TYPE --- default 'content_revision', --- title in cr_revisions.title%TYPE default null, --- description in cr_revisions.description%TYPE default null, --- mime_type in cr_revisions.mime_type%TYPE default 'text/plain', --- nls_language in cr_revisions.nls_language%TYPE default null, --- text in varchar2 default null, --- data in cr_revisions.content%TYPE default null, --- relation_tag in cr_child_rels.relation_tag%TYPE default null, --- is_live in char default 'f' --- ) return cr_items.item_id%TYPE; --- --- --- function is_published ( --- --/** Determins whether an item is published or not. --- -- @author Michael Pih --- -- @param item_id The item ID --- -- @return 't' if the item is published, 'f' otherwise --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return char; --- --- --- function is_publishable ( --- --/** Determines if an item is publishable. Publishable items must --- -- meet the following criteria: --- -- 1) for each child type, the item has n children, min_n < n < max_n --- -- 2) for each relation type, the item has n relations, min_n < n < max_n --- -- 3) any 'publishing_wf' workflows are finished --- -- @author Michael Pih --- -- @param item_id The item ID --- -- @return 't' if the item is publishable in it's present state, --- -- Otherwise, returns 'f' --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return char; --- --- --- --- function is_valid_child ( --- --/** Determines if an item would be a valid child of another item by --- -- checking if the parent allows children of the would-be child's --- -- content type and if the parent already has n_max children of --- -- that content type. --- -- @author Michael Pih --- -- @param item_id The item ID of the potential parent --- -- @param content_type The content type of the potential child item --- -- @return 't' if the item would be a valid child, 'f' otherwise --- --*/ --- --- item_id in cr_items.item_id%TYPE, --- content_type in acs_object_types.object_type%TYPE --- ) return char; --- --- procedure delete ( --- --/** Deletes the specified content item, along with any revisions, symlinks, --- -- workflows, associated templates, associated keywords, --- -- child and item relationships for the item. Use with caution - this --- -- operation cannot be undone. --- -- @author Karl Goldstein --- -- @param item_id The id of the item to delete --- -- @see {acs_object.delete} --- --*/ --- item_id in cr_items.item_id%TYPE --- ); --- --- procedure rename ( --- --/** Renames the item. If an item with the specified name already exists --- -- under this item's parent, an error is thrown --- -- @author Karl Goldstein --- -- @param item_id The id of the item to rename --- -- @param name The new name for the item, must be URL-encoded --- -- @see {content_item.new} --- --*/ --- item_id in cr_items.item_id%TYPE, --- name in cr_items.name%TYPE --- ); --- --- function get_id ( --- --/** Takes in a path, such as "/tv/programs/star_trek/episode_203" --- -- and returns the id of the item with this path. Note: URLs are abstract (no --- -- extensions are allowed in content item names and extensions are stripped when --- -- looking up content items) --- -- @author Karl Goldstein --- -- @param item_path The path to be resolved --- -- @param root_folder_id Starts path resolution from this folder. Defaults to --- -- the root of the sitemap --- -- @param resolve_index Boolean flag indicating whether to return the --- -- id of the index page for folders (if one --- -- exists). Defaults to 'f'. --- -- @return The id of the item with the given path, or null if no such item exists --- -- @see {content_item.get_path} --- --*/ --- item_path in varchar2, --- root_folder_id in cr_items.item_id%TYPE default c_root_folder_id, --- resolve_index in char default 'f' --- ) return cr_items.item_id%TYPE; --- --- function get_path ( --- --/** Retrieves the full path to an item, in the form of --- -- "/tv/programs/star_trek/episode_203" --- -- @author Karl Goldstein --- -- @param item_id The item for which the path is to be retrieved --- -- @param root_folder_id Starts path resolution from this folder. --- -- Defaults to the root of the sitemap --- -- @return The path to the item --- -- @see {content_item.get_id}, {content_item.write_to_file} --- --*/ --- item_id in cr_items.item_id%TYPE, --- root_folder_id in cr_items.item_id%TYPE default null --- ) return varchar2; --- --- function get_virtual_path ( --- --/** Retrieves the virtual path to an item, in the form of --- -- "/tv/programs/star_trek/episode_203" --- -- @author Michael Pih --- -- @param item_id The item for which the path is to be retrieved --- -- @param root_folder_id Starts path resolution from this folder. --- -- Defaults to the root of the sitemap --- -- @return The virtual path to the item --- -- @see {content_item.get_id}, {content_item.write_to_file}, {content_item.get_path} --- --*/ --- item_id in cr_items.item_id%TYPE, --- root_folder_id in cr_items.item_id%TYPE default c_root_folder_id --- ) return varchar2; --- --- procedure write_to_file ( --- --/** Writes the content of the live revision of this item to a file, --- -- creating all the neccessary directories in the process --- -- @author Karl Goldstein --- -- @param item_id The item to be written to a file --- -- @param root_path The path in the filesystem to which the root of the --- -- sitemap corresponds --- -- @see {content_item.get_path} --- --*/ --- item_id in cr_items.item_id%TYPE, --- root_path in varchar2 --- ); --- --- procedure register_template ( --- --/** Registers a template which will be used to render this item. --- -- @author Karl Goldstein --- -- @param item_id The item for which the template will be registered --- -- @param template_id The template to be registered --- -- @param use_context The context in which the template is appropriate, such --- -- as 'admin' or 'public' --- -- @see {content_type.register_template}, {content_item.unregister_template}, --- -- {content_item.get_template} --- --*/ --- item_id in cr_items.item_id%TYPE, --- template_id in cr_templates.template_id%TYPE, --- use_context in cr_item_template_map.use_context%TYPE --- ); --- --- procedure unregister_template ( --- --/** Unregisters a template which will be used to render this item. --- -- @author Karl Goldstein --- -- @param item_id The item for which the template will be unregistered --- -- @param template_id The template to be registered --- -- @param use_context The context in which the template is appropriate, such --- -- as 'admin' or 'public' --- -- @see {content_type.register_template}, {content_item.register_template}, --- -- {content_item.get_template} --- --*/ --- item_id in cr_items.item_id%TYPE, --- template_id in cr_templates.template_id%TYPE default null, --- use_context in cr_item_template_map.use_context%TYPE default null --- ); --- --- function get_template ( --- --/** Retrieves the template which should be used to render this item. If no template --- -- is registered to specifically render the item in the given context, the --- -- default template for the item's type is returned. --- -- @author Karl Goldstein --- -- @param item_id The item for which the template will be unregistered --- -- @param use_context The context in the item is to be rendered, such --- -- as 'admin' or 'public' --- -- @return The id of the registered template, or null if no template could be --- -- found --- -- @see {content_type.register_template}, {content_item.register_template}, --- --*/ --- item_id in cr_items.item_id%TYPE, --- use_context in cr_item_template_map.use_context%TYPE --- ) return cr_templates.template_id%TYPE; --- --- function get_live_revision ( --- --/** Retrieves the id of the live revision for the item --- -- @param item_id The item for which the live revision is to be retrieved --- -- @return The id of the live revision for this item, or null if no live revision --- -- exists --- -- @see {content_item.set_live_revision}, {content_item.get_latest_revision} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_revisions.revision_id%TYPE; --- --- procedure set_live_revision ( --- --/** Make the specified revision the live revision for the item --- -- @author Karl Goldstein --- -- @param revision_id The id of the revision which is to become live --- -- for its corresponding item --- -- @see {content_item.get_live_revision} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE, --- publish_status in cr_items.publish_status%TYPE default 'ready' --- ); --- --- --- procedure unset_live_revision ( --- --/** Set the live revision to null for the item --- -- @author Michael Pih --- -- @param item_id The id of the item for which to unset the live revision --- -- @see {content_item.set_live_revision} --- item_id in cr_items.item_id%TYPE --- ); --- --- procedure set_release_period ( --- --/** Sets the release period for the item. This information may be --- -- used by applications to update the publishing status of items --- -- at periodic intervals. --- -- @author Karl Goldstein --- -- @param item_id The id the item. --- -- @param start_when The time and date when the item should be released. --- -- @param end_when The time and date when the item should be expired. --- --*/ --- item_id in cr_items.item_id%TYPE, --- start_when date default null, --- end_when date default null --- ); --- --- --- function get_revision_count ( --- --/** Return the total count of revisions for this item --- -- @author Karl Goldstein --- -- @param item_id The id the item --- -- @return The number of revisions for this item --- -- @see {content_revision.new} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return number; --- --- -- Return the object type of this item --- function get_content_type ( --- --/** Retrieve the content type of this item. Only objects of this type may be --- -- used as revisions for the item. --- -- @author Karl Goldstein --- -- @param item_id The item for which the content type is to be retrieved --- -- @return The content type of the item --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_items.content_type%TYPE; --- --- function get_context ( --- --/** Retrieve the parent of the given item --- -- @author Karl Goldstein --- -- @param item_id The item for which the parent is to be retrieved --- -- @return The id of the parent for this item --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return acs_objects.context_id%TYPE; --- --- procedure move ( --- --/** Move the specified item to a different folder. If the target folder does --- -- not exist, or if the folder already contains an item with the same name --- -- as the given item, an error will be thrown. --- -- @author Karl Goldstein --- -- @param item_id The item to be moved --- -- @param target_folder_id The new folder for the item --- -- @see {content_item.new}, {content_folder.new}, {content_item.copy} --- --*/ --- item_id in cr_items.item_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE --- ); --- --- procedure copy ( --- --/** Copies the item to a new location, creating an identical item with --- -- an identical latest revision (if any). If the target folder does --- -- not exist, or if the folder already contains an item with the same name --- -- as the given item, an error will be thrown. --- -- @author Karl Goldstein, Michael Pih --- -- @param item_id The item to be copied --- -- @param target_folder_id The folder where the item is to be copied --- -- @param creation_user The user_id of the creator --- -- @param creation_ip The IP address of the creator --- -- @see {content_item.new}, {content_folder.new}, {content_item.move} --- --*/ --- item_id in cr_items.item_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE, --- creation_user in acs_objects.creation_user%TYPE, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ); --- --- function copy2 ( --- --/** Copies the item to a new location, creating an identical item with --- -- an identical latest revision (if any). If the target folder does --- -- not exist, or if the folder already contains an item with the same name --- -- as the given item, an error will be thrown. --- -- @author Karl Goldstein, Michael Pih --- -- @param item_id The item to be copied --- -- @param target_folder_id The folder where the item is to be copied --- -- @param creation_user The user_id of the creator --- -- @param creation_ip The IP address of the creator --- -- @return The item ID of the new copy. --- -- @see {content_item.new}, {content_folder.new}, {content_item.move} --- --*/ --- item_id in cr_items.item_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE, --- creation_user in acs_objects.creation_user%TYPE, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_items.item_id%TYPE; --- --- -- get the latest revision for an item --- function get_latest_revision ( --- --/** Retrieves the id of the latest revision for the item (as opposed to the live --- -- revision) --- -- @author Karl Goldstein --- -- @param item_id The item for which the latest revision is to be retrieved --- -- @return The id of the latest revision for this item, or null if no revisions --- -- exist --- -- @see {content_item.get_live_revision} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_revisions.revision_id%TYPE; --- --- --- function get_best_revision ( --- --/** Retrieves the id of the live revision for the item if one exists, --- -- otherwise retrieves the id of the latest revision if one exists. --- -- revision) --- -- @author Michael Pih --- -- @param item_id The item for which the revision is to be retrieved --- -- @return The id of the live or latest revision for this item, --- -- or null if no revisions exist --- -- @see {content_item.get_live_revision}, {content_item.get_latest_revision} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_revisions.revision_id%TYPE; --- --- function get_title ( --- --/** Retrieves the title for the item, using either the latest or the live revision. --- -- If the specified item is in fact a folder, return the folder's label. --- -- In addition, this function will automatically resolve symlinks. --- -- @author Karl Goldstein --- -- @param item_id The item for which the title is to be retrieved --- -- @param is_live If 't', use the live revision to get the title. Otherwise, --- -- use the latest revision. The default is 'f' --- -- @return The title of the item --- -- @see {content_item.get_live_revision}, {content_item.get_latest_revision}, --- -- {content_symlink.resolve} --- --*/ --- item_id in cr_items.item_id%TYPE, --- is_live in char default 'f' --- ) return cr_revisions.title%TYPE; --- --- function get_publish_date ( --- --/** Retrieves the publish date for the item --- -- @author Karl Goldstein --- -- @param item_id The item for which the publish date is to be retrieved --- -- @param is_live If 't', use the live revision for the item. Otherwise, use --- -- the latest revision. The default is 'f' --- -- @return The publish date for the item, or null if the item has no revisions --- -- @see {content_item.get_live_revision}, {content_item.get_latest_revision}, --- --*/ --- item_id in cr_items.item_id%TYPE, --- is_live in char default 'f' --- ) return cr_revisions.publish_date%TYPE; --- --- function is_subclass ( --- --/** Determines if one type is a subclass of another. A class is always a subclass of --- -- itself. --- -- @author Karl Goldstein --- -- @param object_type The child class --- -- @param supertype The superclass --- -- @return 't' if the child class is a subclass of the superclass, 'f' otherwise --- -- @see {acs_object_type.create_type} --- --*/ --- object_type in acs_object_types.object_type%TYPE, --- supertype in acs_object_types.supertype%TYPE --- ) return char; --- --- function relate ( --- --/** Relates two content items --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @param object_id The item id of the related object --- -- @param relation_tag A tag to help identify the relation type, --- -- defaults to 'generic' --- -- @param order_n The order of this object among other objects --- -- of the same relation type, defaults to null. --- -- @param relation_type The object type of the relation, defaults to --- -- 'cr_item_rel' --- --*/ --- item_id in cr_items.item_id%TYPE, --- object_id in acs_objects.object_id%TYPE, --- relation_tag in cr_type_relations.relation_tag%TYPE default 'generic', --- order_n in cr_item_rels.order_n%TYPE default null, --- relation_type in acs_object_types.object_type%TYPE default 'cr_item_rel' --- ) return cr_item_rels.rel_id%TYPE; --- --- --- procedure unrelate ( --- --/** Delete the item relationship between two items --- -- @author Michael Pih --- -- @param rel_id The relationship id --- -- @see {content_item.relate} --- --*/ --- rel_id in cr_item_rels.rel_id%TYPE --- ); --- --- function is_index_page ( --- --/** Determine if the item is an index page for the specified folder. --- -- The item is an index page for the folder if it exists in the --- -- folder and its item name is "index". --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @param folder_id The folder id --- -- @return 't' if the item is an index page for the specified --- -- folder, 'f' otherwise --- -- @see {content_folder.get_index_page} --- --*/ --- item_id in cr_items.item_id%TYPE, --- folder_id in cr_folders.folder_id%TYPE --- ) return varchar2; --- --- --- function get_parent_folder ( --- --/** Get the parent folder. --- -- @author Michael Pih --- -- @param item_id The item id --- -- @return the folder_id of the parent folder, null otherwise --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_folders.folder_id%TYPE; --- --- end content_item; - --- show errors - - --- create or replace package content_revision --- as --- --- function new ( --- --/** Create a new revision for an item. --- -- @author Karl Goldstein --- -- @param title The revised title for the item --- -- @param description A short description of this revision, 4000 characters maximum --- -- @param publish_date Publication date. --- -- @param mime_type The revised mime type of the item, defaults to 'text/plain' --- -- @param nls_language The revised language of the item, for use with Intermedia searching --- -- @param data The blob which contains the body of the revision --- -- @param item_id The id of the item being revised --- -- @param revision_id The id of the new revision. A new id will be allocated by default --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created revision --- -- @see {acs_object.new}, {content_item.new} --- --*/ --- title in cr_revisions.title%TYPE, --- description in cr_revisions.description%TYPE default null, --- publish_date in cr_revisions.publish_date%TYPE default sysdate, --- mime_type in cr_revisions.mime_type%TYPE default 'text/plain', --- nls_language in cr_revisions.nls_language%TYPE default null, --- data in cr_revisions.content%TYPE, --- item_id in cr_items.item_id%TYPE, --- revision_id in cr_revisions.revision_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_revisions.revision_id%TYPE; --- --- function new ( --- title in cr_revisions.title%TYPE, --- description in cr_revisions.description%TYPE default null, --- publish_date in cr_revisions.publish_date%TYPE default sysdate, --- mime_type in cr_revisions.mime_type%TYPE default 'text/plain', --- nls_language in cr_revisions.nls_language%TYPE default null, --- text in varchar2 default '', --- item_id in cr_items.item_id%TYPE, --- revision_id in cr_revisions.revision_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE default sysdate, --- creation_user in acs_objects.creation_user%TYPE default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_revisions.revision_id%TYPE; --- --- function copy ( --- --/** Creates a new copy of a revision, including all attributes and content --- -- and content, returning the ID of the new revision --- -- @author Karl Goldstein, Michael Pih --- -- @param revision_id The id of the revision to copy --- -- @param copy_id The id of the new copy (default null) --- -- @param target_item_id The id of the item which will own the copied revision. If null, the item that holds the original revision will own the copied revision. Defaults to null. --- -- @param creation_user The id of the creation user --- -- @param creation_ip The IP address of the creation user (default null) --- -- @return The id of the new revision --- -- @see {content_revision.new} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE, --- copy_id in cr_revisions.revision_id%TYPE default null, --- target_item_id in cr_items.item_id%TYPE default null, --- creation_user in acs_objects.creation_user%TYPE default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_revisions.revision_id%TYPE; --- --- procedure delete ( --- --/** Deletes the revision. --- -- @author Karl Goldstein --- -- @param revision_id The id of the revision to delete --- -- @see {content_revision.new}, {acs_object.delete} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE --- ); --- --- function get_number ( --- --/** Return the revision number of the specified revision, according to --- -- the chronological --- -- order in which revisions have been added for this item. --- -- @author Karl Goldstein --- -- @param revision_id The id the revision --- -- @return The number of the revision --- -- @see {content_revision.new} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE --- ) return number; --- --- procedure index_attributes( --- --/** Generates an XML document for insertion into cr_revision_attributes, --- -- which is indexed by Intermedia for searching attributes. --- -- @author Karl Goldstein --- -- @param revision_id The id of the revision to index --- -- @see {content_revision.new} --- --*/ --- revision_id IN cr_revisions.revision_id%TYPE --- ); --- --- function export_xml ( --- revision_id IN cr_revisions.revision_id%TYPE --- ) return cr_xml_docs.doc_id%TYPE; --- --- function write_xml ( --- revision_id IN number, --- clob_loc IN clob --- ) return number as language --- java --- name --- 'com.arsdigita.content.XMLExchange.exportRevision( --- java.lang.Integer, oracle.sql.CLOB --- ) return int'; --- --- function import_xml ( --- item_id IN cr_items.item_id%TYPE, --- revision_id IN cr_revisions.revision_id%TYPE, --- doc_id IN number --- ) return cr_revisions.revision_id%TYPE; --- --- function read_xml ( --- item_id IN number, --- revision_id IN number, --- clob_loc IN clob --- ) return number as language --- java --- name --- 'com.arsdigita.content.XMLExchange.importRevision( --- java.lang.Integer, java.lang.Integer, oracle.sql.CLOB --- ) return int'; --- --- procedure to_html ( --- --/** Converts a revision uploaded as a binary document to html --- -- @author Karl Goldstein --- -- @param revision_id The id of the revision to index --- --*/ --- revision_id IN cr_revisions.revision_id%TYPE --- ); --- --- procedure replace( --- revision_id number, search varchar2, replace varchar2) --- as language --- java --- name --- 'com.arsdigita.content.Regexp.replace( --- int, java.lang.String, java.lang.String --- )'; --- --- function is_live ( --- -- /** Determine if the revision is live --- -- @author Karl Goldstein, Stanislav Freidin --- -- @param revision_id The id of the revision to check --- -- @return 't' if the revision is live, 'f' otherwise --- -- @see {content_revision.is_latest} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE --- ) return varchar2; --- --- function is_latest ( --- -- /** Determine if the revision is the latest revision --- -- @author Karl Goldstein, Stanislav Freidin --- -- @param revision_id The id of the revision to check --- -- @return 't' if the revision is the latest revision for its item, 'f' otherwise --- -- @see {content_revision.is_live} --- --*/ --- revision_id in cr_revisions.revision_id%TYPE --- ) return varchar2; --- --- procedure to_temporary_clob ( --- revision_id in cr_revisions.revision_id%TYPE --- ); --- --- procedure content_copy ( --- -- /** Copies the content of the specified revision to the content --- -- of another revision --- -- @author Michael Pih --- -- @param revision_id The id of the revision with the content to be copied --- -- @param revision_id The id of the revision to be updated, defaults to the --- -- latest revision of the item with which the source revision is --- -- associated. --- --*/ --- revision_id in cr_revisions.revision_id%TYPE, --- revision_id_dest in cr_revisions.revision_id%TYPE default null --- ); --- --- end content_revision; - --- show errors - --- create or replace package content_symlink --- as --- --- function new ( --- --/** Create a new symlink, linking two items --- -- @author Karl Goldstein --- -- @param name The name for the new symlink, defaults to the name of the --- -- target item --- -- @param label The label of the symlink, defaults to 'Symlinke to ' --- -- @param target_id The item which the symlink will point to --- -- @param parent_id The parent folder for the symlink. This must actually be a folder --- -- and not a generic content item. --- -- @param symlink_id The id of the new symlink. A new id will be allocated by default --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created symlink --- -- @see {acs_object.new}, {content_item.new}, {content_symlink.resolve} --- --*/ --- name in cr_items.name%TYPE default null, --- label in cr_symlinks.label%TYPE default null, --- target_id in cr_items.item_id%TYPE, --- parent_id in cr_items.parent_id%TYPE, --- symlink_id in cr_symlinks.symlink_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_symlinks.symlink_id%TYPE; --- --- --- procedure delete ( --- --/** Deletes the symlink --- -- @author Karl Goldstein --- -- @param symlink_id The id of the symlink to delete --- -- @see {content_symlink.new}, {acs_object.delete} --- --*/ --- symlink_id in cr_symlinks.symlink_id%TYPE --- ); --- --- --- procedure copy ( --- --/** Copies the symlink itself to another folder, without resolving the symlink --- -- @author Karl Goldstein --- -- @param symlink_id The id of the symlink to copy --- -- @param target_folder_id The id of the folder where the symlink is to be copied --- -- @param creation_user The id of the creation user --- -- @param creation_ip The IP address of the creation user (defualt null) --- -- @see {content_symlink.new}, {content_item.copy} --- --*/ --- symlink_id in cr_symlinks.symlink_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE, --- creation_user in acs_objects.creation_user%TYPE, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ); --- --- function is_symlink ( --- --/** Determines if the item is a symlink --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @return 't' if the item is a symlink, 'f' otherwise --- -- @see {content_symlink.new}, {content_symlink.resolve} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return char; --- --- --- function resolve ( --- --/** Resolves the symlink and returns the target item id. --- -- @author Karl Goldstein --- -- @param item_id The item id to be resolved --- -- @return The target item of the symlink, or the original item id if --- -- the item is not in fact a symlink --- -- @see {content_symlink.new}, {content_symlink.is_symlink} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_items.item_id%TYPE; --- --- --- function resolve_content_type ( --- --/** Gets the content type of the target item. --- -- @author Michael Pih --- -- @param item_id The item id to be resolved --- -- @return The content type of the symlink target, otherwise null. --- -- the item is not in fact a symlink --- -- @see {content_symlink.resolve} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return cr_items.content_type%TYPE; --- --- --- end content_symlink; - --- show errors - --- create or replace package content_extlink --- as --- --- function new ( --- --/** Create a new extlink, an item pointing to an off-site resource --- -- @author Karl Goldstein --- -- @param name The name for the new extlink, defaults to the name of the --- -- target item --- -- @param url The URL of the item --- -- @param label The text label or title of the item --- -- @param description A brief description of the item --- -- @param parent_id The parent folder for the extlink. This must actually be a folder --- -- and not a generic content item. --- -- @param extlink_id The id of the new extlink. A new id will be allocated by default --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created extlink --- -- @see {acs_object.new}, {content_item.new}, {content_extlink.resolve} --- --*/ --- name in cr_items.name%TYPE default null, --- url in cr_extlinks.url%TYPE, --- label in cr_extlinks.label%TYPE default null, --- description in cr_extlinks.description%TYPE default null, --- parent_id in cr_items.parent_id%TYPE, --- extlink_id in cr_extlinks.extlink_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_extlinks.extlink_id%TYPE; --- --- --- procedure delete ( --- --/** Deletes the extlink --- -- @author Karl Goldstein --- -- @param extlink_id The id of the extlink to delete --- -- @see {content_extlink.new}, {acs_object.delete} --- --*/ --- extlink_id in cr_extlinks.extlink_id%TYPE --- ); --- --- --- function is_extlink ( --- --/** Determines if the item is a extlink --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @return 't' if the item is a extlink, 'f' otherwise --- -- @see {content_extlink.new}, {content_extlink.resolve} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return char; --- --- --- end content_extlink; - --- show errors - --- create or replace package content_folder --- as --- --- function new ( --- --/** Create a new folder --- -- @author Karl Goldstein --- -- @param label The label for the folder --- -- @param description A short description of the folder, 4000 characters maximum --- -- @param parent_id The parent of the folder --- -- @param folder_id The id of the new folder. A new id will be allocated by default --- -- @param context_id The context id. The parent id will be used as the default context --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created folder --- -- @see {acs_object.new}, {content_item.new} --- --*/ --- name in cr_items.name%TYPE, --- label in cr_folders.label%TYPE, --- description in cr_folders.description%TYPE default null, --- parent_id in cr_items.parent_id%TYPE default null, --- context_id in acs_objects.context_id%TYPE default null, --- folder_id in cr_folders.folder_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE default sysdate, --- creation_user in acs_objects.creation_user%TYPE default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_folders.folder_id%TYPE; --- --- procedure delete ( --- --/** Delete a folder. An error is thrown if the folder is not empty --- -- @author Karl Goldstein --- -- @param folder_id The id of the folder to delete --- -- @see {acs_object.delete}, {content_item.delete} --- --*/ --- folder_id in cr_folders.folder_id%TYPE --- ); --- --- procedure rename ( --- --/** Change the name, label and/or description of the folder --- -- @author Karl Goldstein --- -- @param folder_id The id of the folder to modify --- -- @param name The new name for the folder. An error will be thrown if --- -- an item with this name already exists under this folder's --- -- parent. If this parameter is null, the old name will be preserved --- -- @param label The new label for the folder. The old label will be preserved if --- -- this parameter is null --- -- @param label The new description for the folder. The old description --- -- will be preserved if this parameter is null --- -- @see {content_folder.new} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- name in cr_items.name%TYPE default null, --- label in cr_folders.label%TYPE default null, --- description in cr_folders.description%TYPE default null --- ); --- --- procedure move ( --- --/** Recursively move the folder and all items in into a new location. --- -- An error is thrown if either of the parameters is not a folder. --- -- The root folder of the sitemap and the root folder of the --- -- templates cannot be moved. --- -- @author Karl Goldstein --- -- @param folder_id The id of the folder to move --- -- @param target_folder_id The destination folder --- -- @see {content_folder.new}, {content_folder.copy} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE --- ); --- --- procedure copy ( --- --/** Recursively copy the folder and all items in into a new location. --- -- An error is thrown if either of the parameters is not a folder. --- -- The root folder of the sitemap and the root folder of the --- -- templates cannot be copied --- -- @author Karl Goldstein --- -- @param folder_id The id of the folder to copy --- -- @param target_folder_id The destination folder --- -- @param creation_user The id of the creation user --- -- @param creation_ip The IP address of the creation user (defaults to null) --- -- @see {content_folder.new}, {content_folder.copy} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE, --- creation_user in acs_objects.creation_user%TYPE, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ); --- --- function is_folder ( --- --/** Determine if the item is a folder --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @return 't' if the item is a folder, 'f' otherwise --- -- @see {content_folder.new}, {content_folder.is_sub_folder} --- --*/ --- item_id in cr_items.item_id%TYPE --- ) return char; --- --- function is_sub_folder ( --- --/** Determine if the item target_folder_id is a subfolder of --- -- the item folder_id --- -- @author Karl Goldstein --- -- @param folder_id The superfolder id --- -- @param target_folder_id The subfolder id --- -- @return 't' if the item target_folder_id is a subfolder of --- -- the item folder_id, 'f' otherwise --- -- @see {content_folder.is_folder} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- target_folder_id in cr_folders.folder_id%TYPE --- ) return char; --- --- function is_empty ( --- --/** Determine if the folder is empty --- -- @author Karl Goldstein --- -- @param folder_id The folder id --- -- @return 't' if the folder contains no subfolders or items, 'f' otherwise --- -- @see {content_folder.is_folder} --- --*/ --- folder_id in cr_folders.folder_id%TYPE --- ) return varchar2; --- --- function is_root ( --- --/** Determine whether the folder is a root (has a parent_id of 0) --- -- @author Karl Goldstein --- -- @param folder_id The folder ID --- -- @return 't' if the folder is a root or 'f' otherwise --- --*/ --- folder_id in cr_folders.folder_id%TYPE --- ) return char; --- --- procedure register_content_type ( --- --/** Register a content type to the folder, if it is not already registered. --- -- Only items of the registered type(s) may be added to the folder. --- -- @author Karl Goldstein --- -- @param folder_id The folder id --- -- @param content_type The content type to be registered --- -- @see {content_folder.unregister_content_type}, --- -- {content_folder.is_registered} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- content_type in cr_folder_type_map.content_type%TYPE, --- include_subtypes in varchar2 default 'f' --- ); --- --- procedure unregister_content_type ( --- --/** Unregister a content type from the folder, if it has been registered. --- -- Only items of the registered type(s) may be added to the folder. --- -- If the folder already contains items of the type to be unregistered, the --- -- items remain in the folder. --- -- @author Karl Goldstein --- -- @param folder_id The folder id --- -- @param content_type The content type to be unregistered --- -- @param include_subtypes If 't', all subtypes of content_type will be --- -- unregistered as well --- -- @see {content_folder.register_content_type}, {content_folder.is_registered} --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- content_type in cr_folder_type_map.content_type%TYPE, --- include_subtypes in varchar2 default 'f' --- ); --- --- -- change this to is_type_registered --- function is_registered ( --- --/** Determines if a content type is registered to the folder --- -- Only items of the registered type(s) may be added to the folder. --- -- @author Karl Goldstein --- -- @param folder_id The folder id --- -- @param content_type The content type to be checked --- -- @param include_subtypes If 't', all subtypes of the content_type --- -- will be checked, returning 't' if all of them are registered. If 'f', --- -- only an exact match with content_type will be --- -- performed. --- -- @return 't' if the type is registered to this folder, 'f' otherwise --- -- @see {content_folder.register_content_type}, {content_folder.unregister_content_type}, --- --*/ --- folder_id in cr_folders.folder_id%TYPE, --- content_type in cr_folder_type_map.content_type%TYPE, --- include_subtypes in varchar2 default 'f' --- ) return varchar2; --- --- --- function get_label ( --- --/** Returns the label for the folder. This function is the default name method --- -- for the folder object. --- -- @author Karl Goldstein --- -- @param folder_id The folder id --- -- @return The folder's label --- -- @see {acs_object_type.create_type}, the docs for the name_method parameter --- --*/ --- folder_id in cr_folders.folder_id%TYPE --- ) return cr_folders.label%TYPE; --- --- --- function get_index_page ( --- --/** Returns the item ID of the index page of the folder, null otherwise --- -- @author Michael Pih --- -- @param folder_id The folder id --- -- @return The item ID of the index page --- --*/ --- folder_id in cr_folders.folder_id%TYPE --- ) return cr_items.item_id%TYPE; --- --- --- --- end content_folder; - --- show errors - - - --- create or replace package content_template --- as --- --- c_root_folder_id constant integer := -200; --- --- function get_root_folder return cr_folders.folder_id%TYPE; --- --- function new ( --- --/** Creates a new content template which can be used to render content items. --- -- @author Karl Goldstein --- -- @param name The name for the template, must be a valid UNIX-like filename. --- -- If a template with this name already exists under the specified --- -- parent item, an error is thrown --- -- @param parent_id The parent of this item, defaults to null --- -- @param template_id The id of the new template. A new id will be allocated if this --- -- parameter is null --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created template --- -- @see {acs_object.new}, {content_item.new}, {content_item.register_template}, --- -- {content_type.register_template} --- --*/ --- name in cr_items.name%TYPE, --- parent_id in cr_items.parent_id%TYPE default null, --- template_id in cr_templates.template_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ) return cr_templates.template_id%TYPE; --- --- procedure delete ( --- --/** Deletes the specified template, and unregisters the template from --- -- all content types and content items. --- -- Use with caution - this operation cannot be undone. --- -- @author Karl Goldstein --- -- @param template_id The id of the template to delete --- -- @see {acs_object.delete}, {content_item.unregister_template}, --- -- {content_type.unregister_template}, --- --*/ --- template_id in cr_templates.template_id%TYPE --- ); --- --- function is_template ( --- --/** Determine if an item is a template. --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @return 't' if the item is a template, 'f' otherwise --- -- @see {content_template.new} --- --*/ --- template_id in cr_templates.template_id%TYPE --- ) return varchar2; --- --- function get_path ( --- --/** Retrieves the full path to the template, as described in content_item.get_path --- -- @author Karl Goldstein --- -- @param template_id The id of the template for which the path is to --- -- be retrieved --- -- @param root_folder_id Starts path resolution at this folder --- -- @return The path to the template, starting with the specified root folder --- -- @see {content_item.get_path} --- --*/ --- template_id in cr_templates.template_id%TYPE, --- root_folder_id in cr_folders.folder_id%TYPE default c_root_folder_id --- ) return varchar2; --- --- end content_template; - --- show errors - --- create or replace package content_keyword --- as --- --- function new ( --- --/** Creates a new keyword (also known as "subject category"). --- -- @author Karl Goldstein --- -- @param heading The heading for the new keyword --- -- @param description The description for the new keyword --- -- @param parent_id The parent of this keyword, defaults to null. --- -- @param keyword_id The id of the new keyword. A new id will be allocated if this --- -- parameter is null --- -- @param object_type The type for the new keyword, defaults to 'content_keyword'. --- -- This parameter may be used by subclasses of --- -- content_keyword to initialize the superclass. --- -- @param creation_date As in acs_object.new --- -- @param creation_ip As in acs_object.new --- -- @param creation_user As in acs_object.new --- -- @return The id of the newly created keyword --- -- @see {acs_object.new}, {content_item.new}, {content_keyword.item_assign}, --- -- {content_keyword.delete} --- --*/ --- heading in cr_keywords.heading%TYPE, --- description in cr_keywords.description%TYPE default null, --- parent_id in cr_keywords.parent_id%TYPE default null, --- keyword_id in cr_keywords.keyword_id%TYPE default null, --- creation_date in acs_objects.creation_date%TYPE --- default sysdate, --- creation_user in acs_objects.creation_user%TYPE --- default null, --- creation_ip in acs_objects.creation_ip%TYPE default null, --- object_type in acs_object_types.object_type%TYPE default 'content_keyword' --- ) return cr_keywords.keyword_id%TYPE; --- --- procedure delete ( --- --/** Deletes the specified keyword, which must be a leaf. Unassigns the --- -- keyword from all content items. Use with caution - this --- -- operation cannot be undone. --- -- @author Karl Goldstein --- -- @param keyword_id The id of the keyword to be deleted --- -- @see {acs_object.delete}, {content_keyword.item_unassign} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE --- ); --- --- function get_heading ( --- --/** Retrieves the heading of the content keyword --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @return The heading for the specified keyword --- -- @see {content_keyword.set_heading}, {content_keyword.get_description} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE --- ) return varchar2; --- --- function get_description ( --- --/** Retrieves the description of the content keyword --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @return The description for the specified keyword --- -- @see {content_keyword.get_heading}, {content_keyword.set_description} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE --- ) return varchar2; --- --- procedure set_heading ( --- --/** Sets a new heading for the keyword --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @param heading The new heading --- -- @see {content_keyword.get_heading}, {content_keyword.set_description} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE, --- heading in cr_keywords.heading%TYPE --- ); --- --- procedure set_description ( --- --/** Sets a new description for the keyword --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @param description The new description --- -- @see {content_keyword.set_heading}, {content_keyword.get_description} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE, --- description in cr_keywords.description%TYPE --- ); --- --- function is_leaf ( --- --/** Determines if the keyword has no sub-keywords associated with it --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @return 't' if the keyword has no descendants, 'f' otherwise --- -- @see {content_keyword.new} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE --- ) return varchar2; --- --- procedure item_assign ( --- --/** Assigns this keyword to a content item, creating a relationship between them --- -- @author Karl Goldstein --- -- @param item_id The item to be assigned to --- -- @param keyword_id The keyword to be assigned --- -- @param context_id As in acs_rel.new, deprecated --- -- @param creation_ip As in acs_rel.new, deprecated --- -- @param creation_user As in acs_rel.new, deprecated --- -- @see {acs_rel.new}, {content_keyword.item_unassign} --- --*/ --- item_id in cr_items.item_id%TYPE, --- keyword_id in cr_keywords.keyword_id%TYPE, --- context_id in acs_objects.context_id%TYPE default null, --- creation_user in acs_objects.creation_user%TYPE default null, --- creation_ip in acs_objects.creation_ip%TYPE default null --- ); --- --- procedure item_unassign ( --- --/** Unassigns this keyword to a content item, removing a relationship between them --- -- @author Karl Goldstein --- -- @param item_id The item to be unassigned from --- -- @param keyword_id The keyword to be unassigned --- -- @see {acs_rel.delete}, {content_keyword.item_assign} --- --*/ --- item_id in cr_items.item_id%TYPE, --- keyword_id in cr_keywords.keyword_id%TYPE --- ); --- --- function is_assigned ( --- --/** Determines if the keyword is assigned to the item --- -- @author Karl Goldstein --- -- @param item_id The item id --- -- @param keyword_id The keyword id to be checked for assignment --- -- @param recurse Specifies if the keyword search is --- -- recursive. May be set to one of the following --- -- values:
    --- --
  • none: Not recursive. Look for an exact match.
  • --- --
  • up: Recursive from specific to general. A search for --- -- "attack dogs" will also match "dogs", "animals", "mammals", etc.
  • --- --
  • down: Recursive from general to specific. A search for --- -- "mammals" will also match "dogs", "attack dogs", "cats", "siamese cats", --- -- etc.
--- -- @return 't' if the keyword may be matched to an item, 'f' otherwise --- -- @see {content_keyword.item_assign} --- --*/ --- item_id in cr_items.item_id%TYPE, --- keyword_id in cr_keywords.keyword_id%TYPE, --- recurse in varchar2 default 'none' --- ) return varchar2; --- --- function get_path ( --- --/** Retreives a path to the keyword/subject category, with the most general --- -- category at the root of the path --- -- @author Karl Goldstein --- -- @param keyword_id The keyword id --- -- @return The path to the keyword, or null if no such keyword exists --- -- @see {content_keyword.new} --- --*/ --- keyword_id in cr_keywords.keyword_id%TYPE --- ) return varchar2; --- --- end content_keyword; - --- show errors - - - - --- create or replace package content_permission --- is --- --- procedure inherit_permissions ( --- --/** Make the child object inherit all of the permissions of the parent --- -- object. Typically, this function is called whenever a new object --- -- is created under a given parent --- -- @author Karl Goldstein --- -- @param parent_object_id The parent object id --- -- @param child_object_id The child object id --- -- @see {content_permission.grant}, {acs_permission.grant_permission} --- --*/ --- parent_object_id in acs_objects.object_id%TYPE, --- child_object_id in acs_objects.object_id%TYPE, --- child_creator_id in parties.party_id%TYPE default null --- ); --- --- function has_grant_authority ( --- --/** Determine if the user may grant a certain permission to another --- -- user. The permission may only be granted if the user has --- -- the permission himself and posesses the cm_perm access, or if the --- -- user posesses the cm_perm_admin access. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param holder_id The person who is attempting to grant the permissions --- -- @param privilege The privilege to be granted --- -- @return 't' if the donation is possible, 'f' otherwise --- -- @see {content_permission.grant_permission}, {content_permission.is_has_revoke_authority}, --- -- {acs_permission.grant_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- holder_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE --- ) return varchar2; --- --- procedure grant_permission_h ( --- --/** This is a helper function for content_permission.grant_permission and --- -- should not be called individually.

--- -- Grants a permission and revokes all descendants of the permission, since --- -- they are no longer relevant. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param grantee_id The person who should gain the parent privilege --- -- @param privilege The parent privilege to be granted --- -- @see {content_permission.grant_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- grantee_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE --- ); --- --- procedure grant_permission ( --- --/** Grant the specified privilege to another user. If the donation is --- -- not possible, the procedure does nothing. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param holder_id The person who is attempting to grant the permissions --- -- @param privilege The privilege to be granted --- -- @param recepient_id The person who will gain the privilege --- -- @param is_recursive If 't', applies the donation recursively to --- -- all child objects of the object (equivalent to UNIX's chmod -r). --- -- If 'f', only affects the objects itself. --- -- @see {content_permission.has_grant_authority}, {content_permission.revoke_permission}, --- -- {acs_permission.grant_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- holder_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE, --- recepient_id in parties.party_id%TYPE, --- is_recursive in varchar2 default 'f', --- object_type in acs_objects.object_type%TYPE default 'content_item' --- ); --- --- function has_revoke_authority ( --- --/** Determine if the user may take a certain permission away from another --- -- user. The permission may only be revoked if the user has --- -- the permission himself and posesses the cm_perm access, while the --- -- other user does not, or if the user posesses the cm_perm_admin access. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param holder_id The person who is attempting to revoke the permissions --- -- @param privilege The privilege to be revoked --- -- @param revokee_id The user from whom the privilege is to be taken away --- -- @return 't' if it is possible to revoke the privilege, 'f' otherwise --- -- @see {content_permission.has_grant_authority}, {content_permission.revoke_permission}, --- -- {acs_permission.revoke_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- holder_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE, --- revokee_id in parties.party_id%TYPE --- ) return varchar2; --- --- procedure revoke_permission_h ( --- --/** This is a helper function for content_permission.revoke_permission and --- -- should not be called individually.

--- -- Revokes a permission but grants all child permissions to the holder, to --- -- ensure that the permission is not permanently lost --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param revokee_id The person who should lose the parent permission --- -- @param privilege The parent privilege to be revoked --- -- @see {content_permission.revoke_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- revokee_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE --- ); --- --- procedure revoke_permission ( --- --/** Take the specified privilege away from another user. If the operation is --- -- not possible, the procedure does nothing. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be changed --- -- @param holder_id The person who is attempting to revoke the permissions --- -- @param privilege The privilege to be revoked --- -- @param recepient_id The person who will lose the privilege --- -- @param is_recursive If 't', applies the operation recursively to --- -- all child objects of the object (equivalent to UNIX's chmod -r). --- -- If 'f', only affects the objects itself. --- -- @see {content_permission.grant_permission}, {content_permission.has_revoke_authority}, --- -- {acs_permission.revoke_permission} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- holder_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE, --- revokee_id in parties.party_id%TYPE, --- is_recursive in varchar2 default 'f', --- object_type in acs_objects.object_type%TYPE default 'content_item' --- ); --- --- function permission_p ( --- --/** Determine if the user has the specified permission on the specified --- -- object. Does NOT check objects recursively: that is, if the user has --- -- the permission on the parent object, he does not automatically gain --- -- the permission on all the child objects. --- -- @author Karl Goldstein --- -- @param object_id The object whose permissions are to be checked --- -- @param holder_id The person whose permissions are to be examined --- -- @param privilege The privilege to be checked --- -- @return 't' if the user has the specified permission on the object, --- -- 'f' otherwise --- -- @see {content_permission.grant_permission}, {content_permission.revoke_permission}, --- -- {acs_permission.permission_p} --- --*/ --- object_id in acs_objects.object_id%TYPE, --- holder_id in parties.party_id%TYPE, --- privilege in acs_privileges.privilege%TYPE --- ) return varchar2; --- --- function cm_admin_exists --- -- /** Determine if there exists a user who has administrative --- -- privileges on the entire content repository. --- -- @author Stanislav Freidin --- -- @return 't' if an administrator exists, 'f' otherwise --- -- @see {content_permission.grant_permission} --- return varchar2; --- --- end content_permission; - --- show errors - \i content-type.sql \i content-item.sql \i content-revision.sql Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-4.6.4-4.6.5.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/tcl/extlink-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-content-repository/tcl/item-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs-oracle.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/acs-content-repository/tcl/item-procs-oracle.xql 17 Sep 2001 05:16:40 -0000 1.1 +++ openacs-4/packages/acs-content-repository/tcl/item-procs-oracle.xql 20 Mar 2003 22:11:36 -0000 1.1.4.1 @@ -39,4 +39,19 @@ + + + + begin + content_item.copy( + item_id => :item_id, + target_folder_id => :target_folder_id, + creation_user => :creation_user, + creation_ip => :creation_ip + ); + end; + + + + Index: openacs-4/packages/acs-content-repository/tcl/item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs-postgresql.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/acs-content-repository/tcl/item-procs-postgresql.xql 17 Sep 2001 05:16:40 -0000 1.1 +++ openacs-4/packages/acs-content-repository/tcl/item-procs-postgresql.xql 20 Mar 2003 22:11:36 -0000 1.1.4.1 @@ -40,4 +40,18 @@ + + + + select content_item__copy( + :item_id, + :target_folder_id, + :creation_user, + :creation_ip + ) + + + + + Index: openacs-4/packages/acs-content-repository/tcl/item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/item-procs.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 19 Feb 2003 13:38:29 -0000 1.5.2.1 +++ openacs-4/packages/acs-content-repository/tcl/item-procs.tcl 20 Mar 2003 22:11:36 -0000 1.5.2.2 @@ -263,3 +263,25 @@ return $file_url } + +ad_proc item::copy { + -item_id:required + -target_folder_id:required +} { + + Copy the given item. + + @param item_id The content item to copy + @param target_folder_id The folder which will hold the new copy + +} { + + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + db_exec_plsql copy_item {} + +} + +} { + Index: openacs-4/packages/attachments/attachments.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/attachments.info,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/attachments/attachments.info 3 Feb 2003 16:38:31 -0000 1.7.2.2 +++ openacs-4/packages/attachments/attachments.info 20 Mar 2003 22:11:54 -0000 1.7.2.3 @@ -7,7 +7,7 @@ f t - + oracle postgresql @@ -18,8 +18,8 @@ OpenForce, Inc. Attachments - - + + Index: openacs-4/packages/attachments/www/go-to-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/attachments/www/go-to-attachment.tcl 12 Dec 2002 00:23:52 -0000 1.2.2.1 +++ openacs-4/packages/attachments/www/go-to-attachment.tcl 20 Mar 2003 22:12:18 -0000 1.2.2.2 @@ -18,9 +18,8 @@ } switch $object_type { - fs_url { - set url [db_string select_url {}] - ad_returnredirect $url + content_extlink { + ad_returnredirect [db_string select_url {}] ad_script_abort return } Index: openacs-4/packages/attachments/www/go-to-attachment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/attachments/www/go-to-attachment.xql 12 Dec 2002 00:23:52 -0000 1.1.2.1 +++ openacs-4/packages/attachments/www/go-to-attachment.xql 20 Mar 2003 22:12:18 -0000 1.1.2.2 @@ -2,25 +2,22 @@ - -select -object_type -from attachments, acs_objects -where -attachments.object_id = :object_id and -attachments.item_id = :attachment_id and -attachments.item_id = acs_objects.object_id - + + select object_type + from attachments, acs_objects + where + attachments.object_id = :object_id and + attachments.item_id = :attachment_id and + attachments.item_id = acs_objects.object_id + - -select -url -from fs_urls -where -url_id = :attachment_id - + + select url + from cr_extlinks + where extlink_id = :attachment_id + Index: openacs-4/packages/attachments/www/simple-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/simple-add-2.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/attachments/www/simple-add-2.tcl 2 Jul 2002 04:18:54 -0000 1.1 +++ openacs-4/packages/attachments/www/simple-add-2.tcl 20 Mar 2003 22:12:18 -0000 1.1.2.1 @@ -24,11 +24,11 @@ ad_require_permission $folder_id write db_transaction { - # Create the URL (for now) - set url_id [fs::url_new -url $url -name $title -description $description -folder_id $folder_id] - # Attach the URL - attachments::attach -object_id $object_id -attachment_id $url_id + # Create and attach the URL + attachments::attach -object_id $object_id \ + -attachment_id [content_simple::new -url $url -label $title -description $description -parent_id $folder_id] + } ad_returnredirect "$return_url" Index: openacs-4/packages/attachments/www/simple-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/simple-add.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/attachments/www/simple-add.tcl 17 Sep 2002 21:08:38 -0000 1.4 +++ openacs-4/packages/attachments/www/simple-add.tcl 20 Mar 2003 22:12:18 -0000 1.4.2.1 @@ -30,18 +30,14 @@ # set templating datasources -set pretty_name [fs::simple_get_type_pretty_name -type $type] -if {[empty_string_p $pretty_name]} { - return -code error "No such type" -} +set pretty_name "URL" set context {{Attach URL}} set fs_context_bar [fs_context_bar_list -final "Add $pretty_name" $folder_id] # Should probably generate the item_id and version_id now for # double-click protection - # if title isn't passed in ignore lock_title_p if {[empty_string_p $title]} { set lock_title_p 0 Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.17.2.4 -r1.17.2.5 --- openacs-4/packages/file-storage/file-storage.info 20 Mar 2003 14:47:21 -0000 1.17.2.4 +++ openacs-4/packages/file-storage/file-storage.info 20 Mar 2003 22:12:32 -0000 1.17.2.5 @@ -6,159 +6,30 @@ File Storage Areas f f - - - - oracle - postgresql - + + Jowell S. Sabino

This application allows users to collaboratively maintain documents on the web server 2002-10-27 OpenACS Now allows storage of files on the filesystem or database. - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - + + + + + Index: openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 17 Sep 2002 21:03:24 -0000 1.4 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 20 Mar 2003 22:12:50 -0000 1.4.2.1 @@ -246,6 +246,7 @@ -- allow child items to be added content_folder.register_content_type(v_folder_id,'content_revision','t'); content_folder.register_content_type(v_folder_id,'content_folder','t'); + content_folder.register_content_type(v_folder_id,'content_extlink','t'); -- set up default permissions acs_permission.grant_permission( @@ -612,6 +613,12 @@ 't' -- include_subtypes ); + content_folder.register_content_type( + v_folder_id, -- folder_id + 'content_extlink', -- content_type + 't' -- include_subtypes + ); + -- Give the creator admin privileges on the folder acs_permission.grant_permission( v_folder_id, -- object_id Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/oracle/file-storage-simple-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/oracle/file-storage-simple-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql 17 Feb 2003 20:31:19 -0000 1.5.2.1 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-views-create.sql 20 Mar 2003 22:12:50 -0000 1.5.2.2 @@ -8,23 +8,18 @@ create or replace view fs_urls_full as - select fs_urls.url_id, - fs_urls.url, - fs_simple_objects.folder_id, - fs_simple_objects.name, - fs_simple_objects.description, + select cr_extlinks.extlink_id as url_id, + cr_extlinks.url, + cr_items.parent_id as folder_id, + cr_extlinks.label as name, + cr_extlinks.description, acs_objects.* - from fs_urls, - fs_simple_objects, + from cr_extlinks, + cr_items, acs_objects - where fs_urls.url_id = fs_simple_objects.object_id - and fs_simple_objects.object_id = acs_objects.object_id; + where cr_extlinks.extlink_id = cr_items.item_id + and cr_items.item_id = acs_objects.object_id; --- DRB: note that content size is incorrect as it does not include --- URLs. The fix for this: get rid of OF's fucked-up fs_simple_objects --- and use the URLs in the content repository that were so kindly --- implemented for us by Ars Digita in the first place ... - create or replace view fs_folders as select cr_folders.folder_id, @@ -64,44 +59,38 @@ create or replace view fs_objects as - select fs_folders.folder_id as object_id, - 0 as live_revision, - 'folder' as type, - fs_folders.content_size, - fs_folders.name, - '' as file_upload_name, - fs_folders.last_modified, - '' as url, - fs_folders.parent_id, - fs_folders.key, - 0 as sort_key - from fs_folders - union all - select fs_files.file_id as object_id, - fs_files.live_revision, - fs_files.type, - fs_files.content_size, - fs_files.name, - fs_files.file_upload_name, - fs_files.last_modified, - '' as url, - fs_files.parent_id, - fs_files.key, - 1 as sort_key - from fs_files - union all - select fs_urls_full.url_id as object_id, - 0 as live_revision, - 'url' as type, - 0 as content_size, - fs_urls_full.name, - fs_urls_full.name as file_upload_name, - fs_urls_full.last_modified, - fs_urls_full.url, - fs_urls_full.folder_id as parent_id, - fs_urls_full.url as key, - 1 as sort_key - from fs_urls_full; - - - + select cr_items.item_id as object_id, + cr_items.live_revision, + case + when cr_items.content_type = 'content_folder' then 'folder' + when cr_items.content_type = 'content_extlink' then 'url' + else cr_revisions.mime_type + end as type, + case + when cr_items.content_type = 'content_folder' + then (select count(*) + from cr_items ci + where ci.content_type <> 'content_folder' + connect by prior ci.item_id = ci.parent_id + start with ci.item_id = cr_folders.folder_id) + else 0 + end as content_size, + case + when cr_items.content_type = 'content_folder' then cr_folders.label + when cr_items.content_type = 'content_extlink' then cr_extlinks.label + else cr_items.name + end as name, + cr_revisions.title as file_upload_name, + acs_objects.last_modified, + cr_extlinks.url, + cr_items.parent_id, + cr_items.name as key, + case + when cr_items.content_type = 'content_folder' then 0 + else 1 + end as sort_key + from cr_items, cr_extlinks, cr_folders, cr_revisions, acs_objects + where cr_items.item_id = cr_extlinks.extlink_id(+) + and cr_items.item_id = cr_folders.folder_id(+) + and cr_items.item_id = acs_objects.object_id + and cr_items.live_revision = cr_revisions.revision_id(+); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-4.6.1-4.6.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 18 Sep 2002 06:03:29 -0000 1.8 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 20 Mar 2003 22:13:19 -0000 1.8.2.1 @@ -131,6 +131,11 @@ ''content_folder'', -- content_types ''t'' -- include_subtypes ); + PERFORM content_folder__register_content_type( + v_folder_id, -- folder_id + ''content_extlink'', -- content_types + ''t'' -- include_subtypes + ); -- set up default permissions PERFORM acs_permission__grant_permission ( @@ -637,6 +642,12 @@ ''t'' -- include_subtypes (default) ); + PERFORM content_folder__register_content_type( + v_folder_id, -- folder_id + ''content_extlink'', -- content_types + ''t'' -- include_subtypes + ); + -- Give the creator admin privileges on the folder PERFORM acs_permission__grant_permission ( v_folder_id, -- object_id Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.3 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/postgresql/file-storage-simple-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql,v diff -u -r1.6.2.2 -r1.6.2.3 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql 18 Feb 2003 01:45:06 -0000 1.6.2.2 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-views-create.sql 20 Mar 2003 22:13:19 -0000 1.6.2.3 @@ -8,17 +8,17 @@ create view fs_urls_full as - select fs_urls.url_id, - fs_urls.url, - fs_simple_objects.folder_id, - fs_simple_objects.name, - fs_simple_objects.description, + select cr_extlinks.extlink_id as url_id, + cr_extlinks.url, + cr_items.parent_id as folder_id, + cr_extlinks.label as name, + cr_extlinks.description, acs_objects.* - from fs_urls, - fs_simple_objects, + from cr_extlinks, + cr_items, acs_objects - where fs_urls.url_id = fs_simple_objects.object_id - and fs_simple_objects.object_id = acs_objects.object_id; + where cr_extlinks.extlink_id = cr_items.item_id + and cr_items.item_id = acs_objects.object_id; create view fs_folders as @@ -37,7 +37,6 @@ where cr_folders.folder_id = ci.item_id and cr_folders.folder_id = acs_objects.object_id; - create view fs_files as select cr_revisions.item_id as file_id, @@ -57,46 +56,38 @@ and cr_items.content_type = 'file_storage_object' and cr_revisions.revision_id = acs_objects.object_id; --- DRB: Simple advice: don't use this view in PostgreSQL because, unlike in Oracle, it is --- *never* optimized ... - create view fs_objects as - select fs_folders.folder_id as object_id, - 0 as live_revision, - 'folder' as type, - fs_folders.content_size, - fs_folders.name, - '' as file_upload_name, - fs_folders.last_modified, - '' as url, - fs_folders.parent_id, - fs_folders.key, - 0 as sort_key - from fs_folders - union all - select fs_files.file_id as object_id, - fs_files.live_revision, - fs_files.type, - fs_files.content_size, - fs_files.name, - fs_files.file_upload_name, - fs_files.last_modified, - '' as url, - fs_files.parent_id, - fs_files.key, - 1 as sort_key - from fs_files - union all - select fs_urls_full.url_id as object_id, - 0 as live_revision, - 'url' as type, - 0 as content_size, - fs_urls_full.name, - fs_urls_full.name as file_upload_name, - fs_urls_full.last_modified, - fs_urls_full.url, - fs_urls_full.folder_id as parent_id, - fs_urls_full.url as key, - 1 as sort_key - from fs_urls_full; + select cr_items.item_id as object_id, + cr_items.live_revision, + case + when cr_items.content_type = 'content_folder' then 'folder' + when cr_items.content_type = 'content_extlink' then 'url' + else cr_revisions.mime_type + end as type, + case + when cr_items.content_type = 'content_folder' + then (select count(*) + from cr_items ci2 + where ci2.content_type <> 'content_folder' + and ci2.tree_sortkey between cr_items.tree_sortkey and tree_right(cr_items.tree_sortkey)) + else 0 + end as content_size, + case + when cr_items.content_type = 'content_folder' then cr_folders.label + when cr_items.content_type = 'content_extlink' then cr_extlinks.label + else cr_items.name + end as name, + cr_revisions.title as file_upload_name, + acs_objects.last_modified, + cr_extlinks.url, + cr_items.parent_id, + cr_items.name as key, + case + when cr_items.content_type = 'content_folder' then 0 + else 1 + end as sort_key + from cr_items left join cr_extlinks on (cr_items.item_id = cr_extlinks.extlink_id) + left join cr_folders on (cr_items.item_id = cr_folders.folder_id) + left join cr_revisions on (cr_items.live_revision = cr_revisions.revision_id) + join acs_objects on (cr_items.item_id = acs_objects.object_id); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v diff -u -r1.25.2.3 -r1.25.2.4 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 18 Feb 2003 01:45:42 -0000 1.25.2.3 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 20 Mar 2003 22:13:59 -0000 1.25.2.4 @@ -322,10 +322,6 @@ } { Return a list the object_ids contained by a file storage folder. - This would be trivial if it weren't for the fact that we need to UNION ALL - with the gawddamned fs_simple_objects Open Force forced upon us and which - will be removed as soon as I (DRB) find the time to write upgrade scripts. - @param folder_id The folder for which to retrieve contents @param user_id The viewer of the contents (to make sure they have permission) @@ -410,7 +406,7 @@ if {[string equal folder $type]} { set result [publish_folder_to_file_system -folder_id $object_id -path $path -folder_name $name -user_id $user_id] } elseif {[string equal url $type]} { - set result [publish_simple_object_to_file_system -object_id $object_id -path $path -file_name $file_name] + set result [publish_url -object_id $object_id -path $path -file_name $file_name] } else { set result [publish_versioned_object_to_file_system -object_id $object_id -path $path] } @@ -449,29 +445,9 @@ return $dir } - ad_proc -public publish_simple_object_to_file_system { + ad_proc -public publish_url_to_file_system { {-object_id:required} {-path ""} - {-file_name:required} - } { - publish a simple object to the file system; you must implement a proc - named 'fs::publish_simple__to_file_system', where is the - fs_simple_object type that you create, for each new simple file storage - object you create. - } { - if {[empty_string_p $path]} { - set path [ns_tmpnam] - file mkdir $path - } - - set object [db_list_of_ns_sets select_object_info {}] - - return [publish_simple_[ns_set get $object type]_to_file_system -object $object -path $path -file_name $file_name] - } - - ad_proc -public publish_simple_url_to_file_system { - {-object:required} - {-path ""} {-file_name ""} } { publish a url object to the file system @@ -481,15 +457,15 @@ file mkdir $path } - set object [lindex $object 0] + db_1row select_object_metadata {} if {[empty_string_p $file_name]} { - set file_name [ns_set get $object name] + set file_name $label } set file_name [remove_special_file_system_characters -string $file_name] set fp [open [file join ${path} ${file_name}] w] - puts $fp [ns_set get $object url] + puts $fp url close $fp return [file join ${path} ${file_name}] Index: openacs-4/packages/file-storage/tcl/file-storage-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.xql,v diff -u -r1.10.2.3 -r1.10.2.4 --- openacs-4/packages/file-storage/tcl/file-storage-procs.xql 7 Mar 2003 00:11:52 -0000 1.10.2.3 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.xql 20 Mar 2003 22:13:59 -0000 1.10.2.4 @@ -57,21 +57,15 @@ - select * - from (select cr_items.item_id as object_id, - cr_items.name - from cr_items - where cr_items.parent_id = :folder_id - union all - select fs_simple_objects.object_id, - fs_simple_objects.name - from fs_simple_objects - where fs_simple_objects.folder_id = :folder_id) contents - where exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = contents.object_id - and m.party_id = :user_id - and m.privilege = 'read') + select cr_items.item_id as object_id, + cr_items.name + from cr_items + where cr_items.parent_id = :folder_id + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = cr_items.item_id + and m.party_id = :user_id + and m.privilege = 'read') @@ -92,11 +86,11 @@ - + - select fs_objects.* - from fs_objects - where fs_objects.object_id = :object_id + select fs_urls_full.* + from fs_urls_full + where fs_urls_full.object_id = :object_id Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/tcl/fs-simple-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/tcl/fs-simple-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/tcl/fs-simple-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/file-storage/tcl/fs-simple-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 18 Mar 2003 01:44:01 -0000 1.1.2.6 +++ openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 20 Mar 2003 22:14:12 -0000 1.1.2.7 @@ -14,69 +14,24 @@ fs_objects.url, fs_objects.sort_key, fs_objects.file_upload_name, - case when fs_objects.last_modified >= (now() - interval '$n_past_days days') then 1 else 0 end as new_p, - delete_p, - write_p - from - (select fs_folders.folder_id as object_id, - 0 as live_revision, - 'folder' as type, - fs_folders.content_size, - fs_folders.name, - '' as file_upload_name, - fs_folders.last_modified, - '' as url, - fs_folders.parent_id, - cast('f' as bool) as write_p, - cast('f' as bool) as delete_p, - 0 as sort_key - from fs_folders - where fs_folders.parent_id = :folder_id - and exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = fs_folders.folder_id - and m.party_id = :viewing_user_id - and m.privilege = 'read') - union all - select fs_files.file_id as object_id, - fs_files.live_revision, - fs_files.type, - fs_files.content_size, - fs_files.name, - fs_files.file_upload_name, - fs_files.last_modified, - '' as url, - fs_files.parent_id, - cast('f' as bool) as write_p, - cast('f' as bool) as delete_p, - 1 as sort_key - from fs_files - where fs_files.parent_id = :folder_id - and exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = fs_files.file_id - and m.party_id = :viewing_user_id - and m.privilege = 'read') - union all - select fs_urls_full.url_id as object_id, - 0 as live_revision, - 'url' as type, - 0 as content_size, - fs_urls_full.name, - fs_urls_full.name as file_upload_name, - fs_urls_full.last_modified, - fs_urls_full.url, - fs_urls_full.folder_id as parent_id, - acs_permission__permission_p(fs_urls_full.url_id, :viewing_user_id, 'write') as write_p, - acs_permission__permission_p(fs_urls_full.url_id, :viewing_user_id, 'delete') as delete_p, - 1 as sort_key - from fs_urls_full - where fs_urls_full.folder_id = :folder_id - and exists (select 1 - from acs_object_party_privilege_map m - where m.object_id = fs_urls_full.url_id - and m.party_id = :viewing_user_id - and m.privilege = 'read')) as fs_objects + case when fs_objects.last_modified >= (now() - cast('$n_past_days days' as interval)) then 1 else 0 end as new_p, + case + when type = 'url' + then acs_permission__permission_p(fs_objects.object_id, :viewing_user_id, 'delete') + else 't' + end as delete_p, + case + when type = 'url' + then acs_permission__permission_p(fs_objects.object_id, :viewing_user_id, 'write') + else 't' + end as write_p + from fs_objects + where fs_objects.parent_id = :folder_id + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = fs_objects.object_id + and m.party_id = :viewing_user_id + and m.privilege = 'read') order by fs_objects.sort_key, fs_objects.name Index: openacs-4/packages/file-storage/www/simple-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-add-2.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/file-storage/www/simple-add-2.tcl 27 Apr 2002 17:00:16 -0000 1.2 +++ openacs-4/packages/file-storage/www/simple-add-2.tcl 20 Mar 2003 22:14:12 -0000 1.2.2.1 @@ -21,7 +21,6 @@ # Check for write permission on this folder ad_require_permission $folder_id write -# Create the URL (for now) -set url_id [fs::url_new -url $url -name $title -description $description -folder_id $folder_id] +content_extlink::new -url $url -label $title -description $description -parent_id $folder_id ad_returnredirect "?folder_id=$folder_id" Index: openacs-4/packages/file-storage/www/simple-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-add.adp,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/file-storage/www/simple-add.adp 6 Sep 2002 21:50:38 -0000 1.4 +++ openacs-4/packages/file-storage/www/simple-add.adp 20 Mar 2003 22:14:12 -0000 1.4.2.1 @@ -4,7 +4,7 @@
- +
Index: openacs-4/packages/file-storage/www/simple-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-add.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/file-storage/www/simple-add.tcl 10 Sep 2002 22:22:56 -0000 1.4 +++ openacs-4/packages/file-storage/www/simple-add.tcl 20 Mar 2003 22:14:12 -0000 1.4.2.1 @@ -7,7 +7,6 @@ @cvs-id $Id$ } { folder_id:integer,notnull - {type "fs_url"} {title ""} {lock_title_p 0} } -validate { @@ -27,17 +26,13 @@ # set templating datasources -set pretty_name [fs::simple_get_type_pretty_name -type $type] -if {[empty_string_p $pretty_name]} { - return -code error "No such type" -} +set pretty_name "URL" set context [fs_context_bar_list -final "Add $pretty_name" $folder_id] # Should probably generate the item_id and version_id now for # double-click protection - # if title isn't passed in ignore lock_title_p if {[empty_string_p $title]} { set lock_title_p 0 Index: openacs-4/packages/file-storage/www/simple-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-delete.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/file-storage/www/simple-delete.tcl 10 Sep 2002 22:22:56 -0000 1.2 +++ openacs-4/packages/file-storage/www/simple-delete.tcl 20 Mar 2003 22:14:12 -0000 1.2.2.1 @@ -13,6 +13,6 @@ ad_require_permission $object_id delete # Delete -fs::simple_delete -object_id $object_id +content_extlink::delete -extlink_id $object_id ad_returnredirect "./?folder_id=$folder_id" Index: openacs-4/packages/file-storage/www/simple-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/simple-edit-2.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/file-storage/www/simple-edit-2.tcl 2 Apr 2002 06:50:49 -0000 1.1 +++ openacs-4/packages/file-storage/www/simple-edit-2.tcl 20 Mar 2003 22:14:12 -0000 1.1.2.1 @@ -15,8 +15,8 @@ ad_require_permission $object_id write # edit the URL -fs::url_edit -url_id $object_id -name $name -description $description -url $url +content_extlink::edit -extlink_id $object_id -url $url -label $name -description $description -set folder_id [db_string select_folder_id "select folder_id from fs_simple_objects where object_id= :object_id"] +set folder_id [db_string select_folder_id {}] ad_returnredirect "?folder_id=$folder_id" Index: openacs-4/packages/file-storage/www/simple-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/simple-edit.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/file-storage/www/simple-edit.tcl 5 Sep 2002 09:29:00 -0000 1.2 +++ openacs-4/packages/file-storage/www/simple-edit.tcl 20 Mar 2003 22:14:12 -0000 1.2.2.1 @@ -17,7 +17,4 @@ set pretty_name "$name" set context [fs_context_bar_list -final "Edit URL" $folder_id] -# Should probably generate the item_id and version_id now for -# double-click protection - ad_return_template Index: openacs-4/packages/file-storage/www/url-goto.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/url-goto.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/file-storage/www/url-goto.tcl 10 Sep 2002 22:22:56 -0000 1.2 +++ openacs-4/packages/file-storage/www/url-goto.tcl 20 Mar 2003 22:14:12 -0000 1.2.2.1 @@ -8,14 +8,11 @@ url_id:notnull } -# Check for write permission on this folder +# Check for read permission on this url ad_require_permission $url_id read -# Check the URL -set url [db_string select_url "select url from fs_urls where url_id= :url_id" -default ""] - -if {![empty_string_p $url]} { - ad_returnredirect $url -} else { +if { ![db_0or1row select_url {}] } { return -code error "no such URL" } + +ad_returnredirect $url