Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesp #1399

Draft
wants to merge 32 commits into
base: develop
Choose a base branch
from
Draft

Nesp #1399

Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e90fb7c
nesp marine hub scripts
Nov 30, 2021
6008276
nesp marine artefact upload scripts
Dec 1, 2021
3baf765
nesp marine artefact upload scripts
Dec 1, 2021
2b7302e
BCLLC-CR-60 changes
Dec 6, 2021
da44513
Northern hub changes
Dec 13, 2021
c150100
Review changes of https://github.com/AtlasOfLivingAustralia/biocollec…
Dec 13, 2021
b553756
Script to upload NESP tropical projects
Dec 16, 2021
88908e8
removed checking for commas in associated program and subprogarm fields
Dec 20, 2021
7a7286c
changes document role to logo
Dec 20, 2021
5efeaef
Added Functional tests of Publication status requirement
Jan 24, 2022
7b0780d
NESP Marine document upload scripts
Jan 24, 2022
0fbb0fa
document upload code review changes
Jan 24, 2022
61a867d
script to insert DAWE user as admin to NESP projects
Jan 25, 2022
320aa37
script to update site with projects and project with projectSiteId
Feb 1, 2022
aacc988
added citation and keywords to json array
Feb 7, 2022
98a13b9
changed document attributes - type to role
Feb 8, 2022
a56bb77
added doi link as some documents actually contains only the doi link …
Feb 9, 2022
6cdf372
initialize new fields doiLink, role, citation and keywords as empty
Feb 13, 2022
97b078e
Mapped keywords to label list
Feb 15, 2022
a9969c6
bug fix - assigning keywords array to labels
Feb 17, 2022
bb32685
Added string manipulations to handle double quotes in tsv files, chan…
Feb 22, 2022
f6083fe
Added string manipulations to handle double quotes in tsv files, chan…
Feb 22, 2022
2dd67c5
removed string manipulations from role
Feb 22, 2022
918799f
set "publiclyViewable":false in NESP documents uploaded by script
Apr 26, 2022
d928b7f
progress checkin
Apr 27, 2022
547940e
progress checkin
Apr 29, 2022
1d2a854
script to soft delet TSR hub documents
Apr 29, 2022
f5afc30
Code review changes - script to soft delete TSR hub documents
May 2, 2022
b31a554
Code review changes - script to soft delete TSR hub documents
May 2, 2022
0ae5ffc
script to fix embedded video issues
Jun 7, 2022
17a4af9
script to fix embedded video issues
Jun 7, 2022
7668f85
code refactored
Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/RestClient/nesp/TSR/TSR_sites.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
projectName,projectId,siteId,name
nesp,dde82d78-d201-4296-8624-c9fce565395e,78e5cbc6-fcf1-482f-a234-a68e23414515,TSR_7_1
53 changes: 53 additions & 0 deletions scripts/RestClient/nesp/TSR/siteImport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
print("Import started");

var projectName = 0;
var projectId = projectName + 1;
var siteId = projectId + 1;
var name = siteId + 1;

var csvData = cat('TSR_sites.csv');
print("Loaded csv file");
var csvRows = csvData.split('\r');
print("Total rows "+ csvRows.length);

for(var i = 1; i < csvRows.length; i++) {
print("--------START record---------")

var row = csvRows[i];
var fields = row.split(',');

var project_id = fields[projectId];
var site_id = fields[siteId];
var site_name = fields[name];

print("Updating projectSiteId " + site_id + " of projectId - " + project_id)

var projectResult = db.project.update(
{ projectId: project_id },
{ $set: { projectSiteId: site_id } }
);

var projects = [project_id];

print("Updating projects " + projects + " of site id - " + site_id)

var today = new ISODate();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
var dateUTC = yyyy+"-"+("0" + mm).slice(-2)+"-"+("0" + dd).slice(-2)+"T00:00:00Z";

var siteResult = db.site.update(
{ siteId: site_id },
{ $set: { projects: projects, lastUpdated: ISODate(dateUTC) } }
);

print("projectResult: "+projectResult)
print("siteResult: "+siteResult)

print("--------END record---------")
}

print(">>>>>>>>>>>>>>>>>>>>")
print("Updated " + (i-1) + " records");
print("<<<<<<<<<<<<<<<<<<<")
36 changes: 36 additions & 0 deletions scripts/RestClient/nesp/addUserPermissionToNesp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//Add hub permission

var userPermission = {};
userPermission.accessLevel = 'admin';
userPermission.entityId = "a0c69ce5-a2fc-4dfe-a387-468a4c916685"; //hubId
userPermission.userId = '135151';
userPermission.entityType = 'au.org.ala.ecodata.Hub';
userPermission.status = "active";

var hubUserPermissionResult = db.userPermission.insert(userPermission);
print("hubUserPermissionResult " + hubUserPermissionResult)

//Add project permissions

var programs = db.hub.findOne({hubId:"a0c69ce5-a2fc-4dfe-a387-468a4c916685"}).supportedPrograms;

for (i =0;i<programs.length;i++) {
let program = programs[i];

var projects = db.project.find({associatedProgram: program, status:"active"},{projectId:1, _id:0});

while (projects.hasNext()) {
let project = projects.next();
print(project.projectId)

var userPermission = {};
userPermission.accessLevel = 'admin';
userPermission.entityId = project.projectId;
userPermission.userId = '135151';
userPermission.entityType = 'au.org.ala.ecodata.Project';
userPermission.status = "active";

var projectUserPermissionResult = db.userPermission.insert(userPermission);
print("projectUserPermissionResult " + projectUserPermissionResult)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hub_name associatedProgram associatedSubProgram projectSiteId projectType organisationId organisationUrl organisationLogo projectName aim description plannedStartDate plannedEndDate ecoScienceType isExternal status manager countries uNRegions banner_image projectUrl associatedOrgs contactMail keywords termsOfUseAgreement embeddedVideo embeddedVideoTitle
nesp-marine NESP 1 - Marine Biodiversity Hub Theme A - Threatened and migratory species Ecological or biological survey / assessment (not citizen science) 9fe1c64f-ad8c-487d-b7f7-b975563d5e4b Project A1 - Northern Australian hotspots for the recovery of threatened euryhaline species Australia's northern rivers and estuaries are important to sustaining sawfish and river shark species listed under the EPBC Act. This project will provide the Department of the Environment with information to improve management and facilitate the recovery of these species. Australia's northern rivers and estuaries are important to sustaining sawfish and river shark species listed under Australia's<em> Environment Protection and Biodiversity Conservation Act 1999</em> (EPBC Act). This project will provide the Department of the Environment with information to improve management and facilitate the recovery of these species.<p>Acoustic telemetry, molecular research, life history studies and Indigenous engagement and education will be central to determining the status of threatened river sharks, and establishing monitoring, management and protection. Following are the key research activities.</p><strong>Monitoring and understanding<strong><p>More than 200 tagged animals will be monitored (via an acoustic array established in earlier research) for mortality estimates, movement patterns and habitat use, acoustic receiver arrays will be designed to measure long term movement and mortality in NT, QLD and WA rivers, and statistical methods developed for estimating annual juvenile mortality.</p><p>Thirty neonate <em>Glyphis glyphis</em> (Speartooth Sharks) will be tagged for mortality estimates and large sub-adult <em>G. glyphis</em> will be tagged to investigate adult distribution, reproductive philopatry and mortality (Adelaide River) and the age structure of <em>G. glyphis</em> will be determined for demographic models.</p><p><em>G. garricki</em> (Northern River Shark) tissue samples will be collected in unsurveyed NT habitat (including the Daly, Finniss, Fitzmaurice, Victoria, Keep rivers) and in WA (Cambridge Gulf, King Sound) in partnership with Indigenous Ranger Groups, Murdoch University and NT Fisheries. <em>G. garricki</em> population structure will be examined and close-kin mark recapture used to establish a lower bound population size estimate.</p><p>Marine Biodiversity Hub research on habitat use, long-term movements and biologically important areas will be synthesised and recovery-directed research prioritised, and&nbsp;new information will be&nbsp;provided&nbsp;for updating the&nbsp;EPBC status of river sharks.</p><strong>Indigenous partnerships for management<strong><p>Key components of this project are being undertaken in partnership with Indigenous organisations, communities and ranger groups. Partnerships will assess Indigenous cultural use and knowledge of sawfish, and develop a sawfish education package for communities.</p><p>The Northern Australian Indigenous Land and Sea Management Alliance is a project partner and Indigenous land councils will be consulted to evaluate engagement and partnership opportunities.</p><p>Malak Malak Rangers (NT) and Dambi-Mangari Rangers (WA) among other ranger groups are assisting with field research, and protocols and methodologies are being developed for an annual Malak Malak <em>Pristis pristis</em> (Largetooth Sawfish) survey.</p><p><strong>Related information</strong></p><ul><li><a href=https://www.nespmarine.edu.au/news/sampling-speartooth-sharks-remote-lower-ord-river">Sampling Speartooth Sharks on the remote Lower Ord River</a></li><li><a href="https://www.nespmarine.edu.au/news/fishers-offer-narrow-sawfish-helping-hand">Fishers offer Narrow Sawfish a helping hand</a></li><li><a href="https://www.nespmarine.edu.au/news/largetooth-sawfish-found-rock-art-500-kilometres-sea">Largetooth Sawfish found in rock art 500 kilometres from the sea</a></li><li><a href="https://www.nespmarine.edu.au/news/making-art-videos-signs-and-steps-save-sawfish-australias-northern-rivers">Making art, videos, signs and steps to save sawfish in Australia's northern rivers</a></li><li>S<a href="http://www.nespmarine.edu.au/sawfish">awfish and river shark research</a> undertaken during the National Environmental Research Program&nbsp; (NERP) 2011-2014&nbsp;</li></ul> 7/1/16 30/6/21 TRUE Completed Peter Kyne Australia Oceania https://www.nespmarine.edu.au/sites/default/files/sawfish_rock_art_Peter_Kyne_carousel_0.png https://www.nespmarine.edu.au/project/project-a1-northern-australian-hotspots-recovery-threatened-euryhaline-species [email protected] Euryhaline sharks,Glyphis garricki,Glyphis glyphis,Indigenous engagement,Largetooth Sawfish,Malak Malak Rangers,northern river sharks,Pristis pristis,Speartooth Shark TRUE
129 changes: 129 additions & 0 deletions scripts/RestClient/nesp/marine/document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
var document =
{
"labels" : [ ],
"dateCreated" : "",
"lastUpdated" : "",
"isPrimaryProjectImage" : true,
"documentId" : "",
"filepath" : "2021-12",
"thirdPartyConsentDeclarationMade" : false,
"projectActivityId" : "",
"role" : "mainImage",
"name" : "",
"type" : "image",
"status" : "active",
"filename" : "",
"isSciStarter" : false,
"projectId" : "",
"readOnly" : false,
"filesize" : 104117,
"contentType" : "image/jpeg"
}

/*
var document =
{
"documentId" : "",
"filename" : "",
"filepath" : "2021-02",
"isPrimaryProjectImage" : true,
"isSciStarter" : false,
"labels" : [ ],
"name" : "",
"projectId" : "",
"role" : "mainImage",
"status" : "active",
"thirdPartyConsentDeclarationMade" : false,
"type" : "image",
"lng" : "",
"filesize" : 104117,
"public" : true,
"contentType" : "image/jpeg",
"lat" : "",
"projectActivityId" : "",
"roles" : [
{
"name" : "Information",
"id" : "information"
},
{
"name" : "Embedded Video",
"id" : "embeddedVideo"
},
{
"name" : "Exceedance Report",
"id" : "exceedanceReport"
},
{
"name" : "Photo",
"id" : "photo"
},
{
"name" : "Project Plan / Work plan",
"id" : "projectPlan"
},
{
"name" : "Project Variation",
"id" : "projectVariation"
},
{
"name" : "Project Highlight Report",
"id" : "projectHighlightReport"
},
{
"name" : "Other Project document",
"id" : "other"
}
],
"fileReady" : true,
"thirdPartyConsentDeclarationRequired" : true,
"embeddedVideoVisible" : false,
"settings" : {
"thirdPartyDeclarationTextSelector" : "#thirdPartyDeclarationText",
"roles" : [
{
"name" : "Information",
"id" : "information"
},
{
"name" : "Embedded Video",
"id" : "embeddedVideo"
},
{
"name" : "Exceedance Report",
"id" : "exceedanceReport"
},
{
"name" : "Photo",
"id" : "photo"
},
{
"name" : "Project Plan / Work plan",
"id" : "projectPlan"
},
{
"name" : "Project Variation",
"id" : "projectVariation"
},
{
"name" : "Project Highlight Report",
"id" : "projectHighlightReport"
},
{
"name" : "Other Project document",
"id" : "other"
}
],
"showSettings" : true,
"imageLocation" : "/assets/"
},
"hasPreview" : false,
"fileButtonText" : "Change file",
"readOnly" : false,
"saveHelp" : "You must accept the Privacy Declaration before an image can be made viewable by everyone",
"fileLabel" : "",
"progress" : 0,
"complete" : false,
"saveEnabled" : false
};
*/
Loading