Packages

class LiftSession extends LiftMerge with Loggable with HowStateful

The LiftSession class containing the session state information

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LiftSession
  2. HowStateful
  3. Loggable
  4. LiftMerge
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LiftSession(_contextPath: String, underlyingId: String, httpSession: Box[HTTPSession])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addPostPageJavaScript(func: () ⇒ JsCmd): Unit

    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.

    func

    -- the function that returns JavaScript to be appended to responses associated with this page

  5. def addSessionCleanup(f: (LiftSession) ⇒ Unit): Unit

    Adds a cleanup function that will be executed when session is terminated

  6. def allowContainerState_?: Boolean

    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.

    Definition Classes
    HowStateful
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def buildAndStoreComet[T <: LiftCometActor](newCometFn: (CometCreationInfo) ⇒ Box[T])(creationInfo: CometCreationInfo): Box[T]

    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.

    T

    A LiftCometActor or better

    newCometFn

    a Function that takes CometCreateInfo and returns a CometActor instance

    creationInfo

    the info to send to the above function

    returns

    The created, registered, etc. CometActor

  9. def buildDeferredFunction[A, T](deferredFunction: (A) ⇒ T): (A) ⇒ T

    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.

  10. def buildDeferredFunction[T](deferredFunction: () ⇒ T): () ⇒ T

    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.

  11. def buildRoundtrip(info: Seq[RoundTripInfo]): JsExp

    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

  12. def buildXformer(xformRule: String, field: List[String]): (NodeSeq) ⇒ NodeSeq
  13. def cleanupUnseenFuncs(): Unit
  14. def clearPostPageJavaScriptForThisPage(): Unit

    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.

  15. def clientActorFor(in: LiftActor, xlate: (JValue) ⇒ Box[Any]): JsExp

    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.

    in

    the Actor to send messages to.

    xlate

    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

    returns

    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

  16. def clientActorFor(in: LiftActor): JsExp

    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.

    in

    the Actor to send messages to.

    returns

    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

  17. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def cometForHost(hostAndPath: String): (Vector[(LiftActor, Req)], Vector[(LiftActor, Req)])
  19. def contextPath: String

    Define the context path for this session.

    Define the context path for this session. This allows different sessions to have different context paths.

  20. def destroySession(): Unit

    Destroy this session and the underlying container session.

  21. def destroySessionAndContinueInNewSession(continuation: () ⇒ Nothing): Nothing

    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.

  22. def doAsStateless[A](f: ⇒ A): A

    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

    Definition Classes
    HowStateful
  23. def doCometActorCleanup(): Unit
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  26. def executeInScope[T](req: Box[Req], renderVersion: String)(f: ⇒ T): T
  27. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def findAndProcessTemplate(name: List[String]): Box[Elem]

    Finds a template named name and then runs it throught the Lift processing engine

  29. def findComet(theType: String, name: Box[String]): Box[LiftCometActor]

    Find the comet actor by type and name

  30. def findComet(theType: String): List[LiftCometActor]

    Finds all Comet actors by type

  31. def findField(name: List[String], cur: Any): Any
  32. def findFunc(funcName: String): Option[AFuncHolder]

    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.

  33. def fixSessionTime(): Unit
  34. def getAsyncComponent(id: String): Box[LiftCometActor]

    Finds a Comet actor by ID

  35. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  37. val httpSession: Box[HTTPSession]
  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. var liftTagProcessing: List[LiftTagPF]

    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.

  40. val logger: Logger
    Attributes
    protected
    Definition Classes
    Loggable
    Annotations
    @transient()
  41. def merge(xhtml: NodeSeq, req: Req): Node

    Manages the merge phase of the rendering pipeline

    Manages the merge phase of the rendering pipeline

    Definition Classes
    LiftMerge
  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. def normalizeHtml(in: NodeSeq): NodeSeq

    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.

  44. def normalizeHtmlAndAppendEventHandlers(in: NodeSeq): NodeSeq

    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).

  45. def normalizeHtmlAndEventHandlers(nodes: NodeSeq, forceExtractInlineJavaScript: Option[Boolean] = None): NodesAndEventJs

    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.

    forceExtractInlineJavaScript

    If None, uses LiftRules.extractInlineJavaScript to decide whether or not to extract inline JS from the passed nodes. If Some, extracts (Some(true)) or doesn't (Some(false)).

  46. final def notify(): Unit
    Definition Classes
    AnyRef
  47. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  48. def performHeadMerge(in: NodeSeq, req: Req): Node

    Merge all the head elements into the main head element and move tail stuff to the end of the page.

  49. def postPageJavaScript(): List[JsCmd]

    Get the JavaScript to execute as part of the current page

  50. def postPageJavaScript(pageIds: Seq[String]): List[JsCmd]

    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

  51. def postPageJavaScript(rv: String): List[JsCmd]
  52. def processSurroundAndInclude(page: String, in: NodeSeq): NodeSeq

    Processes the surround tag and other lift tags

    Processes the surround tag and other lift tags

    page

    the name of the page currently being processed

    in

    the DOM to process

  53. def processTemplate(template: Box[NodeSeq], request: Req, path: ParsePath, code: Int): Box[LiftResponse]

    Convert a template into a Lift Response.

    Convert a template into a Lift Response.

    template

    -- the NodeSeq that makes up the page... or the template will be located via findVisibleTemplate

    request

    -- the Req the led to this rendering

    path

    -- the ParsePath that led to this page

    code

    -- the HTTP response code (usually 200)

    returns

    a Box of LiftResponse with all the proper page rewriting

  54. var progressListener: Box[(Long, Long, Int) ⇒ Unit]

    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, ...)

  55. def queueCometMessage(cometType: String, cometName: Box[String], msg: Any): Unit

    Queue a message for a comet that is not started yet.

  56. def queueCometMessage(cometType: String, msg: Any): Unit

    Queue a message for a comet that is not started yet.

  57. def removeFunction(name: String): AFuncHolder

    Removes the function with the given name.

    Removes the function with the given name. Note that this will not trigger LiftSession$.onFunctionOwnersRemoved listeners.

  58. val requestHtmlProperties: TransientRequestVar[HtmlProperties]
  59. def runParams(state: Req): List[Any]

    Executes the user's functions based on the query parameters

  60. def runSourceContext(value: Any, xform: (NodeSeq) ⇒ NodeSeq, ns: NodeSeq): NodeSeq
  61. def runTemplate(pageName: String, template: NodeSeq): NodeSeq

    A nicely named proxy for processSurroundAndInclude.

    A nicely named proxy for processSurroundAndInclude. This method processes a Lift template

    pageName

    -- the name of the page being processed (for error reporting)

    template

    -- the template to process using Lift's templating engine

  62. def running_?: Boolean
  63. def sendCometMessage[T](name: Box[String], msg: Any)(implicit cometManifest: Manifest[T]): Unit

    Similar behavior to the main sendCometMessage, except that this version will limit based on the name of the comet and it takes its type selector as a type parameter.

    Similar behavior to the main sendCometMessage, except that this version will limit based on the name of the comet and it takes its type selector as a type parameter.

    name

    the optional name of the CometActor

    msg

    the message to send to the CometActor

  64. def sendCometMessage(theType: String, name: Box[String], msg: Any): Unit

    Similar behavior to the main sendCometMessage, except that this version will limit based on the name of the comet.

    Similar behavior to the main sendCometMessage, except that this version will limit based on the name of the comet. Providing name as Empty, will specifically select comets with no name.

    theType

    the type of the CometActor

    name

    the optional name of the CometActor

    msg

    the message to send to the CometActor

  65. def sendCometMessage[T](msg: Any)(implicit cometManifest: Manifest[T]): Unit

    Similar behavior to the main sendCometMessage, except that the type argument is taken as a type parameter instead of a string.

    Similar behavior to the main sendCometMessage, except that the type argument is taken as a type parameter instead of a string.

    msg

    the message to send to the CometActor

  66. def sendCometMessage(theType: String, msg: Any): Unit

    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 queueCometMessage if it is created as part of the current HTTP request/response cycle.

    theType

    the type of the CometActor

    msg

    the message to send to the CometActor

  67. def serverActorForClient(toCall: String, setupFunc: Box[(LiftActor) ⇒ Unit] = Empty, shutdownFunc: Box[(LiftActor) ⇒ Unit] = Empty, dataFilter: (Any) ⇒ Any = a => a): LiftActor

    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

    toCall

    the name of the browser-side function that should be called when the data is delivered

    setupFunc

    called by localSetup in the CometActor

    shutdownFunc

    called by localShutdown in the CometActor

    dataFilter

    messages are passed through this function... it allows conversion of data from

    returns

    a server-side Actor that is a proxy for the client-side Actor/Function call

  68. def sessionHtmlProperties: (Req) ⇒ HtmlProperties
  69. def stateful_?: Boolean

    Test the statefulness of this session.

    Test the statefulness of this session.

    Definition Classes
    HowStateful
  70. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  71. def terminateHint: Unit
  72. def testStatefulFeature[T](f: ⇒ T): T

    Run the code, but if the session is not stateful, then throw a StateInStatelessException

  73. def toString(): String
    Definition Classes
    AnyRef → Any
  74. val underlyingId: String
  75. val uniqueId: String

    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).

  76. def updateFunctionMap(funcs: Map[String, AFuncHolder], uniqueId: String, when: Long): Unit

    Updates the internal functions mapping

  77. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. object currentSourceContext extends TransientRequestVar[Any]
  81. object legacyIeCompatibilityMode extends SessionVar[Boolean]

Deprecated Value Members

  1. def fixHtml(in: NodeSeq): NodeSeq
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use normalizeHtml instead.

  2. def sendCometActorMessage(theType: String, name: Box[String], msg: Any): Unit
    Annotations
    @deprecated
    Deprecated

    (Since version 3.1) Please switch to using sendCometMessage.

  3. def setupComet(cometType: String, cometName: Box[String], msg: Any): Unit

    Queue a message for a comet that is not started yet.

    Queue a message for a comet that is not started yet.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.1) Please use queueCometMessage instead.

Inherited from HowStateful

Inherited from Loggable

Inherited from LiftMerge

Inherited from AnyRef

Inherited from Any

Ungrouped