Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

initial stab at neo4j #11

Closed
wants to merge 14 commits into from
49 changes: 39 additions & 10 deletions build.gradle
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
// classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
classpath "gradle.plugin.com.energizedwork.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
}
Expand Down Expand Up @@ -43,18 +43,27 @@ repositories {
// In this section you declare the dependencies for your production and test code
dependencies {
// START added dependencies

// Neo4j stuff
// implementation 'io.micronaut.configuration:micronaut-neo4j-gorm:2.0.0.M2'
// ​compile "org.grails.plugins:neo4j"
compile "org.grails.plugins:neo4j:$gormNeo4jVersion"


compile group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.1.2'
// compile 'org.grails.plugins:swagger:1.0.1'
// annotationProcessor "io.micronaut.configuration:micronaut-openapi:1.5.0"
// compile "io.swagger.core.v3:swagger-annotations:2.1.1"
// implementation "io.swagger.core.v3:swagger-annotations"
// compileOnly "io.micronaut.configuration:micronaut-openapi:1.4.0"
annotationProcessor "io.micronaut.configuration:micronaut-openapi:1.5.0"
// compile "io.swagger.core.v3:swagger-annotations:2.1.1"
compile "io.swagger.core.v3:swagger-annotations:2.1.1"
compileOnly "io.micronaut.configuration:micronaut-openapi:1.5.0"
// annotationProcessor "io.micronaut.configuration:micronaut-openapi:1.5.0"
// compile "io.swagger.core.v3:swagger-annotations:2.1.1"
// compileOnly "io.micronaut.configuration:micronaut-openapi:1.5.0"


// runtime 'mysql:mysql-connector-java:5.1.49'
runtime 'org.postgresql:postgresql:9.4.1212'
// runtime 'org.postgresql:postgresql:9.4.1212'


// HTSJDK
Expand Down Expand Up @@ -83,6 +92,10 @@ dependencies {
// compile 'org.grails.plugins:spring-security-core:4.0.0'
// compile 'org.grails.plugins:spring-security-core:3.3.1'

// let's add micronaut stuff
compile "io.micronaut:micronaut-http-client"
compileOnly "io.micronaut:micronaut-inject-groovy"


// END added dependencies

Expand All @@ -103,14 +116,15 @@ dependencies {
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.4.16.Final"
// compile "org.grails.plugins:hibernate5:$hibernateDatastoreVersion"
// compile "org.hibernate:hibernate-ehcache:$hibernateEhcacheVersion"
// compile "org.hibernate:hibernate-core:5.4.16.Final"
compile "org.hibernate:hibernate-validator:6.1.5.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
// runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
testCompile "org.grails:grails-gorm-testing-support"
Expand All @@ -120,6 +134,10 @@ dependencies {
// testCompile "org.grails:grails-test-mixins:3.3.0"
// testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
// testRuntime "org.neo4j.test:neo4j-harness:3.5.0"
runtime "org.neo4j.test:neo4j-harness:$neo4jVersion"


// testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1"

testCompile "org.grails.plugins:geb"
Expand All @@ -137,8 +155,19 @@ webdriverBinaries {
}

bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
// addResources = true
// systemProperties System.properties
// jvmArgs('-Dspring.output.ansi.enabled=always')
//// addResources = true
//// String springProfilesActive = 'spring.profiles.active'
//// systemProperty springProfilesActive, System.getProperty(springProfilesActive)
// sourceResources sourceSets.main
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
Expand Down
23 changes: 14 additions & 9 deletions gradle.properties
@@ -1,13 +1,18 @@
#Thu May 28 09:28:15 PDT 2020
grailsWrapperVersion=1.0.0
chromeDriverVersion=2.44
hibernateCoreVersion=5.4.16.Final
#grailsWrapperVersion=1.0.0
#chromeDriverVersion=2.44
#hibernateCoreVersion=5.4.16.Final
#hibernateDatastoreVersion=7.1.0.M1
#hibernateValidatorVersion=6.0.13.Final
#hibernateEhcacheVersion=5.4.0.Final
webdriverBinariesVersion=1.4
groovyVersion=3.0.3
gormNeo4jVersion=7.1.0.M2
#groovyVersion=3.0.3
grailsVersion=4.0.3
seleniumVersion=3.12.0
gradleWrapperVersion=5.6.4
gormVersion=7.0.2
gebVersion=2.3
seleniumSafariDriverVersion=3.14.0
geckodriverVersion=0.23.0
#gradleWrapperVersion=5.6.4
#gormVersion=7.0.2
#gebVersion=2.3
#seleniumSafariDriverVersion=3.14.0
#geckodriverVersion=0.23.0
neo4jVersion=3.5.18
2 changes: 1 addition & 1 deletion grails-app/conf/application.groovy
@@ -1,6 +1,6 @@


grails.gsp.enable.reload = true
//grails.gsp.enable.reload = true

// locations to search for config files that get merged into the main config;
// config files can be ConfigSlurper scripts, Java properties files, or classes
Expand Down
105 changes: 63 additions & 42 deletions grails-app/conf/application.yml
Expand Up @@ -3,11 +3,26 @@ grails:
profile: web
codegen:
defaultPackage: org.bbop.apollo
spring:
transactionManagement:
proxies: false
gorm:
reactor:
# Whether to translate GORM events into Reactor events
# Disabled by default for performance reasons
events: false
neo4j:
# type: embedded
url: bolt://localhost:7687
username: neo4j
password: testpass
flush.mode: AUTO
options:
maxSessions: 100
encryptionLevel: NONE
sessionLivenessCheckTimeout: 200
# encryption: true

info:
app:
name: '@info.app.name@'
Expand All @@ -19,6 +34,12 @@ spring:
groovy:
template:
check-template-location: false
devtools:
restart:
exclude:
- grails-app/views/**
- grails-app/i18n/**
- grails-app/conf/**

# Spring Actuator Endpoints are Disabled by Default
endpoints:
Expand Down Expand Up @@ -86,46 +107,46 @@ endpoints:
unique-names: true

---
hibernate:
cache:
queries: false
use_second_level_cache: false
use_query_cache: false
dataSource:
pooled: true
jmxExport: true
driverClassName: org.h2.Driver
username: sa
password: ''
#hibernate:
# cache:
# queries: false
# use_second_level_cache: false
# use_query_cache: false
#dataSource:
# pooled: true
# jmxExport: true
# driverClassName: org.h2.Driver
# username: sa
# password: ''

environments:
development:
dataSource:
dbCreate: create-drop
url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
dataSource:
dbCreate: none
url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
#environments:
# development:
# dataSource:
# dbCreate: create-drop
# url: jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
# test:
# dataSource:
# dbCreate: update
# url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
# production:
# dataSource:
# dbCreate: none
# url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
# properties:
# jmxEnabled: true
# initialSize: 5
# maxActive: 50
# minIdle: 5
# maxIdle: 25
# maxWait: 10000
# maxAge: 600000
# timeBetweenEvictionRunsMillis: 5000
# minEvictableIdleTimeMillis: 60000
# validationQuery: SELECT 1
# validationQueryTimeout: 3
# validationInterval: 15000
# testOnBorrow: true
# testWhileIdle: true
# testOnReturn: false
# jdbcInterceptors: ConnectionState
# defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED
1 change: 1 addition & 0 deletions grails-app/controllers/UrlMappings.groovy
Expand Up @@ -20,6 +20,7 @@ class UrlMappings {
// "/"(redirect: '/annotator/index')
"500"(view: '/error')
// "/menu"(view: '/menu')
"/proxytest"(controller: "proxy", action: "init")
"/"(view: '/index')
// "/${clientToken}/version.jsp"(controller: 'annotator', view: "version")
// "/about"(controller: 'annotator', view: "about")
Expand Down
58 changes: 39 additions & 19 deletions grails-app/controllers/org/bbop/apollo/AnnotatorController.groovy
Expand Up @@ -13,7 +13,7 @@ import org.bbop.apollo.history.FeatureOperation
import org.bbop.apollo.report.AnnotatorSummary
import org.grails.web.json.JSONArray
import org.grails.web.json.JSONObject
import org.hibernate.FetchMode
//import org.hibernate.FetchMode
// import io.swagger.annotations.*
import org.springframework.http.HttpStatus

Expand Down Expand Up @@ -512,25 +512,45 @@ class AnnotatorController {
order('lastUpdated', sortorder)
}
if (showOnlyGoAnnotations) {
fetchMode 'goAnnotations', FetchMode.JOIN
'goAnnotations'
}
fetchMode 'owners', FetchMode.JOIN
fetchMode 'featureSynonyms', FetchMode.JOIN
fetchMode 'featureDBXrefs', FetchMode.JOIN
fetchMode 'featureProperties', FetchMode.JOIN
fetchMode 'featureLocations', FetchMode.JOIN
fetchMode 'featureLocations.sequence', FetchMode.JOIN
fetchMode 'parentFeatureRelationships', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.parentFeature', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations.sequence', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.childFeatureRelationships', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.featureLocations', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.featureLocations.sequence', FetchMode.JOIN
fetchMode 'parentFeatureRelationships.childFeature.owners', FetchMode.JOIN
'owners'
'featureSynonyms'
'featureDBXrefs'
'featureProperties'
'featureLocations'
'featureLocations.sequence'
'parentFeatureRelationships'
'parentFeatureRelationships.childFeature'
'parentFeatureRelationships.parentFeature'
'parentFeatureRelationships.childFeature.parentFeatureRelationships'
'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature'
'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations'
'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations.sequence'
'parentFeatureRelationships.childFeature.childFeatureRelationships'
'parentFeatureRelationships.childFeature.featureLocations'
'parentFeatureRelationships.childFeature.featureLocations.sequence'
'parentFeatureRelationships.childFeature.owners'
// if (showOnlyGoAnnotations) {
// fetchMode 'goAnnotations', FetchMode.JOIN
// }
// fetchMode 'owners', FetchMode.JOIN
// fetchMode 'featureSynonyms', FetchMode.JOIN
// fetchMode 'featureDBXrefs', FetchMode.JOIN
// fetchMode 'featureProperties', FetchMode.JOIN
// fetchMode 'featureLocations', FetchMode.JOIN
// fetchMode 'featureLocations.sequence', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.parentFeature', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.parentFeatureRelationships.childFeature.featureLocations.sequence', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.childFeatureRelationships', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.featureLocations', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.featureLocations.sequence', FetchMode.JOIN
// fetchMode 'parentFeatureRelationships.childFeature.owners', FetchMode.JOIN
}
long durationInMilliseconds = System.currentTimeMillis() - start;
log.debug "criteria query ${durationInMilliseconds}"
Expand Down
20 changes: 20 additions & 0 deletions grails-app/controllers/org/bbop/apollo/ProxyController.groovy
@@ -1,7 +1,9 @@
package org.bbop.apollo

import grails.converters.JSON
import grails.gorm.transactions.Transactional
import org.bbop.apollo.gwt.shared.PermissionEnum
import org.grails.web.json.JSONObject

import static org.springframework.http.HttpStatus.*

Expand Down Expand Up @@ -29,6 +31,24 @@ class ProxyController {
respond proxyInstance
}

@Transactional
def init(){
println "intting proxy 2"
println "asdfasdfC running! "
Proxy proxy = new Proxy(
referenceUrl: "http://asdf.com",
targetUrl: "http://asdf.com",
active: true,
).save(failOnError: true,flush: true)
def proxies = Proxy.findAllByActive(true)
if(proxies){
respond proxies
}
// proxyService.initProxies()
println "D"
render new JSONObject() as JSON
}

def create() {
params.active = true
respond new Proxy(params)
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/org/bbop/apollo/Allele.groovy
Expand Up @@ -20,7 +20,7 @@ class Allele {
]

static mapping = {
alleleInfo cascade: 'all-delete-orphan'
// alleleInfo cascade: 'all-delete-orphan'
}

}