Skip to content

Commit

Permalink
consolidate csw handler
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Nov 30, 2024
1 parent 190e291 commit 7129c25
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions inst/metadata/entity/entity_handler_csw.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,17 @@ handle_entities_csw <- function(handler, source, config, handle = TRUE){
if(length(altitles)>0) for(altitle in altitles) entity$setTitle("alternative", altitle)
#description
entity$setDescription("abstract", rec$identificationInfo[[1]]$abstract)
entity$setDescription("purpose", rec$identificationInfo[[1]]$purpose)
if(!is.null(rec$identificationInfo[[1]]$purpose)) if(!is.na(rec$identificationInfo[[1]]$purpose)){
entity$setDescription("purpose", rec$identificationInfo[[1]]$purpose)
}
credits = rec$identificationInfo[[1]]$credit
if(length(credits)>0) entity$setDescription("credit", credits[[1]])
entity$setDescription("info", rec$identificationInfo[[1]]$supplementalInformation)
entity$setDescription("edition", rec$identificationInfo[[1]]$citation$edition)
if(!is.null(rec$identificationInfo[[1]]$supplementalInformation)) if(!is.na(rec$identificationInfo[[1]]$supplementalInformation)){
entity$setDescription("info", rec$identificationInfo[[1]]$supplementalInformation)
}
if(!is.null(rec$identificationInfo[[1]]$citation$edition)) if(!is.na(rec$identificationInfo[[1]]$citation$edition)){
entity$setDescription("edition", rec$identificationInfo[[1]]$citation$edition)
}
status = rec$identificationInfo[[1]]$status
if(length(status)>0) entity$setDescription("status", status[[1]]$attrs$codeListValue)
#subject
Expand Down

0 comments on commit 7129c25

Please sign in to comment.