net.liftweb.proto

Crudify

trait Crudify extends AnyRef

This trait automatically adds CRUD (Create, read, update and delete) operations to an existing persistence mechanism. Various methods can be overridden to customize which operations are available to a user and how things are displayed. For example, you can disable deletion of entities by overriding deleteMenuLoc to Empty.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Crudify
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait CrudBridge extends AnyRef

    This trait represents a Bridge between TheCrudType and the Crudify trait.

  2. trait FieldPointerBridge extends AnyRef

    Attributes
    protected
  3. abstract type FieldPointerType

    A generic representation of a field.

    A generic representation of a field. For example, this represents the abstract "name" field and is used along with an instance of TheCrudType to compute the BaseField that is the "name" field on the specific instance of TheCrudType

  4. abstract type TheCrudType

    The type of records we're manipulating

Abstract Value Members

  1. implicit abstract def buildBridge(from: TheCrudType): CrudBridge

    This method will instantiate a bridge from TheCrudType so that the appropriate logical operations can be performed on TheCrudType

    This method will instantiate a bridge from TheCrudType so that the appropriate logical operations can be performed on TheCrudType

    Attributes
    protected
  2. implicit abstract def buildFieldBridge(from: FieldPointerType): FieldPointerBridge

    Based on a FieldPointer, build a FieldPointerBridge

    Based on a FieldPointer, build a FieldPointerBridge

    Attributes
    protected
  3. abstract def calcPrefix: List[String]

    What's the prefix for this CRUD.

    What's the prefix for this CRUD. Typically the table name.

  4. abstract def computeFieldFromPointer(instance: TheCrudType, pointer: FieldPointerType): Box[BaseField]

    Given an instance of TheCrudType and FieldPointerType, convert that to an actual instance of a BaseField on the instance of TheCrudType

    Given an instance of TheCrudType and FieldPointerType, convert that to an actual instance of a BaseField on the instance of TheCrudType

    Attributes
    protected
  5. abstract def create: TheCrudType

    Vend a new instance of TheCrudType

  6. abstract def fieldsForDisplay: List[FieldPointerType]

    When displaying a record, what fields do we display

  7. abstract def findForList(start: Long, count: Int): List[TheCrudType]

    Given a range, find the records.

    Given a range, find the records. Your implementation of this method should enforce ordering (e.g., on primary key).

  8. abstract def findForParam(in: String): Box[TheCrudType]

    Given a String that represents the primary key, find an instance of TheCrudType

Concrete Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. lazy val CreateItem: String

  7. lazy val DeleteItem: String

  8. lazy val EditItem: String

  9. lazy val ListItems: String

  10. lazy val Prefix: List[String]

  11. lazy val ViewItem: String

  12. def _createTemplate: Elem

    The core template for creating.

    The core template for creating. Does not include any page wrapping.

  13. def _deleteTemplate: Elem

    The core template for deleting.

    The core template for deleting. Does not include any page wrapping.

  14. def _editTemplate: Elem

    The core template for editing.

    The core template for editing. Does not include any page wrapping.

    Attributes
    protected
  15. def _showAllTemplate: Elem

    The core template for showing record.

    The core template for showing record. Does not include any page wrapping

  16. def _viewTemplate: Elem

    The core template for viewing.

    The core template for viewing. Does not include any page wrapping.

  17. def addlMenuLocParams: List[AnyLocParam]

    If there are any Loc.

    If there are any Loc.LocParams that need to be added to every menu (e.g., a guard for access control of the Crudify screens)

    Attributes
    protected
  18. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  19. def calcCreateItem: String

  20. def calcDeleteItem: String

  21. def calcEditItem: String

  22. def calcListItems: String

  23. def calcViewItem: String

  24. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def createButton: String

  26. def createClass: String

  27. def createId: String

  28. def createMenuLoc: Box[Menu]

    The menu item for creating items (make this "Empty" to disable)

  29. def createMenuLocParams: List[AnyLocParam]

    Override to include new Params for the create menu

  30. def createMenuName: String

  31. lazy val createPath: List[String]

  32. lazy val createPathString: String

  33. def createTemplate(): NodeSeq

    This is the template that's used to render the page after the optional wrapping of the template in the page wrapper.

  34. def crudAllNext(first: Long, list: List[TheCrudType])(in: NodeSeq): Node with Serializable { def child: Seq[scala.xml.Node] }

    Override this method to change how the next link is generated

    Override this method to change how the next link is generated

    Attributes
    protected
  35. def crudAllPrev(first: Long)(in: NodeSeq): Node with Serializable { def child: Seq[scala.xml.Node] }

    Override this method to change how the previous link is generated

    Override this method to change how the previous link is generated

    Attributes
    protected
  36. def crudDoForm(item: TheCrudType, noticeMsg: String)(in: NodeSeq): NodeSeq

  37. def crudyDelete(item: TheCrudType)(html: NodeSeq): NodeSeq

    Override this method to change how the delete screen is built

    Override this method to change how the delete screen is built

    Attributes
    protected
  38. def deleteButton: String

  39. def deleteClass: String

  40. def deleteId: String

  41. def deleteMenuLoc: Box[Menu]

    The menu item for deleting an item (make this "Empty" to disable)

  42. def deleteMenuLocParams: List[LocParam[TheCrudType]]

    Override to include new Params for the delete menu

  43. def deleteMenuName: String

  44. lazy val deletePath: List[String]

  45. lazy val deletePathString: String

  46. def deleteTemplate(): NodeSeq

    This is the template that's used to render the page after the optional wrapping of the template in the page wrapper

  47. def displayHtml: NodeSeq

  48. def displayName: String

  49. def displayRecord(entry: TheCrudType)(in: NodeSeq): NodeSeq

    Customize the display of records for view menu loc

    Customize the display of records for view menu loc

    Attributes
    protected
  50. def doCrudAll(in: NodeSeq): NodeSeq

    Override this method if you want to change the behavior of displaying records via the crud.

    Override this method if you want to change the behavior of displaying records via the crud.all snippet

    Attributes
    protected
  51. def doCrudAllHeaderItems(in: NodeSeq): NodeSeq

    Override this method to customize how header items are treated

    Override this method to customize how header items are treated

    Attributes
    protected
  52. def doCrudAllRowItem(c: TheCrudType)(in: NodeSeq): NodeSeq

    Override this method to customize how a crudAll line is generated

    Override this method to customize how a crudAll line is generated

    Attributes
    protected
  53. def doCrudAllRows(list: List[TheCrudType])(in: NodeSeq): NodeSeq

    Override this method to determine how all the rows on a crud page are displayed

    Override this method to determine how all the rows on a crud page are displayed

    Attributes
    protected
  54. def doDeleteFields(item: TheCrudType)(html: NodeSeq): NodeSeq

    Override this method to change how fields are displayed for delete

    Override this method to change how fields are displayed for delete

    Attributes
    protected
  55. def doDeleteSubmit(item: TheCrudType, from: String)(): Nothing

    Override this method to change the behavior of deleting an item

    Override this method to change the behavior of deleting an item

    Attributes
    protected
  56. def doDisplayRecordRow(entry: TheCrudType)(in: NodeSeq): NodeSeq

    Customize the display of a row for displayRecord

    Customize the display of a row for displayRecord

    Attributes
    protected
  57. def editButton: String

  58. def editClass: String

  59. def editErrorClass: String

  60. def editId: String

  61. def editMenuLoc: Box[Menu]

    The menu item for editing an item (make this "Empty" to disable)

  62. def editMenuLocParams: List[LocParam[TheCrudType]]

    Override to include new Params for the edit menu

  63. def editMenuName: String

    The String displayed for menu editing

  64. lazy val editPath: List[String]

  65. lazy val editPathString: String

  66. def editTemplate(): NodeSeq

    This is the template that's used to render the page after the optional wrapping of the template in the page wrapper

  67. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  69. def fieldsForEditing: List[FieldPointerType]

    The list of fields to present on a form form editing

  70. def fieldsForList: List[FieldPointerType]

    The fields displayed on the list page.

    The fields displayed on the list page. By default all the displayed fields, but this list can be shortened.

  71. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  72. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  74. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  75. lazy val listPath: List[String]

  76. lazy val listPathString: String

  77. lazy val locSnippets: DispatchLocSnippets { val dispatch: PartialFunction[String,scala.xml.NodeSeq => scala.xml.NodeSeq] }

  78. def menus: List[Menu]

  79. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  80. def nextWord: String

  81. final def notify(): Unit

    Definition Classes
    AnyRef
  82. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  83. def obscurePrimaryKey(in: String): String

    This method can be used to obscure the primary key.

    This method can be used to obscure the primary key. This is more secure because end users will not have access to the primary key. This method actually does the obfuscation. You can use Mapper's KeyObfuscator class to implement a nice implementation of this method for session-by-session obfuscation.

    By default, there's no obfuscation. Note that if you obfuscate the primary key, you need to update the findForParam method to accept the obfuscated keys (and translate them back.)

  84. def obscurePrimaryKey(in: TheCrudType): String

    This method can be used to obscure the primary key.

    This method can be used to obscure the primary key. This is more secure because end users will not have access to the primary key.

  85. def pageWrapper(body: NodeSeq): NodeSeq

  86. def previousWord: String

  87. def referer: String

  88. def rowsPerPage: Int

    This method defines how many rows are displayed per page.

    This method defines how many rows are displayed per page. By default, it's hard coded at 20, but you can make it session specific or change the default by overriding this method.

    Attributes
    protected
  89. def showAllClass: String

  90. def showAllId: String

  91. def showAllMenuLoc: Box[Menu]

    The menu item for listing items (make this "Empty" to disable)

  92. def showAllMenuLocParams: List[AnyLocParam]

    Override to include new Params for the show all menu

  93. def showAllMenuName: String

  94. def showAllTemplate(): NodeSeq

    This is the template that's used to render the page after the optional wrapping of the template in the page wrapper

  95. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  96. def toString(): String

    Definition Classes
    AnyRef → Any
  97. def viewClass: String

  98. def viewId: String

  99. def viewMenuLoc: Box[Menu]

    The menu item for viewing an item (make this "Empty" to disable)

  100. def viewMenuLocParams: List[LocParam[TheCrudType]]

    Override to include new Params for the view menu

  101. def viewMenuName: String

  102. lazy val viewPath: List[String]

  103. lazy val viewPathString: String

  104. def viewTemplate(): NodeSeq

    This is the template that's used to render the page after the optional wrapping of the template in the page wrapper

  105. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. def wrapNameInRequired(fieldName: NodeSeq, required: Boolean): NodeSeq

    As the field names are being displayed for editing, this method is called with the XHTML that will be displayed as the field name and a flag indicating whether the field is required.

    As the field names are being displayed for editing, this method is called with the XHTML that will be displayed as the field name and a flag indicating whether the field is required. You can wrap the fieldName in a span with a css class indicating that the field is required or otherwise do something to update the field name indicating to the user that the field is required. By default the method wraps the fieldName in a span with the class attribute set to "required_field".

Inherited from AnyRef

Inherited from Any

Ungrouped