### Start sdmx-api site Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/windows-stat-core-services/ Starts the sdmx-api IIS site. ```sh /c/Windows/System32/inetsrv/appcmd start site /site.name:sdmx-api ``` -------------------------------- ### Start transfer-service site with appcmd Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/windows-stat-core-services/ Starts the transfer-service IIS site. Use this after configuring the service. The site name must match the one created during installation. ```sh /c/Windows/System32/inetsrv/appcmd start site /site.name:transfer-service ``` -------------------------------- ### Download maapi-app.config example Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/windows-stat-core-services/ Download the example configuration file from the dotstatsuite-core-sdmxri-nsi-ws repository and save it as Estat.Sri.Mapping.Tool.dll.config. ```sh curl https://gitlab.com/sis-cc/.stat-suite/dotstatsuite-core-sdmxri-nsi-ws/-/raw/master/docs/installation/config-examples/maapi-app.config?inline=false >Estat.Sri.Mapping.Tool.dll.config ``` -------------------------------- ### Start IIS site getdata-service Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/windows-stat-core-services/ Starts the newly created IIS site. ```sh /c/Windows/System32/inetsrv/appcmd start site /site.name:getdata-service ``` -------------------------------- ### Example routes.json for QA deployment Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/configurations/tenant-model/ Example routes.json file for a deployment strategy using a proxy, showing hosts for keycloak, sdmxjs, visions, sfs, share, data-viewer, data-lifecycle-manager, and data-explorer with tenant mappings. ```json [ {"host": "keycloak.siscc.org", "target": "http://keycloak-http"}, {"host": "sdmxjs-qa.siscc.org", "target": "http://sdmxjs"}, {"host": "visions-qa.siscc.org", "target": "http://visions"}, {"host": "sfs-qa.siscc.org", "target": "http://sfs" }, {"host": "share-qa.siscc.org", "target": "http://share" }, {"host": "dv-qa.siscc.org", "target": "http://data-viewer", "tenant": "oecd" }, {"host": "dlm-qa.siscc.org", "target": "http://data-lifecycle-manager", "tenant": "oecd:dlm" }, {"host": "dlm2-qa.siscc.org", "target": "http://data-lifecycle-manager", "tenant": "oecd:dlm2" }, {"host": "de-qa.siscc.org", "target": "http://data-explorer", "tenant": "oecd:de" } ] ``` -------------------------------- ### Empty dataHeader mixin override Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/configurations/de-customisation/ Starts the example of overriding the DataHeader component. Replace 'nameOfTheComponents' with 'dataHeader' (camelCase). This does not erase other theme props. ```json { "theme": { "mixins": { "dataHeader": {} } } } ``` -------------------------------- ### Keycloak configuration in tenants.json Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/configurations/authentication/keycloak-configuration/ Update the 'keycloak' property in the tenants.json file to specify the realm and client ID for your Keycloak setup. In this example, the realm is 'DotStat-Local' and the client ID is 'DotStat-Applications'. ```json "keycloak": { "realm": "DotStat-Local", "clientId": "DotStat-Applications" } ``` -------------------------------- ### data-viewer start command Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/monotenant-install-from-artifacts/ Command to start the data-viewer service in git bash. Sets SERVER_PORT=3005 and CONFIG_URL=http://localhost:5007, then runs npm run start:run. ```bash SERVER_PORT=3005 CONFIG_URL=http://localhost:5007 npm run start:run ``` -------------------------------- ### Download web.config sample Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/install-source-code/windows-stat-core-services/ Downloads the demo-routing-iis.config file from the dotstatsuite-documentation repository and saves it as web.config in the sdmx-api folder. ```sh curl -L https://gitlab.com/sis-cc/dotstatsuite-documentation/-/raw/master/dotstatsuite-core/demo-routing-iis.config -o /c/dotstatsuite-website/sdmx-api/web.config ``` -------------------------------- ### R script: Authenticate with OauthToken, refresh token, and fetch dataflows Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/StatSuite-auth-access-R-example.R Complete R workflow: starts OauthToken.exe to get tokens, refreshes the access token via Keycloak, then calls the SDMX REST service to retrieve dataflow IDs. Requires httr, XML, and jsonlite packages. The script sets proxy environment variables and expects the OauthToken.exe path and service URLs to be configured. ```R library(httr) library(XML) Oauth_console <- 'Z:\\OauthToken\\Bin\\OauthToken.exe' keycloak_url <- 'https://AUTH-SERVICE-ROOT/auth/realms/YOURORG' test_url <- 'https://SDMX-SERVICE-ROOT/rest/dataflow/all/all/all' # To get all dataflow app_id <- ' yourappid' # Start OauthToken.exe console, it opens a browser, user authenticates # --------------------------------------------------------------------------- out <- '' out <- shell(paste0(Oauth_console, " ", keycloak_url, app_id), intern = TRUE, wait=TRUE) o <- as.list(out) access_token <- trimws(substr(o[[20]],nchar('accessToken:')+1,nchar(o[[20]]))) refresh_token <- trimws(substr(o[[23]],nchar('refreshToken:')+1,nchar(o[[23]]))) # Refresh the token # --------------------------------------------------------------------------- Sys.unsetenv("no_proxy") Sys.setenv(no_proxy='') res <- httr::POST(paste0(keycloak_url,'/protocol/openid-connect/token'), httr::add_headers(.headers = c("Content-Type" = "application/x-www-form-urlencoded")), body = paste0('grant_type=refresh_token&client_id=app&refresh_token=',refresh_token), encode = "multipart") if (res$status_code==200) { json_res <- httr::content(res, type = "text", encoding = "UTF-8") cat('\nToken has been refreshed') result <- jsonlite::fromJSON(json_res) new_access_token <- result$access_token new_refresh_token <- result$refresh_token } else { stop('An error has occured when refreshing token') } # Test NSI REST URL (Get all dataflows) using token # --------------------------------------------------------------------------- config <- c(httr::add_headers("Authorization"=paste0('Bearer ',new_access_token))) config <- c(config, httr::accept('application/xml;')) Sys.unsetenv("no_proxy") Sys.setenv(no_proxy="*") msg <- httr::GET(test_url, as.list(config)) if (res$status_code==200) { xml_doc <- xmlParse(msg) nsDefs <- xmlNamespaceDefinitions(xml_doc) xml_ns <- structure(sapply(nsDefs, function(x) x$uri), names = names(nsDefs)) df_ids <- xpathSApply(doc = xml_doc, path = '//message:Structure//message:Structures//structure:Dataflows//structure:Dataflow', namespaces = xml_ns, xmlGetAttr, 'id') cat(paste0('\n', length(df_ids), ' dataflows')) } else { stop('An error has occured when getting dataflows') } ``` -------------------------------- ### Example tenants.json configuration Source: https://sis-cc.gitlab.io/dotstatsuite-documentation/configurations/tenant-model/ Example configuration file showing the structure of the tenant model, including organisations, spaces, datasources, and scopes (DLM and DE). The file is named tenants.json. ```json { "org-1": { "id": "org-1", "label": "org-1-name", "spaces": { "space-1": { "label": "space-1-name", ... }, "space-2": { "label": "space-2-name", ... }, }, "datasources": { "ds:space-1": { "dataSpaceId": "space-1", "dataqueries": [...] } }, "scopes": { "dlm-scope-1": { "type": "dlm", "label": "dlm-scope-1-name", "oidc": { ... }, "spaces": [ { "id": "space1", ... }, { "id": "space2", ... } ] }, "dlm-scope-1": { ... }, "de-scope-1": { "type": "de", "label": "de-scope-1-name", "oidc": { ... }, "spaces": [ "space1", "space2" ], "datasources": [ "ds:space1", "ds:space2" ] }, "de-scope-2": { ... } } }, "org-2": { ... } } ```