Skip to content

Commit

Permalink
#3 fix broken CSWClient 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jul 28, 2018
1 parent 0cb75e3 commit ecd9960
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/CSWConstraint.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CSWConstraint <- R6Class("CSWConstraint",
stop("The argument 'filter' should be an object of class 'OGCFilter'")
}
self$CqlText = cqlText
if(!is.null(filter)) filter$setFilterVersion("2.0")
if(!is.null(filter) && serviceVersion=="3.0.0") filter$setFilterVersion("2.0")
self$filter = filter
},

Expand All @@ -40,6 +40,13 @@ CSWConstraint <- R6Class("CSWConstraint",
nsVersion <- ifelse(serviceVersion=="3.0.0", "3.0", serviceVersion)
private$xmlNamespace = paste(private$xmlNamespaceBase, nsVersion, sep="/")
names(private$xmlNamespace) <- ifelse(serviceVersion=="3.0.0", "csw30", "csw")
if(!is.null(self$filter)){
if(serviceVersion=="3.0.0"){
self$filter$setFilterVersion("2.0")
}else{
self$filter$setFilterVersion("1.1.0")
}
}
}

)
Expand Down

0 comments on commit ecd9960

Please sign in to comment.