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
/* | |
* Copyright 2004-2005 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
package org.osscripters.grails.common.web.converters.marshaller | |
import grails.converters.XML | |
import org.codehaus.groovy.grails.web.converters.exceptions.ConverterException | |
import org.codehaus.groovy.grails.web.converters.marshaller.NameAwareMarshaller | |
import org.gcontracts.annotations.Requires | |
/** | |
* User: berngp | |
* Date: 4/12/11 |
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
package org.osscripters.grails.common.web.converters.marshaller | |
import grails.plugin.spock.ControllerSpec | |
import org.codehaus.groovy.grails.support.MockApplicationContext | |
import org.codehaus.groovy.grails.web.converters.ConverterUtil | |
import org.codehaus.groovy.grails.web.converters.configuration.ConvertersConfigurationInitializer | |
import org.springframework.validation.Errors | |
import org.springframework.web.context.WebApplicationContext | |
/** |
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
package org.some.package | |
class SomeLegacyStatus { | |
enum Status { | |
NONE, | |
ACTIVE, | |
PENDING, | |
SUSPENDED, | |
BANNED, |
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
controller.metaClass.render = {Map map, Closure closure -> | |
renderArgs.putAll(map) | |
switch(map.contentType) { | |
case null: | |
break | |
case 'application/xml': | |
case 'text/xml': | |
def smb = new StreamingMarkupBuilder() | |
if (map.encoding){ |
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-app/conf/JMSSpringBeans.groovy | |
import grails.util.Environment | |
import org.apache.activemq.spring.ActiveMQConnectionFactory | |
import org.springframework.jms.connection.SingleConnectionFactory | |
import grails.util.Environment | |
import org.apache.activemq.spring.ActiveMQConnectionFactory | |
import org.springframework.jms.connection.SingleConnectionFactory | |
beans { |
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
0. Sudo | |
1. Setup your Clojure distributions, including clojure-contrib | |
e.g. | |
root@bowman-europa:/usr/local/clojure# ll | |
total 8 | |
drwxr-xr-x 8 root root 4096 2011-07-14 19:32 clojure-1.2.1 | |
drwxr-xr-x 6 root root 4096 2010-08-19 11:02 clojure-contrib-1.2.0 | |
lrwxrwxrwx 1 root root 13 2011-07-14 19:37 current -> clojure-1.2.1 | |
lrwxrwxrwx 1 root root 21 2011-07-14 20:50 current-contrib -> clojure-contrib-1.2.0 |
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
/** | |
* Fails with https://issues.scala-lang.org/browse/SI-1133 | |
* Workaround: Split the <i>cases</i> inside <i>serve</i> into two or more | |
* <i>serve</i> blocks. | |
* | |
* Note: To avoid noise all cases bellow are returning a NotFoundResponse(). | |
*/ | |
object CategoryAdminResource extends RestHelper with Loggable { |
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
package com.ign.lift.record | |
import java.util.{Calendar, Date, GregorianCalendar, UUID} | |
import java.util.regex.Pattern | |
import net.liftweb.json.JsonAST._ | |
import net.liftweb.json.Formats | |
import com.mongodb.{BasicDBList, BasicDBObject, DBRef} | |
import scala.collection.JavaConversions._ | |
import org.bson.types.ObjectId |
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 com.newrelic.api.agent.NewRelic | |
import collection.mutable.{HashMap, SynchronizedMap} | |
import com.yammer.metrics.{Timer, MetricsGroup} | |
trait Measurable { | |
protected lazy val metricsGroup = new MetricsGroup(this.getClass) | |
private val timers = new HashMap[String, Timer] with SynchronizedMap[String, Timer] |
OlderNewer