Create an object or val that is a subclass of the FactoryMaker to generate factory for a particular class as well as define session and request specific vendors and use doWith to define the vendor just for the scope of the call.
Generic container used mainly for adding functions
Register an AsyncMeta provider in addition to the default Jetty6, Jetty7, and Servlet 3.
Register an AsyncMeta provider in addition to the default Jetty6, Jetty7, and Servlet 3.0 providers
Tells Lift where to find Snippets, Views, Comet Actors and Lift ORM Model object
Tells Lift where to find Snippets,Views, Comet Actors and Lift ORM Model object
Holds user functions that are executed after the response is sent to client.
Holds user functions that are executed after the response is sent to client. The functions' result will be ignored.
The default action to take when the JavaScript action fails
The JavaScript to execute at the end of an Ajax request (for example, removing the spinning working thingy)
Contains the Ajax URI path used by Lift to process Ajax requests.
How many times do we retry an Ajax command before calling it a failure?
The name of the Ajax script that manages Ajax requests.
Holds the last update time of the Ajax request.
Holds the last update time of the Ajax request. Based on this server may return HTTP 304 status indicating the client to used the cached information.
The JavaScript to execute at the beginning of an Ajax request (for example, showing the spinning working thingy)
Add functionality around all of the HTTP request/response cycle.
Add functionality around all of the HTTP request/response cycle. This is an optimal place to get a database connection. Note that whatever is loaned at the beginning of the request will not be returned until the end of the request. It's super-important to (1) not do anything related to state or touch the request objects or anything else at the beginning or end of the loan wrapper phase; (2) make sure that your code does not throw exceptions as exceptions can cause major problems.
This FactoryMaker can be used to disable the little used attributeSnippets
Does the current context support parallel snippet execution
The meta for the detected AsyncProvider given the container we're running in
Attaches an ID entity for resource URI specified in link or script tags.
Attaches an ID entity for resource URI specified in link or script tags. This allows controlling browser resource caching. By default this just adds a query string parameter unique per application lifetime. More complex implementation could user per resource MD5 sequences thus "forcing" browsers to refresh the resource only when the resource file changes. Users can define other rules as well. Inside user's function it is safe to use S context as attachResourceId is called from inside the <lift:with-resource-id> snippet
The HTTP authentication mechanism that Lift will perform.
The HTTP authentication mechanism that Lift will perform. See LiftRules.protectedResource
Tells Lift if the Comet JavaScript should be included.
Tells Lift if the Comet JavaScript should be included. By default it is set to true.
Holds user functions that are executed before sending the response to client.
Holds user functions that are executed before sending the response to client. The functions' result will be ignored.
Used by Lift to construct full package names from the packages provided to addToPackages function
Computes the Comet path by adding additional tokens on top of cometPath
The function that calculates if the response should be rendered in IE6/7/8 compatibility mode
Put a function that will calculate the request timeout based on the incoming request.
If there is an alternative way of calculating the context path (by default returning Empty)
If there is an alternative way of calculating the context path (by default returning Empty)
If this function returns an Empty, the contextPath provided by the container will be used.
An XML header is inserted at the very beginning of returned XHTML pages.
An XML header is inserted at the very beginning of returned XHTML pages. This function defines the cases in which such a header is inserted. The function takes a NodeResponse (the LiftResponse that is converting the XML to a stream of bytes), the Node (root node of the XML), and a Box containing the content type.
Server-side actors that represent client-side actor endpoints (client actors, Round Trips) need a lifespan.
Server-side actors that represent client-side actor endpoints (client actors, Round Trips) need a lifespan. By default, it's 60 seconds, but you might want to make it longer if the client is going to get delayed by long computations that bar it from re-establishing the long polling connection
Partial function to allow you to build a CometActor from code rather than via reflection
A factory that will vend comet creators
If a Comet request fails timeout for this period of time.
If a Comet request fails timeout for this period of time. Default value is 10 seconds
Holds the CometLogger that will be used to log comet activity
Sometimes the comet logger (which is really the Ajax logger) needs to have the string cleaned up to remove stuff like passwords.
Sometimes the comet logger (which is really the Ajax logger) needs to have the string cleaned up to remove stuff like passwords. That's done by this function.
Holds the CometLogger that will be used to log comet activity
Contains the Comet URI path used by Lift to process Comet requests.
The timeout in milliseconds of a comet ajax-request.
The timeout in milliseconds of a comet ajax-request. Defaults to 5000 ms.
The timeout in milliseconds of a comet render-request.
The timeout in milliseconds of a comet render-request. Defaults to 30000 ms.
If you want the AJAX request timeout to be something other than 120 seconds, put the value here
The name of the Comet script that manages Comet requests.
Holds the last update time of the Comet request.
Holds the last update time of the Comet request. Based on this server may return HTTP 304 status indicating the client to used the cached information.
Calculate the Comet Server (by default, the server that the request was made on, but can do the multi-server thing as well)
If this is Full, comet updates (partialUpdates or reRenders) are wrapped in a try/catch statement.
If this is Full, comet updates (partialUpdates or reRenders) are wrapped in a try/catch statement. The provided JsCmd is the body of the catch statement. Within that JsCmd, the variable "e" refers to the caught exception.
In development mode, this defaults to Full and the command within invokes liftComet.lift_cometError with the exception; lift_cometError rethrows the exception by default. In production mode, this defaults to Empty.
Note that if you set this to Full, it is highly advised that you rethrow the exception. If you fail to rethrow the exception, you run the risk of dropping an unpredictable number of updates (i.e., if the third of 20 updates that are sent to the client in a single response throws an exception, none of the subsequent ones will run; failing to rethrow the exception means any updates that did not run will never be run).
Holds the function that configures logging.
Holds the function that configures logging. Must be set before any loggers are created
Holds the function that configures logging.
Holds the function that configures logging. Must be set before any loggers are created
Returns the HTTPContext
convertResponse is a PartialFunction that reduces a given Tuple4 into a LiftResponse that can then be sent to the browser.
Should codes that represent entities be converted to XML entities when rendered?
Ever wanted to add custom attribute processing to Lift? Here's your chance.
Ever wanted to add custom attribute processing to Lift? Here's your chance. Every attribute with the data- prefix will be tested against this RulesSeq and if there's a match, then use the rule process. Simple, easy, cool.
Obtain the resource URL by name
If a deferred snippet has a failure during render, what should we display?
If a deferred snippet has a failure during render, what should we display?
A partial function that determines content type based on an incoming Req and Accept header
In Dev mode and Test mode, return a non-200 response code if there is an error on the page (one that would result in the red box with the error message being displayed).
In Dev mode and Test mode, return a non-200 response code if there is an error on the page (one that would result in the red box with the error message being displayed). This helps in testing automation.
Holds the user's DispatchPF functions that will be executed in stateful context
Set to false if you want to have 404's handled the same way in dev and production mode
Open a resource by name and process its contents using the supplied function.
Does the LiftRules instance think it's done booting?
Holds user functions that will be executed very early in the request processing.
Holds user functions that will be executed very early in the request processing. The functions' result will be ignored.
Execute certain functions early in a Stateful Request This is called early in a stateful request (one that's not serviced by a stateless REST request and one that's not marked as a stateless HTML page request).
Execute certain functions early in a Stateful Request
By default lift uses a garbage-collection mechanism of removing unused bound functions from LiftSesssion.
By default lift uses a garbage-collection mechanism of removing unused bound functions from LiftSesssion. Setting this to false will disable this mechanisms and there will be no Ajax polling requests attempted.
Should the JSESSIONID be encoded in the URL if cookies are not supported
The sequence of partial functions (pattern matching) for handling converting an exception to something to be sent to the browser depending on the current RunMode (development, etc.
The sequence of partial functions (pattern matching) for handling converting an exception to something to be sent to the browser depending on the current RunMode (development, etc.)
By default it returns an XhtmlResponse containing a predefined markup. You can overwrite this by calling LiftRules.exceptionHandler.prepend(...). If you are calling append then your code will not be called since a default implementation is already appended.
Update the function here that calculates particular paths to excluded from context path rewriting
When a request is parsed into a Req object, certain suffixes are explicitly split from the last part of the request URI.
When a request is parsed into a Req object, certain suffixes are explicitly split from the last part of the request URI. If the suffix is contained in this list, it is explicitly split. The default list is: "html", "htm", "jpg", "png", "gif", "xml", "rss", "json" ...
There may be times when you want to entirely control the templating process.
There may be times when you want to entirely control the templating process. You can insert a function to this factory that will do your custom template resolution. If the PartialFunction isDefinedAt the given locale/path, then that's the template returned. In this way, you can return Empty for a template that's not found and the template will not be found. Otherwise, if the function is not defined for the locale/path pair, the normal templating system will be used. Also, keep in mind how FactoryMaker can be used... it can be global, per request, etc.
Modifies the root relative paths from the css url-s
Modifies the root relative paths from the css url-s
- the path of the css resource
If you use the form attribute in a snippet invocation, what attributes should be copied from the snippet invocation tag to the form tag.
If you use the form attribute in a snippet invocation, what attributes should be copied from the snippet invocation tag to the form tag. The default list is "class", "id", "target", "style", "onsubmit"
Provides a function that returns random names for form variables, page ids, callbacks, etc.
Obtain the resource URL by name
The function that converts a fieldName, contentType, fileName and an InputStream into a FileParamHolder.
The function that converts a fieldName, contentType, fileName and an InputStream into a FileParamHolder. By default, create an in-memory instance. Use OnDiskFileParamHolder to create an on-disk version
When a parameter is received either via POST or GET and does not have a corresponding mapping on the server, the function provided by this FactoryMaker will be called with the req and parameter name.
When a parameter is received either via POST or GET and does not have a corresponding mapping on the server, the function provided by this FactoryMaker will be called with the req and parameter name.
By default, if the parameter looks Lift-like (i.e., it starts with an F), then we log a warning with the given parameter name and URI.
A unified set of properties for managing how to treat HTML, XHTML, HTML5.
A unified set of properties for managing how to treat HTML, XHTML, HTML5. The default behavior is to return an OldHtmlPropteries instance, but you can change this to return an Html5Properties instance any you'll get HTML5 support. LiftRules.htmlProperties.default.set((r: Req) => new Html5Properties(r.userAgent))
Defines the resources that are protected by authentication and authorization.
Defines the resources that are protected by authentication and authorization. If this function is not defined for the input data, the resource is considered unprotected ergo no authentication is performed. If this function is defined and returns a Full box, it means that this resource is protected by authentication, and authenticated subjed must be assigned to the role returned by this function or to a role that is child-of this role. If this function returns Empty it means that this resource is protected by authentication but no authorization is performed meaning that roles are not verified.
Holds the JS library specific UI artifacts.
Holds the JS library specific UI artifacts. By default it uses JQuery's artifacts
The JavaScript to execute to log a message on the client side when liftAjax.
The JavaScript to execute to log a message on the client side when liftAjax.lift_logError is called.
If Empty no logging is performed The default when running in DevMode is to call lift_defaultLogError which will use JavaScript console if available or alert otherwise.
To always use alert set:
LiftRules.jsLogFunc = Full(v => JE.Call("alert",v).cmd)
The function that converts a scala.
The function that converts a scala.text.Document to a String (used for JsonAST.JValue to text convertion. By default, use Printer.pretty for dev mode and Printer.compact for other modes
How long should we wait for all the lazy snippets to render
The base name of the resource bundle of the lift core code
The polling interval for background Ajax requests to keep functions to not be garbage collected.
The polling interval for background Ajax requests to keep functions to not be garbage collected. This will be applied if the Ajax request will fail. Default value is set to 15 seconds.
The polling interval for background Ajax requests to prevent functions of being garbage collected.
The polling interval for background Ajax requests to prevent functions of being garbage collected. Default value is set to 75 seconds.
Get the partial function that defines if a request should be handled by the application (rather than the default container handler)
Allows user adding additional Lift tags (the tags must be prefixed by lift namespace such as <lift:xxxx/>).
Allows user adding additional Lift tags (the tags must be prefixed by lift namespace such as <lift:xxxx/>). Each LiftTagPF function will be called with the following parameters:
- Element label, - The Element itselft, - The attributes - The child nodes - The page name
Obtain the resource as an array of bytes by name
Obtain the resource as a String by name
Obtain the resource as an XML by name.
Obtain the resource as an XML by name. If you're using this to load a template, consider using the Template object instead.
Template
A function that takes the current HTTP request and returns the current
The function referenced here is called if there's a localization lookup failure
A function that defines how a String should be converted to XML for the localization stuff.
A function that defines how a String should be converted to XML for the localization stuff. By default, Text(s) is returned, but you can change this to attempt to parse the XML in the String and return the NodeSeq.
Controls whether or not the service handling timing messages (Service request (GET) .
Controls whether or not the service handling timing messages (Service request (GET) ... took ... Milliseconds) are logged. Defaults to true.
This variable controls whether RequestVars that have been set but not subsequently read will be logged in Dev mode.
This variable controls whether RequestVars that have been set but not subsequently read will be logged in Dev mode. Logging can be disabled at the per-RequestVar level via RequestVar.logUnreadVal
RequestVar#logUnreadVal
Put a test for being logged in into this function
A function that takes appropriate action in breaking out of any existing comet requests based on the request, browser type, etc.
The maximum concurrent requests.
The maximum concurrent requests. If this number of requests are being serviced for a given session, messages will be sent to all Comet requests to terminate
The maximum allowed size of a single file in a mime multi-part POST.
The maximum allowed size of a single file in a mime multi-part POST. Default 7MB
The maximum allowed size of a complete mime multi-part POST.
The maximum allowed size of a complete mime multi-part POST. Default 8MB
Returns any mimeHeaders for the currently invoked handleMimeFile.
The JsCmd to execute when the ajax session is lost.
The JsCmd to execute when the ajax session is lost. The ajax session is considered lost when either an ajax request comes in for a session that does not exist on the server.
By default, we invoke liftAjax.lift_sessionLost, which can be overridden client-side for more complex work. liftAjax.lift_sessionLost reloads the page by default.
The JsCmd to execute when the comet session is lost.
The JsCmd to execute when the comet session is lost. The comet session is considered lost when either (a) a comet request comes in for a session that does not exist on the server or (b) a comet request comes in for a session that has no associated comet actors (this typically happens when the server restarts).
By default, we invoke liftComet.lift_sessionLost, which can be overridden client-side for more complex work. liftComet.lift_sessionLost reloads the current page by default.
Set the default fadeout mechanism for Lift notices.
Set the default fadeout mechanism for Lift notices. Thus you provide a function that take a NoticeType.Value and decide the duration after which the fade out will start and the actual fadeout time. This is applicable for general notices (not associated with id-s) regardless if they are set for the page rendering, ajax response or Comet response.
Use this to apply various effects to the notices.
Use this to apply various effects to the notices. The user function receives the NoticeType and the id of the element containing the specific notice. Thus it is the function's responsibility to form the javascript code for the visual effects. This is applicable for both ajax and non ajax contexts. For notices associated with ID's the user type will receive an Empty notice type. That's because the effect is applied on the real estate holding the notices for this ID. Typically this contains a single message.
This function is called to convert the current set of Notices into a JsCmd that will be executed on the client to display the Notices.
This function is called to convert the current set of Notices into a JsCmd that will be executed on the client to display the Notices.
net.liftweb.builtin.snippet.Msgs
Holds user function hooks when the request is about to be processed It's legacy from when Lift was a lot more Rails-like.
Holds user function hooks when the request is about to be processed It's legacy from when Lift was a lot more Rails-like. It's called literally at the very beginning of the servicing of the HTTP request. The S scope is not available nor is the DB connection available in onBeginServicing. We recommend using earlyInStateful.
Holds user function hooks when the request was processed
By default, Http response headers are appended.
By default, Http response headers are appended. However, there are some headers that should only appear once (for example "expires"). This Vendor vends the list of header responses that can only appear once.
Should pages that are not found be passed along the request processing chain to the next handler outside Lift?
Runs responseTransformers
The global multipart progress listener: pBytesRead - The total number of bytes, which have been read so far.
The global multipart progress listener: 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, ...)
Set to false if you do not want ajax/comet requests that are not associated with a session to call their respective session loss handlers (set via LiftRules.
Set to false if you do not want ajax/comet requests that are not associated with a session to call their respective session loss handlers (set via LiftRules.noAjaxSessionCmd and LiftRules.noCometSessionCmd).
Returns the JavaScript that manages Ajax requests.
Renders that JavaScript that holds Comet identification information
Returns the JavaScript that manages Comet requests.
If the request times out (or returns a non-Response) you can intercept the response here and create your own response
Given the current location (based on the Req.
Given the current location (based on the Req.path.partPath), what are the resource bundles in the templates for the current page.
DefaultRoutines.resourceForCurrentLoc()
The base name of the resource bundle
The path to handle served resources
Holds the user's transformer functions allowing the user to modify a LiftResponse before sending it to client.
Implementation for snippetNamesToSearch that looks first in a package named by taking the current template path.
Implementation for snippetNamesToSearch that looks first in a package named by taking the current template path. For example, suppose the following is configured in Boot: LiftRules.snippetNamesToSearch.default.set(() => LiftRules.searchSnippetsWithRequestPath) LiftRules.addToPackages("com.mycompany.myapp") LiftRules.addToPackages("com.mycompany.mylib") The tag <lift:MySnippet> in template foo/bar/baz.html would search for the snippet in the following locations:
Returns the Ajax script as a JavaScript response
Returns the Comet script as a JavaScript response
A function that takes the HTTPSession and the contextPath as parameters and returns a LiftSession reference.
A function that takes the HTTPSession and the contextPath as parameters and returns a LiftSession reference. This can be used in cases subclassing LiftSession is necessary.
A method that returns a function to create migratory sessions.
A method that returns a function to create migratory sessions. If you want migratory sessions for your
application, LiftRules.sessionCreator = LiftRules.sessionCreatorForMigratorySessions
If you want to make the Lift inactivity timeout shorter than the container inactivity timeout, set the inactivity timeout here
Set the Ajax end JavaScript function.
Set the Ajax end JavaScript function. The Java-callable alternative to assigning the var ajaxEnd
Set the Ajax end JavaScript function.
Set the Ajax end JavaScript function. The Java-callable alternative to assigning the var ajaxStart
Sets the HTTPContext
Define the sitemap.
Set the sitemap to a function that will be run to generate the sitemap.
Set the sitemap to a function that will be run to generate the sitemap.
This allows for changing the SiteMap when in development mode and having
the function re-run for each request.
This is **NOT** a mechanism for dynamic SiteMap. This is a mechanism **ONLY** for allowing you to change the SiteMap during development. There will be significant performance penalties (serializing the service of requests... only one at a time) for changing the SiteMap.
Return the sitemap if set in Boot.
Return the sitemap if set in Boot. If the current runMode is development mode, the sitemap may be recomputed on each page load.
The default location to send people if SiteMap access control fails.
The default location to send people if SiteMap access control fails. The path is expressed a a List[String]
The dispatcher that takes a Snippet and converts it to a DispatchSnippet instance
Set a snippet failure handler here.
Set a snippet failure handler here. The class and method for the snippet are passed in
Function that generates variants on snippet names to search for, given the name from the template.
Function that generates variants on snippet names to search for, given the name from the template. The default implementation just returns name :: Nil (e.g. no change). The names are searched in order. See also searchSnippetsWithRequestPath for an implementation.
There may be times when you want to entirely control the templating process.
There may be times when you want to entirely control the templating process. You can insert a function that creates a white list of snippets. The white list is the exhaustive list of snippets. The snippets are class/method pairs. If the partial function is defined and the result is a Full Box, the function is run. If the Box is an EmptyBox, then the result is a snippet lookup failure. If the partial function is not defined, then the normal snippet resolution mechanism is used. Please note that in Scala a Map is PartialFunction and you can create Maps that have a default value using the withDefaultValue method.
Holds the user's snippet functions that will be executed by lift given a certain path.
Holds the user's rewrite functions that can alter the URI parts and query parameters.
Holds the user's rewrite functions that can alter the URI parts and query parameters.
This rewrite takes place within the scope of the S state so SessionVars and other session-related
information is available.
Note also that rewrites should not have side effects except
to memoize database query results. No side effects means that you should not change SessionVars
in a rewrite.
In general, rewrites should be considered low level access. Rather than using a rewrite to extract
parameters out of a URL, you'll be much better off using SiteMap generally and Menu.param and Menu.params
specifically for extracting parameters from URLs.
Holds user's DispatchPF functions that will be executed in a stateless context.
Holds user's DispatchPF functions that will be executed in a stateless context. This means that no session will be created and no JSESSIONID cookie will be presented to the user (unless the user has presented a JSESSIONID cookie).
This is the way to do stateless REST in Lift
Certain paths and requests within your application can be marked as stateless and if there is access to Lift's stateful facilities (setting SessionVars, updating function tables, etc.
Certain paths and requests within your application can be marked as stateless and if there is access to Lift's stateful facilities (setting SessionVars, updating function tables, etc.) the developer will receive a notice and the operation will not complete.
Holds the user's rewrite functions that can alter the URI parts and query parameters.
Holds the user's rewrite functions that can alter the URI parts and query parameters. This rewrite
is performed very early in the HTTP request cycle and may not include any state. This rewrite is meant
to rewrite requests for statelessDispatch.
Note also that rewrites should not have side effects except
to memoize database query results. No side effects means that you should not change SessionVars
in a rewrite.
If you want the standard (non-AJAX) request timeout to be something other than 10 seconds, put the value here
Should comments be stripped from the served XHTML
Determines the path parts and suffix from given path parts
Compute the headers to be sent to the browser in addition to anything else that's sent
Ever wanted to match on *any* arbitrary tag in your HTML and process it any way you wanted? Well, here's your chance, dude.
Ever wanted to match on *any* arbitrary tag in your HTML and process it any way you wanted? Well, here's your chance, dude. You can capture any tag and do anything you want with it.
Note that this set of PartialFunctions is run for **EVERY** node in the DOM so make sure it runs *FAST*.
Also, no subsequent processing of the returned NodeSeq is done (no LiftSession.processSurroundAndInclude()) so evaluate everything you want to.
But do avoid infinite loops, so make sure the PartialFunction actually returns true *only* when you're going to return a modified node.
An example might be:
case ("script", e, session) if e.getAttribute("data-serverscript").isDefined => ...
The list of suffixes that Lift looks for in templates.
The list of suffixes that Lift looks for in templates. By default, html, xhtml, and htm
A function that converts the current Request into an AsyncProvider.
Should an exception be thrown on out of scope Session and RequestVar access.
Should an exception be thrown on out of scope Session and RequestVar access. By default, no.
A function that takes the current HTTP request and returns the current
Hooks to be run when LiftServlet.
Hooks to be run when LiftServlet.destroy is called.
If Lift garbage collection is enabled, functions that are not seen in the page for this period of time (given in milliseconds) will be discarded, hence eligible for garbage collection.
If Lift garbage collection is enabled, functions that are not seen in the page for this period of time (given in milliseconds) will be discarded, hence eligible for garbage collection. The default value is 10 minutes.
The list of partial function for defining the behavior of what happens when URI is invalid and you're not using a site map
Use this PartialFunction to to automatically add static URL parameters to any URL reference from the markup of Ajax request.
If you don't want lift to send the application/xhtml+xml mime type to those browsers that understand it, then set this to { @code false }
Given a type manifest, vend a form
Given a type manifest, vend a form
Change this variable to set view dispatching
Define the XHTML validator
LiftRules is the global object that holds all of Lift's configuration.