object Loc
The Loc companion object, complete with a nice constructor
- Alphabetic
- By Inheritance
- Loc
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
AnyLocParam = LocParam[Any]
A type alias for LocParam instances that are applicable to any Loc
-
case class
CalcParamStateless
[-T](f: (Box[T]) ⇒ Boolean) extends LocParam[T] with Product with Serializable
A function that calculates the statelessness of the Loc for the given request with the parameterized type passed into the function
-
case class
CalcStateless
(f: () ⇒ Boolean) extends AnyLocParam with Product with Serializable
A function that calculates the statelessness of the Loc for the given request
-
case class
CalcValue
[T](func: () ⇒ Box[T]) extends LocParam[T] with Product with Serializable
Calculate the value for the Loc.
Calculate the value for the Loc. This is useful for parameterized menus. It allows you to calculate the value of the Loc.
- case class DataLoc [T](name: String, link: Link[T], text: LinkText[T], defaultValue: Box[T], xparams: LocParam[T]*) extends Loc[T] with Product with Serializable
-
trait
DispatchLocSnippets
extends LocSnippets
A subclass of LocSnippets with a built in dispatch method (no need to implement isDefinedAt or apply...
A subclass of LocSnippets with a built in dispatch method (no need to implement isDefinedAt or apply... just def dispatch: PartialFunction[String, NodeSeq => NodeSeq].
- See also
ValueSnippets.apply
ValueSnippets
-
case class
EarlyResponse
(func: () ⇒ Box[LiftResponse]) extends AnyLocParam with Product with Serializable
Allows you to generate an early response for the location rather than going through the whole Lift XHTML rendering pipeline
- type FailMsg = () ⇒ LiftResponse
-
case class
HttpAuthProtected
(role: (Req) ⇒ Box[Role]) extends AnyLocParam with Product with Serializable
Indicates that the path denominated by Loc requires HTTP authentication and only a user assigned to this role or to a role that is child-of this role can access it.
-
case class
If
(test: () ⇒ Boolean, failMsg: FailMsg) extends AnyLocParam with Product with Serializable
If the test returns True, the page can be accessed, otherwise, the result of FailMsg will be sent as a response to the browser.
If the test returns True, the page can be accessed, otherwise, the result of FailMsg will be sent as a response to the browser. If the Loc cannot be accessed, it will not be displayed in menus.
- test
-- the function that tests access to the page
- failMsg
-- what to return the the browser (e.g., 304, etc.) if the page is accessed.
- case class IfValue [T](test: (Box[T]) ⇒ Boolean, failMsg: FailMsg) extends LocParam[T] with Product with Serializable
-
class
Link
[-T] extends PartialFunction[Req, Box[Boolean]]
This defines the Link to the Loc.
-
case class
LinkText
[-T](text: (T) ⇒ NodeSeq) extends Product with Serializable
A function that can be used to calculate the link text from the current value encapsulated by the Loc.
-
case class
LocGroup
(group: String*) extends AnyLocParam with Product with Serializable
If the Loc is in a group (or groups) like "legal" "community" etc.
If the Loc is in a group (or groups) like "legal" "community" etc. the groups can be specified and recalled at the top level
-
trait
LocInfo
[X] extends AnyLocParam
An extension point for adding arbitrary lazy values to a Loc.
-
trait
LocParam
[-T] extends AnyRef
Algebraic data type for parameters that modify handling of a Loc in a SiteMap
-
case class
LocQueryParameters
[T](f: (Box[T]) ⇒ List[(String, String)]) extends LocParam[T] with Product with Serializable
Calculate additional query parameters to add as a query string to the Loc
-
trait
LocSnippets
extends PartialFunction[String, (NodeSeq) ⇒ NodeSeq] with ValueSnippets[Any] with AnyLocParam
Allows you to create a handler for many snippets that are associated with a Loc, but agnostic to the
Loc
's value.Allows you to create a handler for many snippets that are associated with a Loc, but agnostic to the
Loc
's value.- See also
ValueSnippets.apply
ValueSnippets
-
case class
MenuCssClass
(cssClass: StringFunc) extends AnyLocParam with Product with Serializable
MenuCssClass is used to add css to the Menu node.
MenuCssClass is used to add css to the Menu node. The css allows for replacing menu with an icon and other super-fun and helpful things. cssClass is a StringFunc which can either be a String constant or a Function that returns a String. Thus, you can compute the css based on the current state or you can have a constant. Syntactically you can use either:
MenuCssClass("foobar") MenuCssClass(() => calculateCssForMyMenuItem())
-
case class
QueryParameters
(f: () ⇒ List[(String, String)]) extends AnyLocParam with Product with Serializable
Calculate additional query parameters to add as a query string to the Loc
-
class
Snippet
extends ValueSnippets[Any] with AnyLocParam
A single snippet that's associated with a
Loc
, but is not directly aware of theLoc
value.A single snippet that's associated with a
Loc
, but is not directly aware of theLoc
value.- See also
ValueSnippets
-
case class
Template
(template: () ⇒ NodeSeq) extends AnyLocParam with Product with Serializable
Allows a user to specify a template based upon a function from the current value encapsulated in the Loc
-
case class
TemplateBox
(template: () ⇒ Box[NodeSeq]) extends AnyLocParam with Product with Serializable
Allows a user to specify a template based upon a function from the current value encapsulated in the Loc.
Allows a user to specify a template based upon a function from the current value encapsulated in the Loc. Allow the return of Box[NodeSeq] so that it's more friendly to Templates.
-
case class
Test
(test: (Req) ⇒ Boolean) extends AnyLocParam with Product with Serializable
Tests to see if the request actually matches the requirements for access to the page.
Tests to see if the request actually matches the requirements for access to the page. For example, if a parameter is missing from the request, this is a good way to restrict access to the page.
-
case class
TestAccess
(func: () ⇒ Box[LiftResponse]) extends AnyLocParam with Product with Serializable
Allows extra access testing for a given menu location such that you can generically return a response during access control testing
- case class TestValueAccess [T](func: (Box[T]) ⇒ Box[LiftResponse]) extends LocParam[T] with Product with Serializable
-
case class
Title
[T](title: (T) ⇒ NodeSeq) extends LocParam[T] with Product with Serializable
This LocParam may be used to specify a function that calculates a title for the page based upon the current value encapsulated by this Loc.
-
case class
Unless
(test: () ⇒ Boolean, failMsg: FailMsg) extends AnyLocParam with Product with Serializable
Unless the test returns True, the page can be accessed, otherwise, the result of FailMsg will be sent as a response to the browser.
Unless the test returns True, the page can be accessed, otherwise, the result of FailMsg will be sent as a response to the browser. If the Loc cannot be accessed, it will not be displayed in menus.
- test
-- the function that tests access to the page
- failMsg
-- what to return the the browser (e.g., 304, etc.) if the page is accessed.
- case class UnlessValue [T](test: (Box[T]) ⇒ Boolean, failMsg: FailMsg) extends LocParam[T] with Product with Serializable
-
case class
UseParentParams
() extends AnyLocParam with Product with Serializable
If this is a submenu, use the parent Loc's params
-
trait
UserLocParam
[-T] extends LocParam[T]
Extension point for user-defined LocParam instances.
-
case class
Value
[T](value: T) extends LocParam[T] with Product with Serializable
The value of Loc
-
trait
ValueSnippets
[A] extends LocParam[A]
The common interface for
LocParam
s that provide snippet functions, which can be aware of theLoc
value.The common interface for
LocParam
s that provide snippet functions, which can be aware of theLoc
value.- A
The type with which the
Loc
is parameterized.
- case class ValueTemplate [T](template: (Box[T]) ⇒ NodeSeq) extends LocParam[T] with Product with Serializable
- case class ValueTemplateBox [T](template: (Box[T]) ⇒ Box[NodeSeq]) extends LocParam[T] with Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(name: String, link: Link[Unit], text: LinkText[Unit], params: List[LocParam[Unit]]): Loc[Unit]
-
def
apply(name: String, link: Link[Unit], text: LinkText[Unit], params: LocParam[Unit]*): Loc[Unit]
Create a Loc (Location) instance
Create a Loc (Location) instance
- name
-- the name of the location. This must be unique across your entire sitemap. It's used to look up a menu item in order to create a link to the menu on a page.
- link
-- the Link to the page
- text
-- the text to display when the link is displayed
- params
-- access test, title calculation, etc.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- implicit def redirectToFailMsg(in: ⇒ RedirectResponse): FailMsg
- implicit def strFuncToFailMsg(in: () ⇒ String): FailMsg
- implicit def strToFailMsg(in: ⇒ String): FailMsg
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object ExtLink
-
object
Hidden
extends AnyLocParam with Product with Serializable
If this parameter is included, the item will not be visible in the menu, but will still be accessable.
-
object
HideIfNoKids
extends AnyLocParam with Product with Serializable
If the Loc has no children, hide the Loc itself
- object Link
-
object
LinkText
extends Serializable
The companion object to LinkText that contains some helpful implicit conversion
-
object
MatchWithoutCurrentValue
extends AnyLocParam with Product with Serializable
If this parameter is included, the Loc will continue to execute even if currentValue is not defined.
If this parameter is included, the Loc will continue to execute even if currentValue is not defined.
By default, Lift will determine that a Loc does not match a given request if its currentValue comes up Empty, and as a result will return an HTTP 404. For situations where this is not the desired, "Not Found" behavior, you can add the MatchWithoutCurrentValue LocParam to a Loc, then use the IfValue LocParam to define what should happen when the currentValue is Empty.
For example, given some class Thing, you could do the following to trigger a redirect when a Thing with a particular ID isn't found.
Menu.param[Thing]("Thing", "Thing", Thing.find(_), _.id) >> MatchWithoutCurrentValue >> IfValue(_.isDefined, () => RedirectResponse("/page/to/redirect/to"))
-
object
PlaceHolder
extends AnyLocParam with Product with Serializable
The Loc does not represent a menu itself, but is the parent menu for children (implies HideIfNoKids)
- object Snippet
-
object
Stateless
extends AnyLocParam with Product with Serializable
Is the Loc a stateless Loc...
Is the Loc a stateless Loc... it will be served in stateless mode
- object ValueSnippets