-
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.
- Loading branch information
Showing
7 changed files
with
308 additions
and
15 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,87 @@ | ||
#' ISOOperationChainMetadata | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO OperationChainMetadata | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISOOperationChainMetadata | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @examples | ||
#' md <- ISOOperationChainMetadata$new() | ||
#' xml <- md$encode() | ||
#' | ||
#' @references | ||
#' - ISO 19139 \url{https://schemas.isotc211.org/19119/srv/srv/#element_SV_OperationChainMetadata} | ||
#' | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-1/srv/1.3.0/srv/#element_SV_OperationChainMetadata} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOOperationChainMetadata <- R6Class("ISOOperationChainMetadata", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "SV_OperationChainMetadata", | ||
xmlNamespacePrefix = list( | ||
"19139" = "SRV", | ||
"19115-3" = "SRV" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field name name [1..1]: character | ||
name = NULL, | ||
#'@field description description [1..1]: character | ||
description = NULL, | ||
#'@field operation operation [1..*]: ISOOperationMetadata | ||
operation = list(), | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Set name | ||
#'@param name name | ||
#'@param locales list of localized texts. Default is \code{NULL} | ||
setName = function(name, locales = NULL){ | ||
self$name <- as.character(name) | ||
if(!is.null(locales)){ | ||
self$name <- self$createLocalisedProperty(name, locales) | ||
} | ||
}, | ||
|
||
#'@description Set description | ||
#'@param description description | ||
#'@param locales list of localized texts. Default is \code{NULL} | ||
setDescription = function(description, locales = NULL){ | ||
self$description <- as.character(description) | ||
if(!is.null(locales)){ | ||
self$description <- self$createLocalisedProperty(description, locales) | ||
} | ||
}, | ||
|
||
#'@description Adds operation metadata | ||
#'@param operation object of class \link{ISOOperationMetadata} | ||
#'@return \code{TRUE} if added, \code{FALSE} otherwise | ||
addOperation = function(operation){ | ||
if(!is(operation, "ISOOperationMetadata")){ | ||
stop("The argument should be an object of class 'ISOOperationMetadata'") | ||
} | ||
return(self$addListElement("operation", operation)) | ||
}, | ||
|
||
#'@description Deletes operation metadata | ||
#'@param operation object of class \link{ISOOperationMetadata} | ||
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise | ||
delOperation = function(operation){ | ||
if(!is(operation, "ISOOperationMetadata")){ | ||
stop("The argument should be an object of class 'ISOOperationMetadata'") | ||
} | ||
return(self$delListElement("operation", operation)) | ||
} | ||
|
||
|
||
) | ||
) |
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.