Permalink
Browse files

added gsp, groovy and grails snnipets

  • Loading branch information...
1 parent 09ce0f3 commit c38bd63a35625f43b250f28421020c5e6f077b3e @victorhg victorhg committed Feb 11, 2011
View
1 grails/bt.snippet
@@ -0,0 +1 @@
+static belongsTo = [${1:varName:} ${2:DomainName}]
View
3 grails/crit.snippet
@@ -0,0 +1,3 @@
+def ${1:varName} = ${2:domainName}.withCriteria {
+ ${3}
+}
View
1 grails/fall.snippet
@@ -0,0 +1 @@
+${1:domainName}.findAll${2:Attribute}(${3:value})${4}
View
1 grails/find.snippet
@@ -0,0 +1 @@
+${1:domainName}.findBy${2:Attribute}(${3:value})${4}
View
1 grails/hm.snippet
@@ -0,0 +1 @@
+static hasMany = [${1:listName}: ${2:DomainName}]
View
1 grails/ho.snippet
@@ -0,0 +1 @@
+static hasOne = [${1:attrName:} ${2:DomainName}]
View
3 grails/mconfig.snippet
@@ -0,0 +1,3 @@
+mockConfig """
+ ${1}
+"""
View
1 grails/mdomain.snippet
@@ -0,0 +1 @@
+mockDomain(${1:DomainClass},[${2:objList}])${3}
View
1 grails/mp.snippet
@@ -0,0 +1 @@
+mockParams.${1:varName} = '${2:value}'${3}
View
4 grails/mserv.snippet
@@ -0,0 +1,4 @@
+def service = mockForm(${1:serviceName})
+service.demand.${2:methodName}(1..${3:1}) { ${4:params ->}
+ ${5}
+}
View
1 grails/red.snippet
@@ -0,0 +1 @@
+redirect controller:${1:controllerName}, action:${2:actionName} params:[${3:params}]
View
1 grails/render.snippet
@@ -0,0 +1 @@
+render view:"${1:viewName}", model:[${2:modelMap}]
View
4 grails/tag.snippet
@@ -0,0 +1,4 @@
+def ${1:tagName} = { attr, body ->
+ out << ${2}
+
+}
View
3 grails/test.snippet
@@ -0,0 +1,3 @@
+public void test${1:Name}() {
+ ${2}
+}
View
3 groovy/class.snippet
@@ -0,0 +1,3 @@
+class ${1:className} {
+ ${2}
+}
View
3 groovy/cls.snippet
@@ -0,0 +1,3 @@
+def ${1:closureName} = { ${2: param ->}
+ ${3}
+}
View
3 groovy/each.snippet
@@ -0,0 +1,3 @@
+${1:listName}.each { ${2: varName ->}
+ ${3}
+}
View
3 groovy/if.snippet
@@ -0,0 +1,3 @@
+if( ${1:exp} ) {
+ ${2}
+}
View
3 gsp/geach.snippet
@@ -0,0 +1,3 @@
+<g:each in="${1:list}" var="${2:varName}">
+ ${3}
+</g:each>
View
3 gsp/gform.snippet
@@ -0,0 +1,3 @@
+ <g:form action="${1:actionName}" method="${2:post}" >
+ ${3}
+</g:form>
View
4 gsp/gherr.snippet
@@ -0,0 +1,4 @@
+<g:hasErrors bean="${1:modelName}">
+ ${2}
+</g:hasErrors>
+
View
3 gsp/gif.snippet
@@ -0,0 +1,3 @@
+<g:if test="${1:condition}">
+ ${2}
+</g:if>
View
1 gsp/ginput.snippet
@@ -0,0 +1 @@
+<g:textField name="${1:fieldName}" value="${2:value}" />
View
1 gsp/gjs.snippet
@@ -0,0 +1 @@
+<g:javascript ${1:src/library}="${2:jsName}" />
View
3 gsp/glink.snippet
@@ -0,0 +1,3 @@
+<g:link controller="${1:controller}" action="${2:action}" id="${3:id}">
+ ${4}
+</g:link>
View
1 gsp/gsel.snippet
@@ -0,0 +1 @@
+<g:select name="${1:name}" from="${2:list}" value="${3:value}" />${4}
View
1 gsp/gsubmit.snippet
@@ -0,0 +1 @@
+<g:submitButton name="${1:name}" value="${2:value}" />${5}
View
1 gsp/gtemplate.snippet
@@ -0,0 +1 @@
+<g:render template="${1:templatePath}" model="[${2:modelMap}]" />${3}
View
9 gsp/skel/layout.snippet
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <g:layoutHead />
+ </head>
+ <body>
+ <g:layoutBody />
+ </body>
+</html>
+

0 comments on commit c38bd63

Please sign in to comment.