-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #946 from AtlasOfLivingAustralia/feature/issue945
Optionally adds species URL to download #945
- Loading branch information
Showing
8 changed files
with
120 additions
and
2 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
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
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
26 changes: 26 additions & 0 deletions
26
src/main/groovy/au/org/ala/ecodata/metadata/SpeciesUrlGetter.groovy
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package au.org.ala.ecodata.metadata | ||
|
||
import pl.touk.excel.export.getters.Getter | ||
import au.org.ala.ecodata.Record | ||
|
||
class SpeciesUrlGetter extends OutputDataGetter implements Getter<String> { | ||
String biePrefix | ||
SpeciesUrlGetter(String propertyName, Map dataNode, Map<String, Object> documentMap, TimeZone timeZone, String biePrefix) { | ||
super(propertyName, dataNode, documentMap, timeZone) | ||
this.biePrefix = biePrefix | ||
} | ||
|
||
@Override | ||
def species(Object node, Value outputValue) { | ||
def val = outputValue.value | ||
if (!val?.name) { | ||
return "" | ||
} | ||
if (!val?.guid || val.guid == Record.UNMATCHED_GUID) { | ||
return "Unmatched name" | ||
} | ||
return biePrefix+val.guid | ||
} | ||
|
||
|
||
} |
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
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