Index: openacs-4/packages/acs-content-repository/www/doc/guide/revisions.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/revisions.adp,v
diff -u -r1.2.2.4 -r1.2.2.5
--- openacs-4/packages/acs-content-repository/www/doc/guide/revisions.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4
+++ openacs-4/packages/acs-content-repository/www/doc/guide/revisions.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5
@@ -5,22 +5,24 @@
Revisions
At a basic level, creating a new revision of a content item
involves the following steps: Content revisions are initialized using the
-content_revision.new function. The only parameters
+content_revision.new function. The only parameters
required to create the revision are a title, a content item ID, and
some text: The item_id parameter is ID of the content item with
+ The item_id parameter is ID of the content item with
which the revision is associated. The content_item.new function accepts a number of other
-optional parameters: description, mime_type, and
-publish_date. The standard creation_date,
-creation_user, and creation_ip should be
-specified for auditing purposes. Instead of the text
-parameter, this function can be called with a data
-parameter, in which data is a blob: The content_item.new function accepts a number of
+other optional parameters: description,
+mime_type, and publish_date. The standard
+creation_date, creation_user, and
+creation_ip should be specified for auditing purposes.
+Instead of the text parameter, this function can be
+called with a data parameter, in which data
+is a blob: Given that there is no way (AFAIK) to pass variable parameters
to a PL/SQL function, there is no way to make
-content_revision.new generic enough to support submission
-of the attributes for all different content types. This leaves you
-with three alternatives:Creating Content Revisions
+
+ACS Documentation : Content Repository : Developer Guide
-
Use the Content Revision API to create a revision
@@ -31,15 +33,16 @@
Here comes a car...uh oh! The End'
);
-
revision_id := content_revision.new(
title => 'A Revision',
@@ -56,27 +59,27 @@
Insert additional attributes
The last option is made possible by an instead of -insert trigger on the attribute view for each content type. +
The last option is made possible by an instead of +insert trigger on the attribute view for each content type. (An attribute view joins together the storage tables for -the ancestors of each content type, including acs_objects -and cr_revisions). Normally it is not possible to insert -into a view. Oracle allows you to create an instead of -trigger for a view, however, which intercepts the DML statement and -allows you to execute an arbitrary block of PL/SQL instead. The -code to create or replace the trigger is automatically generated -and executed with each call to -content_type.create_attribute. The trigger makes it +the ancestors of each content type, including +acs_objects and cr_revisions). Normally it is +not possible to insert into a view. Oracle allows you to create an +instead of trigger for a view, however, which intercepts +the DML statement and allows you to execute an arbitrary block of +PL/SQL instead. The code to create or replace the trigger is +automatically generated and executed with each call to +content_type.create_attribute. The trigger makes it possible to create complete revisions with a single insert statement:
@@ -99,16 +102,16 @@Inserting content via file or text upload
Selecting a live revision
The live revision of a content item can be obtained with the -content_item.get_live_revision function:
+content_item.get_live_revision function:live_revision_id := content_item.get_live_revision( item_id => :item_id );-The item_id identifies the content item with which the -revision is associated.
+The item_id identifies the content item with which +the revision is associated.
Likewise, the most recent revision of a content item can be -obtained with the content_item.get_latest_revision +obtained with the content_item.get_latest_revision function:
latest_revision_id := content_item.get_latest_revision( @@ -117,5 +120,5 @@
karlg\@arsdigita.com -Last Modified: $Id: revisions.html,v 1.1.1.1 2001/03/13 22:59:26 -ben Exp $
+Last Modified: $Id: revisions.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $