Skip to content

Instantly share code, notes, and snippets.

View ahonor's full-sized avatar

Alex Honor ahonor

View GitHub Profile
@ahonor
ahonor / gist:3306761
Created August 9, 2012 18:17
getNodeAttributes.groovy
/**
* AJAX call used in the views, "/nodeType/{create,edit}.gsp"
*/
def getNodeAttributes = {
def response = []
def attrs = []
if(params.templateid){
def attributes = []
Attribute.list().each() {
@ahonor
ahonor / gist:3229739
Created August 1, 2012 18:49
Yana XML API output
## XML Format
<yana>
<result (success|error="true") apiversion="X">?
(
<error>?
<message>string</message>
</error>
|
@ahonor
ahonor / ExportService.groovy
Created July 31, 2012 22:19
Export service
package com.dtolabs
import groovy.xml.MarkupBuilder
import com.dtolabs.groovy.util.BuilderUtil
/**
* Provides a model export service that takes a project
* and dumps it out as XML-based model content.
*
* Export format must conform to the /import/yana.xsd file.
@ahonor
ahonor / example2.xml
Created July 31, 2012 17:06
Yana import Example 2
<yana>
<attributes>
<attribute name="controller" filter="String"/>
<!-- Package -->
<attribute name="arch" filter="String"/>
<attribute name="base" filter="String"/>
<attribute name="buildtime" filter="String"/>
<attribute name="filename" filter="String"/>
@ahonor
ahonor / rundeck.xml
Created July 31, 2012 16:44
yana rundeck.xml
<!-- Sample XML to establish the minimum set of node types to support default usage of the -->
<!-- Rundeck rundeck-yana2-nodes-plugin (https://github.com/sharadr/rundeck-yana2-nodes-plugin) -->
<yana>
<attributes>
<attribute name="hostname" filter="String"/>
<attribute name="osArch" filter="String"/>
<attribute name="osFamily" filter="String"/>
<attribute name="osName" filter="String"/>
<attribute name="osVersion" filter="String"/>
@ahonor
ahonor / gist:3191169
Created July 28, 2012 00:17
ImportServiceTests
package com.dtolabs
import grails.test.mixin.*
import grails.test.GrailsUnitTestCase
import org.springframework.core.io.Resource
import org.springframework.core.io.ClassPathResource
$ $GRAILS_HOME/bin/grails test-app unit: ImportService
| Running 2 unit tests... 2 of 2
| Failure: testParse(com.dtolabs.ImportServiceTests)
| grails.validation.ValidationException: Validation error occured during call to save():
- Field error in object 'com.dtolabs.Attribute' on field 'filter': rejected value [null]; codes [com.dtolabs.Attribute.filter.nullable.error.com.dtolabs.Attribute.filter,com.dtolabs.Attribute.filter.nullable.error.filter,com.dtolabs.Attribute.filter.nullable.error.com.dtolabs.Filter,com.dtolabs.Attribute.filter.nullable.error,attribute.filter.nullable.error.com.dtolabs.Attribute.filter,attribute.filter.nullable.error.filter,attribute.filter.nullable.error.com.dtolabs.Filter,attribute.filter.nullable.error,com.dtolabs.Attribute.filter.nullable.com.dtolabs.Attribute.filter,com.dtolabs.Attribute.filter.nullable.filter,com.dtolabs.Attribute.filter.nullable.com.dtolabs.Filter,com.dtolabs.Attribute.filter.nullable,attribute.filter.nullable.com.dtolabs.Attribute.filter,attribute.filter.nu
@ahonor
ahonor / gist:3191022
Created July 27, 2012 23:28
ImportServiceTests
package com.dtolabs
import grails.test.mixin.*
import grails.test.GrailsUnitTestCase
import org.springframework.core.io.Resource
import org.springframework.core.io.ClassPathResource
@ahonor
ahonor / gist:3190987
Created July 27, 2012 23:16
ImportServiceTests
package com.dtolabs
import grails.test.mixin.*
import grails.test.GrailsUnitTestCase
import org.springframework.core.io.Resource
import org.springframework.core.io.ClassPathResource
@ahonor
ahonor / gist:3180468
Created July 26, 2012 05:48
Strawman XML import file for yana2
<yana>
<attributes>
<attribute name="controller" filter="String"/>
<!-- Package -->
<attribute name="arch" filter="String"/>
<attribute name="base" filter="String"/>
<attribute name="buildtime" filter="String"/>
<attribute name="filename" filter="String"/>