Show Menu
Cheatography

DFN Code Templates Cheat Sheet (DRAFT) by

Shortcuts and explanation for Code Templates

This is a draft cheat sheet. It is a work in progress and is not finished yet.

JSP Form

dfnfi : Form Input with label and error tooltip
dfnfta : Form Textarea with label and error tooltip
dfnfs : Form Select with label and error tooltip
dfntts : Defines tooltips script
dfncb : Form checkbox spring tag
dfncbs : Form checkboxes spring tag
dfnfr : Form radio buttons spring tag

Base Controller

dfnpde – Defines editor for Date type conversion
dfnpe – Defines editor for type conversion
dfnple – Defines editor for List type conversion
dfnpsn – Defines editor for empty string to null

File Templates

DFN Entity
DFN Search Model
DFN DAO
DFN Service
DFN Validator
DFN Controller
DFN Form Page
DFN Search Page
DFN Cron Job
DFN Custom Tag
 

JSP Search

dfndc : Display Column Tag
dfnsi : Search input filter with label
dfnss : Search select menu filter with label

JavaScript

dfnjr : Jquery ready function

Validator

dfnves – Validates empty string
dfnvnn – Validates field not null

Entity

dfncu – Generates audituble fields, setter, getter
dfnmtm – Declare a many to many relation
dfnmto – Declares a many to one relation

DAO

dfnpne – Put not empty field to search criteria
dfnpnn – Put not null field to search criteria
dfnpo – Defines Property Order for sorting
 

Java

dfncnn – Checks if the collection is not empty
iter – iterates Iterable
inn – Inserts “if not null” statement
ifn – Inserts “if null” statement
lazy – Performs lazy initia­liz­ation
fori – creates iteration loop
itar – iterates elements of array
itco – iterates elements of java.u­til.Co­lle­ction
itit – iterates java.u­til.It­erator
itli – iterates elements of java.u­til.List
dfnld – Performs logging with debug message
dfnli – Performs logging with info message
dfnlj – Declares logger in the class

Search Model

dfnsfl – Declares search field of type long
dfnsfs – Declares search field of type string

SQL

dfnct – Create New Table with auditable fields
dfnip – Inserts permis­sions for security

Surround With

DFNCIF – Surround with c:if tags
DFNST – Surround with spring security tags