Index: openacs-4/packages/cms/www/modules/items/assign-keywords-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/assign-keywords-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/assign-keywords-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_keyword.item_assign(
+ :root_id, :item_id, null, :user_id, :ip);
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/assign-keywords-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/assign-keywords-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/assign-keywords-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ postgresql7.1
+
+
+
+
+
+ select content_keyword__item_assign(
+ :root_id, :item_id, null, :user_id, :ip);
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/attributes-edit-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes-edit-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/attributes-edit-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,22 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ i.content_type, i.name, nvl(r.title, i.name) title, i.latest_revision
+ from
+ cr_items i, cr_revisions r
+ where
+ i.item_id = :item_id
+ and
+ i.latest_revision = r.revision_id (+)
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/attributes-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/attributes-edit.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ i.content_type, i.name, coalesce(r.title, i.name) title, i.latest_revision
+ from
+ cr_items i left outer join cr_revisions r on i.latest_revision = r.revision_id
+ where
+ i.item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/attributes-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/attributes-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ content_item.get_revision_count(x.item_id) revision_count,
+ content_revision.get_number(:revision_id) revision_number,
+ content_item.get_live_revision(x.item_id) live_revision,
+ x.*
+ from
+ $type_info(table_name)x x
+ where
+ object_id = :revision_id
+
+
+
+
+
+
+
+ select
+ types.pretty_name object_label,
+ types.table_name,
+ types.id_column,
+ attr.attribute_name,
+ attr.pretty_name attribute_label
+ from
+ acs_attributes attr,
+ ( select
+ object_type, pretty_name, table_name, id_column,
+ level as inherit_level
+ from
+ acs_object_types
+ where
+ object_type ^= 'acs_object'
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :content_type) types
+ where
+ attr.object_type = types.object_type
+ order by
+ types.inherit_level desc
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/attributes-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/attributes-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,54 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ content_item__get_revision_count(x.item_id) as revision_count,
+ content_revision__get_number(:revision_id) as revision_number,
+ content_item__get_live_revision(x.item_id) as live_revision,
+ x.*
+ from
+ $type_info(table_name)x x
+ where
+ object_id = :revision_id
+
+
+
+
+
+
+
+ select
+ types.pretty_name as object_label,
+ types.table_name,
+ types.id_column,
+ attr.attribute_name,
+ attr.pretty_name as attribute_label
+ from
+ acs_attributes attr,
+ ( select
+ ot2.object_type, ot2.pretty_name, ot2.table_name, ot2.id_column,
+ tree_level(ot2.tree_sortkey) as inherit_level
+ from
+ (select * from acs_object_types where object_type = :content_type) ot1,
+ acs_object_types ot2
+ where
+ ot2.object_type != 'acs_object'
+ and
+ ot2.tree_sortkey <= ot1.tree_sortkey
+ and
+ ot1.tree_sortkey like (ot2.tree_sortkey || '%')) types
+ where
+ attr.object_type = types.object_type
+ order by
+ types.inherit_level desc
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/attributes.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/attributes.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ select
+ o.object_type, t.table_name
+ from
+ acs_objects o, acs_object_types t
+ where
+ o.object_id = :revision_id
+ and
+ o.object_type = t.object_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/comment-add-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/comment-add-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/comment-add-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,41 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 = journal_entry.new(
+ journal_id => :journal_id,
+ object_id => :object_id,
+ action => 'comment',
+ action_pretty => 'Comment',
+ creation_user => :user_id,
+ creation_ip => :ip_address,
+ msg => :msg );
+ end;
+
+
+
+
+
+
+
+ select content_item.get_title(:item_id) from dual
+
+
+
+
+
+
+
+
+ select acs_object_id_seq.nextval from dual
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/comment-add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/comment-add-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/comment-add-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,41 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select journal_entry__new(
+ :journal_id,
+ :object_id,
+ 'comment',
+ 'Comment',
+ now(),
+ :user_id,
+ :ip_address,
+ :msg );
+
+
+
+
+
+
+
+
+ select content_item__get_title(:item_id, 'f')
+
+
+
+
+
+
+
+
+ select acs_object_id_seq.nextval
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/comments-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/comments-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/comments-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,36 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ journal_id, action_pretty, msg,
+ decode(NVL(p.person_id, 0),
+ 0, 'System',
+ substr(p.first_names, 1, 1) || '. ' || p.last_name) person,
+ to_char(o.creation_date, 'MM/DD/YY HH24:MI:SS') when
+ from
+ journal_entries j, acs_objects o, persons p
+ where
+ (
+ j.object_id = :item_id
+ or
+ j.object_id in (select case_id from wf_cases c
+ where c.object_id = :item_id)
+ ) and
+ j.journal_id = o.object_id
+ and
+ o.creation_user = p.person_id (+)
+ and
+ msg is not null
+ order by
+ o.creation_date desc
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/comments-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/comments-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/comments-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,36 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ journal_id, action_pretty, msg,
+ case when coalesce(p.person_id, 0) = 0
+ then 'System'
+ else
+ substr(p.first_names, 1, 1) || '. ' || p.last_name
+ end as person,
+ to_char(o.creation_date, 'MM/DD/YY HH24:MI:SS') as when
+ from
+ journal_entries j, acs_objects o left outer join persons p on o.creation_user = p.person_id
+ where
+ (
+ j.object_id = :item_id
+ or
+ j.object_id in (select case_id from wf_cases c
+ where c.object_id = :item_id)
+ ) and
+ j.journal_id = o.object_id
+ and
+ msg is not null
+ order by
+ o.creation_date desc
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/content-add-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-add-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/content-add-1.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ select
+ i.item_id, content_type, title as name, mime_type
+ from
+ cr_revisions r, cr_items i
+ where
+ i.item_id = r.item_id
+ and
+ r.revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/content-add-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-add-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/content-add-2.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ item_id, title as name
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/content-download-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/content-download-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,34 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ content
+ from
+ cr_revisions
+ where
+ revision_id = $revision_id
+
+
+
+
+
+
+
+
+ select
+ item_id, mime_type, content_revision.is_live( revision_id ) is_live
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,36 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ r.content, i.storage_type
+ from
+ cr_revisions r, cr_items i
+ where
+ r.item_id = i.item_id
+ and
+ revision_id = $revision_id
+
+
+
+
+
+
+
+
+ select
+ item_id, mime_type, content_revision__is_live( revision_id ) as is_live
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/content-download.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/Attic/content-download.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/content-download.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ select
+ name
+ from
+ cr_items
+ where
+ item_id = ( select
+ item_id
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id )
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/create-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/create-1.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ pretty_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/create-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-2-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/create-2-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ nvl(content_item.get_path(:parent_id), '/') as item_path,
+ pretty_name as content_type_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/create-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-2-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/create-2-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,21 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ coalesce(content_item__get_path(:parent_id,null), '/') as item_path,
+ pretty_name as content_type_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/delete-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/delete-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/delete-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ content_item.delete(
+ item_id => :item_id
+ );
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/delete-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/delete-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/delete-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__delete(:item_id)
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/delete.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/delete.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/delete.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ parent_id
+ from
+ cr_resolved_items
+ where
+ resolved_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/export-xml-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/export-xml-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/export-xml-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_revision.export_xml(:revision_id);
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/export-xml-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/export-xml-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/export-xml-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ postgresql7.1
+
+
+
+
+-- FIXME: need to modify xml related code to work with pg.
+
+ select content_revision__export_xml(:revision_id);
+
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/export-xml.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/export-xml.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/export-xml.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select doc from cr_xml_docs where doc_id = :doc_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/index-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/index-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select content_symlink.resolve(:item_id) from dual
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/index-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/index-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_symlink__resolve(:item_id)
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/index.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/index.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ select
+ content_type, latest_revision
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/publish-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/publish-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,33 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ content_item.set_live_revision(
+ revision_id => :revision_id
+ );
+ end;
+
+
+
+
+
+
+
+ select
+ item_id,
+ content_item.is_publishable( item_id ) as publish_p
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/publish-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/publish-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,32 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__set_live_revision(
+ :revision_id
+ );
+
+
+
+
+
+
+
+
+ select
+ item_id,
+ content_item__is_publishable( item_id ) as publish_p
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/publish-status-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-status-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/publish-status-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,116 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ NVL(initcap(publish_status), 'Production') publish_status,
+ NVL(to_char(start_when, 'MM/DD/YY HH:MI AM'), 'Immediate') start_when,
+ NVL(to_char(end_when, 'MM/DD/YY HH:MI AM'), 'Indefinite') end_when,
+ content_item.is_publishable(:item_id) is_publishable,
+ live_revision
+ from
+ cr_items i, cr_release_periods r
+ where
+ i.item_id = :item_id
+ and
+ i.item_id = r.item_id (+)
+
+
+
+
+
+
+
+ select
+ content_item.is_publishable( item_id ) is_publishable,
+ live_revision
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select content_workflow.unfinished_workflow_exists( :item_id ) from dual
+
+
+
+
+
+
+
+
+ select
+ child_type, relation_tag, min_n,
+ o.pretty_name as child_type_pretty,
+ o.pretty_plural as child_type_plural,
+ case when max_n = null then '-' else max_n end max_n,
+ (
+ select
+ count(*)
+ from
+ cr_child_rels
+ where
+ parent_id = i.item_id
+ and
+ content_item.get_content_type( child_id ) = c.child_type
+ and
+ relation_tag = c.relation_tag
+ ) child_count
+ from
+ cr_type_children c, cr_items i, acs_object_types o
+ where
+ c.parent_type = i.content_type
+ and
+ c.child_type = o.object_type
+ and
+ -- this item is the parent
+ i.item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ target_type, relation_tag, min_n,
+ o.pretty_name as target_type_pretty,
+ o.pretty_plural as target_type_plural,
+ case when max_n = null then '-' else max_n end max_n,
+ (
+ select
+ count(*)
+ from
+ cr_item_rels
+ where
+ item_id = i.item_id
+ and
+ content_item.get_content_type( related_object_id ) = r.target_type
+ and
+ relation_tag = r.relation_tag
+ ) rel_count
+ from
+ cr_type_relations r, cr_items i, acs_object_types o
+ where
+ o.object_type = r.target_type
+ and
+ r.content_type = i.content_type
+ and
+ i.item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/publish-status-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-status-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/publish-status-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,115 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ coalesce(initcap(publish_status), 'Production') as publish_status,
+ coalesce(to_char(start_when, 'MM/DD/YY HH:MI AM'), 'Immediate') as start_when,
+ coalesce(to_char(end_when, 'MM/DD/YY HH:MI AM'), 'Indefinite') as end_when,
+ content_item__is_publishable(:item_id) as is_publishable,
+ live_revision
+ from
+ cr_items i left outer join cr_release_periods r using (item_id)
+ where
+ i.item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ content_item__is_publishable( item_id ) as is_publishable,
+ live_revision
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select content_workflow__unfinished_workflow_exists( :item_id )
+
+
+
+
+
+
+
+
+ select
+ child_type, relation_tag, min_n,
+ o.pretty_name as child_type_pretty,
+ o.pretty_plural as child_type_plural,
+ case when max_n = null then '-' else max_n end as max_n,
+ (
+ select
+ count(*)
+ from
+ cr_child_rels
+ where
+ parent_id = i.item_id
+ and
+ content_item__get_content_type( child_id ) = c.child_type
+ and
+ relation_tag = c.relation_tag
+ ) child_count
+ from
+ cr_type_children c, cr_items i, acs_object_types o
+ where
+ c.parent_type = i.content_type
+ and
+ c.child_type = o.object_type
+ and
+ -- this item is the parent
+ i.item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ target_type, relation_tag, min_n,
+ o.pretty_name as target_type_pretty,
+ o.pretty_plural as target_type_plural,
+ case when max_n is null then '-' else max_n end as max_n,
+ (
+ select
+ count(*)
+ from
+ cr_item_rels
+ where
+ item_id = i.item_id
+ and
+ content_item__get_content_type( related_object_id ) = r.target_type
+ and
+ relation_tag = r.relation_tag
+ ) rel_count
+ from
+ cr_type_relations r, cr_items i, acs_object_types o
+ where
+ o.object_type = r.target_type
+ and
+ r.content_type = i.content_type
+ and
+ i.item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/publish.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/publish.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-child-order.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-child-order.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-child-order.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,57 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ update cr_child_rels set order_n = :swap_order where rel_id = :rel_id
+
+
+
+
+
+
+
+
+ update cr_child_rels set order_n = :order_n where rel_id = :swap_id
+
+
+
+
+
+
+
+
+ select rel_id, order_n from cr_child_rels r1
+ where r1.parent_id = :item_id
+ and r1.order_n < :order_n
+ and not exists (select order_n from cr_child_rels r2
+ where r2.parent_id = :item_id
+ and r2.order_n < :order_n
+ and r2.order_n > r1.order_n)
+
+
+
+
+
+
+
+ select rel_id, order_n from cr_child_rels r1
+ where r1.parent_id = :item_id
+ and r1.order_n > :order_n
+ and not exists (select order_n from cr_child_rels r2
+ where r2.parent_id = :item_id
+ and r2.order_n > :order_n
+ and r2.order_n < r1.order_n)
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-items-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-2-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-items-2-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,29 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ :rel_id := content_item.relate (
+ item_id => :item_id,
+ object_id => :related_id,
+ relation_tag => :relation_tag,
+ order_n => :order_n,
+ relation_type => :relation_type
+ );
+ end;
+
+
+
+
+
+
+
+ select content_item.get_title(:item_id) from dual
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-items-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-2-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-items-2-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,30 @@
+
+
+
+ postgresql7.1
+
+
+
+
+
+ select content_item__relate (
+ :item_id,
+ :related_id,
+ :relation_tag,
+ :order_n,
+ :relation_type
+ );
+
+
+
+
+
+
+
+
+ select content_item__get_title(:item_id, 'f')
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-items-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-items-2.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ coalesce(max(order_n) + 1, 1)
+ from
+ cr_item_rels
+ where
+ item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-items-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-items-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,67 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ content_item.get_title(i.item_id) as title,
+ i.content_type
+ from
+ cr_items i
+ where
+ i.item_id = :item_id
+
+
+
+
+
+
+
+ select
+ lpad(' ', level, '-') || pretty_name as pretty_name,
+ object_type
+ from
+ acs_object_types
+ connect by
+ prior object_type = supertype
+ start with
+ object_type = 'cr_item_rel'
+
+
+
+
+
+
+
+ select
+ i.item_id as related_id,
+ content_item.get_title(i.item_id) as title,
+ content_item.get_path(i.item_id) as path,
+ tr.relation_tag
+ from
+ cr_items i, cr_type_relations tr
+ where
+ content_item.is_subclass(i.content_type, tr.target_type) = 't'
+ and
+ content_item.is_subclass(:item_type, tr.content_type) = 't'
+ and (
+ tr.max_n is null
+ or
+ (select count(*) from cr_item_rels
+ where item_id = :item_id
+ and relation_tag = tr.relation_tag) < tr.max_n
+ )
+ and
+ i.item_id in $sql_items
+ and
+ i.item_id ^= :item_id
+ order by
+ path, i.item_id, tr.relation_tag
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-items-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-items-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,68 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ content_item__get_title(i.item_id,'f') as title,
+ i.content_type
+ from
+ cr_items i
+ where
+ i.item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ lpad(' ', level, '-') || pretty_name as pretty_name,
+ object_type
+ from
+ acs_object_types
+ where
+ tree_sortkey like (select tree_sortkey || '%'
+ from acs_object_types where object_type = 'cr_item_rel')
+
+
+
+
+
+
+
+
+ select
+ i.item_id as related_id,
+ content_item__get_title(i.item_id,'f') as title,
+ content_item__get_path(i.item_id,null) as path,
+ tr.relation_tag
+ from
+ cr_items i, cr_type_relations tr
+ where
+ content_item__is_subclass(i.content_type, tr.target_type) = 't'
+ and
+ content_item__is_subclass(:item_type, tr.content_type) = 't'
+ and (
+ tr.max_n is null
+ or
+ (select count(*) from cr_item_rels
+ where item_id = :item_id
+ and relation_tag = tr.relation_tag) < tr.max_n
+ )
+ and
+ i.item_id in $sql_items
+ and
+ i.item_id != :item_id
+ order by
+ path, i.item_id, tr.relation_tag
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relate-order.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-order.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relate-order.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,87 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ update $rel_table
+ set order_n = :swap_order
+ where rel_id = :rel_id
+
+
+
+
+
+
+
+ update $rel_table
+ set order_n = :order_n
+ where rel_id = :swap_id
+
+
+
+
+
+
+
+ select
+ $rel_parent_column
+ from
+ $rel_table
+ where
+ rel_id = :rel_id
+
+
+
+
+
+
+
+ select
+ order_n
+ from
+ $rel_table
+ where
+ rel_id = :rel_id
+
+
+
+
+
+
+
+ select
+ rel_id, order_n
+ from
+ $rel_table
+ where
+ $rel_parent_column = :item_id
+ and
+ order_n = :order_n - 1
+
+
+
+
+
+
+
+ select
+ rel_id, order_n
+ from
+ $rel_table
+ where
+ $rel_parent_column = :item_id
+ and
+ order_n = :order_n + 1
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relationship-view-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relationship-view-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relationship-view-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,63 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ t.pretty_name as type_name, t.object_type,
+ r.item_id, r.related_object_id,\
+ content_item.get_title(i.item_id) as item_title,
+ acs_object.name(r.related_object_id) as related_title,
+ content_item.is_subclass(o2.object_type, 'content_item') as is_item,
+ r.relation_tag, r.order_n
+ from
+ acs_objects o, acs_object_types t,
+ cr_item_rels r, cr_items i, acs_objects o2
+ where
+ o.object_type = t.object_type
+ and
+ o.object_id = :rel_id
+ and
+ r.rel_id = :rel_id
+ and
+ i.item_id = r.item_id
+ and
+ o2.object_id = r.related_object_id
+
+
+
+
+
+
+
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.pretty_name as attribute_label, attr.datatype,
+ types.pretty_name as type_name
+ from
+ acs_attributes attr,
+ (select
+ object_type, table_name, id_column, pretty_name,
+ level as inherit_level
+ from
+ acs_object_types
+ where
+ object_type not in ('acs_object', 'cr_item_rel')
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = :object_type) types
+ where
+ attr.object_type (+) = types.object_type
+ order by
+ inherit_level desc, attr.pretty_name
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relationship-view-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relationship-view-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relationship-view-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,65 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ t.pretty_name as type_name, t.object_type,
+ r.item_id, r.related_object_id,
+ content_item__get_title(i.item_id,'f') as item_title,
+ acs_object__name(r.related_object_id) as related_title,
+ content_item__is_subclass(o2.object_type, 'content_item') as is_item,
+ r.relation_tag, r.order_n
+ from
+ acs_objects o, acs_object_types t,
+ cr_item_rels r, cr_items i, acs_objects o2
+ where
+ o.object_type = t.object_type
+ and
+ o.object_id = :rel_id
+ and
+ r.rel_id = :rel_id
+ and
+ i.item_id = r.item_id
+ and
+ o2.object_id = r.related_object_id
+
+
+
+
+
+
+
+ FIX ME CONNECT BY
+FIX ME OUTER JOIN
+
+ select
+ types.table_name, types.id_column, attr.attribute_name,
+ attr.pretty_name as attribute_label, attr.datatype,
+ types.pretty_name as type_name
+ from
+ acs_attributes attr right outer join
+ (select
+ ot2.object_type, ot2.table_name, ot2.id_column, ot2.pretty_name,
+ tree_level(ot2.tree_sortkey) as inherit_level
+ from
+ (select * from acs_object_types where object_type = :object_type) ot1,
+ acs_object_types ot2
+ where
+ ot2.object_type not in ('acs_object', 'cr_item_rel')
+ and
+ ot2.tree_sortkey <= ot2.tree_sortkey
+ and
+ ot1.tree_sortkey like (ot2.tree_sortkey || '%')) types
+ using (object_type)
+ order by
+ inherit_level desc, attr.pretty_name
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/relationship-view.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relationship-view.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/relationship-view.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select $what from $a_row(table_name)
+ where $a_row(id_column) = :rel_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/rename-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/rename-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ content_item.rename (
+ item_id => :item_id,
+ name => :name
+ );
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/rename-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/rename-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__rename (
+ :item_id,
+ :name
+ );
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/rename.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/rename.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+ select
+ name
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ parent_id
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-add-1-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-1-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-add-1-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ content_item.get_content_type( :item_id )
+ from
+ dual
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-add-1-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-1-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-add-1-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ content_item__get_content_type( :item_id )
+ from
+ dual
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-add-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-add-1.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ select
+ name
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-add-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-add-2.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ content_type, name
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,99 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ revision_id, title, description, item_id, mime_type,
+ content_revision.get_number( revision_id ) revision_number,
+ (
+ select
+ label
+ from
+ cr_mime_types
+ where
+ mime_type = cr_revisions.mime_type
+ ) mime_type_pretty,
+ to_char(publish_date,'Month DD, YYYY') as publish_date_pretty,
+ dbms_lob.getlength(content) as content_size
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
+
+
+ select content_item.is_publishable( :item_id ) from dual
+
+
+
+
+
+
+
+
+ select
+ name, locale, live_revision as live_revision_id,
+ (
+ select
+ pretty_name
+ from
+ acs_object_types
+ where
+ object_type = cr_items.content_type
+ ) content_type,
+ content_item.get_path(item_id) as path
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ attribute_id, pretty_name,
+ (select pretty_name from acs_object_types
+ where object_type = attr.object_type) object_type,
+ nvl(column_name,attribute_name) attribute_name,
+ nvl(attr.table_name,o.table_name) table_name,
+ nvl(o.id_column,'object_id') id_column
+ from
+ acs_attributes attr,
+ (select
+ object_type, table_name, id_column
+ from
+ acs_object_types
+ where
+ object_type not in ('acs_object','content_revision')
+ connect by
+ prior supertype = object_type
+ start with
+ object_type = (select
+ object_type
+ from
+ acs_objects
+ where
+ object_id = :revision_id) ) o
+ where
+ o.object_type = attr.object_type
+ order by
+ attr.object_type, attr.sort_order
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,100 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ revision_id, title, description, item_id, mime_type,
+ content_revision__get_number( revision_id ) as revision_number,
+ (
+ select
+ label
+ from
+ cr_mime_types
+ where
+ mime_type = cr_revisions.mime_type
+ ) mime_type_pretty,
+ to_char(publish_date,'Month DD, YYYY') as publish_date_pretty,
+ content_length as content_size
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
+
+
+ select content_item__is_publishable( :item_id )
+
+
+
+
+
+
+
+
+ select
+ name, locale, live_revision as live_revision_id,
+ (
+ select
+ pretty_name
+ from
+ acs_object_types
+ where
+ object_type = cr_items.content_type
+ ) content_type,
+ content_item__get_path(item_id,null) as path
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ attribute_id, pretty_name,
+ (select pretty_name from acs_object_types
+ where object_type = attr.object_type) as object_type,
+ coalesce(column_name,attribute_name) as attribute_name,
+ coalesce(attr.table_name,o.table_name) as table_name,
+ coalesce(o.id_column,'object_id') as id_column
+ from
+ acs_attributes attr,
+ (select
+ ot2.object_type, ot2.table_name, ot2.id_column
+ from
+ (select * from acs_object_types where object_type = (select
+ object_type
+ from
+ acs_objects
+ where
+ object_id = :revision_id)) ot1,
+ acs_object_types ot2
+ where
+ ot2.object_type not in ('acs_object','content_revision')
+ and
+ ot2.tree_sortkey <= ot1.tree_sortkey
+ and
+ ot1.tree_sortkey like (ot2.tree_sortkey || '%')) o
+ where
+ o.object_type = attr.object_type
+ order by
+ attr.object_type, attr.sort_order
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-upload-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-upload-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-upload-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,53 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ :item_id := content_item.new(
+ name => :name,
+ parent_id => :parent_id,
+ content_type => :content_type,
+ creation_user => [User::getID],
+ creation_ip => '[ns_conn peeraddr]' );
+ end;
+
+
+
+
+
+
+ insert into cr_xml_docs
+ values ($revision_id, empty_clob()) returning doc into :1
+
+
+
+
+
+
+ begin
+ :revision_id := content_revision.import_xml(
+ :item_id, :revision_id, :revision_id);
+ end;
+
+
+
+
+
+
+
+ select
+ NVL(content_item.get_path(:parent_id), '/') as item_path,
+ pretty_name as content_type_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision-upload-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,65 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__new(
+ name => :name,
+ parent_id => :parent_id,
+ null,
+ now(),
+ creation_user => [User::getID],
+ null,
+ creation_ip => '[ns_conn peeraddr]',
+ 'content_item',
+ content_type => :content_type,
+ null,
+ null,
+ 'text/plain',
+ null,
+ null,
+ 'text');
+
+
+
+
+
+
+
+
+-- FIX ME LOB
+insert into cr_xml_docs
+ values ($revision_id, empty_lob()) returning doc into :1
+
+
+
+
+
+
+
+
+ select content_revision__import_xml(:item_id, :revision_id, :revision_id)
+
+
+
+
+
+
+
+
+ select
+ coalesce(content_item__get_path(:parent_id,null), '/') as item_path,
+ pretty_name as content_type_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revision.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revision.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ select count(*) from cr_revisions where item_id = :item_id
+
+
+
+
+
+
+
+
+--FIXME:
+ select
+ content
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
+
+
+ select
+ [join $attr_columns ", "]
+ from
+ [join $attr_tables ", "]
+ where
+ [join $column_id_cons " and "]
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revisions-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revisions-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revisions-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,50 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ content_item.get_content_type( :item_id )
+ from
+ dual
+
+
+
+
+
+
+
+
+ select
+ item_id, name, locale, live_revision, publish_status,
+ content_item.is_publishable(item_id) as is_publishable
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+ pagination::paginate_query "
+ select
+ revision_id,
+ trim(title) as title,
+ trim(description) as description,
+ content_revision.get_number(revision_id) as revision_number
+ from
+ cr_revisions r
+ where
+ r.item_id = :item_id
+ order by
+ revision_number desc" $page
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/revisions-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revisions-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/revisions-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,51 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ content_item__get_content_type( :item_id )
+ from
+ dual
+
+
+
+
+
+
+
+
+ select
+ item_id, name, locale, live_revision, publish_status,
+ content_item__is_publishable(item_id) as is_publishable
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+ select
+ revision_id,
+ trim(title) as title,
+ trim(description) as description,
+ content_revision__get_number(revision_id) as revision_number
+ from
+ cr_revisions r
+ where
+ r.item_id = :item_id
+ order by
+ revision_number desc
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/status-edit-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/status-edit-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ content_item.set_release_period(
+ item_id => :item_id,
+ start_when => $start_when,
+ end_when => $end_when
+ );
+ end;
+
+
+
+
+
+
+
+ select content_item.is_publishable( :item_id ) from dual
+
+
+
+
+
+
+
+ select content_item.is_published( :item_id ) from dual
+
+
+
+
+
+
+
+ select
+ NVL(publish_status, 'production') as publish_status,
+ to_char(NVL(start_when, sysdate), 'YYYY MM DD HH24 MI SS') start_when,
+ to_char(NVL(end_when, sysdate + 365), 'YYYY MM DD HH24 MI SS') end_when
+ from
+ cr_items i, cr_release_periods r
+ where
+ i.item_id = :item_id
+ and
+ i.item_id = r.item_id (+)
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/status-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/status-edit-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,52 @@
+
+
+
+ postgresql7.1
+
+
+
+ select content_item__set_release_period(
+ :item_id,
+ $start_when,
+ $end_when
+ );
+
+
+
+
+
+
+
+
+ select content_item__is_publishable( :item_id )
+
+
+
+
+
+
+
+
+ select content_item__is_published( :item_id )
+
+
+
+
+
+
+
+
+ select
+ coalesce(publish_status, 'production') as publish_status,
+ to_char(coalesce(start_when, current_timestamp), 'YYYY MM DD HH24 MI SS') as start_when,
+ to_char(coalesce(end_when, current_timestamp + 365), 'YYYY MM DD HH24 MI SS') as end_when
+ from
+ cr_items i left outer join cr_release_periods r using (item_id)
+ where
+ i.item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/status-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/status-edit.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ select live_revision from cr_items where item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/template-register.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/template-register.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/template-register.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ select count(1) from cr_item_template_map
+ where use_context = :context
+ and item_id = :item_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/template-unregister-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/template-unregister-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/template-unregister-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ content_item.unregister_template(
+ template_id => :template_id,
+ item_id => :item_id,
+ use_context => :context );
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/template-unregister-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/template-unregister-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/template-unregister-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__unregister_template(
+ :item_id,
+ :template_id,
+ :context );
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/templates-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/templates-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/templates-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,82 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ select
+ cms_permission.permission_p( module_id, :user_id, 'cm_write' )
+ from
+ cm_modules
+ where
+ key = 'types'
+
+
+
+
+
+
+
+
+ select
+ object_type, pretty_name,
+ content_item.get_title(:item_id) name
+ from
+ acs_object_types
+ where
+ object_type = content_item.get_content_type(:item_id)
+
+
+
+
+
+
+
+
+ select
+ template_id, use_context,
+ content_item.get_path( template_id ) path,
+ cms_permission.permission_p( template_id, :user_id, 'cm_examine')
+ as can_read_template
+ from
+ cr_item_template_map t
+ where
+ t.item_id = :item_id
+ order by
+ path, use_context
+
+
+
+
+
+
+
+
+ select
+ template_id, use_context, is_default,
+ content_item.get_path( template_id ) path,
+ cms_permission.permission_p( template_id, :user_id, 'cm_examine')
+ as can_read_template,
+ (select 1
+ from
+ cr_item_template_map itmap
+ where
+ itmap.template_id = t.template_id
+ and
+ itmap.use_context = t.use_context
+ and
+ itmap.item_id = :item_id) already_registered_p
+ from
+ cr_type_template_map t
+ where
+ t.content_type = :content_type
+ order by
+ path, use_context
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/templates-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/templates-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/templates-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,82 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select
+ cms_permission__permission_p( module_id, :user_id, 'cm_write' )
+ from
+ cm_modules
+ where
+ key = 'types'
+
+
+
+
+
+
+
+
+ select
+ object_type, pretty_name,
+ content_item__get_title(:item_id,'f') as name
+ from
+ acs_object_types
+ where
+ object_type = content_item__get_content_type(:item_id)
+
+
+
+
+
+
+
+
+ select
+ template_id, use_context,
+ content_item__get_path( template_id ) as path,
+ cms_permission__permission_p( template_id, :user_id, 'cm_examine')
+ as can_read_template
+ from
+ cr_item_template_map t
+ where
+ t.item_id = :item_id
+ order by
+ path, use_context
+
+
+
+
+
+
+
+
+ select
+ template_id, use_context, is_default,
+ content_item__get_path( template_id, null ) as path,
+ cms_permission__permission_p( template_id, :user_id, 'cm_examine')
+ as can_read_template,
+ (select 1
+ from
+ cr_item_template_map itmap
+ where
+ itmap.template_id = t.template_id
+ and
+ itmap.use_context = t.use_context
+ and
+ itmap.item_id = :item_id) already_registered_p
+ from
+ cr_type_template_map t
+ where
+ t.content_type = :content_type
+ order by
+ path, use_context
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/unpublish-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unpublish-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/unpublish-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ content_item.unset_live_revision( :item_id );
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/unpublish-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unpublish-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/unpublish-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_item__unset_live_revision( :item_id );
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/unrelate-item-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unrelate-item-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/unrelate-item-oracle.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ content_item.unrelate (
+ rel_id => :rel_id
+ );
+ end;
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/unrelate-item-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unrelate-item-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/unrelate-item-postgresql.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+ postgresql7.1
+
+
+
+
+
+ select content_item__unrelate (:rel_id )
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/unrelate-item.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unrelate-item.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/unrelate-item.xql 25 May 2001 04:56:36 -0000 1.1
@@ -0,0 +1,19 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ select item_id from cr_item_rels where rel_id = :rel_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-1.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ select
+ pretty_name
+ from
+ acs_object_types
+ where
+ object_type = :content_type
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-oracle.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_revision.new (
+ item_id => :item_id,
+ title => :title,
+ description => :description,
+ mime_type => :mime_type,
+ creation_user => :user_id,
+ creation_ip => :ip_address
+ );
+ end;
+
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_blob()
+ where revision_id = $revision_id
+ returning content into :1
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2-postgresql.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,39 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_revision__new (
+ :title,
+ :description,
+ now(),
+ :mime_type,
+ null,
+ ' ',
+ :item_id,
+ null,
+ now(),
+ :user_id,
+ :ip_address
+ );
+
+
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_lob()
+ where revision_id = $revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,49 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ insert into images (
+ image_id, width, height
+ ) values (
+ :revision_id, :width, :height
+ )
+
+
+
+
+
+
+
+ insert into cr_demo_article_images (
+ article_image_id, caption
+ ) values (
+ :revision_id, :caption
+ )
+
+
+
+
+
+
+
+ select
+ count(1)
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,79 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ update cr_revisions
+ set title = :title,
+ description = :description
+ where revision_id = :revision_id
+
+
+
+
+
+
+
+ update images
+ set width = :width,
+ height = :height
+ where image_id = :revision_id
+
+
+
+
+
+
+
+ select
+ i.name, i.latest_revision, r.title
+ from
+ cr_items i, cr_revisions r
+ where
+ i.item_id = :item_id
+ and
+ i.item_id = r.item_id
+ and
+ i.latest_revision = r.revision_id
+
+
+
+
+
+
+
+
+ select
+ latest_revision
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
+
+
+ select
+ count(1)
+ from
+ cr_revisions
+ where
+ revision_id = :revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-oracle.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ update cr_revisions
+ set content = empty_blob()
+ where revision_id = $revision_id
+ returning content into :1
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/content-add-1-postgresql.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ update cr_revisions
+ set content = empty_lob()
+ where revision_id = $revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/content-add-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/content-add-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/content-add-1.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ update images
+ set width = :width,
+ height = :height
+ where image_id = :revision_id
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/create-1-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/create-1-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/create-1-oracle.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,34 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_revision.new (
+ item_id => :item_id,
+ title => :title,
+ description => :description,
+ mime_type => :mime_type,
+ creation_user => :user_id,
+ creation_ip => :ip_address
+ );
+ end;
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_blob()
+ where revision_id = $revision_id
+ returning content into :1
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/create-1-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/create-1-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/create-1-postgresql.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,38 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_revision__new (
+ :title,
+ :description,
+ now(),
+ :mime_type,
+ null,
+ ' ',
+ :item_id,
+ null,
+ now(),
+ :user_id,
+ :ip_address
+ );
+
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_lob()
+ where revision_id = $revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/create-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/create-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/create-1.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,37 @@
+
+
+
+
+
+ abort transaction
+
+
+
+
+
+
+
+ insert into images (
+ image_id, width, height
+ ) values (
+ :revision_id, :width, :height
+ )
+
+
+
+
+
+
+
+ select
+ count(1)
+ from
+ cr_items
+ where
+ item_id = :item_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-oracle.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,35 @@
+
+
+
+ oracle8.1.6
+
+
+
+
+ begin
+ :1 := content_revision.new (
+ item_id => :item_id,
+ title => :title,
+ description => :description,
+ mime_type => :mime_type,
+ creation_user => :user_id,
+ creation_ip => :ip_address
+ );
+ end;
+
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_blob()
+ where revision_id = $revision_id
+ returning content into :1
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1-postgresql.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,39 @@
+
+
+
+ postgresql7.1
+
+
+
+
+ select content_revision__new (
+ :title,
+ :description,
+ now(),
+ :mime_type,
+ null,
+ ' ',
+ :item_id,
+ null,
+ now(),
+ :user_id,
+ :ip_address
+ );
+ end;
+
+
+
+
+
+
+
+
+ update cr_revisions
+ set content = empty_lob()
+ where revision_id = $revision_id
+
+
+
+
+
+
Index: openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/cms/www/modules/items/custom/image/revision-add-1.xql 25 May 2001 04:56:37 -0000 1.1
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ insert into images (
+ image_id, width, height
+ ) values (
+ :revision_id, :width, :height
+ )
+
+
+
+
+