Forum OpenACS CMS: edit-this-page now working with Oracle

A client of mine choose Oracle 9.2 as the DBMS for its OpenACS 5.1.4 site, but soon encountered serious problems with edit-this-page.
Making it working required only a small amount of code, but a quite painful debugging session to find, understand and fix it.

I'm posting here the steps I did, because I've not commit rights and it is not easy for me to match the existing open bugs.

  • sql/oracle/edit-this-page-create.sql
    In the last fiew rows of the file the etp_page_revision content type was created with the PostgreSQL syntax content_type__create_type instead of content_type.create_type, thus preventing the correct installation of the data model.
  • sql/oracle/edit-this-page-create.sql
    This fragment of the 'get_relative_url' function:
          if v_object_type = 'content_item' then
            return name;
          end if;
    
    should read instead:
          if v_object_type = 'etp_page_revision' then
            return name;
          end if;
    
  • www/etp-setup-2-oracle.xql
    The two queries 'register_types' and 'register_folders':
    <fullquery name="register_types">
        <querytext>
          select
          content_folder.register_content_type(:folder_id,'content_revision','t')
        </querytext>
    </fullquery>
    
    <fullquery name="register_folders">
        <querytext>
          select
          content_folder.register_content_type(:folder_id,'content_folder','f')
        </querytext>
    </fullquery>
    
    should read instead:
    <fullquery name="register_types">
        <querytext>
          begin
          content_folder.register_content_type(:folder_id,'content_revision','t');
          end;
        </querytext>
    </fullquery>
    
    <fullquery name="register_folders">
        <querytext>
          begin
          content_folder.register_content_type(:folder_id,'content_folder','f');
          end;
        </querytext>
    </fullquery>
    
  • www/etp-edit.tcl Added a row to set latest_revision_id in the following fragment:
    	if { ![empty_string_p [db_map update_${attribute}_attribute_clob]] } {
    	    db_dml update_${attribute}_attribute_clob "" -blobs  [list $value]
    	} else {
    	    db_dml update_attribute ""
    	}
    
    wich should read instead:
    	if { ![empty_string_p [db_map update_${attribute}_attribute_clob]] } {
                set latest_revision_id [etp::get_latest_revision_id $package_id $name]
    	    db_dml update_${attribute}_attribute_clob "" -blobs  [list $value]
    	} else {
    	    db_dml update_attribute ""
    	}
    
  • www/etp-edit-oracle.xql
    Added the column 'mime_type' to the 'get_standard_attribute' query.
    Copied the query 'update_content_attribute_clob' here from www/etp-edit-2-oracle.xql
  • www/etp.adp Changed the line:
    <if @content_items.object_type@ eq "content_item">
    
    into:
    <if @content_items.object_type@ eq "etp_page_revision">
    
    Removed the lines:
    <if @content_items.rownum@ ne 1>
    | <a href="etp-swap?sort_order=@content_items.sort_order@">move up</a>
    </if>
    
    This is necessary because the Oracle cr_items table lacks the tree_sortkey attribute and, without changing the actual logic, it is not possible the reordering of the dependent items with the 'move up' link.
  • tcl/etp-procs-oracle.xql
    Added the column 'mime_type' to the queries 'get_page_attributes' and 'get_page_attribute_other_revisions'
Hope this helps.
Collapse
Posted by Richard Hamilton on
Given the extent of the work that you are doing I would suggest you contact Dave Bauer and ask him for commit rights on cvs. It will make your life much easier!

Regards
Richard