Skip to content

Commit

Permalink
Removed worldExtent project site default for sciStarter projects with…
Browse files Browse the repository at this point in the history
…out a project area
  • Loading branch information
jack-brinkman committed Oct 1, 2024
1 parent f30e99d commit c3e98cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 116 deletions.
97 changes: 0 additions & 97 deletions grails-app/conf/data/worldExtent.json

This file was deleted.

20 changes: 1 addition & 19 deletions grails-app/services/au/org/ala/ecodata/ProjectService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ class ProjectService {
* @return
*/
Map createSciStarterSites(Map project) {
Map result = [siteIds: null]
Map result = [siteIds: []]
List sites = []
if (project.regions) {
// convert region to site
Expand All @@ -895,12 +895,6 @@ class ProjectService {
}

result.siteIds = sites
} else {
// if no region, then create world extent.
String siteId = getWorldExtent()
if (siteId) {
result.siteIds = [siteId]
}
}

result
Expand Down Expand Up @@ -977,18 +971,6 @@ class ProjectService {
}
}

/**
* World extent is used as project area of all SciStarter Projects without project area. This function
* creates a new world extent every time it is called.
* @return - siteId - 'abcd-sds'
*/
String getWorldExtent() {
// use JSON.parse since JSONSlurper converts numbers to BigDecimal which throws error on serialization.
Object world = JSON.parse(getClass().getResourceAsStream("/data/worldExtent.json")?.getText())
Map site = siteService.create(world)
return site.siteId
}

/**
* Get a String that describes a project. This used for indexing purposes currently.
* The motivaion for this method was because there was no single field to distinguish between projects but had multiple
Expand Down

0 comments on commit c3e98cc

Please sign in to comment.