Browse Source

Updated doc + checks

master
Maxime Wack 6 years ago
parent
commit
50db8f1b69
5 changed files with 43 additions and 10 deletions
  1. +0
    -6
      R/ontology.R
  2. +4
    -4
      R/pm.R
  3. +1
    -0
      R/system.R
  4. +20
    -0
      man/clear_demodata.Rd
  5. +18
    -0
      man/service.Rd

+ 0
- 6
R/ontology.R View File

@@ -19,8 +19,6 @@ add_ontology <- function(name, scheme, ont, modi = NULL, include_code = T, host
add_ont(name, scheme, host, admin, pass)

populate_ont(ont, modi, name, scheme, include_code, host, admin, pass)

populate_concept(ont, modi, name, scheme, host, admin, pass)
}

#' Delete an ontology from i2b2
@@ -39,8 +37,4 @@ add_ontology <- function(name, scheme, ont, modi = NULL, include_code = T, host
delete_ontology <- function(scheme, host = "", admin = "", pass = "")
{
delete_ont(scheme, host, admin, pass)

delete_concept(scheme, host, admin, pass)

delete_modifier(scheme, host, admin, pass)
}

+ 4
- 4
R/pm.R View File

@@ -91,7 +91,7 @@ add_project <- function(project_id, project_name, host = "", admin = "", pass =

# crc-ds.xml
xml2::read_html("/opt/wildfly-10.0.0.Final/standalone/deployments/crc-ds.xml") %>%
xml_nodes("datasources") -> crc
rvest::xml_nodes("datasources") -> crc

datasource <- list()
datasource$datasource$`connection-url` <- list(stringr::str_c("jdbc:postgresql://localhost:5432/i2b2", project_id, "data"))
@@ -107,11 +107,11 @@ add_project <- function(project_id, project_name, host = "", admin = "", pass =
attr(datasource$datasource, "pool-name") <- stringr::str_c("QueryTool", project_id, "DS")
attr(datasource$datasource, "enabled") <- "true"
attr(datasource$datasource, "use-ccm") <- "false"
datasource %>% as_xml_document -> datasource
datasource %>% xml2::as_xml_document -> datasource

crc %>% xml2::xml_add_child(datasource)

write_xml(crc, "/opt/wildfly-10.0.0.Final/standalone/deployments/crc-ds.xml")
xml2::write_xml(crc, "/opt/wildfly-10.0.0.Final/standalone/deployments/crc-ds.xml")
}

#' List projects
@@ -168,6 +168,6 @@ delete_project <- function(project_id, host = "", admin = "", pass = "")
new <- list(datasources = datasources)
attr(new$datasources, "xmlns") <- "http://www.jboss.org/ironjacamar/schema"

xml2::write_xml(new %>% as_xml_document, "/opt/wildfly-10.0.0.Final/standalone/deployments/crc-ds.xml")
xml2::write_xml(new %>% xml2::as_xml_document, "/opt/wildfly-10.0.0.Final/standalone/deployments/crc-ds.xml")
}


+ 1
- 0
R/system.R View File

@@ -76,6 +76,7 @@ create_admin <- function(admin = "i2b2admin", pass= NULL, pass_length = 8)
#'
#' @param service The service to manage (pg for short for postgresql-9.1)
#' @param action The action to perform
#' @param use_sudo Use sudo if not executed by root account (defaults to T)
#' @export
service <- function(service, action = c("start", "stop", "restart"), use_sudo = T)
{


+ 20
- 0
man/clear_demodata.Rd View File

@@ -0,0 +1,20 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/demodata.R
\name{clear_demodata}
\alias{clear_demodata}
\title{Clear the demodata tables}
\usage{
clear_demodata(project, host = "", admin = "", pass = "")
}
\arguments{
\item{project}{The name of the project}

\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Clear the demodata tables
}

+ 18
- 0
man/service.Rd View File

@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/system.R
\name{service}
\alias{service}
\title{Manage services}
\usage{
service(service, action = c("start", "stop", "restart"), use_sudo = T)
}
\arguments{
\item{service}{The service to manage (pg for short for postgresql-9.1)}

\item{action}{The action to perform}

\item{use_sudo}{Use sudo if not executed by root account (defaults to T)}
}
\description{
Start/stop/restart services
}

Loading…
Cancel
Save