ATWF A Tcl Web Framwork

Check-in [2b9139ef97]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:smaller fixes

git-svn-id: https://atwf.svn.sourceforge.net/svnroot/atwf@612 3ddb7fe1-eb8e-4980-8f37-d9e37380b5db

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2b9139ef97f95e1c2d3b91f05003769ff3060b68
User & Date: arnulf@wiedemann-pri.de 2010-12-04 23:08:21
Context
2010-12-04
23:10
initial version

git-svn-id: https://atwf.svn.sourceforge.net/svnroot/atwf@613 3ddb7fe1-eb8e-4980-8f37-d9e37380b5db check-in: 23292c4f81 user: arnulf@wiedemann-pri.de tags: trunk

23:08
smaller fixes

git-svn-id: https://atwf.svn.sourceforge.net/svnroot/atwf@612 3ddb7fe1-eb8e-4980-8f37-d9e37380b5db check-in: 2b9139ef97 user: arnulf@wiedemann-pri.de tags: trunk

21:54
fixed typo

git-svn-id: https://atwf.svn.sourceforge.net/svnroot/atwf@611 3ddb7fe1-eb8e-4980-8f37-d9e37380b5db check-in: f3b837a976 user: arnulf@wiedemann-pri.de tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/ATWF/Controllers/Action.tcl.

458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
            set _classMethods [getClassMethods $this]
        }
        if {[getInvokeArg useCaseSensitiveActions] || [methodExists $this $action real_method_name]} {
            if {[getInvokeArg useCaseSensitiveActions]} {
                 return -code error "Using case sensitive actions without word separators is deprecated please do not rely on this feature"
            }
            set method [$this info function $action -name]
set fd [open /tmp/atwf.log a]
puts $fd "===== [clock format [clock seconds] -format {%Y-%m-%d %T}] ==="
puts $fd "action!$this $action!method!$method!"
close $fd
	    $this $action
        } else {
            __call $action [list]
        }
        postDispatch
    }








<
<
<
<







458
459
460
461
462
463
464




465
466
467
468
469
470
471
            set _classMethods [getClassMethods $this]
        }
        if {[getInvokeArg useCaseSensitiveActions] || [methodExists $this $action real_method_name]} {
            if {[getInvokeArg useCaseSensitiveActions]} {
                 return -code error "Using case sensitive actions without word separators is deprecated please do not rely on this feature"
            }
            set method [$this info function $action -name]




	    $this $action
        } else {
            __call $action [list]
        }
        postDispatch
    }

Changes to library/ATWF/Controllers/Front.tcl.

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
        _instance {
	  }
        _controllerDir -
        _invokeParams {
            set $name [list]
	  }
        _plugins {
            set $name [uplevel #0 ::ATWF::Controllers::Plugin::Broker #auto]
	  }
        _throwExceptions -
        _returnResponse {
            set $name false
	  }
        _moduleControllerDirectoryName {
            set $name controllers
................................................................................
        $_plugins registerPlugin [uplevel #0 ::ATWF::Controllers::Plugins::ErrorHandler #auto] 100
    }

    if {([getParam noViewRenderer] eq "") && ![::ATWF::Controllers::Actions::HelperBroker::hasHelper viewRenderer]} {
        [::ATWF::Controllers::Actions::HelperBroker::getStack] offsetSet -80 [uplevel #0 ::ATWF::Controllers::Actions::Helpers::ViewRenderer #auto]
    }

     # Instantiate default request object (HTTP version) if none provided
    if {$request ne ""} {
        setRequest $request
    } else {
        if {$request eq "" && [set request [getRequest]] eq ""} {
            set request [uplevel #0 ::ATWF::Controllers::Requests::Http #auto]
            setRequest $request
        }
    }

     # Set base URL of request object, if available
#FIXME !!!
#    if {[is_callable [dict create $_request setBaseUrl]]} {
#        if {$_baseUrl ne ""} {
#            $_request setBaseUrl $_baseUrl
#        }
#    }

     # Instantiate default response object (HTTP version) if none provided
    if {$response ne ""} {
        setResponse $response
    } else {
        if {$_response eq "" && [set _response [getResponse]] eq ""} {
            set response [uplevel #0 ::ATWF::Controllers::Responses::Http #auto]
            setResponse $response
        }
    }

     # Register request and response objects with plugin broker
    $_plugins setRequest $_request
    $_plugins setResponse $_response

     # Initialize router
    set router [getRouter]
    $router setParams [getParams]

     # Initialize dispatcher
    set dispatcher [getDispatcher]
    $dispatcher setParams [getParams]
    $dispatcher setResponse $_response

   #  Begin dispatch
    try {
         # Route request to controller/action, if a router is provided







|







 







|









|







|









|



|



|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
        _instance {
	  }
        _controllerDir -
        _invokeParams {
            set $name [list]
	  }
        _plugins {
            set $name [uplevel #0 ::ATWF::Controllers::Plugins::Broker #auto]
	  }
        _throwExceptions -
        _returnResponse {
            set $name false
	  }
        _moduleControllerDirectoryName {
            set $name controllers
................................................................................
        $_plugins registerPlugin [uplevel #0 ::ATWF::Controllers::Plugins::ErrorHandler #auto] 100
    }

    if {([getParam noViewRenderer] eq "") && ![::ATWF::Controllers::Actions::HelperBroker::hasHelper viewRenderer]} {
        [::ATWF::Controllers::Actions::HelperBroker::getStack] offsetSet -80 [uplevel #0 ::ATWF::Controllers::Actions::Helpers::ViewRenderer #auto]
    }

    # Instantiate default request object (HTTP version) if none provided
    if {$request ne ""} {
        setRequest $request
    } else {
        if {$request eq "" && [set request [getRequest]] eq ""} {
            set request [uplevel #0 ::ATWF::Controllers::Requests::Http #auto]
            setRequest $request
        }
    }

    # Set base URL of request object, if available
#FIXME !!!
#    if {[is_callable [dict create $_request setBaseUrl]]} {
#        if {$_baseUrl ne ""} {
#            $_request setBaseUrl $_baseUrl
#        }
#    }

    # Instantiate default response object (HTTP version) if none provided
    if {$response ne ""} {
        setResponse $response
    } else {
        if {$_response eq "" && [set _response [getResponse]] eq ""} {
            set response [uplevel #0 ::ATWF::Controllers::Responses::Http #auto]
            setResponse $response
        }
    }

    # Register request and response objects with plugin broker
    $_plugins setRequest $_request
    $_plugins setResponse $_response

    # Initialize router
    set router [getRouter]
    $router setParams [getParams]

    # Initialize dispatcher
    set dispatcher [getDispatcher]
    $dispatcher setParams [getParams]
    $dispatcher setResponse $_response

   #  Begin dispatch
    try {
         # Route request to controller/action, if a router is provided

Changes to library/ATWF/Controllers/Plugins/Plugin.tcl.

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  # Called after ::ATWF::Controllers::Front exits from the router.
  #
  # @param  ::ATWF::Controllers::Request request
  # @return void
::itcl::body Controllers::Plugins::Plugin::routeShutdown {request} {
}

  #============================ dispatchLoopStart ==============================
  # Called before ::ATWF::Controllers::Front enters its dispatch loop.
  #
  # @param  ::ATWF::Controllers::Request request
  # @return void
::itcl::body Controllers::Plugins::Plugin::dispatchLoopStartup {request} {
}








|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
  # Called after ::ATWF::Controllers::Front exits from the router.
  #
  # @param  ::ATWF::Controllers::Request request
  # @return void
::itcl::body Controllers::Plugins::Plugin::routeShutdown {request} {
}

  #============================ dispatchLoopStartup ============================
  # Called before ::ATWF::Controllers::Front enters its dispatch loop.
  #
  # @param  ::ATWF::Controllers::Request request
  # @return void
::itcl::body Controllers::Plugins::Plugin::dispatchLoopStartup {request} {
}

Changes to library/ATWF/Controllers/Requests/Request.tcl.

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258

    return $default
}

  #============================ setParam =======================================
  # Set an action parameter
  #
  # A $value of null will unset the $key if it exists
  #
  # @param string $key
  # @param mixed $value
  # @return Controllers::Requests::Request
::itcl::body Controllers::Requests::Request::setParam {key value} {
    if {($value eq "") && [dict exists $_params $key]} {
        set _params [dict remove $_params $key]
    } else  {
        if {$value ne ""} {
            dict set _params $key $value







|

|
|







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258

    return $default
}

  #============================ setParam =======================================
  # Set an action parameter
  #
  # A value of null will unset the key if it exists
  #
  # @param string key
  # @param mixed  value
  # @return Controllers::Requests::Request
::itcl::body Controllers::Requests::Request::setParam {key value} {
    if {($value eq "") && [dict exists $_params $key]} {
        set _params [dict remove $_params $key]
    } else  {
        if {$value ne ""} {
            dict set _params $key $value

Changes to library/ATWF/Controllers/Routers/Routings/Module.tcl.

120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

# FIXME!!! temporary!!!
proc ::urldecode {arg} {
puts stderr "Need urldecode method!"
    return $arg
}
  #============================ match ==========================================
  # Matches a user submitted path. Assigns and returns an array of variables
  # on a successful match.
  #
  # If a request object is registered, it uses its setModuleName(),
  # setControllerName(), and setActionName() accessors to set those values.
  # Always returns the values as a dict.
  #
  # @param string path Path used to match against this routing map







|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

# FIXME!!! temporary!!!
proc ::urldecode {arg} {
puts stderr "Need urldecode method!"
    return $arg
}
  #============================ match ==========================================
  # Matches a user submitted path. Assigns and returns an dict of variables
  # on a successful match.
  #
  # If a request object is registered, it uses its setModuleName(),
  # setControllerName(), and setActionName() accessors to set those values.
  # Always returns the values as a dict.
  #
  # @param string path Path used to match against this routing map