_oacs-dav__oacs_dav_put (private)

 _oacs-dav__oacs_dav_put

Defined in packages/oacs-dav/tcl/test/oacs-dav-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_log aa_log (public) aa_log_result aa_log_result (public) aa_run_with_teardown aa_run_with_teardown (public) aa_true aa_true (public) acs_root_dir acs_root_dir (public) _oacs-dav__oacs_dav_put _oacs-dav__oacs_dav_put _oacs-dav__oacs_dav_put->aa_log _oacs-dav__oacs_dav_put->aa_log_result _oacs-dav__oacs_dav_put->aa_run_with_teardown _oacs-dav__oacs_dav_put->aa_true _oacs-dav__oacs_dav_put->acs_root_dir

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_run_with_teardown -rollback -test_code {
        array set sn [site_node::get -url "/"]
        set package_id $sn(package_id)
        set name "__test_file.html"
        oacs_dav::conn -set item_name $name
        set uri "/${name}"
        set item_id ""
        oacs_dav::conn -set method "PUT"
        oacs_dav::conn -set item_id $item_id
        oacs_dav::conn -set uri $uri
        oacs_dav::conn -set urlv $name
        oacs_dav::conn -set tmpfile  "[acs_root_dir]/packages/oacs-dav/tcl/test/$name"
        # we probably want to create a bunch of files in the filesystem
        # and test mime type and other attributes to make sure the
        # content gets in the database
        set tmpfile [oacs_dav::conn tmpfile]
        set tmpfilesize [file size $tmpfile]
        set fd [open $tmpfile r]
        set orig_content [read $fd]
        close $fd
        set folder_id [db_exec_plsql create_test_folder ""]
        aa_log "Folder Created $folder_id package_id $package_id"
        oacs_dav::conn -set folder_id $folder_id
        db_exec_plsql register_content_type ""
        oacs_dav::register_folder $folder_id $sn(node_id)
        set response [oacs_dav::impl::content_revision::put]
        ## Rewrite the file, as put operation would destroy it
        set fd [open $tmpfile w]
        puts -nonewline $fd $orig_content
        close $fd
        ##
        aa_log "Response was $response"
        set new_item_id [db_string item_exists "" -default ""]
        aa_log "Item_id=$new_item_id"
        aa_true "Content Item Created" {$new_item_id ne ""}
        set revision_id [db_string revision_exists "" -default ""]
        aa_true "Content Revision Created"  {$revision_id ne ""}
        set cr_filename [content::revision::get_cr_file_path -revision_id $revision_id]
        aa_true "Content Attribute Set"  {$tmpfilesize == [file size $cr_filename]}
    }
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "oacs_dav_put (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Oracle
Generic XQL file:
<fullquery name="_oacs-dav__oacs_dav_put.item_exists">
    <querytext>
      select item_id from cr_items where name=:name
      and parent_id=:folder_id
    </querytext>
</fullquery>

<fullquery name="_oacs-dav__oacs_dav_put.revision_exists">
    <querytext>
      select revision_id from cr_revisions
      where item_id=:new_item_id
    </querytext>
</fullquery>

<fullquery name="_oacs-dav__oacs_dav_put.item_exists">
    <querytext>
      select item_id from cr_items where name=:name
      and parent_id=:folder_id
    </querytext>
</fullquery>
packages/oacs-dav/tcl/test/oacs-dav-procs.xql

PostgreSQL XQL file:
<fullquery name="_oacs-dav__oacs_dav_put.create_test_folder">
    <querytext>
      select content_folder__new (
      '__test_folder',
      '__test_folder',
      NULL,
      NULL
      )
    </querytext>
</fullquery>

<fullquery name="_oacs-dav__oacs_dav_put.register_content_type">
    <querytext>
      select
      content_folder__register_content_type(:folder_id,'content_revision','t')
    </querytext>
</fullquery>
packages/oacs-dav/tcl/test/oacs-dav-procs-postgresql.xql

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