Class/Object

net.liftweb.http

LiftSession

Related Docs: object LiftSession | package http

Permalink

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

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addPostPageJavaScript(func: () ⇒ JsCmd): Unit

    Permalink

    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

    Permalink

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

  6. def allowContainerState_?: Boolean

    Permalink

    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

    Permalink
    Definition Classes
    Any
  8. def buildAndStoreComet[T <: LiftCometActor](newCometFn: (CometCreationInfo) ⇒ Box[T])(creationInfo: CometCreationInfo): Box[T]

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink
  13. def cleanupUnseenFuncs(): Unit

    Permalink
  14. def clearPostPageJavaScriptForThisPage(): Unit

    Permalink

    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

    Permalink

    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

    Permalink

    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

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

    Permalink
  19. def contextPath: String

    Permalink

    Define the context path for this session.

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

  20. object currentSourceContext extends TransientRequestVar[Any]

    Permalink
  21. def destroySession(): Unit

    Permalink

    Destroy this session and the underlying container session.

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

    Permalink

    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.

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

    Permalink

    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
  24. def doCometActorCleanup(): Unit

    Permalink
  25. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  27. def executeInScope[T](req: Box[Req], renderVersion: String)(f: ⇒ T): T

    Permalink
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def findAndProcessTemplate(name: List[String]): Box[Elem]

    Permalink

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

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

    Permalink

    Find the comet actor by type and name

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

    Permalink

    Finds all Comet actors by type

  32. def findField(name: List[String], cur: Any): Any

    Permalink
  33. def findFunc(funcName: String): Option[AFuncHolder]

    Permalink

    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.

  34. def fixSessionTime(): Unit

    Permalink
  35. def getAsyncComponent(id: String): Box[LiftCometActor]

    Permalink

    Finds a Comet actor by ID

  36. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  37. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  38. val httpSession: Box[HTTPSession]

    Permalink
  39. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  40. object legacyIeCompatibilityMode extends SessionVar[Boolean]

    Permalink
  41. var liftTagProcessing: List[LiftTagPF]

    Permalink

    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.

  42. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Loggable
  43. def merge(xhtml: NodeSeq, req: Req): Node

    Permalink

    Manages the merge phase of the rendering pipeline

    Manages the merge phase of the rendering pipeline

    Definition Classes
    LiftMerge
  44. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  45. def normalizeHtml(in: NodeSeq): NodeSeq

    Permalink

    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.

  46. def normalizeHtmlAndAppendEventHandlers(in: NodeSeq): NodeSeq

    Permalink

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

  47. def normalizeHtmlAndEventHandlers(nodes: NodeSeq): NodesAndEventJs

    Permalink

    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.

  48. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  49. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. def performHeadMerge(in: NodeSeq, req: Req): Node

    Permalink

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

  51. def postPageJavaScript(): List[JsCmd]

    Permalink

    Get the JavaScript to execute as part of the current page

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

    Permalink

    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

  53. def postPageJavaScript(rv: String): List[JsCmd]

    Permalink
  54. def processSurroundAndInclude(page: String, in: NodeSeq): NodeSeq

    Permalink

    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

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

    Permalink

    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

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

    Permalink

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

  57. def removeFunction(name: String): AFuncHolder

    Permalink

    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]

    Permalink
  59. def runParams(state: Req): List[Any]

    Permalink

    Executes the user's functions based on the query parameters

  60. def runSourceContext(value: Any, xform: (NodeSeq) ⇒ NodeSeq, ns: NodeSeq): NodeSeq

    Permalink
  61. def runTemplate(pageName: String, template: NodeSeq): NodeSeq

    Permalink

    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

    Permalink
  63. def sendCometActorMessage(theType: String, name: Box[String], msg: Any): Unit

    Permalink

    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.

    theType

    the type of the CometActor

    name

    the optional name of the CometActor

    msg

    the message to send to the CometActor

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

    Permalink

    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

  65. def sessionHtmlProperties: (Req) ⇒ HtmlProperties

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

    Permalink

    Allows you to send messages to a CometActor that may or may not be set up yet

  67. def stateful_?: Boolean

    Permalink

    Test the statefulness of this session.

    Test the statefulness of this session.

    Definition Classes
    HowStateful
  68. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  69. def terminateHint: Unit

    Permalink
  70. def testStatefulFeature[T](f: ⇒ T): T

    Permalink

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

  71. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  72. val underlyingId: String

    Permalink
  73. val uniqueId: String

    Permalink

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

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

    Permalink

    Updates the internal functions mapping

  75. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def fixHtml(in: NodeSeq): NodeSeq

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Use normalizeHtml instead.

Inherited from HowStateful

Inherited from Loggable

Inherited from LiftMerge

Inherited from AnyRef

Inherited from Any

Ungrouped