Skip to content

Commit

Permalink
- A lot of plugin related improvments
Browse files Browse the repository at this point in the history
- Fixed a bug in study data tables
  • Loading branch information
ferryjagers committed Feb 22, 2019
1 parent 53519bc commit 8f21353
Show file tree
Hide file tree
Showing 108 changed files with 8,736 additions and 85 deletions.
59 changes: 23 additions & 36 deletions grails-app/conf/BuildConfig.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,22 +30,11 @@ grails.project.dependency.resolution = {
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose' log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
legacyResolve true legacyResolve true
repositories { repositories {

grailsPlugins()
grailsHome() grailsHome()
mavenLocal() grailsPlugins()
grailsCentral() grailsCentral()
mavenCentral() mavenCentral()

mavenLocal()
// grails 1.3.9 does not seem to properly inherit maven repo's from plugins
// so explicitely put mavenrepos in here. When upgraded to Grails 2.x this can
// probably be removed
mavenRepo "http://repo.grails.org/grails/plugins/"
mavenRepo "http://nexus.dbnp.org/content/repositories/releases"
//mavenRepo "http://repository.springsource.com/maven/bundles/release"
//mavenRepo "http://repository.springsource.com/maven/bundles/external"
//mavenRepo "http://repository.springsource.com/maven/libraries/release"
//mavenRepo "http://repository.springsource.com/maven/libraries/external"


// Repository for ISATAB tools // Repository for ISATAB tools
//mavenRepo "http://frog.oerc.ox.ac.uk:8080/nexus-2.1.2/content/repositories/releases" //mavenRepo "http://frog.oerc.ox.ac.uk:8080/nexus-2.1.2/content/repositories/releases"
Expand Down Expand Up @@ -80,36 +69,34 @@ grails.project.dependency.resolution = {
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0') { excludes "commons-logging", "xml-apis", "groovy" } compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0') { excludes "commons-logging", "xml-apis", "groovy" }
} }
plugins { plugins {
// plugins for the build system only // Plugins for the build system only
build ":tomcat:7.0.55.3" build ":tomcat:7.0.70"

compile(
":hibernate4:4.3.10",


":jquery:1.11.1", // Plugins needed at runtime but not for compilation
':jquery-ui:1.10.4', runtime ":hibernate4:4.3.10"

runtime ":jquery:1.11.1"
":resources:1.2.14", runtime ":resources:1.2.14"
":spring-security-core:2.0.0",

':matrix-importer:0.2.5.0',
':dbxp-module-base:0.6.2.0',

":famfamfam:1.0.1",
":mail:1.0.7",
":quartz:1.0.2",
":ajaxflow:0.2.4",
":webflow:2.1.0",
":scaffolding:2.1.2"
)


// Plugins needed for compilation
compile ":spring-security-core:2.0.0"
compile ':jquery-ui:1.10.4'
compile ":mail:1.0.7"
compile ":famfamfam:1.0.1"
compile ":quartz:1.0.2"
compile ":ajaxflow:0.2.4"
compile ":webflow:2.1.0"
compile ":scaffolding:2.1.2"
compile ":yui-war-minify:1.5" compile ":yui-war-minify:1.5"


if (System.getProperty("grails.env") == "development") { if (System.getProperty("grails.env") == "development") {
// development mode only Plugins // development mode only Plugins
compile(":console:1.5.4") compile(":console:1.5.4")
} }


// Now included as local plugins
// compile ":matrix-importer:0.2.5.0"
// compile ":dbxp-module-base:0.6.2.0"

// add { transative = false } to ignore dependency transition // add { transative = false } to ignore dependency transition
} }
} }
Expand All @@ -118,5 +105,5 @@ grails.plugin.location.'gdt' = './local-plugins/GDT'
grails.plugin.location.'dbxpSam' = './local-plugins/SAM' grails.plugin.location.'dbxpSam' = './local-plugins/SAM'
grails.plugin.location.'dbxp-base' = './local-plugins/dbxpBase' grails.plugin.location.'dbxp-base' = './local-plugins/dbxpBase'


//grails.plugin.location.'dbxpModuleBase' = '../dbxpModuleBase' grails.plugin.location.'dbxpModuleBase' = './local-plugins/dbxpModuleBase'
//grails.plugin.location.'matrix-importer' = '../matrixImporter' grails.plugin.location.'matrix-importer' = './local-plugins/matrixImporter'
3 changes: 2 additions & 1 deletion grails-app/conf/DataSource.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ dataSource {
hibernate { hibernate {
cache.use_second_level_cache = true cache.use_second_level_cache = true
cache.use_query_cache = false cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // cache.region.factory_class = 'net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
} }
// environment specific settings // environment specific settings
environments { environments {
Expand Down
27 changes: 16 additions & 11 deletions grails-app/services/dbnp/studycapturing/StudyEditService.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class StudyEditService {
int ids Total list of filtered ids int ids Total list of filtered ids
*/ */
def getEntitiesForTemplate( searchParams, study, template ) { def getEntitiesForTemplate( searchParams, study, template ) {

def query = generateHQL( searchParams, study, template ) def query = generateHQL( searchParams, study, template )


// Also count the total number of results in the dataset // Also count the total number of results in the dataset
Expand Down Expand Up @@ -103,22 +104,26 @@ class StudyEditService {
*/ */
def generateOutput( query, searchParams, entity ) { def generateOutput( query, searchParams, entity ) {
def output = [:] def output = [:]

// First select the number of results // First select the number of results
def filteredIds = entity.executeQuery( "SELECT DISTINCT s.id FROM " + query.from + " WHERE " + query.where, query.params ); def filteredIds = entity.executeQuery( "SELECT DISTINCT s.id FROM " + query.from + " WHERE " + query.where, query.params )
output.totalFiltered = filteredIds.size() output.totalFiltered = filteredIds.size()
output.ids = filteredIds output.ids = filteredIds

// Now find the results themselves
def hql = "SELECT " + query.select + " FROM " + query.from + " WHERE " + query.where + " " + ( query.order ? " ORDER BY " + query.order : "" )
output.entities = entity.executeQuery( hql, query.params, [ max: searchParams.max, offset: searchParams.offset ] )


if( query.chooseFirst ) { // Now if filteredIds is not empty find the results themselves by that list
output.entities = output.entities.collect { it[0] } if ( filteredIds.size() != 0 ) {
} def hql = "SELECT " + query.select + " FROM " + entity.simpleName + " " + query.select + " WHERE id IN :ids" + ( query.order ? " ORDER BY " + query.order : "" )
output.entities = entity.executeQuery( hql, [ ids: filteredIds ], [ max: searchParams.max, offset: searchParams.offset ] )
}
else {
output.entities = []
}

if( query.chooseFirst ) {
output.entities = output.entities.collect { it[0] }
}


output output

} }


/** /**
Expand Down Expand Up @@ -290,7 +295,7 @@ class StudyEditService {




// Create an HQL query as it gives us the most flexibility in searching and ordering // Create an HQL query as it gives us the most flexibility in searching and ordering
def from = " Sample s " def from = " Sample s"
def joins = [] def joins = []
def whereClause = [] def whereClause = []
def hqlParams = [ study: study ] def hqlParams = [ study: study ]
Expand Down
27 changes: 11 additions & 16 deletions local-plugins/GDT/grails-app/conf/BuildConfig.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,22 +27,17 @@ grails.project.dependency.resolution = {
} }


plugins { plugins {
build( ":tomcat:7.0.55", // Plugins for the build system only
//Temporary static version of Rest Client Builder due to compile error build ":tomcat:7.0.70"
":rest-client-builder:1.0.3" build ":rest-client-builder:1.0.3"
) {
// plugin only plugin, should not be transitive to the application
export = false
}


compile(":hibernate4:4.3.6.1", // Plugins needed at runtime but not for compilation
":jquery:1.8.3", runtime ":hibernate4:4.3.10"
":webflow:2.0.8.1", runtime ":jquery:1.11.1"
":ajaxflow:0.2.4",
":rest:0.8", // Plugins needed for compilation
":webflow:2.1.0" compile ":ajaxflow:0.2.4"
) { compile ":webflow:2.1.0"
export = false compile ":rest:0.8"
}
} }
} }
46 changes: 26 additions & 20 deletions local-plugins/SAM/grails-app/conf/BuildConfig.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,32 +30,38 @@ grails.project.dependency.resolution = {
} }
plugins { plugins {


build( ":tomcat:7.0.55", // Plugins for the build system only
":release:2.2.1", build ":tomcat:7.0.70"
//Temporary static version of Rest Client Builder due to compile error build ":release:2.2.1"
":rest-client-builder:1.0.3" //Temporary static version of Rest Client Builder due to compile error
) { build ":rest-client-builder:1.0.3"
// plugin only plugin, should not be transitive to the application
export = false // Plugins needed at runtime but not for compilation
} runtime ":hibernate4:4.3.10"
runtime ":jquery:1.11.1"
runtime ":resources:1.2.14"


compile( // Plugins needed for compilation
":hibernate4:4.3.6.1", compile ':jquery-ui:1.10.4'
':famfamfam:1.0.1', compile ":famfamfam:1.0.1"
':matrix-importer:0.2.5.0', compile ":ajaxflow:0.2.4"
':ajaxflow:latest.integration', compile ":jquery-datatables:1.7.5"
':resources:latest.integration',
':jquery:latest.integration', if (System.getProperty("grails.env") == "development") {
':jquery-datatables:1.7.5', // development mode only Plugins
':jquery-ui:1.8.15') { compile(":console:1.5.4")
export = false
} }

// Now included as local plugins
// compile ":matrix-importer:0.2.5.0"
// compile ":dbxp-module-base:0.6.2.0"
} }
} }


//grails.plugin.location.'dbxpModuleBase' = '../dbxpModuleBase'
//grails.plugin.location.'matrixImporter' = '../../../matrixImporter'
grails.plugin.location.'gdt' = '../GDT' grails.plugin.location.'gdt' = '../GDT'
grails.plugin.location.'dbxpBase' = '../dbxpBase' grails.plugin.location.'dbxpBase' = '../dbxpBase'


//grails.plugin.location.'dbxpModuleBase' = '../dbxpModuleBase'
grails.plugin.location.'matrixImporter' = '../matrixImporter'

//grails.server.port.http = "8182" // The modern way of setting the server port //grails.server.port.http = "8182" // The modern way of setting the server port
19 changes: 19 additions & 0 deletions local-plugins/dbxpModuleBase/.gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,19 @@
.project
.classpath
*.iws
ws
*Db.properties
*Db.script
.settings
eclipse
stacktrace.log
target
/plugins
/web-app/plugins
/web-app/WEB-INF/classes
.idea
*.iml
/target-eclipse/*
grails-dbxp-module-base-*.zip
grails-dbxp-module-base-*.zip.sha1
plugin.xml
39 changes: 39 additions & 0 deletions local-plugins/dbxpModuleBase/DbxpModuleBaseGrailsPlugin.groovy
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,39 @@
class DbxpModuleBaseGrailsPlugin {
// the plugin version
def version = "0.6.2.0"
// the version or versions of Grails the plugin is designed for
def grailsVersion = "1.3.7 > *"

// the other plugins this plugin depends on are declared in BuildConfig.groovy
def dependsOn = [jquery: "1.7.1 > *", jqueryDatatables: "1.7.5 > *", jqueryUi: "1.7.1 > *" ]
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp",
"grails-app/views/index.gsp",
"grails-app/controllers/test"
]

def author = "Robert Horlings"
def authorEmail = "robert@isdat.nl"
def title = "Base for Phenotype Database modules that communicate with GSCF"
def description = '''\\
dbxpModuleBase is a Grails plugin that provides basic functionality to create a dbXP module that contains molecular
data for studies defined in GSCF, the Generic Study Capture Framework.
dbxpModuleBase is part of the Phenotype Database software ecosystem.
As of version 0.6.2.0 this module is ready for grails 2.4.0 and higher
'''
def documentation = "https://github.com/thehyve/dbxpModuleBase/blob/master/README.md"
def license = "APACHE"
def issueManagement = [system: "github", url: "https://github.com/thehyve/dbxpModuleBase/issues"]
def scm = [url: "https://github.com/thehyve/dbxpModuleBase"]
def organization = [name: "Phenotype Foundatiom", url: "http://phenotypefoundation.org/" ]
def developers = [
[ name: "Kees van Bochove", email: "kees@thehyve.nl" ],
[ name: "Robert Horlings", email: "robert@isdat.nl" ],
[ name: "Siemen Sikkema", email: "s.h.sikkema@gmail.com" ],
[ name: "Jeroen Wesbeek", email: "work@osx.eu" ],
[ name: "Taco Steemers", email: "taco@thehyve.nl" ],
[ name: "Tjeerd van Dijk", email: "tjeerd@thehyve.nl" ]
]
}
28 changes: 28 additions & 0 deletions local-plugins/dbxpModuleBase/README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,28 @@
dbxpModuleBase
====

A Grails plugin that can serve as the basis for a dbXP module.
dbxpModuleBase provides basic module services such as synchronisation of a proxy Study-Sample-Assay cache with GSCF.

## How to publish changes
To create a new version of dbxpModuleBase and publish it on nexus.nmcdsp.org:

### Make sure that ~/.grails/settings.groovy contains username and password for Nexus:
```
~/.grails $ cat settings.groovy
grails.project.dependency.distribution = {
remoteRepository(id:"pluginReleases", url:"http://nexus.nmcdsp.org/content/repositories/releases/") {
authentication username: "admin", password: "** ask Jeroen or Kees **"
}
}
```

### Make sure maven-publisher plugin is installed
```
grails install-plugin maven-publisher
```

### Deploy the upgrade
```
grails maven-deploy --repository=pluginReleases
```
4 changes: 4 additions & 0 deletions local-plugins/dbxpModuleBase/application.properties
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
#Grails Metadata file
#Thu Jul 19 13:22:53 CEST 2012
app.grails.version=2.3.9
app.name=dbxpModuleBase
57 changes: 57 additions & 0 deletions local-plugins/dbxpModuleBase/grails-app/conf/BuildConfig.groovy
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,57 @@
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()

mavenRepo "http://nexus.nmcdsp.org/content/repositories/releases"
// mavenRepo "http://nexus.nmcdsp.org/content/repositories/snapshots"

// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
//mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
plugins {
build( ":release:latest.integration",
":rest-client-builder:latest.integration"
) {
// plugin only plugin, should not be transitive to the application
export = false
}

compile(
':resources:latest.integration'
) {
// no need to export the plugins to application (dependencies are declared in plugin descriptor file)
export = false
}
compile(
':jquery:latest.integration',
':jquery-datatables:1.7.5',
':jquery-ui:latest.integration',
':famfamfam:1.0.1',
) {
export = true
}
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

// runtime 'mysql:mysql-connector-java:5.1.13'
}
}
Loading

0 comments on commit 8f21353

Please sign in to comment.