From f8677aa30bc1f9d257ebcb6c7f673ba9e88a7e5d Mon Sep 17 00:00:00 2001 From: sal153 Date: Wed, 31 Jul 2024 13:57:10 +1000 Subject: [PATCH 01/15] fix for empty electorates column AA #918 --- .../controllers/au/org/ala/ecodata/SearchController.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy b/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy index 41c7be844..554d39df8 100644 --- a/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy +++ b/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy @@ -513,6 +513,7 @@ class SearchController { params.facets = ELECTORATES SearchResponse result = elasticSearchService.search(params.query, params, HOMEPAGE_INDEX) List electorates = result.aggregations?.find{it.name == ELECTORATES}?.buckets?.collect{it.key} + electorates.removeAll(Arrays.asList(null,"")) List tabsToExport = params.getList('tabs') boolean formSectionPerTab = params.getBoolean("formSectionPerTab", false) Map dataDescriptionLookup = null From c825a07e5254c964888a191ec7725753fd6b1a44 Mon Sep 17 00:00:00 2001 From: sal153 Date: Thu, 1 Aug 2024 10:23:21 +1000 Subject: [PATCH 02/15] added new Meri plan Project Delivery Assumptions column #918 --- .../reporting/ProjectXlsExporter.groovy | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 7d236ee70..89d53c8f9 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -87,6 +87,8 @@ class ProjectXlsExporter extends ProjectExporter { List projectPartnershipProperties = commonProjectProperties + ['data1', 'data2', 'data3'] List projectImplementationHeaders = commonProjectHeaders + ['Project implementation / delivery mechanism'] List projectImplementationProperties = commonProjectProperties + ['implementation'] + List projectDeliveryAssumptionsHeaders = commonProjectHeaders + ['Project delivery assumptions'] + List keyEvaluationQuestionHeaders = commonProjectHeaders + ['Project Key evaluation question (KEQ)', 'How will KEQ be monitored?'] List keyEvaluationQuestionProperties = commonProjectProperties + ['data1', 'data2'] List prioritiesHeaders = commonProjectHeaders + ['Document name', 'Relevant section', 'Explanation of strategic alignment'] @@ -474,6 +476,7 @@ class ProjectXlsExporter extends ProjectExporter { exportMonitoring(project) exportProjectPartnerships(project) exportProjectImplementation(project) + exportProjectDeliveryAssumptions(project) exportKeyEvaluationQuestion(project) exportPriorities(project) exportWHSAndCaseStudy(project) @@ -597,6 +600,23 @@ class ProjectXlsExporter extends ProjectExporter { } + private void exportProjectDeliveryAssumptions(Map project) { + String sheetName = "RDP_Project_Delivery_Assumptions" + if (shouldExport("RDP_Project_Delivery_Assumptions")) { + AdditionalSheet sheet = getSheet("RDP Project Delivery Assumptions", projectImplementationProperties, projectDeliveryAssumptionsHeaders) + int row = sheet.getSheet().lastRowNum + + if (project?.custom?.details?.implementation) { + Map data = [implementation:project?.custom?.details?.implementation?.description] + data.putAll(project) + + sheet.add(data, projectImplementationProperties, row+1) + } + } + + } + + private void exportKeyEvaluationQuestion(Map project) { exportList("MERI_Key Evaluation Question", project, project?.custom?.details?.keq?.rows, keyEvaluationQuestionHeaders, keyEvaluationQuestionProperties) From dd5ecfbadb8557662de5c3764a7b5dd66b71f17d Mon Sep 17 00:00:00 2001 From: sal153 Date: Thu, 1 Aug 2024 10:32:40 +1000 Subject: [PATCH 03/15] added newlink column for the Meri priorities #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 89d53c8f9..9797eefb0 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -91,8 +91,8 @@ class ProjectXlsExporter extends ProjectExporter { List keyEvaluationQuestionHeaders = commonProjectHeaders + ['Project Key evaluation question (KEQ)', 'How will KEQ be monitored?'] List keyEvaluationQuestionProperties = commonProjectProperties + ['data1', 'data2'] - List prioritiesHeaders = commonProjectHeaders + ['Document name', 'Relevant section', 'Explanation of strategic alignment'] - List prioritiesProperties = commonProjectProperties + ['data1', 'data2', 'data3'] + List prioritiesHeaders = commonProjectHeaders + ['Document name', 'Relevant section', 'Explanation of strategic alignment', 'Link to document'] + List prioritiesProperties = commonProjectProperties + ['data1', 'data2', 'data3', 'documentUrl'] List whsAndCaseStudyHeaders = commonProjectHeaders + ['Are you aware of, and compliant with, your workplace health and safety legislation and obligations', 'Do you have appropriate policies and procedures in place that are commensurate with your project activities?', 'Are you willing for your project to be used as a case study by the Department?'] List whsAndCaseStudyProperties = commonProjectProperties + ['obligations', 'policies', 'caseStudy'] List projectAssetHeaders = commonProjectHeaders + ["Asset", "Category"] From 50e0833a38e78ed9668d4ebeeb486402fb105160 Mon Sep 17 00:00:00 2001 From: sal153 Date: Sun, 4 Aug 2024 09:39:48 +1000 Subject: [PATCH 04/15] moved column AU to AP (MERI_Baseline tab) #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 9797eefb0..7b9254130 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -114,8 +114,8 @@ class ProjectXlsExporter extends ProjectExporter { List eventHeaders = commonProjectHeaders + ['Funding', 'Name', 'Description', 'Scheduled Date', 'Media', 'Grant Announcement Date', 'Type'] List eventProperties = commonProjectProperties + ['funding', 'name', 'description', 'scheduledDate', 'media', 'grantAnnouncementDate', 'Type'] - List baselineHeaders = commonProjectHeaders + ['Baseline Method', 'Baseline', 'Code', 'Evidence', 'Monitoring Data Status', 'Outcome statement/s', 'Baseline Protocol', 'Related Target Measures'] - List baselineProperties = commonProjectProperties + ['method', 'baseline', 'code', 'evidence', 'monitoringDataStatus', 'relatedOutcomes', 'protocols', 'relatedTargetMeasures'] + List baselineHeaders = commonProjectHeaders + ['Outcome statement/s','Baseline Method', 'Baseline', 'Code', 'Evidence', 'Monitoring Data Status', 'Baseline Protocol', 'Related Target Measures'] + List baselineProperties = commonProjectProperties + ['relatedOutcomes', 'method', 'baseline', 'code', 'evidence', 'monitoringDataStatus', 'protocols', 'relatedTargetMeasures'] //Different data model RLP outcomes show data on rows not cols List rlpOutcomeHeaders = commonProjectHeaders + ['Type of outcomes', 'Outcome','Investment Priority', 'Related Program Outcome'] From a7e0e7ee3e3592223727b25e2a7a4affae40e15a Mon Sep 17 00:00:00 2001 From: sal153 Date: Sun, 4 Aug 2024 09:40:30 +1000 Subject: [PATCH 05/15] renamed column name (MERI_Baseline tab) #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 7b9254130..23bda27c8 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -114,7 +114,7 @@ class ProjectXlsExporter extends ProjectExporter { List eventHeaders = commonProjectHeaders + ['Funding', 'Name', 'Description', 'Scheduled Date', 'Media', 'Grant Announcement Date', 'Type'] List eventProperties = commonProjectProperties + ['funding', 'name', 'description', 'scheduledDate', 'media', 'grantAnnouncementDate', 'Type'] - List baselineHeaders = commonProjectHeaders + ['Outcome statement/s','Baseline Method', 'Baseline', 'Code', 'Evidence', 'Monitoring Data Status', 'Baseline Protocol', 'Related Target Measures'] + List baselineHeaders = commonProjectHeaders + ['Outcome statement/s','Baseline Method', 'Baseline', 'Code', 'Evidence', 'Monitoring Data Status', 'Baseline Protocol', 'Project Service/Target measure'] List baselineProperties = commonProjectProperties + ['relatedOutcomes', 'method', 'baseline', 'code', 'evidence', 'monitoringDataStatus', 'protocols', 'relatedTargetMeasures'] //Different data model RLP outcomes show data on rows not cols From b8796f9e7f6f5d8a131466d71f7d1c51bf4dbb60 Mon Sep 17 00:00:00 2001 From: sal153 Date: Mon, 5 Aug 2024 10:13:01 +1000 Subject: [PATCH 06/15] commit to display score label instead of scoreId (MERI_Baseline tab) #918 --- .../reporting/ProjectXlsExporter.groovy | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 23bda27c8..8674ae401 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -676,17 +676,29 @@ class ProjectXlsExporter extends ProjectExporter { private void exportBaseline(Map project) { String sheetName = "MERI_Baseline" - if (shouldExport(sheetName)) { - AdditionalSheet sheet = getSheet(sheetName, baselineProperties, baselineHeaders) - int row = sheet.getSheet().lastRowNum - List data = project?.custom?.details?.baseline?.rows?.collect { Map baseline -> - Map baseLineItem = [:] - baseline.each{k, v -> baseLineItem.put(k,v)} - baseLineItem.putAll(project) - baseLineItem + + AdditionalSheet sheet = getSheet(sheetName, baselineProperties, baselineHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] + + if (project?.custom?.details?.baseline?.rows){ + def items = project?.custom?.details?.baseline?.rows + items.each{ Map item -> + Map baseline = [:] + baseline["relatedOutcomes"] = item.relatedOutcomes + baseline["method"] = item.method + baseline["baseline"] = item.baseline + baseline["code"] = item.code + baseline["evidence"] = item.evidence + baseline["monitoringDataStatus"] = item.monitoringDataStatus + baseline["protocols"] = item.protocols + baseline["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) + baseline.putAll(project) + data.add(project + baseline) } - sheet.add(data?:[], baselineProperties, row+1) } + + sheet.add(data?:[], baselineProperties, row+1) } private void exportEvents(Map project) { @@ -1030,4 +1042,12 @@ class ProjectXlsExporter extends ProjectExporter { sheet.add(data?:[], rdpSTProperties, row+1) } + + private static String findScoreLabels(List scoreIds) { + List labels = [] + for (String scoreId : scoreIds) { + labels.add(au.org.ala.ecodata.Score.findByScoreId(scoreId).label) + } + return labels + } } From a604edbaace099dc6130e5928b825530b5a9c2ca Mon Sep 17 00:00:00 2001 From: sal153 Date: Fri, 9 Aug 2024 14:41:05 +1000 Subject: [PATCH 07/15] added RDP Monitoring Methodology #918 --- .../reporting/ProjectXlsExporter.groovy | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 8674ae401..6281ccc39 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -156,6 +156,9 @@ class ProjectXlsExporter extends ProjectExporter { List rlpKeyThreatHeaders =commonProjectHeaders + ['Key threats and/or threatening processes', 'Interventions to address threats'] List rlpKeyThreatProperties =commonProjectProperties + ['keyThreat', 'keyTreatIntervention'] + List rdpMonitoringIndicatorsHeaders =commonProjectHeaders + ['Code', 'Monitoring methodology', 'Project service / Target measure/s', 'Monitoring method', 'Evidence to be retainedX'] + List rdpMonitoringIndicatorsProperties =commonProjectProperties + ['relatedBaseline', 'data1', 'relatedTargetMeasures','protocols', 'evidence'] + OutputModelProcessor processor = new OutputModelProcessor() ProjectService projectService @@ -460,7 +463,7 @@ class ProjectXlsExporter extends ProjectExporter { "MERI_Attachments", "MERI_Baseline", "MERI_Event", "MERI_Approvals", "MERI_Project Assets", 'MERI_Pest Control Methods', 'MERI_Native Species Threat', "RLP_Outcomes", "RLP_Project_Details", "RLP_Key_Threats", "RLP_Services_and_Targets", - "RDP_Outcomes", "RDP_Project_Details", "RDP_Key_Threats", "RDP_Services_and_Targets" + "RDP_Outcomes", "RDP_Project_Details", "RDP_Key_Threats", "RDP_Services_and_Targets", "RDP_Monitoring" ] //Add extra info about approval status if any MERI plan information is to be exported. if (shouldExport(meriPlanTabs)){ @@ -495,6 +498,7 @@ class ProjectXlsExporter extends ProjectExporter { exportRDPProjectDetails(project) exportRDPOutcomes(project) exportRDPServicesTargets(project) + exportRdpMonitoring(project) } @@ -701,6 +705,31 @@ class ProjectXlsExporter extends ProjectExporter { sheet.add(data?:[], baselineProperties, row+1) } + private void exportRdpMonitoring(Map project) { + String sheetName = "RDP_Monitoring" + + AdditionalSheet sheet = getSheet(sheetName, rdpMonitoringIndicatorsProperties, rdpMonitoringIndicatorsHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] + + if (project?.custom?.details?.monitoring?.rows){ + def items = project?.custom?.details?.monitoring?.rows + items.each{ Map item -> + Map monitoringIndicator = [:] + monitoringIndicator["relatedBaseline"] = item.relatedBaseline + monitoringIndicator["data1"] = item.data1 + monitoringIndicator["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) + monitoringIndicator["protocols"] = item.protocols + monitoringIndicator["evidence"] = item.evidence + + monitoringIndicator.putAll(project) + data.add(project + monitoringIndicator) + } + } + + sheet.add(data?:[], rdpMonitoringIndicatorsProperties, row+1) + } + private void exportEvents(Map project) { String sheetName = "MERI_Event" if (shouldExport(sheetName)) { From f564b0f2d2484b843e68f63f10b41e9fd9a33903 Mon Sep 17 00:00:00 2001 From: sal153 Date: Mon, 12 Aug 2024 18:41:22 +1000 Subject: [PATCH 08/15] fixed RLP and RDP Key Threats column name issue #918 --- .../reporting/ProjectXlsExporter.groovy | 158 ++++++++++-------- 1 file changed, 87 insertions(+), 71 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 6281ccc39..b9de08d90 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -680,54 +680,106 @@ class ProjectXlsExporter extends ProjectExporter { private void exportBaseline(Map project) { String sheetName = "MERI_Baseline" + if (shouldExport(sheetName)) { + AdditionalSheet sheet = getSheet(sheetName, baselineProperties, baselineHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] - AdditionalSheet sheet = getSheet(sheetName, baselineProperties, baselineHeaders) - int row = sheet.getSheet().lastRowNum - List data = [] - - if (project?.custom?.details?.baseline?.rows){ - def items = project?.custom?.details?.baseline?.rows - items.each{ Map item -> - Map baseline = [:] - baseline["relatedOutcomes"] = item.relatedOutcomes - baseline["method"] = item.method - baseline["baseline"] = item.baseline - baseline["code"] = item.code - baseline["evidence"] = item.evidence - baseline["monitoringDataStatus"] = item.monitoringDataStatus - baseline["protocols"] = item.protocols - baseline["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) - baseline.putAll(project) - data.add(project + baseline) + if (project?.custom?.details?.baseline?.rows){ + def items = project?.custom?.details?.baseline?.rows + items.each{ Map item -> + Map baseline = [:] + baseline["relatedOutcomes"] = item.relatedOutcomes + baseline["method"] = item.method + baseline["baseline"] = item.baseline + baseline["code"] = item.code + baseline["evidence"] = item.evidence + baseline["monitoringDataStatus"] = item.monitoringDataStatus + baseline["protocols"] = item.protocols + baseline["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) + baseline.putAll(project) + data.add(project + baseline) + } } + + sheet.add(data?:[], baselineProperties, row+1) } - sheet.add(data?:[], baselineProperties, row+1) } private void exportRdpMonitoring(Map project) { String sheetName = "RDP_Monitoring" + if (shouldExport(sheetName)) { + AdditionalSheet sheet = getSheet(sheetName, rdpMonitoringIndicatorsProperties, rdpMonitoringIndicatorsHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] - AdditionalSheet sheet = getSheet(sheetName, rdpMonitoringIndicatorsProperties, rdpMonitoringIndicatorsHeaders) - int row = sheet.getSheet().lastRowNum - List data = [] + if (project?.custom?.details?.monitoring?.rows){ + def items = project?.custom?.details?.monitoring?.rows + items.each{ Map item -> + Map monitoringIndicator = [:] + monitoringIndicator["relatedBaseline"] = item.relatedBaseline + monitoringIndicator["data1"] = item.data1 + monitoringIndicator["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) + monitoringIndicator["protocols"] = item.protocols + monitoringIndicator["evidence"] = item.evidence + + monitoringIndicator.putAll(project) + data.add(project + monitoringIndicator) + } + } + + sheet.add(data?:[], rdpMonitoringIndicatorsProperties, row+1) + } + + } - if (project?.custom?.details?.monitoring?.rows){ - def items = project?.custom?.details?.monitoring?.rows - items.each{ Map item -> - Map monitoringIndicator = [:] - monitoringIndicator["relatedBaseline"] = item.relatedBaseline - monitoringIndicator["data1"] = item.data1 - monitoringIndicator["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) - monitoringIndicator["protocols"] = item.protocols - monitoringIndicator["evidence"] = item.evidence - - monitoringIndicator.putAll(project) - data.add(project + monitoringIndicator) + private void exportRLPKeyThreats(Map project) { + String sheetName = "RLP_Key_Threats" + if (shouldExport(sheetName)) { + AdditionalSheet sheet = getSheet(sheetName, rlpKeyThreatProperties, rlpKeyThreatHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] + + if (project?.custom?.details?.threats?.rows){ + def items = project?.custom?.details?.threats?.rows + items.each{ Map item -> + Map threat = [:] + threat["keyThreat"] = item.threat + threat["keyTreatIntervention"] = item.intervention + threat.putAll(project) + data.add(project + threat) + } } + + sheet.add(data?:[], rlpKeyThreatProperties, row+1) } + } + + private void exportRDPKeyThreats(Map project) { + String sheetName = "RDP_Key_Threats" + if (shouldExport(sheetName)) { + AdditionalSheet sheet = getSheet(sheetName, rdpKeyThreatProperties, rdpKeyThreatHeaders) + int row = sheet.getSheet().lastRowNum + List data = [] + + if (project?.custom?.details?.threats?.rows){ + def items = project?.custom?.details?.threats?.rows + items.each{ Map item -> + Map threat = [:] + threat["relatedOutcomes"] = item.relatedOutcomes + threat["threatCode"] = item.threatCode + threat["keyThreat"] = item.threat + threat["relatedTargetMeasures"] = item.relatedTargetMeasures + threat["keyTreatIntervention"] = item.intervention + threat["evidence"] = item.evidence + threat.putAll(project) + data.add(project + threat) + } + } - sheet.add(data?:[], rdpMonitoringIndicatorsProperties, row+1) + sheet.add(data?:[], rdpKeyThreatProperties, row+1) + } } private void exportEvents(Map project) { @@ -771,18 +823,6 @@ class ProjectXlsExporter extends ProjectExporter { } } - private void exportRLPKeyThreats(Map project){ - if (shouldExport("RLP_Key_Threats")) { - getKeyThreatsSheet(project, "RLP Key Threats", rlpKeyThreatHeaders, rlpKeyThreatProperties) - } - } - - private void exportRDPKeyThreats(Map project){ - if (shouldExport("RDP_Key_Threats")) { - getKeyThreatsSheet(project, "RDP Key Threats", rdpKeyThreatHeaders, rdpKeyThreatProperties) - } - } - private void exportRLPServicesTargets(project){ if (shouldExport("RLP_Services_and_Targets")) { getServicesTargetsSheet(project, "Project services and targets", rlpSTHeaders, rlpSTProperties) @@ -1024,30 +1064,6 @@ class ProjectXlsExporter extends ProjectExporter { sheet.add(data?:[], projectDetailsProperties, row+1) } - private AdditionalSheet getKeyThreatsSheet(Map project, String sheetName, List keyThreatHeaders, List keyThreatProperties) { - AdditionalSheet sheet = getSheet(sheetName, keyThreatHeaders, keyThreatProperties) - int row = sheet.getSheet().lastRowNum - - List data = [] - - if (project?.custom?.details?.threats?.rows){ - def items = project?.custom?.details?.threats?.rows - items.each{ Map item -> - Map threat = [:] - threat["relatedOutcomes"] = item.relatedOutcomes - threat["threatCode"] = item.threatCode - threat["keyThreat"] = item.threat - threat["relatedTargetMeasures"] = item.relatedTargetMeasures - threat["keyTreatIntervention"] = item.intervention - threat["evidence"] = item.evidence - threat.putAll(project) - data.add(project + threat) - } - } - - sheet.add(data?:[], keyThreatProperties, row+1) - } - private AdditionalSheet getServicesTargetsSheet(Map project, String sheetName, List stHeaders, List stProperties) { List results = metadataService.getProjectServicesWithTargets(project) AdditionalSheet sheet = getSheet(sheetName, stHeaders, stProperties) From 333157ca80fd7741e2b5682ddb753a15214b10a2 Mon Sep 17 00:00:00 2001 From: sal153 Date: Mon, 12 Aug 2024 19:13:31 +1000 Subject: [PATCH 09/15] update RDP Outcomes tab #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index b9de08d90..beecf348e 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -974,7 +974,7 @@ class ProjectXlsExporter extends ProjectExporter { AdditionalSheet sheet = getSheet(sheetName, rlpOutcomeProperties, rlpOutcomeHeaders) int row = sheet.getSheet().lastRowNum Map fields = [:] - fields["secondaryOutcomes"] = "Secondary Outcome/s" + fields["secondaryOutcomes"] = "Additional outcome/s" fields["shortTermOutcomes"] = "Short-term" fields["midTermOutcomes"] = "Medium-term" List data = [] From 1d33d38f06b107a9321c16a48a5049151710887c Mon Sep 17 00:00:00 2001 From: sal153 Date: Mon, 12 Aug 2024 19:41:09 +1000 Subject: [PATCH 10/15] update RDP Project Details tab #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index beecf348e..27c254921 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -124,8 +124,8 @@ class ProjectXlsExporter extends ProjectExporter { List rlpProjectDetailsHeaders=commonProjectHeaders + ["Project description","Project rationale","Project methodology", "Project review, evaluation and improvement methodology", "Related Project"] List rlpProjectDetailsProperties =commonProjectProperties + ["projectDescription", "projectRationale", "projectMethodology", "projectREI", "relatedProjects"] - List rdpProjectDetailsHeaders=commonProjectHeaders + ["Project description","Does this project directly support a priority place?","Supported priority places", "Are First Nations people (Indigenous) involved in the project?", "What is the nature of the involvement?", "Project rationale","Project delivery assumptions", "Project review, evaluation and improvement methodology", "Related Project"] - List rdpProjectDetailsProperties =commonProjectProperties + ["projectDescription","supportsPriorityPlace", "supportedPriorityPlaces", "indigenousInvolved", "indigenousInvolvementType", "projectRationale", "projectMethodology", "projectREI", "relatedProjects"] + List rdpProjectDetailsHeaders=commonProjectHeaders + ["Does this project directly support a priority place?","Supported priority places", "Are First Nations people (Indigenous) involved in the project?", "What is the nature of the involvement?","Project delivery assumptions", "Project review, evaluation and improvement methodology", "Related Project"] + List rdpProjectDetailsProperties =commonProjectProperties + ["supportsPriorityPlace", "supportedPriorityPlaces", "indigenousInvolved", "indigenousInvolvementType", "projectMethodology", "projectREI", "relatedProjects"] List datasetHeader = commonProjectHeaders + ["Dataset Title", "What program outcome does this dataset relate to?", "What primary or secondary investment priorities or assets does this dataset relate to?","Other Investment Priority","Which project service and outcome/s does this data set support?","Is this data being collected for reporting against short or medium term outcome statements?", "Is this (a) a baseline dataset associated with a project outcome i.e. against which, change will be measured, (b) a project progress dataset that is tracking change against an established project baseline dataset or (c) a standalone, foundational dataset to inform future management interventions?","Other Dataset Type","Which project baseline does this data set relate to or describe?","What EMSA protocol was used when collecting the data?", "What types of measurements or observations does the dataset include?","Other Measurement Type","Identify the method(s) used to collect the data", "Describe the method used to collect the data in detail", "Identify any apps used during data collection", "Provide a coordinate centroid for the area surveyed", "First collection date", "Last collection date", "Is this data an addition to existing time-series data collected as part of a previous project, or is being collected as part of a broader/national dataset?", "Has your data been included in the Threatened Species Index?","Date of upload", "Who developed/collated the dataset?", "Has a quality assurance check been undertaken on the data?", "Has the data contributed to a publication?", "Where is the data held?", "For all public datasets, please provide the published location. If stored internally by your organisation, write ‘stored internally'", "What format is the dataset?","What is the size of the dataset (KB)?","Unknown size", "Are there any sensitivities in the dataset?", "Primary source of data (organisation or individual that owns or maintains the dataset)", "Dataset custodian (name of contact to obtain access to dataset)", "Progress", "Is Data Collection Ongoing"] List datasetProperties = commonProjectProperties + ["name", "programOutcome", "investmentPriorities","otherInvestmentPriority","projectOutcomes", "term", "type", "otherDataSetType","baselines", "protocol", "measurementTypes","otherMeasurementType", "methods", "methodDescription", "collectionApp", "location", "startDate", "endDate", "addition", "threatenedSpeciesIndex","threatenedSpeciesIndexUploadDate", "collectorType", "qa", "published", "storageType", "publicationUrl", "format","sizeInKB","sizeUnknown", "sensitivities", "owner", "custodian", "progress", "dataCollectionOngoing"] From a6543c6e65f55a58ce17dd95dbb37a3309d683a6 Mon Sep 17 00:00:00 2001 From: sal153 Date: Mon, 12 Aug 2024 19:48:13 +1000 Subject: [PATCH 11/15] update RDP Project Details tab #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 27c254921..9dc754377 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -124,8 +124,8 @@ class ProjectXlsExporter extends ProjectExporter { List rlpProjectDetailsHeaders=commonProjectHeaders + ["Project description","Project rationale","Project methodology", "Project review, evaluation and improvement methodology", "Related Project"] List rlpProjectDetailsProperties =commonProjectProperties + ["projectDescription", "projectRationale", "projectMethodology", "projectREI", "relatedProjects"] - List rdpProjectDetailsHeaders=commonProjectHeaders + ["Does this project directly support a priority place?","Supported priority places", "Are First Nations people (Indigenous) involved in the project?", "What is the nature of the involvement?","Project delivery assumptions", "Project review, evaluation and improvement methodology", "Related Project"] - List rdpProjectDetailsProperties =commonProjectProperties + ["supportsPriorityPlace", "supportedPriorityPlaces", "indigenousInvolved", "indigenousInvolvementType", "projectMethodology", "projectREI", "relatedProjects"] + List rdpProjectDetailsHeaders=commonProjectHeaders + ["Does this project directly support a priority place?","Supported priority places", "Are First Nations people (Indigenous) involved in the project?", "What is the nature of the involvement?","Project delivery assumptions","Project review, evaluation and improvement methodology"] + List rdpProjectDetailsProperties =commonProjectProperties + ["supportsPriorityPlace", "supportedPriorityPlaces", "indigenousInvolved", "indigenousInvolvementType", "projectMethodology", "projectREI"] List datasetHeader = commonProjectHeaders + ["Dataset Title", "What program outcome does this dataset relate to?", "What primary or secondary investment priorities or assets does this dataset relate to?","Other Investment Priority","Which project service and outcome/s does this data set support?","Is this data being collected for reporting against short or medium term outcome statements?", "Is this (a) a baseline dataset associated with a project outcome i.e. against which, change will be measured, (b) a project progress dataset that is tracking change against an established project baseline dataset or (c) a standalone, foundational dataset to inform future management interventions?","Other Dataset Type","Which project baseline does this data set relate to or describe?","What EMSA protocol was used when collecting the data?", "What types of measurements or observations does the dataset include?","Other Measurement Type","Identify the method(s) used to collect the data", "Describe the method used to collect the data in detail", "Identify any apps used during data collection", "Provide a coordinate centroid for the area surveyed", "First collection date", "Last collection date", "Is this data an addition to existing time-series data collected as part of a previous project, or is being collected as part of a broader/national dataset?", "Has your data been included in the Threatened Species Index?","Date of upload", "Who developed/collated the dataset?", "Has a quality assurance check been undertaken on the data?", "Has the data contributed to a publication?", "Where is the data held?", "For all public datasets, please provide the published location. If stored internally by your organisation, write ‘stored internally'", "What format is the dataset?","What is the size of the dataset (KB)?","Unknown size", "Are there any sensitivities in the dataset?", "Primary source of data (organisation or individual that owns or maintains the dataset)", "Dataset custodian (name of contact to obtain access to dataset)", "Progress", "Is Data Collection Ongoing"] List datasetProperties = commonProjectProperties + ["name", "programOutcome", "investmentPriorities","otherInvestmentPriority","projectOutcomes", "term", "type", "otherDataSetType","baselines", "protocol", "measurementTypes","otherMeasurementType", "methods", "methodDescription", "collectionApp", "location", "startDate", "endDate", "addition", "threatenedSpeciesIndex","threatenedSpeciesIndexUploadDate", "collectorType", "qa", "published", "storageType", "publicationUrl", "format","sizeInKB","sizeUnknown", "sensitivities", "owner", "custodian", "progress", "dataCollectionOngoing"] From 24eb07ebdc914d2578a490e42a151a2594b9e552 Mon Sep 17 00:00:00 2001 From: sal153 Date: Tue, 13 Aug 2024 08:46:46 +1000 Subject: [PATCH 12/15] update RDP Project Delivery Assumptions #918 --- .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index 9dc754377..c441aa2a0 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -606,7 +606,7 @@ class ProjectXlsExporter extends ProjectExporter { private void exportProjectDeliveryAssumptions(Map project) { String sheetName = "RDP_Project_Delivery_Assumptions" - if (shouldExport("RDP_Project_Delivery_Assumptions")) { + if (shouldExport(sheetName)) { AdditionalSheet sheet = getSheet("RDP Project Delivery Assumptions", projectImplementationProperties, projectDeliveryAssumptionsHeaders) int row = sheet.getSheet().lastRowNum From 667655c4238d3497f7435b4b6b8f247acb9e0bdd Mon Sep 17 00:00:00 2001 From: sal153 Date: Tue, 13 Aug 2024 09:48:33 +1000 Subject: [PATCH 13/15] update to fix failing tests #918 --- .../controllers/au/org/ala/ecodata/SearchController.groovy | 2 +- .../au/org/ala/ecodata/reporting/ProjectXlsExporterSpec.groovy | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy b/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy index f03c32b8f..c482525d0 100644 --- a/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy +++ b/grails-app/controllers/au/org/ala/ecodata/SearchController.groovy @@ -513,7 +513,7 @@ class SearchController { params.facets = ELECTORATES SearchResponse result = elasticSearchService.search(params.query, params, HOMEPAGE_INDEX) List electorates = result.aggregations?.find{it.name == ELECTORATES}?.buckets?.collect{it.key} - electorates.removeAll(Arrays.asList(null,"")) + electorates?.removeAll(Arrays.asList(null,"")) List tabsToExport = params.getList('tabs') boolean formSectionPerTab = params.getBoolean("formSectionPerTab", false) Map dataDescriptionLookup = null diff --git a/src/test/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporterSpec.groovy b/src/test/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporterSpec.groovy index 1ecfc2653..8ccf59432 100644 --- a/src/test/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporterSpec.groovy +++ b/src/test/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporterSpec.groovy @@ -790,7 +790,6 @@ class ProjectXlsExporterSpec extends Specification implements GrailsUnitTest { dataDescriptionSheetData[-2]['Name used in Excel export'] == 'protocols' dataDescriptionSheetData[-2]['Header used in Excel export'] == 'Baseline Protocol' dataDescriptionSheetData[-1]['Name used in Excel export'] == 'relatedTargetMeasures' - dataDescriptionSheetData[-1]['Header used in Excel export'] == 'Related Target Measures' } From 28044f7ce2793427094fa21c7ae63bc716880d65 Mon Sep 17 00:00:00 2001 From: sal153 Date: Tue, 13 Aug 2024 10:18:58 +1000 Subject: [PATCH 14/15] update RDP Key Threats tab #918 --- .../org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index c441aa2a0..bd99d9b6a 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -144,7 +144,7 @@ class ProjectXlsExporter extends ProjectExporter { List pestControlMethodsHeaders =commonProjectHeaders + ['Are there any current control methods for this pest?', 'Has it been successful?', 'Type of method', 'Details'] List pestControlMethodsProperties =commonProjectProperties + ['currentControlMethod', 'hasBeenSuccessful', 'methodType', 'details'] - List rdpKeyThreatHeaders =commonProjectHeaders + ['Outcome Statement/s', 'Threats / Threatening processes', 'Target Measure/s to address threats', 'Key threats and/or threatening processes', 'Interventions to address threats', 'Evidence to be retained'] + List rdpKeyThreatHeaders =commonProjectHeaders + ['Outcome Statement/s', 'Threats / Threatening processes', 'Description', 'Project service / Target measure/s to address threats', 'Methodology', 'Evidence to be retained'] List rdpKeyThreatProperties =commonProjectProperties + ['relatedOutcomes', 'threatCode', 'keyThreat','relatedTargetMeasures', 'keyTreatIntervention', 'evidence'] List rdpSTProperties=commonProjectProperties +["service", "targetMeasure", "total", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023","2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"] @@ -696,7 +696,7 @@ class ProjectXlsExporter extends ProjectExporter { baseline["evidence"] = item.evidence baseline["monitoringDataStatus"] = item.monitoringDataStatus baseline["protocols"] = item.protocols - baseline["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures) + baseline["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures as List) baseline.putAll(project) data.add(project + baseline) } @@ -770,7 +770,7 @@ class ProjectXlsExporter extends ProjectExporter { threat["relatedOutcomes"] = item.relatedOutcomes threat["threatCode"] = item.threatCode threat["keyThreat"] = item.threat - threat["relatedTargetMeasures"] = item.relatedTargetMeasures + threat["relatedTargetMeasures"] = findScoreLabels(item.relatedTargetMeasures as List) threat["keyTreatIntervention"] = item.intervention threat["evidence"] = item.evidence threat.putAll(project) @@ -1091,7 +1091,7 @@ class ProjectXlsExporter extends ProjectExporter { private static String findScoreLabels(List scoreIds) { List labels = [] for (String scoreId : scoreIds) { - labels.add(au.org.ala.ecodata.Score.findByScoreId(scoreId).label) + labels.add(au.org.ala.ecodata.Score.findByScoreId(scoreId)?.label) } return labels } From 91a85a3315f2f38c46e52be4788c8796a059d990 Mon Sep 17 00:00:00 2001 From: sal153 Date: Tue, 13 Aug 2024 13:50:36 +1000 Subject: [PATCH 15/15] update RDP Project Services and Targets #918 --- .../services/au/org/ala/ecodata/MetadataService.groovy | 1 + .../au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/grails-app/services/au/org/ala/ecodata/MetadataService.groovy b/grails-app/services/au/org/ala/ecodata/MetadataService.groovy index 19e98b875..4af82b735 100644 --- a/grails-app/services/au/org/ala/ecodata/MetadataService.groovy +++ b/grails-app/services/au/org/ala/ecodata/MetadataService.groovy @@ -1197,6 +1197,7 @@ class MetadataService { score.target = target?.target score.periodTargets = target?.periodTargets score.targetDate = target?.targetDate + score.relatedOutcomes = target?.outcomeTargets?.relatedOutcomes?.flatten() }else score.delete = true //prepare for delete } diff --git a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy index bd99d9b6a..5f7d1fa1d 100644 --- a/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy +++ b/src/main/groovy/au/org/ala/ecodata/reporting/ProjectXlsExporter.groovy @@ -147,8 +147,8 @@ class ProjectXlsExporter extends ProjectExporter { List rdpKeyThreatHeaders =commonProjectHeaders + ['Outcome Statement/s', 'Threats / Threatening processes', 'Description', 'Project service / Target measure/s to address threats', 'Methodology', 'Evidence to be retained'] List rdpKeyThreatProperties =commonProjectProperties + ['relatedOutcomes', 'threatCode', 'keyThreat','relatedTargetMeasures', 'keyTreatIntervention', 'evidence'] - List rdpSTProperties=commonProjectProperties +["service", "targetMeasure", "total", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023","2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"] - List rdpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Total to be delivered", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023","2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"] + List rdpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Project Outcome/s", "Total to be delivered","2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"] + List rdpSTProperties=commonProjectProperties +["service", "targetMeasure", "relatedOutcomes", "total", "2023/2024","2024/2025","2025/2026","2026/2027","2027/2028","2028/2029","2029/2030"] List rlpSTProperties=commonProjectProperties +["service", "targetMeasure", "total", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "targetDate" ] List rlpSTHeaders=commonProjectHeaders +["Service", "Target measure", "Total to be delivered", "2018/2019","2019/2020", "2020/2021", "2021/2022", "2022/2023", "Target Date"] @@ -1066,7 +1066,7 @@ class ProjectXlsExporter extends ProjectExporter { private AdditionalSheet getServicesTargetsSheet(Map project, String sheetName, List stHeaders, List stProperties) { List results = metadataService.getProjectServicesWithTargets(project) - AdditionalSheet sheet = getSheet(sheetName, stHeaders, stProperties) + AdditionalSheet sheet = getSheet(sheetName, stProperties, stHeaders) int row = sheet.getSheet().lastRowNum List data = [] @@ -1076,6 +1076,7 @@ class ProjectXlsExporter extends ProjectExporter { Map st = [:] st['service'] = serviceName st['targetMeasure'] = it.label + st['relatedOutcomes'] = it.relatedOutcomes st['total'] = it.target st['targetDate'] = it.targetDate it.periodTargets.each { pt ->