Index: openacs-4/packages/acs-templating/www/doc/TclDocs/content.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/TclDocs/content.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/www/doc/TclDocs/content.adp 27 Oct 2014 16:40:15 -0000 1.2 +++ openacs-4/packages/acs-templating/www/doc/TclDocs/content.adp 7 Aug 2017 23:48:02 -0000 1.3 @@ -2,19 +2,26 @@ {/doc/acs-templating {Templating}} {} +

Namespace content

+
Procedures for generating and processing content +content creation and editing forms..
+

Method Summary

- -

Namespace content

Procedures for generating and processing content -content creation and editing forms..

Method Summary

-Listing of public methods:
+Listing of public methods:
+
content::add_attribute_element
content::add_attribute_elements
content::add_basic_revision
content::add_child_relation_element
content::add_content
content::add_content_element
content::add_revision
content::add_revision_form
content::copy_content
content::get_attribute_enum_values
content::get_latest_revision
content::get_object_id
content::new_item
content::new_item_form
content::validate_name
-

Method Detail

-* indicates required

Public Methods:
+ +

Method Detail

+

+* indicates required

+Public Methods: +
+
-
content::add_attribute_element
Add a form element (possibly a compound widget) to an ATS form object. for entering or editing an attribute value.
-Parameters: +Parameters:
form_name* @@ -39,12 +46,13 @@
+
+ -
content::add_attribute_elements
Add form elements to an ATS form object for all attributes of a content type.
-Parameters: +Parameters:
form_name* @@ -62,15 +70,16 @@ queried
-
Returns:
The list of attributes that were added.
+
Returns:
The list of attributes that were added.
+
+ -
content::add_basic_revision
Create a basic new revision using the content_revision PL/SQL API.
-Parameters: +Parameters:
item_id* @@ -85,7 +94,7 @@
-
Options:
+
Options:
@@ -98,46 +107,49 @@
description
+
+ -
content::add_child_relation_element
Add a select box listing all valid child relation tags. The form must contain a parent_id element and a content_type element. If the elements do not exist, or if there are no valid relation tags, this proc does nothing.
-Parameters: +Parameters:
form_name* The name of the form
-
Options:
+
Options:
+none If present, creates a new form +section for the element.
section -none If present, creates a new form section -for the element.
label{Child relation tag} The label for the element
+
+ -
content::add_content
Update the BLOB column of a revision with content submitted in a form
-Parameters: +Parameters:
revision_id* The object ID of the revision to be updated.
+
+ -
content::add_content_element
Adds a content input element to an ATS form object.
-Parameters: +Parameters:
form_name* @@ -151,14 +163,15 @@
+
+ -
content::add_revision
Create a new revision for an existing item based on a valid form submission. Queries for attribute names and inserts a row into the attribute input view for the appropriate content type. Inserts the contents of a file into the content column of the cr_revisions table for the revision as well.
-Parameters: +Parameters:
form_name* @@ -173,15 +186,16 @@
+
+ -
content::add_revision_form
Adds elements to an ATS form object for adding a revision to an existing item. If the item already exists, element values default a previous revision (the latest one by default). If the form does not already exist, creates the form object and sets its enctype to multipart/form-data to allow for text entries greater than 4000 characters.
-
Options:
+
Options:
@@ -208,11 +222,12 @@
form_nameThe name of the ATS form object. Defaults to { new_item} .
+
+ -
content::copy_content
Update the BLOB column of one revision with the content of another revision
-Parameters: +Parameters:
revision_id_src* @@ -227,38 +242,42 @@
+
+ -
content::get_attribute_enum_values
Returns a list of { pretty_name enum_value } for an attribute of datatype enumeration.
-Parameters: +Parameters:
attribute_id* The primary key of the attribute as in the attribute_id column of the acs_attributes table.
+
+ -
content::get_latest_revision
Get the ID of the latest revision for the specified content item.
-Parameters: +Parameters:
item_id* The ID of the content item.
+
+ -
content::get_object_id
Grab an object ID for creating a new ACS object.
+
+ -
content::new_item
Create a new item, including the initial revision, based on a valid form submission.
-Parameters: +Parameters:
form_name* @@ -272,18 +291,19 @@ to upload for the initial revision.
-
See Also:
add_revision -
+
See Also:
add_revision -
+
+ -
content::new_item_form
Adds elements to an ATS form object for creating an item and its initial revision. If the form does not already exist, creates the form object and sets its enctype to multipart/form-data to allow for text entries greater than 4000 characters.
-
Options:
+
Options:
@@ -311,28 +331,31 @@
form_nameThe name of the ATS form object. Defaults to { new_item} .
+
+ -
content::validate_name
Make sure that name is unique for the folder
-Parameters: +Parameters:
form_name* The name of the form (containing name and parent_id)
-
Returns:
0 if there are items with the same name, 1 otherwise
+
Returns:
0 if there are items with the same name, 1 otherwise

-Private Methods:
-

+
+

+Private Methods:
+

+ -
content::add_revision_dml
Perform the DML to insert a revision into the appropriate input view.
-Parameters: +Parameters:
statement* @@ -357,16 +380,17 @@ cr_revisions
-
See Also:
add_revision -
+
See Also:
add_revision -
+
+ -
content::attribute_insert_statement
Prepare the insert statement into the attribute input view for a new revision (see the content repository documentation for details about the view).
-Parameters: +Parameters:
content_type* @@ -391,11 +415,12 @@
+
+ -
content::get_attribute_params
Query for parameters associated with a particular attribute
-Parameters: +Parameters:
content_type* @@ -410,11 +435,12 @@
+
+ -
content::get_attributes
Returns columns from the acs_attributes table for all attributes associated with a content type.
-Parameters: +Parameters:
content_type* @@ -429,26 +455,28 @@
+
+ -
content::get_default_content_method
Gets the content input method most appropriate for an content type, based on the MIME types that are registered for that content type.
-Parameters: +Parameters:
content_type* The content type for which an input method is needed.
+
+ -
content::get_sql_value
Return the sql statement for a column value in an insert or update statement, using a bind variable for the actual value and wrapping it in a conversion function where appropriate.
-Parameters: +Parameters:
name* @@ -462,25 +490,27 @@
+
+ -
content::get_type_attribute_params
Query for attribute form metadata
-Parameters: +Parameters:
args* Any number of object types
-
Returns:
A list of attribute parameters nested by object_type, +
Returns:
A list of attribute parameters nested by object_type, attribute_name and the is_html flag. For attributes with no parameters, there is a single entry with is_html as null.
+
+ -
content::get_type_info
Return specified columns from the acs_object_types table.
-Parameters: +Parameters:
object_type* @@ -499,11 +529,12 @@
+
+ -
content::get_widget_param_value
Utility procedure to return the value of a widget parameter
-Parameters: +Parameters:
array_ref* @@ -518,7 +549,8 @@
+
+ -
content::prepare_content_file
Looks for an element named { content} in a form and prepares a temporarily file in UTF-8 for uploading to the content @@ -527,22 +559,23 @@ file is text, then ensures that is in UTF-8. Does nothing if the uploaded file is in binary format.
-Parameters: +Parameters:
form_name* The name of the form object in which content was submitted.
-
Returns:
The path of the temporary file containing the content, or an +
Returns:
The path of the temporary file containing the content, or an empty string if the form does not include a content element or the value of the element is null.
+
+ -
content::set_attribute_values
Set the default values for attribute elements in ATS form object based on a previous revision
-Parameters: +Parameters:
form_name* @@ -566,11 +599,12 @@
+
+ -
content::set_content_value
Set the default value for the content text area in an ATS form object based on a previous revision
-Parameters: +Parameters:
form_name* @@ -584,23 +618,25 @@
+
+ -
content::string_to_file
Write a string in UTF-8 encoding to of temp file so it can be uploaded into a BLOB (which is blind to character encodings). Returns the name of the temp file.
-Parameters: +Parameters:
s* The string to write to the file.
+
+ -
content::update_content_from_file
Update the BLOB column of a revision with the contents of a file
-Parameters: +Parameters:
revision_id* @@ -614,12 +650,13 @@
+
+ -
content::upload_content
Inserts content into the database from an uploaded file. Does automatic mime_type updating Parses text/html content and removes tags
-Parameters: +Parameters:
db* @@ -644,6 +681,6 @@

+ +

* indicates required

-