Skip to content

Commit

Permalink
DSLoginBuilder does not enforce providing table or resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed May 18, 2020
1 parent 2ed2cd5 commit 4bf5e58
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/DSLoginBuilder.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ DSLoginBuilder <- R6::R6Class(
} else if (startsWith(url,"http") && !startsWith(url,"https") && !private$.silent) {
warning("Secure HTTP connection is recommended: ", url, call. = FALSE)
}
if (private$.is.empty(table) && private$.is.empty(resource)) {
stop("The table and resource parameters cannot be both empty", call. = FALSE)
}
#if (private$.is.empty(table) && private$.is.empty(resource)) {
# stop("The table and resource parameters cannot be both empty", call. = FALSE)
#}

lg <- private$.get.logins()
if (ncol(lg) == 0) {
Expand Down
17 changes: 16 additions & 1 deletion R/datashield.login.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' builder <- newDSLoginBuilder()
#' builder$append(server="server1", url="https://opal-demo.obiba.org",
#' table="datashield.CNSIM1", resource="datashield.CNSIM1r",
#' user="administrator", password="password",
#' user="dsuser", password="password",
#' options="list(ssl_verifyhost=0,ssl_verifypeer=0)")
#' builder$append(server="server2", url="dslite.server",
#' table="CNSIM2", resource="CNSIM2r", driver="DSLiteDriver")
Expand All @@ -63,6 +63,21 @@
#' # Example 3: login and assign specific variable(s)
#' myvar <- list("LAB_TSC")
#' connections <- datashield.login(logins=logindata, assign=TRUE, variables=myvar)
#'
#' # note that the asignment information can also be provided afterwards
#' builder <- newDSLoginBuilder()
#' builder$append(server="server1", url="https://opal-demo.obiba.org",
#' user="dsuser", password="password")
#' builder$append(server="server2", url="https://opal-test.obiba.org",
#' token="123456789")
#' logindata <- builder$build()
#' connections <- datashield.login(logins=logindata)
#' datashield.assign.table(connections, symbol = "D",
#' table = list(server1 = "CNSIM.CNSIM1",
#' server2 = "CNSIM.CNSIM2"))
#' datashield.assign.resource(connections, symbol = "rsrc",
#' table = list(server1 = "res.CNSIM1",
#' server2 = "res.CNSIM2"))
#'}
#'
datashield.login <- function(logins=NULL, assign=FALSE, variables=NULL, missings=FALSE, symbol="D", id.name=NULL,
Expand Down
17 changes: 16 additions & 1 deletion man/datashield.login.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4bf5e58

Please sign in to comment.