-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#181 support M5 - MCO ISOReleasibility (+ MCC ISOAbstractResponsibility)
- Loading branch information
Showing
12 changed files
with
477 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' ISOAbstractResponsibility | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO abstract responsibility | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISO abstract responsibility | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' ISO 19115-1:2014 Geographic information — Metadata Part 1: Fundamentals | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOAbstractResponsibility <- R6Class("ISOAbstractResponsibility", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "Abstract_Responsibility", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MCC" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#' ISOReleasability | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO releasability | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISOReleasability | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mco/1.0/mco/#element_MD_Releasability} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOReleasability <- R6Class("ISOReleasability", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "MD_Releasability", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MCO" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field addressee addressee [0..*]: ISOAbstractResponsibility | ||
addressee = list(), | ||
#'@field statement statement [0..1]: character | ||
statement = NULL, | ||
#'@field disseminationConstraints disseminationConstraints [0..*]: ISORestriction | ||
disseminationConstraints = list(), | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Adds addressee | ||
#'@param addressee addressee of class \link{ISOAbstractResponsibility} | ||
#'@return \code{TRUE} if added, \code{FALSE} otherwise | ||
addAddressee = function(addressee){ | ||
if(!is(addressee, "ISOAbstractResponsibility")){ | ||
stop("The argument should be an object inheriting class 'ISOAbstractResponsibility'") | ||
} | ||
return(self$addListElement("addressee", addressee)) | ||
}, | ||
|
||
#'@description Deletes addressee | ||
#'@param addressee addressee of class \link{ISOAbstractResponsibility} | ||
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise | ||
delAddressee = function(addressee){ | ||
if(!is(addressee, "ISOAbstractResponsibility")){ | ||
stop("The argument should be an object inheriting class 'ISOAbstractResponsibility'") | ||
} | ||
return(self$delListElement("addressee", addressee)) | ||
}, | ||
|
||
#'@description Set statement | ||
#'@param statement statement | ||
#'@param locales list of localized texts. Default is \code{NULL} | ||
setStatement = function(statement, locales = NULL){ | ||
self$statement = statement | ||
if(!is.null(locales)){ | ||
self$statement <- self$createLocalisedProperty(statement, locales) | ||
} | ||
}, | ||
|
||
#'@description Adds constraint | ||
#'@param constraint constraint of class \link{ISORestriction} | ||
#'@return \code{TRUE} if added, \code{FALSE} otherwise | ||
addConstraint = function(constraint){ | ||
if(!is(constraint, "ISORestriction")){ | ||
if(is(constraint, "character")){ | ||
constraint = ISORestriction$new(value = constraint) | ||
}else{ | ||
stop("The argument should be an object of class 'ISORestriction' or 'character'") | ||
} | ||
} | ||
return(self$addListElement("disseminationConstraints", constraint)) | ||
}, | ||
|
||
#'@description Deletes constraint | ||
#'@param constraint constraint of class \link{ISORestriction} | ||
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise | ||
delConstraint = function(constraint){ | ||
if(!is(constraint, "ISORestriction")){ | ||
if(is(constraint, "character")){ | ||
constraint = ISORestriction$new(value = constraint) | ||
}else{ | ||
stop("The argument should be an object of class 'ISORestriction' or 'character'") | ||
} | ||
} | ||
return(self$delListElement("disseminationConstraints", constraint)) | ||
} | ||
|
||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.