Trait

net.liftweb.proto

Crudify

Related Doc: package proto

Permalink

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
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Crudify
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait CrudBridge extends AnyRef

    Permalink

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

    This trait represents a Bridge between TheCrudType and the Crudify trait. It's not necessary to mix this trait into TheCrudType, but instead provide a mechanism for promoting a TheCrudType to CrudBridge

    Attributes
    protected
  2. trait FieldPointerBridge extends AnyRef

    Permalink
    Attributes
    protected
  3. abstract type FieldPointerType

    Permalink

    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

    Permalink

    The type of records we're manipulating

Abstract Value Members

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

    Permalink

    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

    Permalink

    Based on a FieldPointer, build a FieldPointerBridge

    Based on a FieldPointer, build a FieldPointerBridge

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

    Permalink

    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]

    Permalink

    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

    Permalink

    Vend a new instance of TheCrudType

  6. abstract def fieldsForDisplay: List[FieldPointerType]

    Permalink

    When displaying a record, what fields do we display

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

    Permalink

    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]

    Permalink

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

Concrete 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. lazy val CreateItem: String

    Permalink
  5. lazy val DeleteItem: String

    Permalink
  6. lazy val EditItem: String

    Permalink
  7. lazy val ListItems: String

    Permalink
  8. lazy val Prefix: List[String]

    Permalink
  9. lazy val ViewItem: String

    Permalink
  10. def _createTemplate: Elem

    Permalink

    The core template for creating.

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

  11. def _deleteTemplate: Elem

    Permalink

    The core template for deleting.

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

  12. def _editTemplate: Elem

    Permalink

    The core template for editing.

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

    Attributes
    protected
  13. def _showAllTemplate: Elem

    Permalink

    The core template for showing record.

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

  14. def _viewTemplate: Elem

    Permalink

    The core template for viewing.

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

  15. def addlMenuLocParams: List[AnyLocParam]

    Permalink

    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)

    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
  16. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  17. def calcCreateItem: String

    Permalink
  18. def calcDeleteItem: String

    Permalink
  19. def calcEditItem: String

    Permalink
  20. def calcListItems: String

    Permalink
  21. def calcViewItem: String

    Permalink
  22. def clone(): AnyRef

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

    Permalink
  24. def createClass: String

    Permalink
  25. def createId: String

    Permalink
  26. def createMenuLoc: Box[Menu]

    Permalink

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

  27. def createMenuLocParams: List[AnyLocParam]

    Permalink

    Override to include new Params for the create menu

  28. def createMenuName: String

    Permalink
  29. lazy val createPath: List[String]

    Permalink
  30. lazy val createPathString: String

    Permalink
  31. def createTemplate(): NodeSeq

    Permalink

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

  32. def crudAllNext(first: Long, list: List[TheCrudType]): (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to change how the next link is generated

    Override this method to change how the next link is generated

    Attributes
    protected
  33. def crudAllPrev(first: Long): (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to change how the previous link is generated

    Override this method to change how the previous link is generated

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

    Permalink
  35. def crudyDelete(item: TheCrudType): (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to change how the delete screen is built

    Override this method to change how the delete screen is built

    Attributes
    protected
  36. def deleteButton: String

    Permalink
  37. def deleteClass: String

    Permalink
  38. def deleteId: String

    Permalink
  39. def deleteMenuLoc: Box[Menu]

    Permalink

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

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

    Permalink

    Override to include new Params for the delete menu

  41. def deleteMenuName: String

    Permalink
  42. lazy val deletePath: List[String]

    Permalink
  43. lazy val deletePathString: String

    Permalink
  44. def deleteTemplate(): NodeSeq

    Permalink

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

  45. def displayHtml: NodeSeq

    Permalink
  46. def displayName: String

    Permalink
  47. def displayRecord(entry: TheCrudType): (NodeSeq) ⇒ NodeSeq

    Permalink

    Customize the display of records for view menu loc

    Customize the display of records for view menu loc

    Attributes
    protected
  48. def doCrudAll: (NodeSeq) ⇒ NodeSeq

    Permalink

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

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

    Attributes
    protected
  49. def doCrudAllHeaderItems: (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to customize how header items are treated

    Override this method to customize how header items are treated

    Attributes
    protected
  50. def doCrudAllRowItem(c: TheCrudType): (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to customize how a crudAll line is generated

    Override this method to customize how a crudAll line is generated

    Attributes
    protected
  51. def doCrudAllRows(list: List[TheCrudType]): (NodeSeq) ⇒ NodeSeq

    Permalink

    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
  52. def doDeleteFields(item: TheCrudType): (NodeSeq) ⇒ NodeSeq

    Permalink

    Override this method to change how fields are displayed for delete

    Override this method to change how fields are displayed for delete

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

    Permalink

    Override this method to change the behavior of deleting an item

    Override this method to change the behavior of deleting an item

    Attributes
    protected
  54. def doDisplayRecordRow(entry: TheCrudType): (NodeSeq) ⇒ NodeSeq

    Permalink

    Customize the display of a row for displayRecord

    Customize the display of a row for displayRecord

    Attributes
    protected
  55. def editButton: String

    Permalink
  56. def editClass: String

    Permalink
  57. def editErrorClass: String

    Permalink
  58. def editId: String

    Permalink
  59. def editMenuLoc: Box[Menu]

    Permalink

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

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

    Permalink

    Override to include new Params for the edit menu

  61. def editMenuName: String

    Permalink

    The String displayed for menu editing

  62. lazy val editPath: List[String]

    Permalink
  63. lazy val editPathString: String

    Permalink
  64. def editTemplate(): NodeSeq

    Permalink

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

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

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

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

    Permalink

    The list of fields to present on a form form editing

  68. def fieldsForList: List[FieldPointerType]

    Permalink

    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.

  69. def finalize(): Unit

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

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

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

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

    Permalink
  74. lazy val listPathString: String

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

    Permalink
  76. def menus: List[Menu]

    Permalink
  77. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  78. def nextWord: String

    Permalink
  79. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  81. def obscurePrimaryKey(in: String): String

    Permalink

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

  82. def obscurePrimaryKey(in: TheCrudType): String

    Permalink

    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.

  83. def pageWrapper(body: NodeSeq): NodeSeq

    Permalink
  84. def previousWord: String

    Permalink
  85. def referer: String

    Permalink
  86. def rowsPerPage: Int

    Permalink

    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
  87. def showAllClass: String

    Permalink
  88. def showAllId: String

    Permalink
  89. def showAllMenuLoc: Box[Menu]

    Permalink

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

  90. def showAllMenuLocParams: List[AnyLocParam]

    Permalink

    Override to include new Params for the show all menu

  91. def showAllMenuName: String

    Permalink
  92. def showAllTemplate(): NodeSeq

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  94. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  95. def viewClass: String

    Permalink
  96. def viewId: String

    Permalink
  97. def viewMenuLoc: Box[Menu]

    Permalink

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

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

    Permalink

    Override to include new Params for the view menu

  99. def viewMenuName: String

    Permalink
  100. lazy val viewPath: List[String]

    Permalink
  101. lazy val viewPathString: String

    Permalink
  102. def viewTemplate(): NodeSeq

    Permalink

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

  103. final def wait(): Unit

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

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

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

    Permalink

    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