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
Map<String, Integer> listDistinctGrossDepEnv() { | |
HibernateCriteriaBuilder builder = OutcropSection.createCriteria() | |
Collection results = builder.list { | |
// Not binding to a bean | |
resultTransformer(AliasToEntityMapResultTransformer.INSTANCE) | |
projections { | |
groupProperty("grossDepositionalEnvironment", "keyName") | |
depositionalEnvironment { | |
subEnvironment { | |
count("architecturalElement", "countValue") |
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 no.cipr.safari.model.OutcropSection | |
def c = OutcropSection.createCriteria() | |
def result = c.list { | |
eq("grossDepositionalEnvironment", "*") | |
} |
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
List<Outcrop> listTouchedOutcrops(String grossDepEnv, String depEnv = null, String subDepEnv = null, String archiEleType = null, String basinType = null, String climate = null) { | |
def c = Outcrop.createCriteria() | |
def result = c.list { | |
section { | |
eq("grossDepositionalEnvironment", grossDepEnv) | |
depositionalSetting { | |
basinType ? eq("basinType", basinType) : null | |
climate ? eq("paleoClimate", climate) : null |
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 no.cipr.safari.model | |
import grails.converters.XML | |
class SearchController { | |
def transient modelSearchService | |
def transient depositionalSearchService | |
def index = { | |
def distinct = modelSearchService.listDistinctGrossDepEnv()//works just fine |
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
Map<String, Integer>listDistinctGeometries(query) { | |
HibernateCriteriaBuilder builder = OutcropSection.createCriteria() | |
def types = [min: "minGeometry", max: "maxGeometry", avg: "avgGeometry"] | |
def result = [:] | |
types.each { | |
def archiElementCount = builder.get { | |
query.modern ? isNotNull("modernDepositionalSetting") : isNotNull("depositionalSetting") | |
eq("grossDepositionalEnvironment", query.grossDepEnv) | |
depositionalSetting { | |
if(query.basinType) 'in'("basinType", query.basinType) |
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
try{ | |
user.bnetUrl = params.bnetUrl | |
userService.updateRank(user) | |
user.save(flush:true) | |
} | |
catch(InvalidBnetUrlException e) { | |
flash.message = e.message | |
render(view: "seedError") | |
return | |
} |
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
changeSet(author: "oliver (generated)", id: "1302702919266-23") { | |
dropForeignKeyConstraint(constraintName: "FK375DF2F9A2DB3C5A", baseTableName: "sec_user") | |
dropIndex(indexName: "FK375DF2F9A2DB3C5A", tableName: "sec_user") | |
renameColumn(oldColumnName: "rank_info_id", newColumnName: "rank_infoeu_id", columnDataType: "bigint NULL", tableName: "sec_user") | |
createIndex(indexName: "FK375DF2F9A2DB3C5A", tableName: "sec_user") { | |
column(name: "rank_infoeu_id") | |
} | |
addForeignKeyConstraint(baseColumnNames: "rank_infoeu_id", baseTableName: "sec_user", constraintName: "FK375DF2F9A2DB3C5A", deferrable: "false", initiallyDeferred: "false", referencedColumnNames: "id", referencedTableName: "rank_info", referencesUniqueColumn: "false") | |
} |
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
Map<String, Integer>listDistinctDepositionalEnvironments(query) { | |
HibernateCriteriaBuilder builder = OutcropSection.createCriteria() | |
Collection results = builder.list { | |
resultTransformer(AliasToEntityMapResultTransformer.INSTANCE) | |
query.modern ? isNotNull("modernDepositionalSetting") : isNotNull("depositionalSetting") | |
eq("grossDepositionalEnvironment", query.grossDepEnv) | |
depositionalSetting { | |
if(query.basinType) 'in'("basinType", query.basinType) | |
if(query.paleoClimate)'in'("paleoClimate", query.paleoClimate) | |
} |
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 no.cipr.safari.model | |
enum DataSetScaleEnum { | |
SYSTEM_SCALE('system scale'), | |
DEPOSITIONAL_ELEMENTS_SCALE('depositional elements scale'), | |
ARCHITECTURAL_ELEMENTS_SCALE('architectural elements scale'), | |
FACIES_SCALE('facies scale'), | |
UNKNOWN('unknown'), |
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
//in my config file | |
require_once(SITE_DIR . '/class/ClassAutoLoader.php'); | |
$loader = new ClassAutoLoader(); | |
//the autoloader | |
<?php | |
class ClassAutoloader { | |
public function __construct() { |
OlderNewer