Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.9.1d17-5.9.1d18.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/acs-content-repository/www/doc/design.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/design.adp,v
diff -u -r1.2.2.3 -r1.2.2.4
--- openacs-4/packages/acs-content-repository/www/doc/design.adp 1 Dec 2015 11:17:39 -0000 1.2.2.3
+++ openacs-4/packages/acs-content-repository/www/doc/design.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4
@@ -3,6 +3,9 @@
Content Repository Design
+
+ACS Documentation : Content Repository
+
I. Essentials
@@ -56,20 +59,21 @@
Object Model. As such the same design tradeoffs apply.
The content repository stores all revisions of all content items in a single table, rather than maintaining separate tables for -"live" and other revisions. The single-table approach dramatically -simplifies most operations on the repository, including adding -revisions, marking a "live" revision, and maintaining a full -version history. The drawback of this approach is that accessing -live content is less efficient. Given the ID of a content item, it -is not possible to directly access the live content associated with -that item. Instead, an extra join to the revisions table is -required. Depending on the production habits of the publisher, the -amount of live content in the repository may be eclipsed by large -numbers of infrequently accessed working drafts. The impact of this -arrangement is minimized by storing the actual content data in a -separate tablespace (preferably on a separate disk) from the actual -revisions table, reducing its size and allows the database server -to scan and read it more efficiently.
+"live" and other revisions. The single-table approach +dramatically simplifies most operations on the repository, +including adding revisions, marking a "live" revision, +and maintaining a full version history. The drawback of this +approach is that accessing live content is less efficient. Given +the ID of a content item, it is not possible to directly access the +live content associated with that item. Instead, an extra join to +the revisions table is required. Depending on the production habits +of the publisher, the amount of live content in the repository may +be eclipsed by large numbers of infrequently accessed working +drafts. The impact of this arrangement is minimized by storing the +actual content data in a separate tablespace (preferably on a +separate disk) from the actual revisions table, reducing its size +and allows the database server to scan and read it more +efficiently.The Object Model provides a
graphic overview of the the how the content repository is designed.
@@ -80,5 +84,5 @@
karlg\@arsdigita.com
Developer Guide The content repository is a part of the core data model of ACS
4.0 and greater, and is loaded automatically as part of the ACS
installation process. First install the data model and PL/SQL API: In additional to SQL and PL/SQL, the content repository
implements a limited set of key methods in Java. The XML import and
-export methods are dependent on Oracle's XML Parser for Java v2,
-available from the Oracle Technology Network:
-Last Modified: $Id: design.html,v 1.1.1.1 2001/03/13 22:59:26 ben
-Exp $
+Last Modified: $Id: design.html,v 1.1.1.1.30.1 2016/06/22 07:40:41
+gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/index.adp,v
diff -u -r1.2.2.8 -r1.2.2.9
--- openacs-4/packages/acs-content-repository/www/doc/index.adp 1 Dec 2015 11:17:39 -0000 1.2.2.8
+++ openacs-4/packages/acs-content-repository/www/doc/index.adp 1 Jul 2016 09:17:32 -0000 1.2.2.9
@@ -3,6 +3,7 @@
ACS Content Repository
+ACS Documentation
@@ -38,5 +39,5 @@
karlg\@arsdigita.com
-Last Revised: $Id: index.html,v 1.2.18.2 2015/08/21 10:49:20
+Last Revised: $Id: index.html,v 1.2.18.3 2016/06/22 07:40:41
gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/install.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/install.adp,v
diff -u -r1.2.2.3 -r1.2.2.4
--- openacs-4/packages/acs-content-repository/www/doc/install.adp 1 Dec 2015 11:17:39 -0000 1.2.2.3
+++ openacs-4/packages/acs-content-repository/www/doc/install.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4
@@ -3,6 +3,7 @@
Installing the Content Repository
+Content Repository
Java
To load the XML parser, download and untar the distribution. -Load the class package lib/xmlparserv2.jar into Oracle +Load the class package lib/xmlparserv2.jar into Oracle from a shell prompt:
$ loadjava -user user/password xmlparserv2.jar
Finally, load the SQLJ files in -packages/acs-content-repository/java:
+packages/acs-content-repository/java:$ loadjava -user user/password -resolve *.sqlj@@ -42,26 +43,27 @@
The content repository relies on an Intermedia with the INSO filtering option to search text within a wide variety of file formats, including PDF and Microsoft Word. When the index on the -content column of cr_revisions is built, the INSO -filter automatically detects the file type of each entry and +content column of cr_revisions is built, the +INSO filter automatically detects the file type of each entry and extracts all available text for indexing.
If your searches are not returning any results even after rebuilding the index, INSO filtering may be silently failing. You can verifying this by checking for entries in the -ctx_user_index_errors view following an alter -index statement.
+ctx_user_index_errors view following an alter +index statement.If you experience errors on a UNIX system, check the following:
(SID_DESC = @@ -79,5 +81,5 @@ karlg\@arsdigita.com
-Last revised: $Id: install.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $ +Last revised: $Id: install.html,v 1.1.1.1.30.1 2016/06/22 07:40:41 +gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/intermedia.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/intermedia.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/intermedia.adp 1 Dec 2015 11:17:39 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/intermedia.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4 @@ -3,6 +3,7 @@Content Repository: Testing Intermedia Testing Intermedia
+Content RepositoryEven if you follow the instructions in the installation notes, content searches may inexplicably fail to work. This document describes how to create a simple test case independent of the content repository to verify @@ -39,7 +40,7 @@
Load test documents
You can use SQL*Loader to load some documents into the test table. First create a control file named -cr-test-docs.ctl:
+cr-test-docs.ctl:load data INFILE 'cr-test-docs.data' @@ -86,5 +87,5 @@ karlg\@arsdigita.com
-Last revised: $Id: intermedia.html,v 1.1.1.1 2001/03/13 22:59:26 -ben Exp $ +Last revised: $Id: intermedia.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/object-model.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/object-model.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/object-model.adp 1 Dec 2015 11:17:39 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/object-model.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4 @@ -3,6 +3,7 @@Content Repository: Object Model Object Model
+Content RepositoryThe content repository is an extension of the ACS Object Model. The following diagram illustrates the relationship among the standard object types defined by the content repository (click on a @@ -29,5 +30,5 @@ karlg\@arsdigita.com
- +
-Last revised: $Id: object-model.html,v 1.1.1.1 2001/03/13 22:59:26 -ben Exp $ +Last revised: $Id: object-model.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/requirements.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/requirements.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/requirements.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/requirements.adp 1 Jul 2016 09:17:32 -0000 1.2.2.5 @@ -14,7 +14,8 @@ codes for identifying the file format of each content item. For the purpose of data integrity, the repository must have a canonical list of MIME types that may be assigned to content items.A content type is characterized by a set of attributes that may be associated with a text or binary content object. Attributes are stored separately from their associated content @@ -25,36 +26,41 @@ for each content type:
- +-10.10 Content types must be associated with unique -keyword identifiers, such as press_release, so they can be -referenced in data tables, queries and procedural code.
-10.20 Content types must be associated with singular and -plural descriptive labels, such as Press Release and -Press Releases, to simplify user recognition.
+10.10 Content types must be associated with +unique keyword identifiers, such as press_release, so +they can be referenced in data tables, queries and procedural +code.
+10.20 Content types must be associated with +singular and plural descriptive labels, such as Press +Release and Press Releases, to simplify +user recognition.
10.20 Content types may specify any number of attributes. Attribute values are simple strings or numbers.
-10.30 Content types may inherit attributes from any other -other content type. For example, a regional press release may be a -subtype of the press release type. Regional press releases have a -region attribute in addition to the characteristics of a -regular press release.
-10.40 Part of the definition of a content type may -include a description of the parent-child relationships allowed for -items of this type. For example, a Press Release may contain -one or more items of type Image, but it should not contain -any items of type Internal Financial Status Report.
-10.60 A content type definition may include a list of -allowed file MIME types for items of this type.
-10.70 A content type definition may include a list of -tokens to identify or flag relationships with other items. For -example, the content type definition for a chapter of a reference -manual may include the tokens next, previous and -see_also. Each type of relationship may include a minimum -and/or maximum number of relationships of this type that are -required for an item to be published.
+10.30 Content types may inherit attributes from +any other other content type. For example, a regional press release +may be a subtype of the press release type. Regional press releases +have a region attribute in addition to the +characteristics of a regular press release.+10.40 Part of the definition of a content type +may include a description of the parent-child relationships allowed +for items of this type. For example, a Press +Release may contain one or more items of type +Image, but it should not contain any items of type +Internal Financial Status Report.
+10.60 A content type definition may include a +list of allowed file MIME types for items of this type.
+10.70 A content type definition may include a +list of tokens to identify or flag relationships with other items. +For example, the content type definition for a chapter of a +reference manual may include the tokens next, +previous and see_also. Each type +of relationship may include a minimum and/or maximum number of +relationships of this type that are required for an item to be +published.
Items are the fundamental building blocks of the content repository. Each item represents a distinct text or binary content object that is publishable to the web, such as an article, report, @@ -65,44 +71,46 @@ which the data model must support:
@@ -111,59 +119,61 @@ following:-20.10 Content items must have a simple unique identifier -so they can be related to other objects in the system.
-20.20 Each content item consists of a set of attributes -and a single text or binary object.
-20.25 All content items are associated with a few basic -attributes to facilitate searching and development of browser -interfaces to the content repository:
+20.10 Content items must have a simple unique +identifier so they can be related to other objects in the +system.
+20.20 Each content item consists of a set of +attributes and a single text or binary object.
+20.25 All content items are associated with a +few basic attributes to facilitate searching and development of +browser interfaces to the content repository:
- A title
- A brief description or summary
- An author or contributor
- A publication or posting date
- A distinguished URL at which an item may be accessed.
- A MIME type
-20.30 Each content item must be an instance of a -particular content type. The content type +20.30 Each content item must be an instance of +a particular content type. The content type defines the attributes associated with the content item, in addition to the basic ones described above.
-20.40 A content item must have a unique, persistent URL -(Uniform Resource Locator) by which it is publicly accessible, such -as /press-releases/products/widget. To facilitate moving -of items within the repository, the item itself should only be -associated with the "tail" of the url, such as widget. The -absolute URL of the item is determined by its location within the -repository (See Content -Organization).
-20.50 It must be possible to specify the language of each -item.
-20.60 It must be possible to maintain a revision history -for both the attributes and the text or binary object associated -with a content item.
+20.40 A content item must have a unique, +persistent URL (Uniform Resource Locator) by which it is publicly +accessible, such as /press-releases/products/widget. To +facilitate moving of items within the repository, the item itself +should only be associated with the "tail" of the url, +such as widget. The absolute URL of the item is +determined by its location within the repository (See Content Organization).
+20.50 It must be possible to specify the +language of each item.
+20.60 It must be possible to maintain a +revision history for both the attributes and the text or binary +object associated with a content item.
20.70. There must be a flexible mechanism for implementing access control on individual items, based on granting of permissions to groups or individual users.
-20.80. A content item may be associated with any number -of workflows.
-20.90. Content items may themselves be "containers" or -"parents" for other content items. For example, an Article -may contain multiple Sections.
-20.95 Each item may be associated with any number of -related objects. The type and number of relationships must be -constrained by the content type of the item (See 10.70 above).
+20.80. A content item may be associated with +any number of workflows.+20.90. Content items may themselves be +"containers" or "parents" for other content +items. For example, an Article may contain +multiple Sections.
+20.95 Each item may be associated with any +number of related objects. The type and number of relationships +must be constrained by the content type of the item (See 10.70 +above).
--30.10. A revision consists of the complete state of the -item as it existed at a certain point in time. This includes the -main text or binary object associated with the item, as well as all -attributes.
-30.20. The data model must be extensible so that -revisions for all content types (with any number of attributes) may -be stored and retrieved efficiently.
+30.10. A revision consists of the complete +state of the item as it existed at a certain point in time. This +includes the main text or binary object associated with the item, +as well as all attributes.+30.20. The data model must be extensible so +that revisions for all content types (with any number of +attributes) may be stored and retrieved efficiently.
40.0 Organization of -the Repository
+40.0 +Organization of the Repository
-40.10. The data model must support the hierarchical -organization of content items in a manner similar to a file -system.
-40.20. The URL of a content item should reflect its -location in the hierarchy. For example, a press release with the -URL /press-releases/products/new-widget is located at the -third level down from the root of the hierarchy.
+40.10. The data model must support the +hierarchical organization of content items in a manner similar to a +file system.
+40.20. The URL of a content item should reflect +its location in the hierarchy. For example, a press release with +the URL /press-releases/products/new-widget is located +at the third level down from the root of the hierarchy.
A folder is analogous to a folder or directory in a file system. It represents a level in the content item hierarchy. -In the previous example, press-releases is a folder under -the repository root, and products is folder within that. -The description of a folder may include the following +In the previous example, press-releases is a folder +under the repository root, and products is folder within +that. The description of a folder may include the following information:
-40.20.5.10. A URL-encoded name for building the path to -folders and individual items within the folder.
-40.20.5.20. A pointer to a content item that may serve as -the "index" for the folder (i.e. the item that is served when the -URL of the folder itself is accessed).
-40.20.5.30. A set of constraints on the number and type -of content items that may be stored in the folder.
+40.20.5.10. A URL-encoded name for building the +path to folders and individual items within the folder.+40.20.5.20. A pointer to a content item that +may serve as the "index" for the folder (i.e. the item +that is served when the URL of the folder itself is accessed).
+40.20.5.30. A set of constraints on the number +and type of content items that may be stored in the folder.
-40.30. It must be possible to create symbolic links or -shortcuts to content items, so they may be presented at more than -one URL or branch of the hierarchy.
+40.30. It must be possible to create symbolic +links or shortcuts to content items, so they may be presented at +more than one URL or branch of the hierarchy.40.30.5 Content Symbolic Link.
-40.30.5.20. A pointer to a -target item which the symbolic link references..
-40.30.5.30. A title or -label, which may be different from the title or label of the target -item.
+40.30.5.10. A +URL-encoded name for the symbolic link. As for folders and items, +this only represents the "tail" of the URL, with the full +URL being determined by the folder in which the link is +located.+40.30.5.20. A +pointer to a target item which the symbolic link +references..
+40.30.5.30. A +title or label, which may be different from the title or label of +the target item.
@@ -187,18 +197,21 @@
100.10.10. Register a MIME type
-100.10.20. Set the description of a MIME type
-100.10.30. Get the description of a MIME type
-100.10.40. Determine whether a MIME type is text or -binary
-100.10.50. Get a list of registered MIME types
+100.10.20. Set the description of a MIME +type
+100.10.30. Get the description of a MIME +type
+100.10.40. Determine whether a MIME type is +text or binary
+100.10.50. Get a list of registered MIME +types
100.10.60. Unregister a MIME type
It is important to note that the role of MIME types in the content repository is simply to describe the general file format of each content item. Neither the data model nor the API support the full range of allowed parameters for the general MIME types such as -text/plain.
+text/plain.100.20 Locales
The repository must have access to a list of recognized locales for the purpose of publishing content items in multiple languages @@ -217,112 +230,119 @@
Functional requirements for locales include:
-100.20.10. Register a locale, including language, -territory and character set.
-100.20.20. Get the language of a specified locale.
-100.20.10. Get the character set code of a specified -locale using either Oracle or WETF/ISO/ANSI codes.
-100.20.30. Get the number, date and currency format of a -specified locale.
-100.20.40. Convert a text content item to a specified -locale (character set).
-100.20.50. Get a list of registered locales.
+100.20.10. Register a locale, including +language, territory and character set.
+100.20.20. Get the language of a specified +locale.
+100.20.10. Get the character set code of a +specified locale using either Oracle or WETF/ISO/ANSI codes.
+100.20.30. Get the number, date and currency +format of a specified locale.
+100.20.40. Convert a text content item to a +specified locale (character set).
+100.20.50. Get a list of registered +locales.
100.20.60. Unregister a locale.
100.30 Content Types
-100.30.10. Create a content type, optionally specifying -that it inherits the attributes of another content type. Multiple -inheritance is not supported.
-100.30.20. Get and set the singular and plural proper -names for a content type.
-100.30.30. Create an attribute for a content type.
-100.30.40. Register a content type as a container for -another content type, optionally specifying a minimum and maximum -count of live items.
-100.30.50. Register a content type as a container for -another content type, optionally specifying a minimum and maximum -count of live items.
-100.30.60. Register a set of tags or tokens for labeling -child items of an item of a particular content type.
-100.30.70. Register a template -for use with a content type, optionally specifying a use context -("intranet", "extranet") which the template is appropriate to -use.
-100.30.80. Register a particular type of workflow to -associate with items of this content type by default.
-100.30.90. Register a MIME type as valid for a content -type. For example, the Image content type may only allow GIF -and JPEG file formats.
-100.30.95 Register a relationship with another type of -object, specifying a token or name for the relationship type as -well as a minimum and/or maximum number of relationships of this -type that are required for the item to be published.
+100.30.10. Create a content type, optionally +specifying that it inherits the attributes of another content type. +Multiple inheritance is not supported.+100.30.20. Get and set the singular and plural +proper names for a content type.
+100.30.30. Create an attribute for a content +type.
+100.30.40. Register a content type as a +container for another content type, optionally specifying a minimum +and maximum count of live items.
+100.30.50. Register a content type as a +container for another content type, optionally specifying a minimum +and maximum count of live items.
+100.30.60. Register a set of tags or tokens for +labeling child items of an item of a particular content type.
+100.30.70. Register a template for use with a content type, optionally +specifying a use context ("intranet", +"extranet") which the template is appropriate to use.
+100.30.80. Register a particular type of +workflow to associate with items of this content type by +default.
+100.30.90. Register a MIME type as valid for a +content type. For example, the Image content type +may only allow GIF and JPEG file formats.
+100.30.95 Register a relationship with another +type of object, specifying a token or name for the relationship +type as well as a minimum and/or maximum number of relationships of +this type that are required for the item to be published.
100.40 Content Items
-100.40.10. Create a new item, specifying a parent context -or the root of the repository by default.
+100.40.10. Create a new item, specifying a +parent context or the root of the repository by default.
100.40.15. Rename an item.
-100.40.17. Copy an item to another location in the -repository.
-100.40.20. Move an item to another location in the -repository.
-100.40.30. Get the full path (ancestry of an item) up to -the root.
+100.40.17. Copy an item to another location in +the repository.
+100.40.20. Move an item to another location in +the repository.
+100.40.30. Get the full path (ancestry of an +item) up to the root.
100.40.35. Get the parent of an item.
-100.40.40. Determine whether an item may have a child of -a particular content type, based on the existing children of the -item and the constraints on the content type.
-100.40.45. Label a child item with a tag or token, based -on the set of tags registered for the content type of the container -item.
+100.40.40. Determine whether an item may have a +child of a particular content type, based on the existing children +of the item and the constraints on the content type.
+100.40.45. Label a child item with a tag or +token, based on the set of tags registered for the content type of +the container item.
100.40.50. Get the children of an item.
-100.40.55. Get the children of an item by type or -tag.
-100.40.60. Establish a generic relationship between any -object and a content item, optionally specifying a relationship -type.
+100.40.55. Get the children of an item by type +or tag.
+100.40.60. Establish a generic relationship +between any object and a content item, optionally specifying a +relationship type.
100.40.70. Create a revision.
-100.40.80. Mark a particular revision of an item as -"live".
-100.40.83. Specify a start and end time when an item -should be available.
-100.40.85. Clear the live revision attribute of an item, -effectively removing it from public view.
-100.40.90. Get a list of revisions for an item, including -modifying user, date modified and comments.
-100.40.95. Revert to an older revision (create a new -revision based on an older revision).
+100.40.80. Mark a particular revision of an +item as "live".+100.40.83. Specify a start and end time when an +item should be available.
+100.40.85. Clear the live revision attribute of +an item, effectively removing it from public view.
+100.40.90. Get a list of revisions for an item, +including modifying user, date modified and comments.
+100.40.95. Revert to an older revision (create +a new revision based on an older revision).
100.50 Content Folders
The repository should allow for hierarchical arrangement of content items in a manner similar to a file system. The API to meet this general requirement focuses primarily on content folders:
-100.50.10. Create a folder for logical groups of -content items and other folders. The folder name becomes part of -the distinguished URL of any items it contains. Folders may be -created at the "root" or may be nested within other folders.
-100.50.20. Set a label and description for a folder.
+100.50.10. Create a folder for +logical groups of content items and other folders. The folder name +becomes part of the distinguished URL of any items it contains. +Folders may be created at the "root" or may be nested +within other folders.
+100.50.20. Set a label and description for a +folder.
100.50.30. Get the label and description for a folder.
-100.50.40. Get a list of folders contained within a -folder.
+100.50.40. Get a list of folders contained +within a folder.
100.50.50. Move a folder to another folder.
100.50.60. Copy a folder to another folder.
-100.50.70. Create a symbolic link to a folder from -within another folder. The contents of the folder should be -accessible via the symbolic link as well as the regular path.
-100.50.80. Tag all live item revisions within a folder -with a common version descriptor (i.e. 'Version 1.0' or 'August 1 -release'), for the purpose of versioning an entire branch of the -site. Folder objects themselves are not eligible for -versioning, since they are solely containers and do not have any -content other than the items they contain.
+100.50.70. Create a symbolic +link to a folder from within another folder. The contents +of the folder should be accessible via the symbolic link as well as +the regular path.
+100.50.80. Tag all live item revisions within a +folder with a common version descriptor (i.e. 'Version 1.0' +or 'August 1 release'), for the purpose of versioning an +entire branch of the site. Folder objects themselves are +not eligible for versioning, since they are solely +containers and do not have any content other than the items they +contain.
100.50.90. Delete a folder if it is empty.
Note that folders are simply a special type of content item, and @@ -339,13 +359,14 @@
100.60.10. Create a new subject category.
-100.60.20. Create a new subject category as the child of -another subject category.
-100.60.30. Assign a subject category to a content +100.60.20. Create a new subject category as the +child of another subject category.
+100.60.30. Assign a subject category to a +content item.
+100.60.40. Remove a subject category from an item.
-100.60.40. Remove a subject category from an item.
-100.60.50. Get the subject categories assigned to a -content item.
+100.60.50. Get the subject categories assigned +to a content item.Search
The repository must have a standard means of indexing and @@ -377,5 +398,5 @@ karlg\@arsdigita.com
-Last Modified: $Id: requirements.html,v 1.2 2003/12/11 21:39:47 -jeffd Exp $ +Last Modified: $Id: requirements.html,v 1.2.22.1 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/tutorial.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/tutorial.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/tutorial.adp 9 Jun 2016 13:03:11 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/tutorial.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4 @@ -6,12 +6,13 @@ by Jade RubickWhy use the content repository?
-Let's say you're a developer making a package for OpenACS. -You've heard statements like, "every package should use the content -repository", or maybe a developer has suggested that you use it. Or -maybe you just stumbled across it. Why would you want to spend your -time reading this document and wasting a good afternoon when you -could get started coding right away?
+Let's say you're a developer making a package for +OpenACS. You've heard statements like, "every package +should use the content repository", or maybe a developer has +suggested that you use it. Or maybe you just stumbled across it. +Why would you want to spend your time reading this document and +wasting a good afternoon when you could get started coding right +away?
The simple answer is that the content repository (CR) gives you many different things for free:
@@ -50,21 +51,21 @@
Overview
-First of all, let's get some terminology out of the way. Columns -of a table are referred to as attributes in content -repository-speak.
+First of all, let's get some terminology out of the way. +Columns of a table are referred to as attributes in +content repository-speak.
The steps to set up your data model are as follows:
- What attributes do you want?
- Define tables
- Describe attributes
What attributes do you want?
-The first step is to decide on what part of a Task you'd you'd -like to have under revision control, and what portion you'd like to -have just one version of. In our case, the only thing we wouldn't -want under version control is the Task Number. This will be a -unique identifier for the task, and we don't want that changing -every time someone edits it.
+The first step is to decide on what part of a Task you'd +you'd like to have under revision control, and what portion +you'd like to have just one version of. In our case, the only +thing we wouldn't want under version control is the Task +Number. This will be a unique identifier for the task, and we +don't want that changing every time someone edits it.
For our simple example:
Title - want versions @@ -77,9 +78,10 @@ without versioned attributes.Convention: often, developers will name the first table -by what it is (in my case pm_tasks), and the second, -versioned table by the same name, but with _revisions at the end. -Thus, I'll name my second table pm_tasks_revisions.
+by what it is (in my case pm_tasks), and the +second, versioned table by the same name, but with _revisions at +the end. Thus, I'll name my second table +pm_tasks_revisions. This is actually very easy:Versioned portion:
@@ -117,12 +119,12 @@One thing you have to be careful of when creating these tables is that there are no columns that have the same names as any of the columns in the
+tables for you, but they won't be created if the names +conflict. I'll describe what these views are later, but they +are useful. You were warned.cr_items
andcr_revisions
-tables. For example, you can't call you key on the +tables. For example, you can't call you key on the pm_tasks_revisions tablerevision_id
. Why? There are some views that are automatically generated that combine these -tables for you, but they won't be created if the names conflict. -I'll describe what these views are later, but they are useful. You -were warned.Notice that each table uses as its primary key a reference to either the
cr_revisions
table or thecr_items
table. A content item is basically @@ -134,11 +136,11 @@sql/postgresql/project-manager-create.sql
file. Your name will be different of course.Describe attributes
-After we've created the two tables, we need to let the content -repository know that we have a new type of structured data that we -are storing in the content repository. Tasks are a "content type", -because they have data associated with them, such as when they are -due, and what needs to be done.
+After we've created the two tables, we need to let the +content repository know that we have a new type of structured data +that we are storing in the content repository. Tasks are a +"content type", because they have data associated with +them, such as when they are due, and what needs to be done.
I thus need to to
--create the content type @@ -155,8 +157,9 @@You then need to add in all the attributes, so that the content repository can do some magic things behind the scenes. The content -repository doesn't know about what's inside of the pm_tasks -and pm_tasks_revisions tables, so we teach it:
+repository doesn't know about what's inside of the +pm_tasks and pm_tasks_revisions tables, so we +teach it:-- add in attributes @@ -195,10 +198,10 @@-Side effect: once you've created the content type, the -content repository creates a view for you called +Side effect: once you've created the +content type, the content repository creates a view for you called
pm_tasks_revisionsx
. Note the x at the end of the -name. If you're using Postgres, I believe it will also create a +name. If you're using Postgres, I believe it will also create a view for you calledpm_tasks_revisionsi
Why are these two views created? the x view is created for @@ -212,38 +215,40 @@ table or
+repository API. The advantage is that someday you'll be able to +do really cool stuff with it, like automatically generate +interfaces that take advantage of the new columns and tables +you've added. Another nice thing is that all that messy +business of defining your attributes through the API is taken care +of.alter table add column
statements in SQL, but this also adds in some meta-data that will be useful to you. The disadvantage is that you have to call the content -repository API. The advantage is that someday you'll be able to do -really cool stuff with it, like automatically generate interfaces -that take advantage of the new columns and tables you've added. -Another nice thing is that all that messy business of defining your -attributes through the API is taken care of.Types is the content repository are another term for -tables, although that doesn't explain it completely. Types are also -kept track of within OpenACS, in the
+tables, although that doesn't explain it completely. Types are +also kept track of within OpenACS, in the +acs_object_types
-table, so the system knows about the tables you create, and can do -some intelligent things with them.acs_object_types
table, so the system knows about the +tables you create, and can do some intelligent things with +them.A lot of the intelligent things you can do with this information is still being built. But imagine for example that you -are using the project manager package I've written. You work at an -ice cream company, and every task that is done also has an -associated ice cream flavor with it (yeah, this isn't a good +are using the project manager package I've written. You work at +an ice cream company, and every task that is done also has an +associated ice cream flavor with it (yeah, this isn't a good example, but pay attention anyway). If I've written the project manager to take advantage of it, when you add in this extra attribute to the pm_tasks_revisions table, the UI aspects will be -automatically taken care of. You'll be able to select a flavor when -you edit a task, and it will be shown on the task view page. This -is the direction OpenACS development is going, and it will be +automatically taken care of. You'll be able to select a flavor +when you edit a task, and it will be shown on the task view page. +This is the direction OpenACS development is going, and it will be really really cool!
First, I'm going to describe how to extend other content -repository tables using the CR API. Then, I'll describe how to set -up your own tables as well:
+repository tables using the CR API. Then, I'll describe how to +set up your own tables as well:As you recall from earlier in this page, attributes are just another term for columns in a table. The Content Repository has a mechanism for adding and removing columns via the pl/sql API. If you check your /api-doc:
/api-doc/plsql-subprogram-one?type=FUNCTION&name=content%5ftype%5f%5fcreate%5fattribute
-, you'll see that there is a way to extend the columns +, you'll see that there is a way to extend the columns programmatically.Why would you want to do this? For project manager, I decided to do this because I wanted to customize my local version of the @@ -300,43 +305,44 @@ You then need to define a couple of functions, that do all the nasty work of putting everything in the right tables. The general idea behind it is that the revisioned information is never changed, -but added to. Here's how it works. When you create a new task, you -call the
pm_task__new_task_item
- function (which we'll -write in a little bit). This function creates both a new content -item, and a new content revision. Information is actually stored in -four tables, believe it or not:cr_revisions
+but added to. Here's how it works. When you create a new task, +you call thepm_task__new_task_item
+ function (which +we'll write in a little bit). This function creates both a new +content item, and a new content revision. Information is actually +stored in four tables, believe it or not: +cr_revisions
+,cr_items
, -cr_items
-,pm_tasks
-, and -pm_tasks_revisions
-. The task number is stored in -pm_tasks, the title and description are stored in -pm_tasks_revisions, and some additional information like who -entered the information is stored in cr_revisions and cr_items. -Whenever you make a change to this item, you don't change the table -yourself, but add +pm_tasks
+, andpm_tasks_revisions
+. The +task number is stored in pm_tasks, the title and description are +stored in pm_tasks_revisions, and some additional information like +who entered the information is stored in cr_revisions and cr_items. +Whenever you make a change to this item, you don't change the +table yourself, but add a revision, using yourpm_task__new_task_revision
- function (which we'll write -in a little bit). This function adds another revision, but + function (which we'll +write in a little bit). This function adds another revision, but not - another item or cr_item. After you've added another -revision, you'll have two revisions and one item. Two entries in -cr_revisions (and pm_tasks_revisions), and one item in cr_items and -pm_tasks. The cr_revisions table keeps track of which item is the -most recent, and which item is "live". For the edit-this-page -application, for example, this is used to keep track of which -revision to a page is actually being served to users. In your code, -you'll use your pm_tasks_revisionsx view, which joins the -pm_tasks_revisions table with the cr_revisions table (and it might -even join in cr_items -- I forget at the moment). + another item or cr_item. After you've added +another revision, you'll have two revisions and one item. Two +entries in cr_revisions (and pm_tasks_revisions), and one item in +cr_items and pm_tasks. The cr_revisions table keeps track of which +item is the most recent, and which item is "live". For +the edit-this-page application, for example, this is used to keep +track of which revision to a page is actually being served to +users. In your code, you'll use your pm_tasks_revisionsx view, +which joins the pm_tasks_revisions table with the cr_revisions +table (and it might even join in cr_items -- I forget at the +moment).Defining your pl/sql functions
You can see the actual functions used in project manager via the -CVS browser's entry for project-manager +CVS browser's entry for project-manager . Note these are a little more expanded than what I've used in the examples above.@@ -509,24 +515,27 @@ cr_items:-item_id - unique id for this item, will be -different than the revision_idcr_revisions:
parent_id - used to group items into a hierarchy (see -below)
name - this is used to make a URL by the content repository. -It must be unique per content folder. You can use a number, or -something like project_231. One way to do this is to set it equal -to a title plus the item_id.
locale - not sure, probably for internationalization -support
live_revision - this is equal to the cr_revision table's -revision_id that is the live version
latest_revision - this is equal to the cr_revision table's -revision_id that is the latest version
publish_status - not sure
content_type - not sure
storage_type - not sure, probably text or binary?
storage_area_key - not sure
tree_sortkey - a utility column used in hierarchical -queries.
+item_id - unique id for this item, +will be different than the revision_id
parent_id - used to group items into a hierarchy +(see below)
name - this is used to make a URL by the content +repository. It must be unique per content folder. You can use a +number, or something like project_231. One way to do this is to set +it equal to a title plus the item_id.
locale - not sure, probably for +internationalization support
live_revision - this is equal to the cr_revision +table's revision_id that is the live version
latest_revision - this is equal to the cr_revision +table's revision_id that is the latest version
publish_status - not sure
content_type - not sure
storage_type - not sure, probably text or +binary?
storage_area_key - not sure
tree_sortkey - a utility column used in +hierarchical queries.
-revision_id - a unique id for this revision.@@ -544,8 +553,8 @@
item_id - a reference to the item_id for this revision
title - you can use this for your application. For example, -My Big Project
description - you can use this for your application, as a -longer description.
publish_date - the date this was published. Not sure if this -is for your use, or internal
mime_type - the mime type.
nls_language - I believe this is for +revision_id - a unique id for this +revision.
item_id - a reference to the item_id for this +revision
title - you can use this for your application. For +example, My Big Project
description - you can use this for your +application, as a longer description.
publish_date - the date this was published. Not +sure if this is for your use, or internal
mime_type - the mime type.
nls_language - I believe this is for internationalization
lob - the binary content.
content - the text content.
content_length - the length of the text or binary content?
Using this structure is optional, but useful in many circumstances.
The facility for this is built into the
cr_items
-data model. This makes sense, because you wouldn't want your -hierarchy associated with each revision. Here's how Postgres +data model. This makes sense, because you wouldn't want your +hierarchy associated with each revision. Here's how Postgres describes thecr_items
table:Table "public.cr_items" @@ -576,16 +585,16 @@ give the application its own root directory. Because the content repository is shared among applications, this separates it off from other applications. They can still use the items in your -application, but it must be a more deliberate process. If you don't -create your own root directory, you may see strange-looking data -from other applications in your application, or see your -application's data in other applications. There are times when -you'll want to do this, but probably not until you're much more -familiar with the content repository. Another reason for creating -your own root repository is that you application may be mounted -several times. If you want to separate the directory structure -between instances of your application, you need to create your own -root directory: +application, but it must be a more deliberate process. If you +don't create your own root directory, you may see +strange-looking data from other applications in your application, +or see your application's data in other applications. There are +times when you'll want to do this, but probably not until +you're much more familiar with the content repository. Another +reason for creating your own root repository is that you +application may be mounted several times. If you want to separate +the directory structure between instances of your application, you +need to create your own root directory:Note that this example is for projects rather than tasks. This is -because for the application I'm writing, projects are what tasks -are stored inside of. A project has many component tasks. If you -were writing another application, or if I wasn't doing anythign -with projects, then this would be creating a folder for just tasks. +because for the application I'm writing, projects are what +tasks are stored inside of. A project has many component tasks. If +you were writing another application, or if I wasn't doing +anythign with projects, then this would be creating a folder for +just tasks.-- Creates and returns a unique name for new project folders @@ -646,34 +655,35 @@Typically, this definition would go in your
-sql/postgresql/project-manager-create.sql
file. If this file is broken in several parts, this would go in the project-manager-create-functions.sql portion.Once you've created your root directory, you will set the +
Once you've created your root directory, you will set the
-parent_id
of your items to the id for the new root -repository (in our case, it's returned from the +repository (in our case, it's returned from thepm_project__new_root_folder function
)In the project-manager application, we'll create a root +
In the project-manager application, we'll create a root repository, and make all projects under that root repository. That -means they'll all have a
parent_id
set to the root +means they'll all have aparent_id
set to the root repository. However, we also want to make projects that are sub-projects of other projects. In that case, we will set theparent_id
of the sub-project to theitem_id
of the parent.Understanding folders
For a little while now, we have been talking about folders, but we -haven't delved into what CR folders are. Folders are sub-classes of -cr_items
-, and the only real difference is that they -contain no data, except for a label and description. -If you create folders for your application, then you'll need to -make sure you manage them along with your other objects. For +haven't delved into what CR folders are. Folders are +sub-classes of
cr_items
+, and the only real difference +is that they contain no data, except for a label and description. +If you create folders for your application, then you'll need +to make sure you manage them along with your other objects. For example, if you were to add a folder for each of your objects, then you would probably want to make sure you delete the folder when you delete the object.
@@ -683,7 +693,7 @@ install the project-manager in two parts of your web server, for example, it should have two different root folders). When your application is running, it can determine the root folder by -searching the cr_folders table. Here's the definition of that +searching the cr_folders table. Here's the definition of that table:Table "public.cr_folders" @@ -715,14 +725,14 @@Drop scripts
If you have problems with your drop script in OpenACS 4.6.2, then -Tammy's +Tammy's drop scripts might be of interest to you.Using your data model
You now have a shiny new data model that handles revisions and all -sorts of other things we haven't gotten to yet. Now, in your Tcl -pages and your ps/sql code, you can... +sorts of other things we haven't gotten to yet. Now, in your +Tcl pages and your ps/sql code, you can...
Get latest revision (Tcl) set live_revision_id [db_exec_plsql get_live_revision {select @@ -740,7 +750,7 @@
- OpenACS Content Repository docs
- -Dave's page on Using the Content Repository
+Dave's page on Using the Content RepositoryReference: Definitions
@@ -790,7 +800,7 @@
Troubleshooting
One problem I ran into while trying to get my SQL create and drop -scripts working was that sometimes I wasn't able to delete a +scripts working was that sometimes I wasn't able to delete a content type because I would get errors like these:Referential Integrity: attempting to delete live_revision: 658 @@ -808,8 +818,8 @@ Really, however, what you need to do is make sure your __delete and drop scripts first go through and delete all children of those -items. I'm not sure if you need to delete the items themselves -- I -believe they may be dropped by themselves when the tables are +items. I'm not sure if you need to delete the items themselves +-- I believe they may be dropped by themselves when the tables are dropped, because of thecascade
portion of the SQL data model. Index: openacs-4/packages/acs-content-repository/www/doc/uninstall.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/uninstall.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/uninstall.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/uninstall.adp 1 Jul 2016 09:17:32 -0000 1.2.2.5 @@ -3,31 +3,34 @@Content Repository: Uninstalling Uninstalling the Content Repository
+Content RepositoryThe content repository includes an uninstall script, -sql/content-drop.sql. This script does two things:
+sql/content-drop.sql. This script does two things:-
- Drops the attribute storage tables for all content types you have defined.
- Drops the general tables for the content repository.
The uninstall script does not do the following:
+The uninstall script does not do the +following:
-
-- It does not delete rows from the acs_objects -table. Many other tables reference the object_id column in -this table, so there is the possibility that the uninstall script -will encounter foreign key reference errors.
- It does not delete types from the -acs_object_types table. As for objects themselves, it is +
- It does not delete rows from the +acs_objects table. Many other tables reference the +object_id column in this table, so there is the +possibility that the uninstall script will encounter foreign key +reference errors.
- It does not delete types from the +acs_object_types table. As for objects themselves, it is impossible for an automatic script to properly handle disposal of all foreign key references.
Because of what the uninstall script does not do, it is -only appropriate for removing the content repository in -preparation for removing the entire ACS Objects data model. If -you wish to upgrade an existing installation and cannot afford to -lose your data, you must run an upgrade script rather than -uninstalling the entire data model.
+Because of what the uninstall script does not +do, it is only appropriate for removing the content repository +in preparation for removing the entire ACS Objects data +model. If you wish to upgrade an existing installation and +cannot afford to lose your data, you must run an upgrade script +rather than uninstalling the entire data model.
karlg\@arsdigita.com
-Last revised: $Id: uninstall.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $ +Last revised: $Id: uninstall.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/content.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/content.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/api/content.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/api/content.adp 1 Jul 2016 09:17:32 -0000 1.2.2.5 @@ -9,7 +9,7 @@-
- Function content.blob_to_string
-
Parameters: Not yet documented Declaration: +Parameters: Not yet documented Declaration: + function blob_to_string( blob_loc blob) return varchar2 as language @@ -19,11 +19,11 @@ oracle.sql.BLOB ) return java.lang.String'; -- Procedure content.blob_to_file
-
Parameters: Not yet documented Declaration: +Parameters: Not yet documented Declaration: + procedure blob_to_file( s varchar2, blob_loc blob) as language @@ -33,11 +33,11 @@ java.lang.String, oracle.sql.BLOB )'; -- Procedure content.string_to_blob
-
Parameters: Not yet documented Declaration: +Parameters: Not yet documented Declaration: + procedure string_to_blob( s varchar2, blob_loc blob) as language @@ -47,11 +47,11 @@ java.lang.String, oracle.sql.BLOB )'; -- Procedure content.string_to_blob_size
-
Parameters: Not yet documented Declaration: +Parameters: Not yet documented Declaration: + procedure string_to_blob_size( s varchar2, blob_loc blob, blob_size number) as language @@ -61,9 +61,9 @@ java.lang.String, oracle.sql.BLOB, int )'; -Last Modified: $Id: content.html,v 1.1.1.1.30.1 2016/06/09 -08:21:01 gustafn Exp $
+Last Modified: $Id: content.html,v 1.1.1.1.30.2 2016/06/22 +07:40:41 gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/api/extlink.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/extlink.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/api/extlink.adp 9 Jun 2016 08:44:49 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/api/extlink.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4 @@ -14,9 +14,9 @@Overview
External links are references to content pages on other web sites. They provide the basis for maintaining a hierarchy of -"bookmarks" that may be managed in a manner analogous to other -content items. In particular, external links may be tagged with -keywords and related to the site's own content items.
+"bookmarks" that may be managed in a manner analogous to +other content items. In particular, external links may be tagged +with keywords and related to the site's own content items.
Related Objects
@@ -30,15 +30,16 @@Author: Karl Goldstein - Returns: 't' if the item is a extlink, 'f' otherwise +Returns: 't' if the item is a extlink, 'f' +otherwise Parameters:
item_id: The item id -Declaration: +Declaration: function is_extlink ( item_id in cr_items.item_id%TYPE ) return char; -+ See Also: content_extlink.new, content_extlink.resolve @@ -67,16 +68,16 @@
extlink_id: The id of the new extlink. A new id will be allocated by default - creation_date: As in acs_object.new + creation_date: As in acs_object.new - creation_ip: As in acs_object.new + creation_ip: As in acs_object.new - -creation_user: As in acs_object.new + creation_user: As in acs_object.new Declaration: +Declaration: function new ( name in cr_items.name%TYPE default null, url in cr_extlinks.url%TYPE, @@ -91,7 +92,7 @@ creation_ip in acs_objects.creation_ip%TYPE default null ) return cr_extlinks.extlink_id%TYPE; -+ See Also: acs_object.new, content_item.new, content_extlink.resolve @@ -102,17 +103,17 @@
Author: Karl Goldstein Parameters:
extlink_id: The id of the extlink to delete -Declaration: +Declaration: procedure delete ( extlink_id in cr_extlinks.extlink_id%TYPE ); -+ -Last Modified: $Id: extlink.html,v 1.1.1.1.30.1 2016/06/09 08:21:01 +Last Modified: $Id: extlink.html,v 1.1.1.1.30.2 2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/folder.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/api/folder.adp 9 Jun 2016 08:44:49 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/api/folder.adp 1 Jul 2016 09:17:32 -0000 1.2.2.4 @@ -15,10 +15,11 @@ See Also: content_extlink.new, acs_object.delete Content folders contain related content items and allow content managers to group content as they see fit. Within a content folder, content items must have unique names since this is where they will -be served from. For example within the folder "movies" (served from -"/movies") all items must have unique names, such as: "terminator," -"terminator2" (served from "/movies/terminator, -"/movies/terminator2" respectively).
+be served from. For example within the folder "movies" +(served from "/movies") all items must have unique names, +such as: "terminator," "terminator2" (served +from "/movies/terminator, "/movies/terminator2" +respectively).
Related Objects
@@ -36,12 +37,12 @@Returns: The item ID of the index page Parameters:
folder_id The: folder id -Declaration: +Declaration: + function get_index_page ( folder_id in cr_folders.folder_id%TYPE ) return cr_items.item_id%TYPE; -
folder_id: The folder id -
+
function get_label ( folder_id in cr_folders.folder_id%TYPE ) return cr_folders.label%TYPE; -
folder_id: The folder id -
+
function is_empty ( folder_id in cr_folders.folder_id%TYPE ) return varchar2; -
@@ -88,15 +89,16 @@
item_id: The item id -
+
function is_folder ( item_id in cr_items.item_id%TYPE ) return char; -
@@ -108,53 +110,55 @@
folder_id: The folder id content_type: The content type to be checked - -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. +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.
+
function 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' ) return varchar2; -
Determine if the item target_folder_id is a subfolder -of the item folder_id +
Determine if the item target_folder_id is a subfolder +of the item folder_id
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | 't' if the item target_folder_id is a -subfolder of the item folder_id, 'f' otherwise | +Returns: | 't' if the item +target_folder_id is a subfolder of the item +folder_id, 'f' otherwise | ||||
Parameters: | |||||||
| |||||||
Declaration: | |||||||
+ |
function is_sub_folder ( folder_id in cr_folders.folder_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ) return char; -
@@ -179,16 +183,16 @@
+
function new ( name in cr_items.name%TYPE, label in cr_folders.label%TYPE, @@ -202,7 +206,7 @@ creation_ip in acs_objects.creation_ip%TYPE default null ) return cr_folders.folder_id%TYPE; -
@@ -220,13 +224,13 @@
+
procedure copy ( folder_id in cr_folders.folder_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); -
@@ -238,12 +242,12 @@
folder_id: The id of the folder to delete -
+
procedure delete ( folder_id in cr_folders.folder_id%TYPE ); -
@@ -261,13 +265,13 @@
+
procedure move ( folder_id in cr_folders.folder_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); -
@@ -285,14 +289,14 @@
+
procedure register_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' ); -
+
procedure rename ( 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 ); -
@@ -343,17 +347,17 @@
+
procedure 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' ); -
-Last Modified: $Id: folder.html,v 1.2.18.1 2016/06/09 08:21:01 +Last Modified: $Id: folder.html,v 1.2.18.2 2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/item.adp,v diff -u -r1.2.2.10 -r1.2.2.11 --- openacs-4/packages/acs-content-repository/www/doc/api/item.adp 9 Jun 2016 13:03:11 -0000 1.2.2.10 +++ openacs-4/packages/acs-content-repository/www/doc/api/item.adp 1 Jul 2016 09:17:33 -0000 1.2.2.11 @@ -16,11 +16,11 @@ 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. +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.
item_id: The item for which the content type is to be retrieved -
+
function get_content_type ( item_id in cr_items.item_id%TYPE ) return cr_items.content_type%TYPE; -
item_id: The item for which the parent is to be retrieved -
+
function get_context ( item_id in cr_items.item_id%TYPE ) return acs_objects.context_id%TYPE; -
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 | |
---|---|---|
root_folder_id: | Starts path resolution from this folder. Defaults to the root of the sitemap |
+
function get_id ( item_path in varchar2, root_folder_id in cr_items.item_id%TYPE default c_root_folder_id ) return cr_items.item_id%TYPE; -
@@ -101,12 +102,12 @@ null if no revisions exist
item_id: The item for which the latest revision is to be retrieved -
+
function get_latest_revision ( item_id in cr_items.item_id%TYPE ) return cr_revisions.revision_id%TYPE; -
@@ -121,12 +122,12 @@ if no live revision exists
item_id: The item for which the live revision is to be retrieved -
+
function get_live_revision ( item_id in cr_items.item_id%TYPE ) return cr_revisions.revision_id%TYPE; -
item_id: The item id -
+
function get_parent_folder ( item_id in cr_items.item_id%TYPE ) return cr_folders.folder_id%TYPE; -
+
function 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; -
@@ -185,16 +186,16 @@
+
function get_publish_date ( item_id in cr_items.item_id%TYPE, is_live in char default 'f' ) return cr_revisions.publish_date%TYPE; -
item_id: The id the item -
+
function get_revision_count ( item_id in cr_items.item_id%TYPE ) return number; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
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 +given context, the default template for the item's type is returned.
Author: | Karl Goldstein | @@ -241,16 +242,16 @@||||
---|---|---|---|---|---|
item_id: | The item for which the template will be unregistered | ||||
use_context: | The context in the item is to be rendered, such as 'admin' or -'public' | +use_context: | The context in the item is to be rendered, such as +'admin' or 'public' |
+
function get_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; -
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 | ||||
---|---|---|---|---|---|
item_id: | The item for which the title is to be retrieved | ||||
is_live: | If 't', use the live revision to get the title. Otherwise, use -the latest revision. The default is 'f' | +is_live: | If 't', use the live revision to get the title. +Otherwise, use the latest revision. The default is 'f' |
+
function get_title ( item_id in cr_items.item_id%TYPE, is_live in char default 'f' ) return cr_revisions.title%TYPE; -
+
function get_virtual_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; -
item_id: The item id - folder_id: The folder id
+
function is_index_page ( item_id in cr_items.item_id%TYPE, folder_id in cr_folders.folder_id%TYPE ) return varchar2; -
@@ -345,16 +346,16 @@
item_id The: item ID of the potential parent -
+
function is_publishable ( item_id in cr_items.item_id%TYPE ) return char; -
object_type: The child class - supertype: The superclass
+
function is_subclass ( object_type in acs_object_types.object_type%TYPE, supertype in acs_object_types.supertype%TYPE ) return char; -
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 +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 | ||||||
---|---|---|---|---|---|---|---|
Returns: | 't' if the item would be a valid child, 'f' -otherwise | +Returns: | 't' if the item would be a valid child, +'f' otherwise | ||||
Parameters: | |||||||
| |||||||
Declaration: | |||||||
+ |
function is_valid_child ( item_id in cr_items.item_id%TYPE, content_type in acs_object_types.object_type%TYPE ) return char; -
Creates a new content item. If the data, title -or text parameters are specified, also creates a revision -for the item.
Author: | Karl Goldstein | ||||
---|---|---|---|---|---|
locale: | The locale for this item, for use with Intermedia search | ||||
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 + | 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 | ||
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 | +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 | ||
title: | The user-readable title for the item, defaults to the item's -name | +title: | The user-readable title for the item, defaults to the +item's name | ||
description: | A short description for the item (4000 characters maximum) | ||||
mime_type: | The file type of the item, defaults to 'text/plain' | +mime_type: | The file type of the item, defaults to +'text/plain' | ||
nls_language: | The language for the item, used for Intermedia search | ||||
text: | The text content of the new revision, 4000 charcters maximum. -Cannot be specified simultaneously with the data +Cannot be specified simultaneously with the data parameter | ||||
data: | The blob content of the new revison. Cannot be specified -simultaneously with the text parameter | +simultaneously with the text parameter||||
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' | +Defaults to 'parent content type'-'child content +type'||||
is_live: | If 't', the new revision will become live | ||||
creation_date: | As in acs_object.new + | creation_date: | As in acs_object.new | ||
creation_ip: | As in acs_object.new + | creation_ip: | As in acs_object.new | ||
creation_user: | As in acs_object.new + | creation_user: | As in acs_object.new |
+
function new ( name in cr_items.name%TYPE, parent_id in acs_objects.context_id%TYPE default null, @@ -493,14 +496,14 @@ is_live in char default 'f' ) return cr_items.item_id%TYPE; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
procedure copy ( item_id in cr_items.item_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); -
@@ -544,12 +547,12 @@
item_id: The id of the item to delete -
+
procedure delete ( item_id in cr_items.item_id%TYPE ); -
@@ -566,13 +569,13 @@
+
procedure move ( item_id in cr_items.item_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); -
@@ -591,22 +594,22 @@
+
procedure register_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 ); -
Renames the item. If an item with the specified name already -exists under this item's parent, an error is thrown
Author: | Karl Goldstein | |||
---|---|---|---|---|
Parameters: | ||||
| ||||
Declaration: | ||||
+ |
procedure rename ( item_id in cr_items.item_id%TYPE, name in cr_items.name%TYPE ); -
@@ -634,13 +637,13 @@
revision_id: The id of the revision which is to become live for its corresponding item -
+
procedure set_live_revision ( revision_id in cr_revisions.revision_id%TYPE, publish_status in cr_items.publish_status%TYPE default 'ready' ); -
@@ -660,14 +663,14 @@
+
procedure set_release_period ( item_id in cr_items.item_id%TYPE, start_when date default null, end_when date default null ); -
+
procedure unregister_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 ); -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
procedure write_to_file ( item_id in cr_items.item_id%TYPE, root_path in varchar2 ); -
-Last Modified: $Id: item.html,v 1.3.18.1 2016/06/09 08:21:01 +Last Modified: $Id: item.html,v 1.3.18.2 2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/keyword.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/keyword.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/api/keyword.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/api/keyword.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -32,12 +32,12 @@
keyword_id: The keyword id -
+
function get_description ( keyword_id in cr_keywords.keyword_id%TYPE ) return varchar2; -
keyword_id: The keyword id -
+
function get_heading ( keyword_id in cr_keywords.keyword_id%TYPE ) return varchar2; -
keyword_id: The keyword id -
+
function get_path ( keyword_id in cr_keywords.keyword_id%TYPE ) return varchar2; -
@@ -87,8 +87,8 @@
- item_id: The item id @@ -99,24 +99,27 @@ 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", +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 +down: Recursive from general to specific. A +search for "mammals" will also match "dogs", +"attack dogs", "cats", "siamese cats", etc.
+
function is_assigned ( item_id in cr_items.item_id%TYPE, keyword_id in cr_keywords.keyword_id%TYPE, recurse in varchar2 default 'none' ) return varchar2; -
@@ -127,22 +130,23 @@
keyword_id: The keyword id -
+
function is_leaf ( keyword_id in cr_keywords.keyword_id%TYPE ) return varchar2; -
Creates a new keyword (also known as "subject category").
Author: | Karl Goldstein | ||||
---|---|---|---|---|---|
keyword_id: | The id of the new keyword. A new id will be allocated if this parameter is null | ||||
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. | +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. | ||
creation_date: | As in acs_object.new + | creation_date: | As in acs_object.new | ||
creation_ip: | As in acs_object.new + | creation_ip: | As in acs_object.new | ||
creation_user: | As in acs_object.new + | creation_user: | As in acs_object.new |
+
function new ( heading in cr_keywords.heading%TYPE, description in cr_keywords.description%TYPE default null, @@ -185,7 +189,7 @@ object_type in acs_object_types.object_type%TYPE default 'content_keyword' ) return cr_keywords.keyword_id%TYPE; -
keyword_id: The id of the keyword to be deleted -
+
procedure delete ( keyword_id in cr_keywords.keyword_id%TYPE ); -
@@ -220,13 +224,13 @@
+
procedure item_assign ( item_id in cr_items.item_id%TYPE, keyword_id in cr_keywords.keyword_id%TYPE, @@ -235,7 +239,7 @@ creation_ip in acs_objects.creation_ip%TYPE default null ); -
@@ -251,13 +255,13 @@
+
procedure item_unassign ( item_id in cr_items.item_id%TYPE, keyword_id in cr_keywords.keyword_id%TYPE ); -
@@ -273,13 +277,13 @@
+
procedure set_description ( keyword_id in cr_keywords.keyword_id%TYPE, description in cr_keywords.description%TYPE ); -
+
procedure set_heading ( keyword_id in cr_keywords.keyword_id%TYPE, heading in cr_keywords.heading%TYPE ); -
-Last Modified: $Id: keyword.html,v 1.1.1.1.30.1 2016/06/09 08:21:01 +Last Modified: $Id: keyword.html,v 1.1.1.1.30.2 2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/permission.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/permission.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/api/permission.adp 9 Jun 2016 08:44:49 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/api/permission.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -32,8 +32,8 @@
object_id: The object whose permissions are to be changed @@ -42,14 +42,14 @@- privilege: The privilege to be granted
+
function has_grant_authority ( object_id in acs_objects.object_id%TYPE, holder_id in parties.party_id%TYPE, privilege in acs_privileges.privilege%TYPE ) return varchar2; -
object_id: The object whose permissions are to be changed @@ -78,15 +78,15 @@- revokee_id: The user from whom the privilege is to be taken away
+
function has_revoke_authority ( 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; -
object_id: The object whose permissions are to be checked @@ -112,14 +112,14 @@- privilege: The privilege to be checked
+
function 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; -
+
procedure grant_permission_h ( object_id in acs_objects.object_id%TYPE, grantee_id in parties.party_id%TYPE, privilege in acs_privileges.privilege%TYPE ); -
@@ -170,14 +170,14 @@
+
procedure grant_permission_h ( object_id in acs_objects.object_id%TYPE, grantee_id in parties.party_id%TYPE, privilege in acs_privileges.privilege%TYPE ); -
@@ -195,14 +195,14 @@
+
procedure inherit_permissions ( 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 ); -
@@ -223,14 +223,14 @@
+
procedure revoke_permission_h ( object_id in acs_objects.object_id%TYPE, revokee_id in parties.party_id%TYPE, privilege in acs_privileges.privilege%TYPE ); -
@@ -251,20 +251,20 @@
+
procedure revoke_permission_h ( object_id in acs_objects.object_id%TYPE, revokee_id in parties.party_id%TYPE, privilege in acs_privileges.privilege%TYPE ); -
-Last Modified: $Id: permission.html,v 1.1.1.1.30.1 2016/06/09 -08:21:01 gustafn Exp $ +Last Modified: $Id: permission.html,v 1.1.1.1.30.2 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/revision.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/revision.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/api/revision.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/api/revision.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -14,10 +14,10 @@
Content revisions contain the data for content items. There is a many to one relationship between content revisions and content -items. There is at most one "live" revision for every content item -though. For example, there may be 5 revisions of the review for the -movie "Terminator," yet only one of these may be live on the -website at a given time.
+items. There is at most one "live" revision for every +content item though. For example, there may be 5 revisions of the +review for the movie "Terminator," yet only one of these +may be live on the website at a given time.
revision_id: The id of the revision to copy -
+
function copy ( revision_id in cr_revisions.revision_id%TYPE, copy_id in cr_revisions.revision_id%TYPE default null ) return cr_revisions.revision_id%TYPE; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
revision_id: The id the revision -
+
function get_number ( revision_id in cr_revisions.revision_id%TYPE ) return number; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
function new ( title in cr_revisions.title%TYPE, description in cr_revisions.description%TYPE default null, @@ -139,14 +139,14 @@ creation_ip in acs_objects.creation_ip%TYPE default null ) return cr_revisions.revision_id%TYPE; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
revision_id: The id of the revision to delete -
+
procedure delete ( revision_id in cr_revisions.revision_id%TYPE ); -
@@ -202,19 +202,19 @@
revision_id: The id of the revision to index -
+
procedure index_attributes( revision_id IN cr_revisions.revision_id%TYPE ); -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
revision_id: The id of the revision to index -
+
procedure to_html ( revision_id IN cr_revisions.revision_id%TYPE ); -
-Last Modified: $Id: revision.html,v 1.1.1.1.30.1 2016/06/09 -08:21:01 gustafn Exp $ +Last Modified: $Id: revision.html,v 1.1.1.1.30.2 2016/06/22 +07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/symlink.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/symlink.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/api/symlink.adp 9 Jun 2016 08:44:49 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/api/symlink.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -27,15 +27,16 @@
item_id: The item id -
+
function is_symlink ( item_id in cr_items.item_id%TYPE ) return char; -
@@ -62,16 +63,16 @@
+
function new ( name in cr_items.name%TYPE default null, label in cr_symlinks.label%TYPE default null, @@ -85,7 +86,7 @@ creation_ip in acs_objects.creation_ip%TYPE default null ) return cr_symlinks.symlink_id%TYPE; -
@@ -99,12 +100,12 @@ item id if the item is not in fact a symlink
item_id: The item id to be resolved -
+
function resolve ( item_id in cr_items.item_id%TYPE ) return cr_items.item_id%TYPE; -
@@ -119,12 +120,12 @@ null. the item is not in fact a symlink
item_id: The item id to be resolved -
+
function resolve_content_type ( item_id in cr_items.item_id%TYPE ) return cr_items.content_type%TYPE; -
@@ -140,13 +141,13 @@
+
procedure copy ( symlink_id in cr_symlinks.symlink_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); -
@@ -157,18 +158,18 @@
symlink_id: The id of the symlink to delete -
+
procedure delete ( symlink_id in cr_symlinks.symlink_id%TYPE ); -
-Last Modified: $Id: symlink.html,v 1.2.2.1 2016/06/09 08:21:01 +Last Modified: $Id: symlink.html,v 1.2.2.2 2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/api/template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/api/template.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/api/template.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/api/template.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -40,40 +40,41 @@
+
function 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; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
Determine if an item is a template.
Author: | Karl Goldstein | |||
---|---|---|---|---|
Returns: | 't' if the item is a template, 'f' otherwise | +Returns: | 't' if the item is a template, 'f' +otherwise | |
Parameters: | ||||
| ||||
Declaration: | ||||
+ |
function is_template ( template_id in cr_templates.template_id%TYPE ) return varchar2; -
@@ -96,16 +97,16 @@
+
function new ( name in cr_items.name%TYPE, parent_id in acs_objects.context_id%TYPE default null, @@ -117,7 +118,7 @@ creation_ip in acs_objects.creation_ip%TYPE default null ) return cr_templates.template_id%TYPE; -
template_id: The id of the template to delete -
+
procedure delete ( template_id in cr_templates.template_id%TYPE ); -
+
function create_attribute ( content_type in acs_attributes.object_type%TYPE, attribute_name in acs_attributes.attribute_name%TYPE, @@ -54,7 +54,7 @@ column_spec in varchar2 default 'varchar2(4000)' ) return acs_attributes.attribute_id%TYPE; -
@@ -73,13 +73,13 @@
+
function get_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; -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
procedure create_type ( content_type in acs_object_types.object_type%TYPE, supertype in acs_object_types.object_type%TYPE @@ -132,14 +132,14 @@ name_method in acs_object_types.name_method%TYPE default null ); -
Drop an existing attribute. If you are using CMS, make sure to -call cm_form_widget.unregister_attribute_widget before +call cm_form_widget.unregister_attribute_widget before calling this function.
Author: | Karl Goldstein | @@ -149,38 +149,39 @@||||
---|---|---|---|---|---|
attribute_name: | The name of the attribute to drop | ||||
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). | +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). |
+
procedure drop_attribute ( content_type in acs_attributes.object_type%TYPE, attribute_name in acs_attributes.attribute_name%TYPE, drop_column in varchar2 default 'f' ); -
Create a view for the type which joins all attributes of the -type, including the inherited attributes. The view is named "
+type, including the inherited attributes. The view is named +" X" Called by create_attribute and create_type.Author: | Karl Goldstein | |||
---|---|---|---|---|
Parameters: | ||||
| ||||
Declaration: | ||||
+ |
procedure refresh_view ( content_type in cr_type_template_map.content_type%TYPE ); -
@@ -208,7 +209,7 @@
+
procedure register_child_type ( parent_type in cr_type_children.parent_type%TYPE, child_type in cr_type_children.child_type%TYPE, @@ -217,7 +218,7 @@ max_n in integer default null ); -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
procedure register_relation_type ( content_type in cr_type_relations.content_type%TYPE, target_type in cr_type_relations.target_type%TYPE, @@ -268,7 +269,7 @@ max_n in integer default null ); -
@@ -288,18 +289,18 @@
+
procedure register_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 ( 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 ); -
+
procedure unregister_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 ); -
Parameters: | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Not yet documented | ||||||||||
Declaration: | ||||||||||
+ |
+
procedure 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 null ); -
@@ -422,14 +423,14 @@
+
procedure unregister_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 ); -
The content repository uses the INSO libraries included with Intermedia to support conversion of binary files such as Microsoft Word documents to HTML. This document describes how to make this conversion be part of the item creation or editing process, such that the content is always stored in the repository as HTML.
-Note: Because temporary tables and LOB storage are used -during the conversion process, the entire process described here -must be performed within the context of a single transaction.
+Note: Because temporary tables and LOB storage +are used during the conversion process, the entire process +described here must be performed within the context of a single +transaction.The first step is to create the revision that will be associated with the converted document, and obtain the corresponding ID. The -content column for the revision must be initialized with +content column for the revision must be initialized with an empty blob object:
revision_id := content_revision.new(item_id => :item_id, @@ -26,15 +30,15 @@
The next step in the process is to upload the binary file into -the temporary table cr_doc_filter. This may be done using -any standard technique for uploading a binary file, such as an -image. The temporary table has only two columns; one is a BLOB to -store the document itself, and one is the revision ID.
+the temporary table cr_doc_filter. This may be done +using any standard technique for uploading a binary file, such as +an image. The temporary table has only two columns; one is a BLOB +to store the document itself, and one is the revision ID.Once the revision has been created and the file has been uploaded, the file may be converted to HTML and written into the empty blob associated with the revision. This is done with the -to_html procedure in the content_revision +to_html procedure in the content_revision package:
begin @@ -43,10 +47,10 @@ /
Once the transaction is committed, the uploaded document is -automatically deleted from the cr_doc_filter table.
+automatically deleted from the cr_doc_filter table.The content repository organizes content items in a hierarchical structure similar to a file system. You manage content items in the repository using the same basic operations as in a file system:
The content repository adds an additional twist to a traditional filesystem: any content item, not just a folder, may serve @@ -27,12 +31,12 @@ associated with it. It also is the logical container for all its components.
It is important to note that folders are simply a special -subtype of content item. The content repository's representation of -a parent-child relationship between a folder and the items it -contains is no different from the relationship between a book and -its chapters. Folders may be thought of simply as generic -containers for grouping items that are not necessarily part of a -greater whole.
+subtype of content item. The content repository's +representation of a parent-child relationship between a folder and +the items it contains is no different from the relationship between +a book and its chapters. Folders may be thought of simply as +generic containers for grouping items that are not necessarily part +of a greater whole.Consider a simple repository structure with the following contents:
@@ -41,25 +45,29 @@Note that the same effective organization could have been -achieved by creating the "Press Index" item under the root, and -having press releases as its children. Using the folder approach -may have the following advantages:
+achieved by creating the "Press Index" item under the +root, and having press releases as its children. Using the folder +approach may have the following advantages:By default, the content repository has one root folder for @@ -68,12 +76,12 @@ times might wish to store the content for each instance in its own content root. Creating your own content (and template) root also has the advantage that you will not accidentally access another -package's content nor will another package access your content. Not -that that could do any harm, because you have secured all your +package's content nor will another package access your content. +Not that that could do any harm, because you have secured all your content through appropriate permissions.
We only talk about creating content roots from here on — creating template roots is completely analogous. You create your -own content root by calling content_folder.new in +own content root by calling content_folder.new in PL/SQL:
declare @@ -88,25 +96,26 @@ end; /-
The important point is that you have to pass in 0 for -the parent_id. This parent_id is special in that -it indicates folders with no parent.
+The important point is that you have to pass in 0 for +the parent_id. This parent_id is special in +that it indicates folders with no parent.
The content repository does not keep track of who created what root folders. You have to do that yourself. In the above example, -you need to store the value v_my_content_root somewhere, +you need to store the value v_my_content_root somewhere, for example a table that is specific for your package, otherwise -you won't have a reliable way of accessing your new content +you won't have a reliable way of accessing your new content root.
With multiple content roots, there can be many items with -item_path'/news/article' and you need to tell -the content repository which root you are talking about. For -example, to retrieve content through content_item.get_id, -you pass the id of your content root as the root_folder_id -parameter to specify the content root under which the -item_path should be resolved.
+item_path'/news/article' and you +need to tell the content repository which root you are talking +about. For example, to retrieve content through +content_item.get_id, you pass the id of your content +root as the root_folder_id parameter to specify the +content root under which the item_path should be +resolved.Content items are initialized using the -content_item.new function. A name is the only parameter +content_item.new function. A name is the only parameter required to create an item:
item_id := content_item.new( name => 'my_item' ); @@ -23,11 +26,11 @@
The parent ID must be another content item, or a subclass of content item such as a folder.
-The content_item.new function accepts a number of other -optional parameters. The standard creation_date, -creation_user and creation_ip should be specified -for auditing purposes. You can also create the initial revision and -publish text items in a single step:
+The content_item.new function accepts a number of +other optional parameters. The standard creation_date, +creation_user and creation_ip should be +specified for auditing purposes. You can also create the initial +revision and publish text items in a single step:
item_id := content_item.new( name => 'my_item', @@ -40,17 +43,17 @@
If either the title or text are not null, the function will create the first revision of the item. It will also mark the item -as live if the is_live parameter is true. The alternative -to this one step method is to create a content item and then add a -revision using the Content Revision API.
+as live if the is_live parameter is true. The +alternative to this one step method is to create a content item and +then add a revision using the Content Revision API.If a content item has at least one revision, then it can be -published by calling the content_item.set_live_revision -procedure, which takes as input a revision_id:
+published by calling the content_item.set_live_revision +procedure, which takes as input a revision_id:content_item.set_live_revision( revision_id => :revision_id );
Last Modified: $Id: items.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $
+Last Modified: $Id: items.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/guide/keywords.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/keywords.adp,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/packages/acs-content-repository/www/doc/guide/keywords.adp 25 Aug 2015 18:02:04 -0000 1.2.2.1 +++ openacs-4/packages/acs-content-repository/www/doc/guide/keywords.adp 1 Jul 2016 09:17:33 -0000 1.2.2.2 @@ -5,29 +5,33 @@ (Categories)Subject Keywords are used to implement categorization for the Content Management system. A Subject Keyword is a small -label, such as "Oracle Documentation" or "My Favorite Foods", which -can be associated with any number of content items. Thus, content -items may be grouped by arbitrary categories. For example, -assigning the Subject Keyword "My Favorite Foods" to the content -items "Potstickers", "Strawberries" and "Ice Cream" would indicate +label, such as "Oracle Documentation" or "My +Favorite Foods", which can be associated with any number of +content items. Thus, content items may be grouped by arbitrary +categories. For example, assigning the Subject Keyword "My +Favorite Foods" to the content items "Potstickers", +"Strawberries" and "Ice Cream" would indicate that all the three items belong in the same category - namely, the -category of the user's favorite foods. The actual physical location -of these items within the repository is irrelevant.
+category of the user's favorite foods. The actual physical +location of these items within the repository is irrelevant.Subject Keywords may be nested to provide more detailed control -over categorization; for example, "My Favorite Foods" may be -further subdivided into "Healthy" and "Unhealthy". Subject Keywords -which have descendants are referred to as "Subject -Categories".
+over categorization; for example, "My Favorite Foods" may +be further subdivided into "Healthy" and +"Unhealthy". Subject Keywords which have descendants are +referred to as "Subject Categories".The content_keyword object type is used to represent -Subject Keywords (see content_keyword.sql) The -content_keyword type inherits from -acs_object:
+The content_keyword object type is used to represent +Subject Keywords (see content_keyword.sql) The +content_keyword type inherits from +acs_object:
acs_object_type.create_type ( supertype => 'acs_object', object_type => 'content_keyword', pretty_name => 'Content Keyword', @@ -36,9 +40,9 @@ );-In addition, the cr_keywords +In addition, the cr_keywords table (see -content-create.sql +content-create.sql ) contains extended attributes of Subject Keywords:
@@ -53,7 +57,7 @@ );-In content-keyword.sql +In content-keyword.sql :
attr_id := acs_attribute.create_attribute ( @@ -72,11 +76,12 @@ pretty_plural => 'Descriptions' );-
Thus, each Subject Keyword has a heading, which is a -user-readable heading for the keyword, and a description, -which is a somewhat longer description of the keyword.
-The cr_item_keyword_map table (see -content-create.sql) is used to relate content items to +
Thus, each Subject Keyword has a heading, which is a +user-readable heading for the keyword, and a +description, which is a somewhat longer description of +the keyword.
+The cr_item_keyword_map table (see +content-create.sql) is used to relate content items to keywords:
create table cr_item_keyword_map ( @@ -103,12 +108,12 @@Function/Procedure Purpose Description - new Create a new Subject Keyword This is a standard new function, used to create a new -Subject Keyword. If the parent id is specified, the new keword + new Create a new Subject Keyword This is a standard new function, used to create a +new Subject Keyword. If the parent id is specified, the new keword becomes a child of the parent keyword (which may now be called a Subject Category) - delete Delete a Subject Keyword This is a standard delete function, used to delete a + delete Delete a Subject Keyword This is a standard delete function, used to delete a Subject Keyword Index: openacs-4/packages/acs-content-repository/www/doc/guide/object-relationships.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/object-relationships.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/guide/object-relationships.adp 1 Dec 2015 11:17:41 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/guide/object-relationships.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -5,6 +5,9 @@ Relationships @@ -122,23 +127,27 @@ Assign Keywords to Items These functions should be used to assign Subject Keywords to content items, to unassign keywords from items, and to determine whether a particular keyword is assigned to an item. - The is_assigned function can be used to determine if a -keyword matches a content item, based on the recurse +
The is_assigned function can be used to determine if +a keyword matches a content item, based on the recurse parameter:
-
- If recurse is set to 'none', -is_assigned will return 't' if and only if there -is an exact assignment of the keyword to the item.
- If recurse is set to 'down', -is_assigned will return 't' if there is an exact -assignment of the keyword to the item, or if a narrower keyword is -assigned to the item. For example, a query whether "Potstickers" is -assigned the category "My Favorite Foods" will return 't' -even if "Potstickers" is only assigned the category "Healthy".
- If recurse is set to 'up', -is_assigned will return 't' if there is an exact -assignment of the keyword to the item, or if a broader Subject -Category is assigned to the item. For example, a query whether -"Potstickers" is assigned the category "Healthy" will return -'t' even if "Potstickers" is assigned the broader category -"My Favorite Foods".
+- If recurse is set to 'none', +is_assigned will return 't' if and +only if there is an exact assignment of the keyword to the +item.
- If recurse is set to 'down', +is_assigned will return 't' if there +is an exact assignment of the keyword to the item, or if a narrower +keyword is assigned to the item. For example, a query whether +"Potstickers" is assigned the category "My Favorite +Foods" will return 't' even if +"Potstickers" is only assigned the category +"Healthy".
- If recurse is set to 'up', +is_assigned will return 't' if there +is an exact assignment of the keyword to the item, or if a broader +Subject Category is assigned to the item. For example, a query +whether "Potstickers" is assigned the category +"Healthy" will return 't' even if +"Potstickers" is assigned the broader category "My +Favorite Foods".
Object Relationships
+ +Content Repository : Developer +GuideMany applications of the content repository require that content items be related to each other as well as to other classes of objects. Examples include:
@@ -25,10 +28,10 @@In many cases one content item may serve as a natural container for another item. An article divided into sections, or a news story with an associated photo are one example of this. These -"parent-child" relationships are handled by the basic hierarchical -organization of the content repository. Every item has a parent -item, represented internally by the parent_id column in -the cr_items table.
+"parent-child" relationships are handled by the basic +hierarchical organization of the content repository. Every item has +a parent item, represented internally by the parent_id +column in the cr_items table.It is often desirable to constrain the number and content type of child items. For example, the specifications for a news story may only allow for a single photo. A structured report may have @@ -43,28 +46,29 @@
The content repository accomodates these situations in the following ways:
-
- An API procedure, content_type.register_child_type, +
- An API procedure, content_type.register_child_type, may be used to specify the minimum and maximum number of children of a particular content type that an item may have. You may -optionally specify a "tag" for identifying child items of the same -type. For example, you may want to allow only 1 image with the -"featured" tag, and up to 8 other images without this.
- A Boolean API function, content_item.is_valid_child, +optionally specify a "tag" for identifying child items of +the same type. For example, you may want to allow only 1 image with +the "featured" tag, and up to 8 other images without +this.
- A Boolean API function, content_item.is_valid_child, which checks all registered child constraints on the content type of an item and returns true if it is currently possible to add an child of a particular type to tan item. Note that this function does not protect against concurrent transactions; it is only -foolproof if you lock the cr_child_rels table -beforehand.
- A mapping table, cr_child_rels, which contains two -attributes, order_n and relation_tag, that may be -used to characterize the parent-child relationship. Parent-child -relationships are themselves treated as ACS Objects, so this table -may be extended with additional attributes as required by the -developer.
+foolproof if you lock the cr_child_rels table +beforehand.- A mapping table, cr_child_rels, which contains two +attributes, order_n and relation_tag, that +may be used to characterize the parent-child relationship. +Parent-child relationships are themselves treated as ACS Objects, +so this table may be extended with additional attributes as +required by the developer.
Note that there is no currently no explicit API to "add a -child." You specify the parent of an item upon creating it. You can -use the API procedure content_item.move to change the -parent of an item.
+child." You specify the parent of an item upon creating it. +You can use the API procedure content_item.move to +change the parent of an item.Item-Object Relationships
In addition to the relationships to their parents and children in the content repository hierarchy, content items may be linked to @@ -76,25 +80,26 @@ provides a data model and API for managing these constraints that parallels what is provided for parent-child relationships:
-
- An API procedure, content_type.register_relation_type, -may be used to specify the minimum and maximum number of relations -with a particular object type that an item may have. There is no +
- An API procedure, +content_type.register_relation_type, may be used to +specify the minimum and maximum number of relations with a +particular object type that an item may have. There is no limitation on the type of objects that may be related to content items. If you wish to relate content items to other content items, however, the object type should specify a content type (a subtype -of content_revision) rather than simply -content_item. As for parent-child relationship -constraints, ou may optionally specify a "tag" for identifying -related objects of the same type.
- A Boolean API function, +of content_revision) rather than simply +content_item. As for parent-child relationship +constraints, ou may optionally specify a "tag" for +identifying related objects of the same type.
- A Boolean API function, content_item.is_valid_relation, which checks all registered constraints on the content type of an item and returns true if it is currently possible to relate an object of a -particular type to an item.
- A mapping table, cr_item_rels, which contains two -attributes, order_n and relation_tag, that may be -used to characterize the item-object relationship. Item-object -relationships are themselves treated as ACS Objects, so this table -may be extended with additional attributes as required by the -developer.
+particular type to an item.- A mapping table, cr_item_rels, which contains two +attributes, order_n and relation_tag, that +may be used to characterize the item-object relationship. +Item-object relationships are themselves treated as ACS Objects, so +this table may be extended with additional attributes as required +by the developer.
Extending Parent-Child and Item-Object Relationships
The simple relation mechanisms described above may not be @@ -106,5 +111,5 @@ karlg\@arsdigita.com
+
-Last modified: $Id: object-relationships.html,v 1.1.1.1 -2001/03/13 22:59:26 ben Exp $ +Last modified: $Id: object-relationships.html,v 1.1.1.1.30.1 +2016/06/22 07:40:41 gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/guide/publish.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/publish.adp,v diff -u -r1.2.2.6 -r1.2.2.7 --- openacs-4/packages/acs-content-repository/www/doc/guide/publish.adp 9 Jun 2016 13:03:11 -0000 1.2.2.6 +++ openacs-4/packages/acs-content-repository/www/doc/guide/publish.adp 1 Jul 2016 09:17:33 -0000 1.2.2.7 @@ -5,6 +5,9 @@ ContentPublishing Content
+ +Content Repository : Developer +GuideThe content repository does not place any restrictions on the methods employed for delivering content via a public server infrastructure. Applications are free to query the repository and @@ -23,11 +26,12 @@ combines the data and layout into a rendered page.
Matching URLs to Content Items
The primary mechanism for matching URLs to Content Items are -virtual URL handlers, .vuh files. An explanation -of virtual URL handlers can be found in the tutorial on the -Request Processor.
-Here is an example index.vuh file that you can adapt to -your own purposes:
+virtual URL handlers, .vuh files. An +explanation of virtual URL handlers can be found in the tutorial on +the Request +Processor.Here is an example index.vuh file that you can adapt +to your own purposes:
# Get the paths @@ -42,7 +46,7 @@ # Serve the page # DRB: Note that content::init modifies the local variable the_root, which is treated -# as though it's been passed by reference. This requires that the redirect treat the +# as though it's been passed by reference. This requires that the redirect treat the # path as an absolute path within the filesystem. if { [content::init the_url the_root $content_root $template_root] } { set file "$the_root/$the_url" @@ -51,56 +55,58 @@ ns_returnnotfound }-The content_root and template_root parameters -select the content and template root folders. In the example, they -are just the default roots that the content repository initializes -on installation. If you want to store your content completely -independent from that of other packages, you can initialize your -own content root and pass that folder's ID on to -content::init.
+The content_root and template_root +parameters select the content and template root folders. In the +example, they are just the default roots that the content +repository initializes on installation. If you want to store your +content completely independent from that of other packages, you can +initialize your own content root and pass that folder's ID on +to content::init.
To publish content through URLs that are underneath -/mycontent you need to do the following:
+/mycontent you need to do the following:-
-- Create a directory mycontent in your server's page -root and an index.vuh file in that directory.
- Adapt the set content_root ... and set -template_root .. statements in the example above so that they +
- Create a directory mycontent in your server's +page root and an index.vuh file in that directory.
- Adapt the set content_root ... and set +template_root .. statements in the example above so that they are being set to the content and template root folders that you -want to publish content from.
- Change the set the_url ... statement so that the -variable the_url contains the absolute path to the content -item you wish to serve from your (or the default) content +want to publish content from.
- Change the set the_url ... statement so that the +variable the_url contains the absolute path to the +content item you wish to serve from your (or the default) content root.
If you use the example index.vuh file above unaltered -for requests to my_content, a request for -http://yourserver/mycontent/news/articles/42 would request -the content item /news/articles/42 from the content -repository on the default content root folder.
+If you use the example index.vuh file above unaltered +for requests to my_content, a request for +http://yourserver/mycontent/news/articles/42 would +request the content item /news/articles/42 from the +content repository on the default content root folder.
Matching Content Items to Templates
Querying Content
Querying Attributes
When you create a new content type or add an attribute to an existing content type, a view is created (or recreated) that joins the attribute tables for the entire chain of inheritance for that content type. The view always has the same name as the attribute -table for the content table, with an "x" appended to distinguish it -from the table itself (for example, if the attribute table for -Press Releases is press_releases, then the view -will be named press_releasesx. Querying this view is a -convenient means of accessing any attribute associated with a -content item.
-As a shortcut, the item's template may call -content::get_content in its Tcl file in order to -automatically retrieve the current item's attributes. The +table for the content table, with an "x" appended to +distinguish it from the table itself (for example, if the attribute +table for Press Releases is +press_releases, then the view will be named +press_releasesx. Querying this view is a convenient +means of accessing any attribute associated with a content +item.
+As a shortcut, the item's template may call +content::get_content in its Tcl file in order to +automatically retrieve the current item's attributes. The attributes will be placed in a onerow datasource called -content . The template may then call -template::util::array_to_vars content in order to convert -the onerow datasource to local variables.
-In addition to the "x" view, the Content Repository creates an -"i" view, which simplifies the creation of new revisions. The "i" -view has the same name as the content table, with "i" appended at -the end. You may insert into the view as if it was a normal table; -the insert trigger on the view takes care of inserting the actual -values into the content tables.
+content . The template may then call +template::util::array_to_vars content in order to +convert the onerow datasource to local variables. +In addition to the "x" view, the Content Repository +creates an "i" view, which simplifies the creation of new +revisions. The "i" view has the same name as the content +table, with "i" appended at the end. You may insert into +the view as if it was a normal table; the insert trigger on the +view takes care of inserting the actual values into the content +tables.
Querying Additional Data
Templates often display more than simple content attributes. Additional queries may be necessary to obtain data about related @@ -116,5 +122,5 @@ karlg\@arsdigita.com
-Last Modified: $Id: publish.html,v 1.4.4.1 2016/01/02 21:24:47 +Last Modified: $Id: publish.html,v 1.4.4.2 2016/06/22 07:40:41 gustafn Exp $ 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 @@ RevisionsCreating Content Revisions
+ +ACS Documentation : Content Repository : Developer GuideAt a basic level, creating a new revision of a content item involves the following steps:
-
- Insert a row in the acs_objects table to create the -object.
- Insert a corresponding row in the cr_revisions table -with the basic attributes for the revision.
- Write the content data into the content BLOB column of -the cr_revisions table.
- Insert a corresponding row into the attribute table of each +
- Insert a row in the acs_objects table to create the +object.
- Insert a corresponding row in the cr_revisions table +with the basic attributes for the revision.
- Write the content data into the content BLOB column +of the cr_revisions table.
- Insert a corresponding row into the attribute table of each ancestor of the content type of the item. This is not applicable if -the content type is Basic Item or an immediate subtype -thereof.
- Insert a corresponding row into the attribute table of the +the content type is Basic Item or an immediate +subtype thereof.
- Insert a corresponding row into the attribute table of the content type of the item. This is not applicable if the content type is Basic Item.
Use the Content Revision API to create a revision
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:
@@ -31,15 +33,16 @@ Here comes a car...uh oh! The End' );-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:
revision_id := content_revision.new( title => 'A Revision', @@ -56,27 +59,27 @@Insert additional attributes
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:
+content_revision.new generic enough to support +submission of the attributes for all different content types. This +leaves you with three alternatives:-
-- Call content_revision.new followed by manual DML +
- Call content_revision.new followed by manual DML statements to write data into the content BLOB and insert attributes.
- Write a PL/SQL package for each of your content types, which encapsulates the above code.
- Create revisions by inserting into 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. +
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 $
Index: openacs-4/packages/acs-content-repository/www/doc/guide/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/search.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/guide/search.adp 1 Dec 2015 11:17:42 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/guide/search.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -3,18 +3,22 @@Content Repository Developer Guide: Search Search
+ +Content Repository : Developer +GuideThe content repository provides a consistent sitewide interface for searching content. It uses Intermedia to index the -content column of cr_revisions) as well as all -the attribute columns for each content type.
+content column of cr_revisions) as well as +all the attribute columns for each content type.Searching Content
-The content column in cr_revisions may contain -data in any text or binary format. To accomodate searches across -multiple file types, the content repository uses an Intermedia -index with the INSO filtering option. The INSO filter automatically -detects the the file type of a binary object, and extracts text -from it for indexing. Most common file types are supported, -including PDF and Microsoft Word, and Excel and PowerPoint.
+The content column in cr_revisions may +contain data in any text or binary format. To accomodate searches +across multiple file types, the content repository uses an +Intermedia index with the INSO filtering option. The INSO filter +automatically detects the the file type of a binary object, and +extracts text from it for indexing. Most common file types are +supported, including PDF and Microsoft Word, and Excel and +PowerPoint.
Searching for content requires the same syntax as any text index:
@@ -49,13 +53,14 @@Multilingual searches are not enabled by default. You may enable them for one more languages by setting the appropriate Intermedia preferences when creating -cr_rev_content_index. Some items are not appropriate to display "stand-alone", but -rather need to appear only in the context of a container document -(typically their parent in the content repository). This is -probably a limitation of content_item.get_path: it should -be possible to specify an arbitrary function to return the path for -items of a particular content type, with -content_item.get_path as the default. +cr_rev_content_index.Some items are not appropriate to display +"stand-alone", but rather need to appear only in the +context of a container document (typically their parent in the +content repository). This is probably a limitation of +content_item.get_path: it should be possible to specify +an arbitrary function to return the path for items of a particular +content type, with content_item.get_path as the +default. Searching Attributes
This task is primarily handled to two Intermedia indices:
@@ -66,11 +71,11 @@
After creating a new revision and inserting attributes into the storage table for the content type and all its ancestors, you must -execute the content_revision.index_attributes procedure. +execute the content_revision.index_attributes procedure. (Note that this cannot be called automatically by -content_revision.new, since the attributes in all extended -storage tables must be inserted first).
This procedure creates a row in the -cr_revision_attributes table, and writes an XML document +content_revision.new, since the attributes in all +extended storage tables must be inserted first).
This procedure creates a row in the +cr_revision_attributes table, and writes an XML document including all attributes into this row. A Java stored procedure using the Oracle XML Parser for Java v2 is used to actually generate the XML document.
A special Intermedia index configured to parse XML documents is @@ -89,15 +94,15 @@
Some limitations of the current implementation include:
-
- A USER_DATASTORE associated with each row of the -cr_items table, which feeds Intermedia the contents of the -content column (a BLOB) for the live revision of -an item. This should theoretically be more efficient for searching -live content, especially in production environments where content -is revised often.
- A second USER_DATASTORE associated with each row of -the cr_items table, which feeds Intermedia the XML +
- A USER_DATASTORE associated with each row of the +cr_items table, which feeds Intermedia the contents of +the content column (a BLOB) for the live +revision of an item. This should theoretically be more efficient +for searching live content, especially in production environments +where content is revised often.
- A second USER_DATASTORE associated with each row of +the cr_items table, which feeds Intermedia the XML document representing all attributes for the live revision -of an item (from cr_revision_attributes).
- The default XML document handler for the content repository +of an item (from cr_revision_attributes).
- The default XML document handler for the content repository simply provides a flat file of all attributes. Content types should also be able implement custom handlers, to allow the XML document to reflect one-to-many relationships or special formatting of @@ -108,5 +113,5 @@ karlg\@arsdigita.com
-Last Modified: $Id: search.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $ +Last Modified: $Id: search.html,v 1.1.1.1.30.1 2016/06/22 07:40:41 +gustafn Exp $ Index: openacs-4/packages/acs-content-repository/www/doc/guide/storage.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/storage.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/guide/storage.adp 1 Dec 2015 11:17:42 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/guide/storage.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -30,7 +30,7 @@ );
Content types are nothing more than standard ACS Objects that -inherit from content_revision:
+inherit from content_revision:begin @@ -64,11 +64,12 @@ / show errors-
Note that content types always extend content_revision, -rather than content_item. This is because we want to store -multiple revisions of both the actual data (in this case the image) -as well as associated attributes (the width and height of the image -may vary among revisions).
+Note that content types always extend +content_revision, rather than content_item. +This is because we want to store multiple revisions of both the +actual data (in this case the image) as well as associated +attributes (the width and height of the image may vary among +revisions).
The content repository implements a flexible mechanism for organizing data in a hierarchical fashion in a manner similar to a @@ -94,11 +95,11 @@ max_n_rels_two => 1 ); -
Note that the user object is related to a -content_item object rather than an image object -directly. Each image object represents only a single -revision of a portrait. Revisions always exist in the context of an -item.
+Note that the user object is related to a +content_item object rather than an image +object directly. Each image object represents only a +single revision of a portrait. Revisions always exist in the +context of an item.
Now we have defined both a content type and relationship type, we can start storing portraits. The DML for processing a new @@ -119,5 +120,5 @@
Last Modified: $Id: storage.html,v 1.1.1.1 2001/03/13 22:59:26 -ben Exp $
+Last Modified: $Id: storage.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/guide/template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/template.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/guide/template.adp 1 Dec 2015 11:17:42 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/guide/template.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -5,6 +5,9 @@ TemplatesThe content repository allows you to associate templates with both content types and individual content items. A template determines how a content item is rendered when exported to the file @@ -28,26 +31,27 @@ template. The parent ID must be another content item, or a subclass of content item such as a folder.
-The content_template.new function accepts the standard -creation_date, creation_user, and -creation_ip auditing parameters.
+The content_template.new function accepts the +standard creation_date, creation_user, and +creation_ip auditing parameters.Content items and templates are organized in two separate hierarchies within the content repository. For example, you may -place all your press releases in the press folder under +place all your press releases in the press folder under the item root (having the ID returned by -content_item.get_root_folder). You may have 5 different +content_item.get_root_folder). You may have 5 different templates used to render press releases. These my be stored in the -press folder under the template root (having the -ID returned by content_template.get_root_folder).
+press folder under the template root (having +the ID returned by +content_template.get_root_folder).Templates are placed under their own root to ensures that bare templates are never accessible via a public URL. This is also done because the relationship with the file system may be different for templates than for content items. For example, templates may be associated with additional code or resource files that developers maintain under separate source control.
You use the content_type.register_template procedure to -associate a template with a particular content type:
+You use the content_type.register_template procedure +to associate a template with a particular content type:
content_type.register_template( content_type => 'content_revision', @@ -56,14 +60,14 @@ is_default => 't' );-
The use_context is a simple keyword that specifies the -situation in which the template is appropriate. One general -context, public, is loaded when the content repository is -installed. Templates in this context are for presenting content to -users of the site. Some sites may wish to distinguish this further, -for example using intranet, extranet and -public contexts.
-The is_default flag specifies that this template will +
The use_context is a simple keyword that specifies +the situation in which the template is appropriate. One general +context, public, is loaded when the content repository +is installed. Templates in this context are for presenting content +to users of the site. Some sites may wish to distinguish this +further, for example using intranet, extranet +and public contexts.
+The is_default flag specifies that this template will serve as the default template in the case that no template is registered to a content item of this content type and this use context. Any content type/context pair may have any number of @@ -80,7 +84,7 @@
Individual items may also be associated with templates using the -content_item.register_template procedure:
+content_item.register_template procedure:content_item.register_template( item_id => :item_id, @@ -98,7 +102,7 @@ each press release.Retrieving the template for a content item
The application server (AOLserver or servlet container) may use -the content_item.get_template function to determine the +the content_item.get_template function to determine the proper template to use for rendering a page in any particular context:
@@ -112,7 +116,7 @@ );In the case that no template is registered to given item/context -pair, content_item.get_template will return the default +pair, content_item.get_template will return the default template (if it exists) for the related content type/context pair.
Unregistering templates
@@ -136,5 +140,5 @@
Last Modified: $Id: template.html,v 1.1.1.1 2001/03/13 22:59:26 -ben Exp $
+Last Modified: $Id: template.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/guide/types.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/types.adp,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-content-repository/www/doc/guide/types.adp 1 Dec 2015 11:17:42 -0000 1.2.2.3 +++ openacs-4/packages/acs-content-repository/www/doc/guide/types.adp 1 Jul 2016 09:17:33 -0000 1.2.2.4 @@ -5,6 +5,9 @@ TypesThe content repository requires you to define each type of content supported by your supplication. Content types are defined as ACS Object Types, and may be created in the same @@ -17,8 +20,8 @@
Note that a content type does not have to store its -primary content in the BLOB column of the -cr_revisions table. There is some additional overhead +primary content in the BLOB column of the +cr_revisions table. There is some additional overhead associated with retrieving small passages of text from the BLOB column compared to an attribute column. In most cases the difference is trivial (fewer than about 10 microseconds), but if @@ -27,7 +30,7 @@ is perfectly acceptable to store the content in an attribute column instead.
Basic attributes for all content types are stored in the -cr_revisions (note that they are stored in the revisions +cr_revisions (note that they are stored in the revisions table so that attributes may be updated for each new revision of the actual data). Most types of content require more than the basic attributes. For example, when storing images you will usually want @@ -51,7 +54,7 @@ );
Note that your extended attribute table must reference the -cr_revisions table, notcr_items. As +cr_revisions table, notcr_items. As mentioned above, this allows you to maintain multiple revisions of the attribute data in tandem with revisions of the content object itself.
@@ -84,22 +87,22 @@ ... -The content_type methods use the core ACS Object Type +
The content_type methods use the core ACS Object Type API to create an object type for each content type, and to add attributes to the object type. In addition, -content_type.create_type will create the extended +content_type.create_type will create the extended attribute table with an appropriately defined primary key column (referencing its supertype) if the table does not already exist. -Likewise, content_type.create_attribute will add a column -to the table if the column does not already exist.
-Most importantly, the content_type methods call -content_type.refresh_view after each change to the content -type definition. Each content type must have an associated -attribute view named -table_namex, where -table_name is the name of the extended attribute -table for a particular content type. The view joins the -acs_objects, cr_revisions, and all extended +Likewise, content_type.create_attribute will add a +column to the table if the column does not already exist.
+Most importantly, the content_type methods call +content_type.refresh_view after each change to the +content type definition. Each content type must have an associated +attribute view named +table_namex, where +table_name is the name of the extended +attribute table for a particular content type. The view joins the +acs_objects, cr_revisions, and all extended attribute tables in the class hierarchy of a particular content type. This view may be used to query attributes when serving content.
@@ -110,5 +113,5 @@ details.Last Modified: $Id: types.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $
+Last Modified: $Id: types.html,v 1.1.1.1.30.1 2016/06/22 +07:40:41 gustafn Exp $
Index: openacs-4/packages/acs-content-repository/www/doc/guide/workflow.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/workflow.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/guide/workflow.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/guide/workflow.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -3,6 +3,9 @@This document describes the workflow API calls necessary to apply a simple workflow to a content item.
This simple workflow is defined in -sql/workflows/author-edit-publish.sql.
+sql/workflows/author-edit-publish.sql.Production of a content item frequently begins with a concept which is initiated by the publisher and then executed by the staff. @@ -65,18 +68,19 @@
In this case, only one assignment is made per task. You can make as many assignments per task as desired. There is currently no workflow API to set deadlines, so you must write your own DML to -insert a row into wf_case_deadlines if you wish to allow +insert a row into wf_case_deadlines if you wish to allow the publisher to set deadlines ahead of time.
-The above workflow is created in the Default context. In -practice, you may wish to create one or more contexts in which to -create your workflows. Contexts may be used to represent different -departments within an organization.
-The start_case enables the first task in the workflow, -in this case Authoring.
+The above workflow is created in the Default +context. In practice, you may wish to create one or more contexts +in which to create your workflows. Contexts may be used to +represent different departments within an organization.
+The start_case enables the first task in the +workflow, in this case Authoring.
If multiple persons are assigned to the same task, it is useful -to allow a single person to "check out" or lock an item while they -are working. This is accomplished with the following API calls:
+to allow a single person to "check out" or lock an item +while they are working. This is accomplished with the following API +calls:declare v_journal_id integer; @@ -121,8 +125,8 @@-Upon finishing a task, you must notify the workflow engine where to go next. In this case, an author wishes to simply check an item back in without actually completing the authoring task. The -set_attribute_value procedure must thus be used to set -next_place to the starting place of the workflow.
+set_attribute_value procedure must thus be used to set +next_place to the starting place of the workflow.Finish Task
The process to finish a task varies slightly depending on whether the user has previously checked out the item out or not. If @@ -150,11 +154,12 @@ end; /
In this case an author is finishing the Authoring task, -upon which the workflow engine will move the workflow to the -Authored state (as indicated by the next_place -attribute). If the author had previously checked out the item, then -only the second step is required.
+In this case an author is finishing the +Authoring task, upon which the workflow engine +will move the workflow to the Authored state (as +indicated by the next_place attribute). If the author +had previously checked out the item, then only the second step is +required.
Approval steps more commonly do not involve an explicit check-out process. The code is thus virtually identical to that @@ -180,10 +185,10 @@ /
Note the distinction between approval or rejection is determined -solely by the value of the next_place attribute.
+solely by the value of the next_place attribute.