Index: openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp,v diff -u -r1.2.2.4 -r1.2.2.5 --- openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp 9 Jun 2016 13:03:11 -0000 1.2.2.4 +++ openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp 1 Jul 2016 09:17:33 -0000 1.2.2.5 @@ -3,19 +3,23 @@ Content Repository Developer Guide: HTML Conversion

Converting Binary Documents to HTML

+ +Content Repository : Developer +Guide

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.

Create the Revision

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 @@
 

Uploading Binary Files

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.

Converting the Document

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.


karlg\@arsdigita.com
-Last Modified: $‌Id: convert.html,v 1.1.1.1 2001/03/13 22:59:26 ben -Exp $ +Last Modified: $‌Id: convert.html,v 1.1.1.1.30.1 2016/06/22 07:40:41 +gustafn Exp $