-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
# Conflicts: # build.gradle
- Loading branch information
Showing
5 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ repositories { | |
} | ||
|
||
group = 'au.org.ala' | ||
version = '3.2.0' | ||
version = '3.2.1' | ||
|
||
|
||
boolean inplace = 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/************************************************************************** | ||
* Copyright (C) 2013 Atlas of Living Australia | ||
* All Rights Reserved. | ||
* | ||
* | ||
* The contents of this file are subject to the Mozilla Public | ||
* License Version 1.1 (the "License"); you may not use this file | ||
* except in compliance with the License. You may obtain a copy of | ||
* the License at http://www.mozilla.org/MPL/ | ||
* | ||
* | ||
* Software distributed under the License is distributed on an "AS | ||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing | ||
|
@@ -36,7 +36,7 @@ | |
/** | ||
* The ALA Spatial portal implementation for the layer service. | ||
* Metadata information will be cached from spatial webservices. | ||
* | ||
* | ||
* @author Natasha Carter ([email protected]) | ||
*/ | ||
@Component("layersService") | ||
|
@@ -47,11 +47,11 @@ public class AlaLayersService implements LayersService { | |
private Map<String,String> idToNameMap = RestartDataService.get(this, "idToNameMap", new TypeReference<HashMap<String, String>>(){}, HashMap.class); | ||
private List<Map<String,Object>> layers = RestartDataService.get(this, "layers", new TypeReference<ArrayList<Map<String, Object>>>(){}, ArrayList.class); | ||
private Map<String,String> extraLayers = new HashMap<String,String>(); | ||
|
||
//NC 20131018: Allow cache to be disabled via config (enabled by default) | ||
@Value("${caches.layers.enabled:true}") | ||
protected Boolean enabled = null; | ||
|
||
@Value("${spatial.layers.url:https://spatial.ala.org.au/ws/fields}") | ||
protected String spatialUrl; | ||
|
||
|
@@ -64,12 +64,12 @@ public class AlaLayersService implements LayersService { | |
protected Map<String, Integer> distributions = RestartDataService.get(this, "distributions", new TypeReference<HashMap<String, Integer>>(){}, HashMap.class); | ||
protected Map<String, Integer> checklists = RestartDataService.get(this, "checklists", new TypeReference<HashMap<String, Integer>>(){}, HashMap.class); | ||
protected Map<String, Integer> tracks = RestartDataService.get(this, "tracks", new TypeReference<HashMap<String, Integer>>(){}, HashMap.class); | ||
|
||
@Inject | ||
private RestOperations restTemplate; // NB MappingJacksonHttpMessageConverter() injected by Spring | ||
|
||
private CountDownLatch wait = new CountDownLatch(1); | ||
|
||
@Override | ||
public Map<String, String> getLayerNameMap() { | ||
try { | ||
|
@@ -78,7 +78,7 @@ public Map<String, String> getLayerNameMap() { | |
} | ||
return idToNameMap; | ||
} | ||
|
||
@Scheduled(fixedDelay = 43200000)// schedule to run every 12 hours | ||
public void refreshCache(){ | ||
init(); | ||
|
@@ -102,7 +102,9 @@ public void run() { | |
List list = restTemplate.getForObject(spatialUrl, List.class); | ||
if (list != null && list.size() > 0) layers = list; | ||
for (Map<String, Object> values : layers) { | ||
tmpMap.put((String) values.get("id"), (String) values.get("desc")); | ||
if ((Boolean) values.get("enabled") && (Boolean) values.get("indb")) { | ||
tmpMap.put((String) values.get("id"), (String) values.get("desc")); | ||
} | ||
} | ||
|
||
if (tmpMap.size() > 0) idToNameMap = tmpMap; | ||
|
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
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