| |
788 |
788 |
if {[catch {set page_or_package [my resolve_page [my set object] method]} errorMsg]} { |
| |
789 |
789 |
return [my error_msg -template_file $error_template $errorMsg] |
| |
790 |
790 |
} |
| |
791 |
791 |
my set invoke_object $page_or_package |
| |
792 |
792 |
#my log "--r resolve_page '[my set object]' => $page_or_package" |
| |
793 |
793 |
if {$page_or_package ne ""} { |
| |
794 |
794 |
if {[$page_or_package istype ::xowiki::FormPage] |
| |
795 |
795 |
&& [$page_or_package is_link_page]} { |
| |
796 |
796 |
# If the target is a symbolic link, we may want to call the |
| |
797 |
797 |
# method on the target. The default behavior is defined in the |
| |
798 |
798 |
# array delegate_link_to_target, but if can be overruled with |
| |
799 |
799 |
# the boolean query parameter "deref". |
| |
800 |
800 |
set deref [[self class] exists delegate_link_to_target($method)] |
| |
801 |
801 |
if {[my exists_query_parameter deref]} { |
| |
802 |
802 |
set deref [my query_parameter deref] |
| |
803 |
803 |
} |
| |
804 |
804 |
#my log "invoke on LINK <$method> default deref $deref" |
| |
805 |
805 |
if {$deref} { |
| |
806 |
806 |
set target [$page_or_package get_target_from_link_page] |
| |
807 |
807 |
#my log "delegate $method from $page_or_package [$page_or_package name] to $target [$target name]" |
| |
808 |
|
if {$target ne ""} {set page_or_package $target} |
| |
|
808 |
if {$target ne ""} { |
| |
|
809 |
$target set __link_source $page_or_package |
| |
|
810 |
set page_or_package $target |
| |
809 |
811 |
} |
| |
810 |
812 |
} |
| |
|
813 |
} |
| |
811 |
814 |
if {[$page_or_package procsearch $method] eq ""} { |
| |
812 |
815 |
return [my error_msg "Method <b>'$method'</b> is not defined for this object"] |
| |
813 |
816 |
} else { |
| |
814 |
817 |
#my msg "--invoke [my set object] id=$page_or_package method=$method ([my id] batch_mode $batch_mode)" |
| |
815 |
818 |
|
| |
816 |
819 |
if {$batch_mode} {[my id] set __batch_mode 1} |
| |
817 |
820 |
set err [catch { set r [my call $page_or_package $method ""]} errorMsg] |
| |
818 |
821 |
if {$batch_mode} {[my id] unset -nocomplain __batch_mode} |
| |
819 |
822 |
if {$err} { |
| |
820 |
823 |
ns_log notice "error during invocation of method $method errorMsg: $errorMsg, $::errorInfo" |
| |
821 |
824 |
return [my error_msg -status_code 500 \ |
| |
822 |
825 |
-template_file $error_template \ |
| |
823 |
826 |
"error during [ns_quotehtml $method]: <pre>[ns_quotehtml $errorMsg]</pre>"] |
| |
824 |
827 |
} |
| |
825 |
828 |
return $r |
| |
826 |
829 |
} |
| |
827 |
830 |
} else { |
| |
828 |
831 |
# the requested page was not found, provide an error message and |
| |
829 |
832 |
# an optional link for creating the page |
| |
830 |
833 |
set path [::xowiki::Includelet html_encode [my set object]] |