publish::write_multiple_blobs (private)

 publish::write_multiple_blobs url revision_id [ root_path ]

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

Parameters:
url (required)
Relative URL of the file to write
revision_id (required)
Write the blob for this revision
root_path (optional)
Use this root path (default empty)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 publish::write_content publish::write_content (public) publish::write_multiple_blobs publish::write_multiple_blobs publish::write_content->publish::write_multiple_blobs db_1row db_1row (public) publish::write_multiple_blobs->db_1row db_blob_get_file db_blob_get_file (public) publish::write_multiple_blobs->db_blob_get_file publish::foreach_publish_path publish::foreach_publish_path (private) publish::write_multiple_blobs->publish::foreach_publish_path publish::mkdirs publish::mkdirs (public) publish::write_multiple_blobs->publish::mkdirs

Testcases:
No testcase defined.
Source code:
  foreach_publish_path $url {
    mkdirs $filename

    db_1row get_storage_type "
           select storage_type
             from cr_items
            where item_id = (select item_id
                               from cr_revisions
                              where revision_id = :revision_id)"

    db_blob_get_file wmb_get_blob_file "
      select content from cr_revisions where revision_id = $revision_id
    " -file $filename

    ns_chmod $filename 0764
    ns_log debug "publish::write_multiple_blobs: Wrote revision $revision_id to $filename"
  } $root_path
Generic XQL file:
<fullquery name="publish::write_multiple_blobs.get_storage_type">
    <querytext>

           select storage_type 
             from cr_items 
            where item_id = (select item_id 
                               from cr_revisions 
                              where revision_id = :revision_id)

      </querytext>
</fullquery>
packages/acs-content-repository/tcl/publish-procs.xql

PostgreSQL XQL file:
<fullquery name="publish::write_multiple_blobs.wmb_get_blob_file">
    <querytext>

      select case when i.storage_type = 'file'
                       then '[cr_fs_path]' || r.content
                  when i.storage_type = 'lob'
                       then lob::text
                       else r.content end as content, i.storage_type
      from cr_revisions r, cr_items i
      where r.item_id = i.item_id and r.revision_id = :revision_id

      </querytext>
</fullquery>
packages/acs-content-repository/tcl/publish-procs-postgresql.xql

Oracle XQL file:
<fullquery name="publish::write_multiple_blobs.wmb_get_blob_file">
    <querytext>
        select [expr {$storage_type eq "file" ? "'[cr_fs_path]' || filename" : "content"}]
          from cr_revisions where revision_id = :revision_id
      </querytext>
</fullquery>
packages/acs-content-repository/tcl/publish-procs-oracle.xql

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