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.1 -r1.2.2.2 --- openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp 20 Aug 2015 17:19:49 -0000 1.2.2.1 +++ openacs-4/packages/acs-content-repository/www/doc/guide/convert.adp 25 Aug 2015 18:02:04 -0000 1.2.2.2 @@ -2,39 +2,51 @@ {/doc/acs-content-repository {Content Repository}} {Content Repository Developer Guide: HTML Conversion} Content Repository Developer Guide: HTML Conversion - - -

Converting Binary Documents to HTML

The content repository uses the INSO libraries included with +

Converting Binary Documents to HTML

+

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.

+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.

Create the Revision

The first step is to create the revision that will be associated +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 -an empty blob object:

+an empty blob object:

+
 revision_id := content_revision.new(item_id => :item_id,
                                     revision_id => :revision_id,
                                     data => empty_blob(),
                                     title => 'My Word Document',
                                     ...);
-

Uploading Binary Files

The next step in the process is to upload the binary file into +

+

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.

Converting the Document

Once the revision has been created and the file has been +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 -package:

+package:

+
 begin
   content_revision.to_html(:revision_id);
 end;
 /
-

Once the transaction is committed, the uploaded document is -automatically deleted from the cr_doc_filter table.


karlg\@arsdigita.com
+
+

Once the transaction is committed, the uploaded document is +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 $ -