Associate a function that renders JavaScript with the current page.
Associate a function that renders JavaScript with the current page. This function will be run and the resulting JavaScript will be appended to any rendering associated with this page... the normal page render, Ajax calls, and even Comet calls for this page.
-- the function that returns JavaScript to be appended to responses associated with this page
Adds a cleanup function that will be executed when session is terminated
There may be cases when you are allowed container state (e.g., migratory session, but you're not allowed to write Lift non-migratory state, return true here.
There may be cases when you are allowed container state (e.g., migratory session, but you're not allowed to write Lift non-migratory state, return true here.
Need to add your own CometActor to a Session/Page? You might 'cause creating a CometActor programmatically within a snippet may be between that referring to a CometActor by class name.
Need to add your own CometActor to a Session/Page? You might 'cause creating a CometActor programmatically within a snippet may be between that referring to a CometActor by class name.
This is dangerous stuff, so use with caution.
A LiftCometActor or better
a Function that takes CometCreateInfo
and returns a CometActor
instance
the info to send to the above function
The created, registered, etc. CometActor
Overload of buildDeferredFunction
for functions that take a parameter.
Overload of buildDeferredFunction
for functions that take a parameter.
The returned function, when invoked with a parameter of type A
, will
invoke the passed deferredFunction
with that parameter in the original
request and session context.
During the HTTP request/response cycle or in a CometActor, Lift populates "S" with information about the current session, the current request, etc.
During the HTTP request/response cycle or in a CometActor, Lift populates "S" with information about the current session, the current request, etc. This method allows you to wrap a function in another function that will snapshot current state (request vars, Req, Loc, etc.) such that when the returned function is executed, it will be executed as if it had been executed in the scope of the thread where it was create. This allows you to farm work out to separate threads, but make it look to those threads as if the scope was the same as if it had been executed on the thread that created the function.
Build a bunch of round-trip calls between the client and the server.
Build a bunch of round-trip calls between the client and the server. The client calls the server with a parameter and the parameter gets marshalled to the server and the code is executed on the server. The result can be an item (JValue) or a Stream of Items.
If the The // HERE
Clear the PostPage JavaScript functions for the current page.
Clear the PostPage JavaScript functions for the current page. This is used by CometActor to remove the PostPage JavaScript functions from the given component during redraw.
Pass in a LiftActor and get a JavaScript expression (function(x) {...}) that represents an asynchronous Actor message from the client to the server.
Pass in a LiftActor and get a JavaScript expression (function(x) {...}) that represents an asynchronous Actor message from the client to the server.
The Actor should respond to a message in the form of a JsonAST.JValue.
This method requires the session be stateful
In general, your Actor should be a subclass of ScopedLiftActor because that way you'll have the scope of the current session.
the Actor to send messages to.
a function that will take the JsonAST.JValue and convert it into a representation that can be sent to the Actor (probably deserialize it into a case class.) If the translation succeeds, the translated message will be sent to the actor. If the translation fails, an error will be logged and the raw JsonAST.JValue will be sent to the actor
a JsExp that contains a function that can be called with a parameter and when the function is called, the parameter is JSON serialized and sent to the server
Pass in a LiftActor and get a JavaScript expression (function(x) {...}) that represents an asynchronous Actor message from the client to the server.
Pass in a LiftActor and get a JavaScript expression (function(x) {...}) that represents an asynchronous Actor message from the client to the server.
The Actor should respond to a message in the form of a JsonAST.JValue.
This method requires the session be stateful
In general, your Actor should be a subclass of ScopedLiftActor because that way you'll have the scope of the current session.
the Actor to send messages to.
a JsExp that contains a function that can be called with a parameter and when the function is called, the parameter is JSON serialized and sent to the server
Define the context path for this session.
Define the context path for this session. This allows different sessions to have different context paths.
Destroy this session and the underlying container session.
Destroy the current session, then create a new session and continue the execution of the code.
Destroy the current session, then create a new session and continue the execution of the code. The continuation function must return Nothing (it must throw an exception... this is typically done by calling S.redirectTo(...)). This method is useful for changing sessions on login. Issue #727.
Within the scope of the call, this session is forced into statelessness.
Within the scope of the call, this session is forced into statelessness. This allows for certain URLs in on the site to be stateless and not generate a session, but if a valid session is presented, they have the scope of that session/User
Finds a template named name and then runs it throught the Lift processing engine
Find the comet actor by type and name
Finds all Comet actors by type
Find a function in the function lookup table.
Find a function in the function lookup table. You probably never need to do this, but well, you can look them up.
Finds a Comet actor by ID
The partial function that defines how lift tags are processed for this session.
The partial function that defines how lift tags are processed for this session. Initially composed of LiftRules.liftTagProcessing orElse the default lift tag processing. If you need to change the way a particular session handles lift tags, alter this partial function.
Manages the merge phase of the rendering pipeline
Manages the merge phase of the rendering pipeline
Apply HTML specific corrections such as adding the context path etc.
Apply HTML specific corrections such as adding the context path etc.
In general, you should heavily consider using
normalizeHtmlAndEventHandlers
or its friendliest sibling,
normalizeHtmlAndAppendEventHandlers
.
Runs normalizeHtmlAndEventHandlers
to adjust URLs to context paths
and extract JS event handlers from the given NodeSeq
and pull them into
a separate JsCmd, then uses
S.appendJs
to append that JS to the response's JavaScript (the
page-specific JS file if we are rendering a page, or the end of the
returned JS if this is an AJAX or comet request).
Applies various HTML corrections to the passed HTML, including adding the
context path to links and extracting event handlers into a separate
JsCmd
.
Applies various HTML corrections to the passed HTML, including adding the
context path to links and extracting event handlers into a separate
JsCmd
.
Note that most of the time you can just call
normalizeHtmlAndAppendEventHandlers
and not worry about the extra
JsCmd
, as Lift will automatically append it to the response.
Merge all the head elements into the main head element and move tail stuff to the end of the page.
Get the JavaScript to execute as part of the current page
Get the post-page JavaScript functions for a sequence of page IDs.
Get the post-page JavaScript functions for a sequence of page IDs. This is used by the CometActor to get the post-page JavaScript functions for the comet actor and for the page the the comet actor is associated with
Processes the surround tag and other lift tags
Processes the surround tag and other lift tags
the name of the page currently being processed
the DOM to process
Convert a template into a Lift Response.
Convert a template into a Lift Response.
-- the NodeSeq that makes up the page... or the template will be located via findVisibleTemplate
-- the Req the led to this rendering
-- the ParsePath that led to this page
-- the HTTP response code (usually 200)
a Box of LiftResponse with all the proper page rewriting
Set your session-specific progress listener for mime uploads pBytesRead - The total number of bytes, which have been read so far.
Set your session-specific progress listener for mime uploads pBytesRead - The total number of bytes, which have been read so far. pContentLength - The total number of bytes, which are being read. May be -1, if this number is unknown. pItems - The number of the field, which is currently being read. (0 = no item so far, 1 = first item is being read, ...)
Removes the function with the given name
.
Removes the function with the given name
. Note that this will
not trigger LiftSession$.onFunctionOwnersRemoved
listeners.
Executes the user's functions based on the query parameters
A nicely named proxy for processSurroundAndInclude.
A nicely named proxy for processSurroundAndInclude. This method processes a Lift template
-- the name of the page being processed (for error reporting)
-- the template to process using Lift's templating engine
This method will send a message to a CometActor, whether or not the CometActor is instantiated.
This method will send a message to a CometActor, whether or not the CometActor is instantiated. If the CometActor already exists in the session, the message will be sent immediately. If the CometActor is not yet instantiated, the message will be sent to the CometActor as part of setup (@see setupComet) if it is created as part of the current HTTP request/response cycle.
the type of the CometActor
the optional name of the CometActor
the message to send to the CometActor
Create a Actor that will take messages on the server and then send them to the client.
Create a Actor that will take messages on the server and then send them to the client. So, from the server perspective, it's just an Async message send. From the client perspective, they get a function called each time the message is sent from the server.
If the message sent to the LiftActor is a JsCmd or JsExp, then the code is sent directly to the client and executed on the client.
If the message is a JsonAST.JValue, it's turned into a JSON string, sent to the client and
the client calls the function named in the toCall
parameter with the value.
If the message is anything else, we attempt to JSON serialize the message and if it
can be JSON serialized, it's sent over the wire and passed to the toCall
function on the server
the name of the browser-side function that should be called when the data is delivered
called by localSetup
in the CometActor
called by localShutdown
in the CometActor
messages are passed through this function... it allows conversion of data from
a server-side Actor that is a proxy for the client-side Actor/Function call
Allows you to send messages to a CometActor that may or may not be set up yet
Test the statefulness of this session.
Test the statefulness of this session.
Run the code, but if the session is not stateful, then throw a StateInStatelessException
The unique id of this session.
The unique id of this session. Can be used to securely and uniquely identify the session, unlike underlyingId which is tied to the host session id. This id should be secure to emit into a page as needed (for example, it is used to provide randomness/cache-busting to the comet request path).
Updates the internal functions mapping
The LiftSession class containing the session state information