This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FileStore { | |
String filename | |
FileContent content | |
String contentType | |
public String toString() { "$id:$filename" } | |
static mapping = { | |
content lazy: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- html --- | |
<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection"> | |
<link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="screen, projection"> | |
<!--[if IE]><link rel="stylesheet" href="css/blueprint/lib/ie.css" type="text/css" media="screen, projection"><![endif]--> | |
--- gsp --- | |
<link rel="stylesheet" href="${createLinkTo(dir:'css/blueprint', | |
file:'screen.css')}" type="text/css" media="screen, projection"> | |
<link rel="stylesheet" href="${createLinkTo(dir:'css/blueprint', | |
file:'print.css')}" type="text/css" media="print"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.xml.MarkupBuilder | |
class ExcelController { | |
def type1 = { | |
render(contentType: "application/vnd.ms-excel") { | |
html { | |
body { | |
h1 "Books" | |
table(border:1) { | |
tr { th "a"; th "b" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------ view.gsp ------ | |
<g:form action="save" method="post" enctype="multipart/form-data"> | |
<input type="file" id="fileStore.content" name="fileStore.content"/> | |
</g:form> | |
------ Controller.groovy ------ | |
def save = { | |
def f = request.getFile('fileStore.content') | |
if (!f.empty) { | |
def fileContent = new FileContent() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= /hudson/description要素だけを得る = | |
http://deadlock.netbeans.org/hudson/api/xml?xpath=/hudson/description | |
= 一番最初のJobを得る = | |
http://deadlock.netbeans.org/hudson/api/xml?xpath=/hudson/job[1] | |
= /hudson/description要素を除外する = | |
http://deadlock.netbeans.org/hudson/api/xml?xpath=/&exclude=/hudson/description | |
= /hudson/description, /hudson/view要素を除外する = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grails install-plugin http://www.arquetipos.co.cr/blog/files/grails-image-tools-1.0.3.zip | |
class Picture { | |
byte[] imagefile | |
} | |
def save = { | |
def downloadedFile = request.getFile('imagefile') | |
def pictureInstance = new Picture(params) | |
def imageTool = new ImageTool() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String name | |
Long lock_version | |
static transients = [ 'lock_version' ] | |
static constraints = { | |
version validator: { v, o -> !o.lock_version ?: o.lock_version == v } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
def static reportable = true | |
def static reportFileName = 'person-report' | |
String name | |
Integer age | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blog { | |
String title | |
String body | |
FileInfo uploadedFile | |
static constraints = { | |
title() | |
body maxSize: 4000 | |
uploadedFile nullable: true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlogController { | |
def scaffold = true | |
def list = { | |
[blogInstanceList: Blog.findAll([fetch: [uploadedFile: 'eager']])] | |
} | |
: |
OlderNewer