xowiki::markdown_image::attach (private)

 xowiki::markdown_image::attach page drafts

Defined in packages/xowiki/tcl/markdown-image-procs.tcl

Save each staged image as a child File, using the standard export lifecycle.

Parameters:
page (required)
drafts (required)

Partial Call Graph (max 5 caller/called nodes):
xowiki::Page instproc save_new xowiki::Page instproc save_new (public) xowiki::markdown_image::attach xowiki::markdown_image::attach xowiki::Page instproc save_new->xowiki::markdown_image::attach ad_conn ad_conn (public) xowiki::markdown_image::attach->ad_conn xowiki::markdown_image::file_name xowiki::markdown_image::file_name (private) xowiki::markdown_image::attach->xowiki::markdown_image::file_name

Testcases:
No testcase defined.
Source code:
  set object_id [$page item_id]
  dict for {image_id draft} $drafts {
    lassign $draft path mime origin
    set file [::xowiki::File new -destroy_on_cleanup  -parent_id $object_id -context_id $object_id  -package_id [$page package_id]  -name file:[file_name $image_id $mime]  -title "Pasted image" -mime_type $mime  -creation_user [ad_conn user_id]]
    $file set import_file $path
    $file save_new
    # FormPage may have an outer transaction. Retain the draft on rollback.
    if {$origin ne "legacy"} {
      ns_atclose [list ::xowiki::markdown_image::discard_attached_draft  $object_id [$file item_id] $path]
    }
  }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: