Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- synchronises protocols
- creates records for submitted data
  • Loading branch information
temi committed Mar 21, 2024
1 parent 75f49c7 commit 05b115c
Show file tree
Hide file tree
Showing 13 changed files with 2,651 additions and 349 deletions.
103 changes: 103 additions & 0 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ ecodata.documentation.exampleProjectUrl = 'http://ecodata-test.ala.org.au/ws/act
// Used by ParatooService to sync available protocols
paratoo.core.baseUrl = 'https://dev.core-api.monitor.tern.org.au/api'
paratoo.excludeInterventionProtocols = true
paratoo.core.documentationUrl = '/documentation/swagger.json'

auth.baseUrl = 'https://auth-test.ala.org.au'
userDetails.web.url = "${auth.baseUrl}/userdetails/"
Expand Down Expand Up @@ -1391,3 +1392,105 @@ elasticsearch {
username = 'elastic'
password = 'password'
}

// paratoo / monitor

paratoo.defaultPlotLayoutDataModels = [
[
dataType: "geoMap",
name: "plot_layout",
dwcAttribute: "verbatimCoordinates",
validate: "required",
columns: [
[
dwcAttribute: "verbatimLatitude",
source: "plot_layoutLatitude"
],
[
dwcAttribute: "verbatimLongitude",
source: "plot_layoutLongitude"
]
]
],
[
dataType: "list",
name: "plot_visit",
validate: "required",
columns: [
[
dataType: "date",
name: "end_date",
dwcAttribute: "eventDate"
],
[
dataType: "text",
name: "visit_field_name"
],
[
dataType: "date",
name: "start_date",
dwcAttribute: "eventDate"
]
]
]
]

paratoo.defaultPlotLayoutViewModels = [
[
type: "row",
items: [
[
type: "col",
items: [
[
type: "section",
title: "Plot Visit",
preLabel: "Plot Visit",
boxed: true,
items: [
[
type: "repeat",
source: "plot_visit",
userAddedRows: false,
items: [
[
type: "row",
class: "output-section",
items: [
[
type: "col",
items: [
[
type: "date",
source: "end_date",
preLabel: "End Date"
],
[
type: "text",
source: "visit_field_name",
preLabel: "Visit Field Name"
],
[
type: "date",
source: "start_date",
preLabel: "Start Date"
]
]
]
]
]
]
]
]
],
[
type: "geoMap",
source: "plot_layout",
orientation: "vertical"
]
]
]
]
]
]

Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package au.org.ala.ecodata

import au.ala.org.ws.security.SkipApiKeyCheck
import au.org.ala.ecodata.paratoo.ParatooCollection
import au.org.ala.ecodata.paratoo.ParatooCollectionId
import au.org.ala.ecodata.paratoo.ParatooPlotSelection
import au.org.ala.ecodata.paratoo.ParatooPlotSelectionData
import au.org.ala.ecodata.paratoo.ParatooProject
import au.org.ala.ecodata.paratoo.ParatooToken
import au.org.ala.ecodata.paratoo.*
import groovy.util.logging.Slf4j
import io.swagger.v3.oas.annotations.OpenAPIDefinition
import io.swagger.v3.oas.annotations.Operation
Expand Down
16 changes: 12 additions & 4 deletions grails-app/services/au/org/ala/ecodata/OutputService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package au.org.ala.ecodata
import au.org.ala.ecodata.converter.RecordConverter
import au.org.ala.ecodata.metadata.OutputMetadata

import static au.org.ala.ecodata.Status.ACTIVE
import static au.org.ala.ecodata.Status.DELETED

class OutputService {
Expand Down Expand Up @@ -155,8 +154,12 @@ class OutputService {
props.data = saveImages(props.data, props.name, output.outputId, props.activityId);
props.data = saveAudio(props.data, props.name, output.outputId, props.activityId);


createOrUpdateRecordsForOutput(activity, output, props)
try {
createOrUpdateRecordsForOutput(activity, output, props)
}
catch (Exception ex) {
log.error("Error creating records for activity - ${activity.activityId}", ex)
}
commonService.updateProperties(output, props)

return [status: 'ok', outputId: output.outputId]
Expand Down Expand Up @@ -241,7 +244,12 @@ class OutputService {

List statusUpdate = recordService.updateRecordStatusByOutput(outputId, Status.DELETED)
if (!statusUpdate) {
createOrUpdateRecordsForOutput(activity, output, props)
try {
createOrUpdateRecordsForOutput(activity, output, props)
}
catch (Exception ex) {
log.error("Error creating records for activity - ${activity.activityId}", ex)
}
commonService.updateProperties(output, props)
result = [status: 'ok']
} else {
Expand Down
Loading

0 comments on commit 05b115c

Please sign in to comment.