oacs_dav::impl::content_folder::mkcol (private)

 oacs_dav::impl::content_folder::mkcol

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

MKCOL DAV method for generic content folder

Author:
Dave Bauer

Partial Call Graph (max 5 caller/called nodes):
%3 test_oacs_dav_mkcol oacs_dav_mkcol (test oacs-dav) oacs_dav::impl::content_folder::mkcol oacs_dav::impl::content_folder::mkcol test_oacs_dav_mkcol->oacs_dav::impl::content_folder::mkcol db_exec_plsql db_exec_plsql (public) oacs_dav::impl::content_folder::mkcol->db_exec_plsql db_transaction db_transaction (public) oacs_dav::impl::content_folder::mkcol->db_transaction oacs_dav::conn oacs_dav::conn (public) oacs_dav::impl::content_folder::mkcol->oacs_dav::conn oacs_dav::item_parent_folder_id oacs_dav::item_parent_folder_id (public) oacs_dav::impl::content_folder::mkcol->oacs_dav::item_parent_folder_id AcsSc.dav.mkcol.content_folder AcsSc.dav.mkcol.content_folder (private) AcsSc.dav.mkcol.content_folder->oacs_dav::impl::content_folder::mkcol

Testcases:
oacs_dav_mkcol
Source code:
    set uri [oacs_dav::conn uri]
    set user_id [oacs_dav::conn user_id]
    set peer_addr [oacs_dav::conn peeraddr]
    set item_id [oacs_dav::conn item_id]
    set fname [oacs_dav::conn item_name]
    set parent_id [oacs_dav::item_parent_folder_id $uri]
    if {$parent_id eq ""} {
        return [list 409]
    }
    if { $item_id ne ""} {
        return [list 405]
    }

    # probably have to revisit setting content_types allowed
    # and permissions, but inheriting from the parent seems
    # reasonable

    db_transaction {
            set new_folder_name $fname
            set label $fname
            set description $fname
            set new_folder_id [db_exec_plsql create_folder ""]
            set response [list 201]
    } on_error {
        set response [list 500]
    }

    return $response
Generic XQL file:
packages/oacs-dav/tcl/oacs-dav-procs.xql

PostgreSQL XQL file:
<fullquery name="oacs_dav::impl::content_folder::mkcol.create_folder">
    <querytext>
      select content_folder__new(
          :new_folder_name,
          :label,
          :description,
          :parent_id,
          :parent_id,
          NULL,
          current_timestamp,
          :user_id,
          :peer_addr
      )
    </querytext>
</fullquery>
packages/oacs-dav/tcl/oacs-dav-procs-postgresql.xql

Oracle XQL file:
<fullquery name="oacs_dav::impl::content_folder::mkcol.create_folder">
    <querytext>
	begin
	      :1 := content_folder.new(
              name => :new_folder_name,
              label => :label,
              description => :description,
              parent_id => :parent_id,
              context_id => :parent_id,
              folder_id => NULL,
              creation_date => sysdate,
              creation_user => :user_id,
              creation_ip => :peer_addr
	      );
	end;
    </querytext>
</fullquery>
packages/oacs-dav/tcl/oacs-dav-procs-oracle.xql

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