-
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.
Optionally adds species URL to download #945
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
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,23 @@ | ||
package au.org.ala.ecodata.metadata | ||
|
||
import pl.touk.excel.export.getters.Getter | ||
|
||
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 "" | ||
} | ||
|
||
return val?.guid ? biePrefix+val.guid : "Unmatched name" | ||
} | ||
|
||
|
||
} |
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