cr_write_content-lob (private)

 cr_write_content-lob [ -string ] [ -item_id item_id ] \
    [ -revision_id revision_id ] [ -mime_type mime_type ] \
    [ -content content ] [ -content_length content_length ] \
    [ -storage_area_key storage_area_key ]

Defined in packages/acs-content-repository/tcl/revision-procs.tcl

Switches:
-string (optional, boolean)
-item_id (optional)
-revision_id (optional)
-mime_type (optional)
-content (optional)
-content_length (optional)
-storage_area_key (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 db_blob_get db_blob_get (public) db_driverkey db_driverkey (public) db_string db_string (public) db_write_blob db_write_blob (public) util_return_headers util_return_headers (public) cr_write_content-lob cr_write_content-lob cr_write_content-lob->db_blob_get cr_write_content-lob->db_driverkey cr_write_content-lob->db_string cr_write_content-lob->db_write_blob cr_write_content-lob->util_return_headers

Testcases:
No testcase defined.
Source code:

    if { $string_p } {
        return [db_blob_get write_lob_content ""]
    }

    #
    # Unfortunately, old versions of OpenACS did not set the
    # content_length correctly, so we fix this here locally.
    #
    if {$content_length eq "" && [db_driverkey ""] eq "postgresql"} {
        set content_length [db_string get_lob_length {
            select sum(byte_len)
            from cr_revisions, lob_data
            where revision_id = :revision_id and lob_id = cr_revisions.lob
        }]
    }

    util_return_headers $mime_type $content_length
    #
    # In a HEAD request, just send headers and no content
    #
    if {![string equal -nocase "head" [ns_conn method]]} {
        db_write_blob write_lob_content ""
    } else {
        ns_conn close
    }
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="cr_write_content-lob.write_lob_content">
    <querytext>
          select lob as content, 'lob' as storage_type
          from cr_revisions
          where revision_id = :revision_id
      </querytext>
</fullquery>
packages/acs-content-repository/tcl/revision-procs-postgresql.xql

Oracle XQL file:
<fullquery name="cr_write_content-lob.write_lob_content">
    <querytext>
          select content
          from cr_revisions
          where revision_id = :revision_id
      </querytext>
</fullquery>
packages/acs-content-repository/tcl/revision-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: