Index: openacs-4/packages/acs-content-repository/tcl/symlink-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/symlink-procs-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-content-repository/tcl/symlink-procs-oracle.xql 27 Jan 2004 19:42:17 -0000 1.1
@@ -0,0 +1,77 @@
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_symlink.new (
+ name => :name,
+ target_id => :target_id,
+ label => :label,
+ parent_id => :parent_id,
+ symlink_id => :symlink_id,
+ creation_user => :creation_user,
+ creation_ip => :creation_ip
+ );
+ end;
+
+
+
+
+
+
+
+ update acs_objects
+ set last_modified = sysdate,
+ modifying_user = :modifying_user,
+ modifying_ip = :modifying_ip
+ where object_id = :symlink_id
+
+
+
+
+
+
+
+ begin
+ content_symlink.del (
+ symlink_id => :symlink_id
+ );
+ end;
+
+
+
+
+
+
+
+ select content_symlink.is_symlink (:item_id)
+ from dual
+
+
+
+
+
+
+
+ select content_symlink.resolve (
+ :item_id
+ ) from dual
+
+
+
+
+
+
+
+ select content_symlink.resolve_content_type (
+ :item_id
+ ) from dual
+
+
+
+
+
+
Index: openacs-4/packages/acs-content-repository/tcl/symlink-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/symlink-procs-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-content-repository/tcl/symlink-procs-postgresql.xql 27 Jan 2004 19:42:17 -0000 1.1
@@ -0,0 +1,73 @@
+
+
+ postgresql7.1
+
+
+
+
+ select content_symlink__new (
+ :name,
+ :label,
+ :target_id,
+ :parent_id,
+ :symlink_id,
+ current_timestamp,
+ :creation_user,
+ :creation_ip
+ );
+
+
+
+
+
+
+
+ update acs_objects
+ set last_modified = current_timestamp,
+ modifying_user = :modifying_user,
+ modifying_ip = :modifying_ip
+ where object_id = :symlink_id
+
+
+
+
+
+
+
+ select content_symlink__delete (
+ :symlink_id
+ );
+
+
+
+
+
+
+
+ select content_symlink__is_symlink (
+ :item_id
+ );
+
+
+
+
+
+
+
+ select content_symlink__resolve (
+ :item_id
+ );
+
+
+
+
+
+
+ select content_symlink__resolve_content_type (
+ :item_id
+ };
+
+
+
+
+
Index: openacs-4/packages/acs-content-repository/tcl/symlink-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/symlink-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-content-repository/tcl/symlink-procs.tcl 27 Jan 2004 19:42:17 -0000 1.1
@@ -0,0 +1,125 @@
+ad_library {
+
+ Manage external links in the content repository
+
+ @author Dave Bauer (dave@thedesignexperience.org)
+ @cvs-d $Id:
+
+}
+
+namespace eval content_symlink {}
+
+ad_proc content_symlink::new {
+ {-symlink_id ""}
+ -target_id:required
+ -parent_id:required
+ {-name ""}
+ {-label ""}
+} {
+
+ Create a new internal link.
+
+ @symlink_id Optional pre-assigned object_id for the link
+ @target_id The item_id of the target of the link
+ @parent_id The folder that will contain this symlink
+ @name Name to assign the object (defaults to the name of the target item)
+ @label Label for the symlink (defaults to the URL)
+ @description An extended description of the link (defaults to NULL)
+
+} {
+
+ set creation_user [ad_conn user_id]
+ set creation_ip [ad_conn peeraddr]
+
+ return [db_exec_plsql symlink_new {}]
+
+}
+
+ad_proc content_symlink::edit {
+ -symlink_id:required
+ -target_id:required
+ -label:required
+} {
+
+ Edit an existing internal link. The parameters are required because it
+ is assumed that the caller will be pulling the existing values out of
+ the database before editing them.
+
+ @symlink_id Optional pre-assigned object_id for the link
+ @target_id The target item_id of the link
+ @label Label for the symlink (defaults to the target_id item title)
+ @description An extended description of the link (defaults to NULL)
+
+} {
+
+ set modifying_user [ad_conn user_id]
+ set modifying_ip [ad_conn peeraddr]
+
+ db_transaction {
+ db_dml symlink_update_object {}
+ db_dml symlink_update_symlink {}
+ }
+
+}
+
+ad_proc content_symlink::delete {
+ -symlink_id:required
+} {
+
+ Delete an external link.
+
+ @symlink_id The object id of the link to delete
+
+} {
+ db_exec_plsql symlink_delete {}
+}
+
+ad_proc content_symlink::symlink_p {
+ -item_id:required
+} {
+
+ Returns true if the given item is a symlink
+
+ @symlink_id The object id of the item to check.
+
+} {
+ return [db_string symlink_check {}]
+}
+
+ad_proc content_symlink::symlink_name {
+ -item_id:required
+} {
+
+ Returns the name of an symlink
+
+ @item_id The object id of the item to check.
+
+} {
+ return [db_string symlink_name {}]
+}
+
+ad_proc -public content_symlink::resolve {
+ -item_id:required
+} {
+ @param item)id item_id of content_symlink item to resolve
+
+ @return item_id of symlink target
+} {
+
+ return [db_exec_plsql resolve_symlink ""]
+
+}
+
+ad_proc -public content_symlink::resolve_content_type {
+ -item_id:required
+} {
+
+ @param item_id item_id of symlink
+
+ @return content_type of target item
+
+} {
+
+ return [db_exec_plsql resolve_content_type ""]
+
+}
Index: openacs-4/packages/acs-content-repository/tcl/symlink-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/symlink-procs.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-content-repository/tcl/symlink-procs.xql 27 Jan 2004 19:42:17 -0000 1.1
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ update cr_symlinks
+ set target_id = :target_id,
+ label = :label,
+ description = :description
+ where symlink_id = :symlink_id
+
+
+
+
+
+
+ select label
+ from cr_symlinks
+ where symlink_id = :item_id
+
+
+
+