DivTree: JSON file
The original approach in #529 (closed) assumed we would reuse the existing RepositoryFile
approach to associate tree data with crops. This means that the .json
file would be uploaded to the repository to the /crops/{crop.shortName}
folder directly.
In this ticket, add support to upload the .json
file with the DiversityTreeService
and controller. The .json
files for different DiversityTree
are stored in repository at /divtree/{divTree.uuid}.json
.
Replace private String treeFile
with RepositoryFile treeFile
.
If a new .json
file is uploaded, the original RepositoryFile
must be deleted.
CropDetails
The UI uses CropDetails.files[]
list to find *.json
and treats them as Diversity Trees for display.
Extend CropDetails
with List<DiversityTree> diversityTrees
property and load all PUBLISHED records associated with this Crop
.
Part of #528 (closed).