---+ Package ==

%TOC%
---+!! package TWiki::UI

Coordinator of execution flow and service functions used by the UI packages


---++ StaticMethod *handleRequest* <tt>(...)</tt>

Main coordinator of request-process-response cycle.

... are any parameters passed by engine, which are forwarded to prepare



---++ StaticMethod *prepare* <tt>(...) -> $req</tt>

Initialize a TWiki::Request object by calling many engine methods
and returns it.

   * ... are any parameters to pass to engine's prepareRequest method



---++ StaticMethod *dispath* <tt>($req) -> $res</tt>

Based on $req->action pass control to correct UI handler
and returns the TWiki::Response object generated.
   * =$req= is the TWiki::Request object



---++ StaticMethod *execute* <tt>($req,$sub,%initialContext) -> $res</tt>

Creates a TWiki session object with %initalContext and calls
$sub method. Returns the TWiki::Response object generated



---++ StaticMethod *finalize* <tt>($res,$req)</tt>

Finalizes the request by calling many engine's methods to send response to
client and take any appropriate finalize actions, such as delete temporary
files.
   * =$res= is the TWiki::Response object
   * =$req= it the TWiki::Request object. Needed to finalizeUploads



---++ StaticMethod *login* <tt>($session)</tt>

Handler to "login" action.
   * =$session= is a TWiki session object



---++ StaticMethod *checkWebExists* <tt>($session,$web,$topic,$op)</tt>

Check if the web exists. If it doesn't, will throw an oops exception.
 $op is the user operation being performed.



---++ StaticMethod *topicExists* <tt>($session,$web,$topic,$op)=>boolean</tt>

Check if the given topic exists, throwing an OopsException
if it doesn't. $op is the user operation being performed.



---++ StaticMethod *checkMirror* <tt>($session,$web,$topic)</tt>

Checks if this web is a mirror web, throwing an OopsException
if it is.



---++ StaticMethod *checkAccess* <tt>($web,$topic,$mode,$user)</tt>

Check if the given mode of access by the given user to the given
web.topic is permissible, throwing a TWiki::OopsException if not.



---++ StaticMethod *readTemplateTopic* <tt>($session,$theTopicName) -> ($meta,$text)</tt>

Read a topic from the TWiki web, or if that fails from the current
web.


