For a future project I am looking for a library to handle SSDP communication and messages in DIDL-Lite xml dialect. Is there any reasonable implementation of java, groovy or python?
I don't like to use implementations of existing UPnP stacks like cybergarage or the frauenhofer UPnP stack because they are highly depending on these stack...
Hi, is there a built-in support in Groovy to handle Zip files (the groovy way)? Or do i have to use java.util.zip.ZipFile to process Zip files in Groovy ?
...
Hi guys,
i have a grails project with an Image Domain Class and Controller.
I just installed the grails ImageTools 1.0.4 Plugin and i would like to generate thumbnails for images wich will be uploaded.
My Image-Domain-Class:
class Image {
byte[] data
//String name
byte[] thumbnail
static constraints = {
//name()
data()
}
}
...
I am developing grails application which uses file searching.For that I wrote the following code. This code works and it is gives the results with case sensitive.But I want to search files without case sensitive.
def criteria = FileDomain.createCriteria()
def results = criteria {
and {
like('user', User.findById(session?.user...
The 1st example below illustrates the working code. I want to take the working code a step further and store the SQL in an XML file. However, once I read it from an XML file I can't seem to get groovy to treat the SQL statement as a GString anymore.
Here is the working example:
private void testRefCursors(){
//object owner param...
Which of the following technology is easy to learn and fun for developing a website? If you could only pick one which would it be and why
Clojure/Compojure+Ring/Moustache+Ring
Groovy/Grails
Python/Django
Ruby/Rails
Turbogear
Cappuccino or Sproutcore
Javascript/jQuery
...
Hi,
I've seen various posts on SO criticising the Eclipse Grails plugin, and am wondering if anyone has found a way to work productively with Grails within Eclipse?
I had a look at the Grails plugin page, and the information there doesn't look very promising, particularly the conflicting advice regarding the 'Disable Groovy Compiler Ge...
I'm new to Groovy, really like it, but found a compilation problem. I'm using Jetty as a webserver, which is serving .groovy files (groovlets)
Consider two files:
Test1.groovy which contains:
println new Test2().property
Test2.groovy which contains:
public class Test2 {
String property = "print this"
}
When calling /Test1.gr...
Hi,
In the following Groovy code snipped to add a fileAsString method to the String class, could someone explain what exactly 'this' refers to. I thought it was the object on which the fileAsString method is invoked, but apparently that's actually what delegate refers to.
String.metaClass.fileAsString = {
this.class.getResourceAsSt...
I have seen examples of how you can use the Groovy AST transformations to extend the language, e.g. to log before and after a method call as shown here. However, would it also be possible to use this framework to extend the syntax of the language itself? For instance, what if I wanted to be able to parse and transform the following into ...
I am trying to build Groovy from source (on RH Linux) using ant, but for some reason it thinks that my Java version is 1.4, and not 1.6, and thus it won't compile. The offending lines seem to be
<condition property="groovy.build.vm5">
<not>
<contains string="${ant.java.version}" substring="1.4"/>
</not>
</condition>
i...
I am trying to compile the latest Groovy distribution from source, using ant 1.7.1. The process runs along smoothly until "-createEmbeddableJar:", under which it fails saying
BUILD FAILED
myHomeDir/groovy-src-1.6.0/groovy-1.6.0/build.xml:582: The <unwar> type doesn't support the
nested "globmapper" element.
Build xml from line ...
The GString concept in Groovy is pretty powerful (see http://groovy.codehaus.org/Strings+and+GString).
GStrings let you do things like:
world = "World"
println "Hello ${world}"
# Output: Hello World
println "1+2 = ${1+2}"
# Output: 1+2 = 3
println "${System.exit(-1)}"
# Program terminated
I'm trying to figure out if using Groovy GStr...
Hi,
Assume I have a Grails domain object like this:
class Todo {
String name
String priority
String status
static constraints = {
name(blank: false)
priority()
}
}
What are the default constraints on a field if:
It's listed in the constraints block without any actual contraints, e.g. priori...
The following grails script:
// Import.groovy
includeTargets << grailsScript("Bootstrap")
target(main: "Import some data...") {
depends(bootstrap)
def Channel = grailsApp.classLoader.loadClass("content.Channel")
def c
// works: saving a valid Channel succeeds
c = Channel.newInstance(title:"A Channel", slug:"a-c...
So, I am trying to learn how to use (and extend) Groovy, and I am following the example from this page. Basically, it shows how to define an annotation for Groovy code that lets you hook in to the compiler process. The example revolves around writing and annotation that will cause lines to be printed before and after method calls.
My c...
Yes/no-question: Is there a Groovy GDK function to capitalize the first character of a string?
I'm looking for a Groovy equivalent of Perl's ucfirst(..) or Apache Commons StringUtils.capitalize(str) (the latter capitalizes the first letter of all words in the input string).
I'm currently coding this by hand using ..
str = str[0].toUpp...
Most Java code is also syntactically valid Groovy code. However, there are a few exceptions which leads me to my question:
Which constructs/features in Java are syntactically invalid in Groovy? Please provide concrete examples of Java code (Java 1.6) that is NOT valid Groovy code (Groovy 1.6).
Update:
So far we've got five examples o...
Just wonder groovy way to do value matching with default like this?
if(params.max != 10 && params.max != 20 && params.max != 30){
params.max = 10
}
...
In Grails, you can use the JSON converters to do this in the controller:
render Book.list() as JSON
The render result is
[
{"id":1,
"class":"Book",
"author":"Stephen King",
"releaseDate":'2007-04-06T00:00:00',
"title":"The Shining"}
]
You can control the output date by make a setting in Config.groovy
grails.converters.json.dat...