Moved all classes from RefClass OOP model to R6 and made improvements
authorFuad Muhic <fmuhic@capeannenterprises.com>
Mon, 11 Dec 2017 16:34:20 +0000 (17:34 +0100)
committerFuad Muhic <fmuhic@capeannenterprises.com>
Mon, 11 Dec 2017 16:34:20 +0000 (17:34 +0100)
to tree structure representing collection content.

Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic@capeannenterprises.com>

20 files changed:
sdk/R/.RData
sdk/R/DESCRIPTION
sdk/R/NAMESPACE
sdk/R/R/Arvados.R
sdk/R/R/ArvadosFile.R
sdk/R/R/Collection.R
sdk/R/R/HttpParser.R
sdk/R/R/HttpRequest.R
sdk/R/R/Subcollection.R
sdk/R/R/arvados_objects.R [deleted file]
sdk/R/R/custom_classes.R [deleted file]
sdk/R/README
sdk/R/man/Arvados.Rd [moved from sdk/R/man/Arvados-class.Rd with 68% similarity]
sdk/R/man/ArvadosFile-class.Rd [deleted file]
sdk/R/man/ArvadosFile.Rd [new file with mode: 0644]
sdk/R/man/Collection-class.Rd [deleted file]
sdk/R/man/Collection.Rd [new file with mode: 0644]
sdk/R/man/HttpParser.Rd [moved from sdk/R/man/HttrParser-class.Rd with 52% similarity]
sdk/R/man/Subcollection-class.Rd [deleted file]
sdk/R/man/Subcollection.Rd [new file with mode: 0644]

index 21c70242b8b4b82cd00484040e336d86018a4a66..b08e7751163f390ab6a4f6f0dcf90db8334fcf84 100644 (file)
Binary files a/sdk/R/.RData and b/sdk/R/.RData differ
index cc46f65bfa942a88a5765a64cfa5a8988864345e..b0343c7015c28592533b12daa19c87d8fd5b7452 100644 (file)
@@ -11,6 +11,7 @@ Encoding: UTF-8
 LazyData: true
 RoxygenNote: 6.0.1.9000
 Imports:
+    R6,
     httr,
     stringr,
     jsonlite,
index b29927fc2464259ac2af25dd06a9dcc1413ee1d5..411deb8a31124c09fae36b73abf811ff3c534c3e 100644 (file)
@@ -4,6 +4,3 @@ export(Arvados)
 export(ArvadosFile)
 export(Collection)
 export(Subcollection)
-exportClasses(ArvadosFile)
-exportClasses(Collection)
-exportClasses(Subcollection)
index ab38763e1643dff9df47aa66ed668eb32c93d92a..196fcfb51f9969de7b5a9e1ff0dc7c4738e6b7b9 100644 (file)
@@ -1,6 +1,5 @@
 source("./R/HttpRequest.R")
 source("./R/HttpParser.R")
-source("./R/custom_classes.R")
 
 #' Arvados SDK Object
 #'
@@ -8,35 +7,16 @@ source("./R/custom_classes.R")
 #'
 #' @field token Token represents user authentification token.
 #' @field host Host represents server name we wish to connect to.
-#' @examples arv = Arvados("token", "host_name")
+#' @examples arv = Arvados$new("token", "host_name")
 #' @export Arvados
-Arvados <- setRefClass(
+Arvados <- R6::R6Class(
 
     "Arvados",
 
-    fields = list(
-
-        getToken          = "function",
-        getHostName       = "function",
-
-        #Todo(Fudo): This is for debug only. Remove it.
-        getWebDavToken    = "function",
-        getWebDavHostName = "function",
-        setWebDavToken    = "function",
-        setWebDavHostName = "function",
-
-        collection_get    = "function",
-        collection_list   = "function",
-        collection_create = "function",
-        collection_update = "function",
-        collection_delete = "function"
-    ),
-
-    methods = list(
+    public = list(
 
         initialize = function(auth_token = NULL, host_name = NULL) 
         {
-            # Private state
             if(!is.null(host_name))
                Sys.setenv(ARVADOS_API_HOST  = host_name)
 
@@ -49,108 +29,122 @@ Arvados <- setRefClass(
             if(host == "" | token == "")
                 stop("Please provide host name and authentification token or set ARVADOS_API_HOST and ARVADOS_API_TOKEN environmental variables.")
 
+            discoveryDocumentURL <- paste0("https://", host, "/discovery/v1/apis/arvados/v1/rest")
+
             version <- "v1"
             host  <- paste0("https://", host, "/arvados/", version, "/")
 
-            # Public methods
-            getToken <<- function() { token }
-            getHostName <<- function() { host }
+            private$http <- HttpRequest$new()
+            private$httpParser <- HttpParser$new()
+            private$token <- token
+            private$host <- host
+            
+            headers <- list(Authorization = paste("OAuth2", private$token))
+
+            serverResponse <- private$http$GET(discoveryDocumentURL, headers)
+
+            discoveryDocument <- private$httpParser$parseJSONResponse(serverResponse)
+            private$webDavHostName <- discoveryDocument$keepWebServiceUrl
+            print(private$webDavHostName)
+        },
+
+        getToken    = function() private$token,
+        getHostName = function() private$host,
 
-            #Todo(Fudo): Hardcoded credentials to WebDAV server. Remove them later
-            getWebDavToken    <<- function() { webDavToken }
-            getWebDavHostName <<- function() { webDavHostName }
-            setWebDavToken    <<- function(token) { webDavToken <<- token }
-            setWebDavHostName <<- function(hostName) { webDavHostName <<- hostName }
+        #Todo(Fudo): Hardcoded credentials to WebDAV server. Remove them later
+        getWebDavHostName = function() private$webDavHostName,
 
-            collection_get <<- function(uuid) 
-            {
-                collectionURL <- paste0(host, "collections/", uuid)
-                headers <- list(Authorization = paste("OAuth2", token))
+        getCollection = function(uuid) 
+        {
+            collectionURL <- paste0(private$host, "collections/", uuid)
+            headers <- list(Authorization = paste("OAuth2", private$token))
 
-                http <- HttpRequest() 
-                serverResponse <- http$GET(collectionURL, headers)
+            serverResponse <- private$http$GET(collectionURL, headers)
 
-                httpParser <- HttpParser()
-                collection <- httpParser$parseJSONResponse(serverResponse)
+            collection <- private$httpParser$parseJSONResponse(serverResponse)
 
-                if(!is.null(collection$errors))
-                    stop(collection$errors)       
+            if(!is.null(collection$errors))
+                stop(collection$errors)       
 
-                collection
-            }
+            collection
+        },
 
-            collection_list <<- function(filters = NULL, limit = 100, offset = 0) 
-            {
-                collectionURL <- paste0(host, "collections")
-                headers <- list(Authorization = paste("OAuth2", token))
+        listCollections = function(filters = NULL, limit = 100, offset = 0) 
+        {
+            collectionURL <- paste0(private$host, "collections")
+            headers <- list(Authorization = paste("OAuth2", private$token))
 
-                http <- HttpRequest() 
-                serverResponse <- http$GET(collectionURL, headers, NULL, filters, limit, offset)
+            serverResponse <- private$http$GET(collectionURL, headers, NULL, filters, limit, offset)
 
-                httpParser <- HttpParser()
-                collection <- httpParser$parseJSONResponse(serverResponse)
+            collection <- private$httpParser$parseJSONResponse(serverResponse)
 
-                if(!is.null(collection$errors))
-                    stop(collection$errors)       
+            if(!is.null(collection$errors))
+                stop(collection$errors)       
 
-                collection
-            }
+            collection
+        },
 
-            collection_delete <<- function(uuid) 
-            {
-                collectionURL <- paste0(host, "collections/", uuid)
-                headers <- list("Authorization" = paste("OAuth2", token),
-                                "Content-Type"  = "application/json")
+        deleteCollection = function(uuid) 
+        {
+            collectionURL <- paste0(private$host, "collections/", uuid)
+            headers <- list("Authorization" = paste("OAuth2", private$token),
+                            "Content-Type"  = "application/json")
 
-                http <- HttpRequest() 
-                serverResponse <- http$DELETE(collectionURL, headers)
+            serverResponse <- private$http$DELETE(collectionURL, headers)
 
-                httpParser <- HttpParser()
-                collection <- httpParser$parseJSONResponse(serverResponse)
+            collection <- private$httpParser$parseJSONResponse(serverResponse)
 
-                if(!is.null(collection$errors))
-                    stop(collection$errors)       
+            if(!is.null(collection$errors))
+                stop(collection$errors)       
 
-                collection
-            }
+            collection
+        },
 
-            collection_update <<- function(uuid, body) 
-            {
-                collectionURL <- paste0(host, "collections/", uuid)
-                headers <- list("Authorization" = paste("OAuth2", token),
-                                "Content-Type"  = "application/json")
-                body <- jsonlite::toJSON(body, auto_unbox = T)
+        updateCollection = function(uuid, body) 
+        {
+            collectionURL <- paste0(private$host, "collections/", uuid)
+            headers <- list("Authorization" = paste("OAuth2", private$token),
+                            "Content-Type"  = "application/json")
 
-                http <- HttpRequest() 
-                serverResponse <- http$PUT(collectionURL, headers, body)
+            body <- jsonlite::toJSON(body, auto_unbox = T)
 
-                httpParser <- HttpParser()
-                collection <- httpParser$parseJSONResponse(serverResponse)
+            serverResponse <- private$http$PUT(collectionURL, headers, body)
 
-                if(!is.null(collection$errors))
-                    stop(collection$errors)       
+            collection <- private$httpParser$parseJSONResponse(serverResponse)
 
-                collection
-            }
+            if(!is.null(collection$errors))
+                stop(collection$errors)       
 
-            collection_create <<- function(body) 
-            {
-                collectionURL <- paste0(host, "collections")
-                headers <- list("Authorization" = paste("OAuth2", token),
-                                "Content-Type"  = "application/json")
-                body <- jsonlite::toJSON(body, auto_unbox = T)
+            collection
+        },
 
-                http <- HttpRequest() 
-                serverResponse <- http$POST(collectionURL, headers, body)
+        createCollection = function(body) 
+        {
+            collectionURL <- paste0(private$host, "collections")
+            headers <- list("Authorization" = paste("OAuth2", private$token),
+                            "Content-Type"  = "application/json")
+            body <- jsonlite::toJSON(body, auto_unbox = T)
 
-                httpParser <- HttpParser()
-                collection <- httpParser$parseJSONResponse(serverResponse)
+            serverResponse <- private$http$POST(collectionURL, headers, body)
 
-                if(!is.null(collection$errors))
-                    stop(collection$errors)       
+            collection <- private$httpParser$parseJSONResponse(serverResponse)
 
-                collection
-            }
+            if(!is.null(collection$errors))
+                stop(collection$errors)       
+
+            collection
         }
-    )
+
+    ),
+    
+    private = list(
+
+        token          = NULL,
+        host           = NULL,
+        webDavHostName = NULL,
+        http           = NULL,
+        httpParser     = NULL
+    ),
+    
+    cloneable = FALSE
 )
index 067e70ac3e2500e70a89512160ef3fb55e3e138a..f7c45dcc206c6a2d7d01fd33b23722f22010e0d8 100644 (file)
@@ -1,48 +1,61 @@
-source("./R/HttpRequest.R")
-#' ArvadosFile Class
-#' 
-#' @details 
-#' Todo: Update description
-#' Subcollection
-#' 
+#' ArvadosFile Object
+#'
+#' Update description
+#'
 #' @export ArvadosFile
-#' @exportClass ArvadosFile
-ArvadosFile <- setRefClass(
+ArvadosFile <- R6::R6Class(
+
     "ArvadosFile",
-    fields = list(
-        name         = "character",
-        relativePath = "character",
 
-        read = "function"
+    public = list(
+
+        initialize = function(name, relativePath, api, collection)
+        {
+            private$name         <- name
+            private$relativePath <- relativePath
+            private$api          <- api
+            private$collection   <- collection
+            private$http         <- HttpRequest$new()
+            private$httpParser   <- HttpParser$new()
+        },
 
+        getName = function() private$name,
 
-    ),
-    methods = list(
-        initialize = function(subcollectionName, api)
+        getRelativePath = function() private$relativePath,
+
+        read = function(offset = 0, length = 0)
         {
-            name <<- subcollectionName
-
-            read <<- function(offset = 0, length = 0)
-            {
-                if(offset < 0 || length < 0)
-                stop("Offset and length must be positive values.")
-
-                range = paste0("bytes=", offset, "-")
-
-                if(length > 0)
-                    range = paste0(range, offset + length - 1)
-                
-                fileURL = paste0(api$getWebDavHostName(), relativePath);
-                headers <- list(Authorization = paste("OAuth2", api$getWebDavToken()), 
-                                Range = range)
-
-                #TODO(Fudo): Move this to HttpRequest.R
-                # serverResponse <- httr::GET(url = fileURL,
-                                            # config = httr::add_headers(unlist(headers)))
-                http <- HttpRequest()
-                serverResponse <- http$GET(fileURL, headers)
-                parsed_response <- httr::content(serverResponse, "raw")
-            }
+            if(offset < 0 || length < 0)
+            stop("Offset and length must be positive values.")
+
+            range = paste0("bytes=", offset, "-")
+
+            if(length > 0)
+                range = paste0(range, offset + length - 1)
+            
+            fileURL = paste0(private$api$getWebDavHostName(), "c=", private$collection$uuid, "/", private$relativePath);
+            headers <- list(Authorization = paste("OAuth2", private$api$getToken()), 
+                            Range = range)
+
+            #TODO(Fudo): Move this to HttpRequest.R
+            # serverResponse <- httr::GET(url = fileURL,
+                                        # config = httr::add_headers(unlist(headers)))
+            serverResponse <- private$http$GET(fileURL, headers)
+            parsed_response <- httr::content(serverResponse, "raw")
+
         }
-    )
+    ),
+
+    private = list(
+
+        name         = NULL,
+        relativePath = NULL,
+        parent       = NULL,
+        api          = NULL,
+        collection   = NULL,
+        http         = NULL,
+        httpParser   = NULL
+    ),
+    
+    cloneable = FALSE
 )
index 29afadc02dab103a863af0b8bcb315b44c1d447e..c372bc20a224b08c85558b8994158988a720874d 100644 (file)
-source("./R/Arvados.R")
-source("./R/HttpParser.R")
 source("./R/Subcollection.R")
 source("./R/ArvadosFile.R")
 
-#' Collection Class
-#' 
-#' @details 
-#' Todo: Update description
-#' Collection
-#' 
-#' @param uuid Object ID
-#' @param etag Object version
-#' @param owner_uuid No description
-#' @param created_at No description
-#' @param modified_by_client_uuid No description
-#' @param modified_by_user_uuid No description
-#' @param modified_at No description
-#' @param portable_data_hash No description
-#' @param replication_desired No description
-#' @param replication_confirmed_at No description
-#' @param replication_confirmed No description
-#' @param updated_at No description
-#' @param manifest_text No description
-#' @param name No description
-#' @param description No description
-#' @param properties No description
-#' @param delete_at No description
-#' @param file_names No description
-#' @param trash_at No description
-#' @param is_trashed No description
-#' 
+#' Arvados Collection Object
+#'
+#' Update description
+#'
+#' @examples arv = Collection$new(api, uuid)
 #' @export Collection
-
-#' @exportClass Collection
-Collection <- setRefClass(
+Collection <- R6::R6Class(
 
     "Collection",
 
-    fields = list(uuid                     = "ANY",
-                  items                    = "ANY",
-                  fileContent              = "ANY",
-                  etag                     = "ANY",
-                  owner_uuid               = "ANY",
-                  created_at               = "ANY",
-                  modified_by_client_uuid  = "ANY",
-                  modified_by_user_uuid    = "ANY",
-                  modified_at              = "ANY",
-                  portable_data_hash       = "ANY",
-                  replication_desired      = "ANY",
-                  replication_confirmed_at = "ANY",
-                  replication_confirmed    = "ANY",
-                  updated_at               = "ANY",
-                  manifest_text            = "ANY",
-                  name                     = "ANY",
-                  description              = "ANY",
-                  properties               = "ANY",
-                  delete_at                = "ANY",
-                  file_names               = "ANY",
-                  trash_at                 = "ANY",
-                  is_trashed               = "ANY",
-
-                  getCollectionContent = "function",
-                  get                  = "function"
-    ),
+    public = list(
 
-    methods = list(
+        #Todo(Fudo): Encapsulate this?
+        uuid                     = NULL,
+        etag                     = NULL,
+        owner_uuid               = NULL,
+        created_at               = NULL,
+        modified_by_client_uuid  = NULL,
+        modified_by_user_uuid    = NULL,
+        modified_at              = NULL,
+        portable_data_hash       = NULL,
+        replication_desired      = NULL,
+        replication_confirmed_at = NULL,
+        replication_confirmed    = NULL,
+        updated_at               = NULL,
+        manifest_text            = NULL,
+        name                     = NULL,
+        description              = NULL,
+        properties               = NULL,
+        delete_at                = NULL,
+        file_names               = NULL,
+        trash_at                 = NULL,
+        is_trashed               = NULL,
 
-        initialize = function(api, uuid) 
+        initialize = function(api, uuid)
         {
-            result <- api$collection_get(uuid)
-            
-            # Private members
-            uuid                     <<- result$uuid                               
-            etag                     <<- result$etag                               
-            owner_uuid               <<- result$owner_uuid                         
-            created_at               <<- result$created_at                         
-            modified_by_client_uuid  <<- result$modified_by_client_uuid            
-            modified_by_user_uuid    <<- result$modified_by_user_uuid              
-            modified_at              <<- result$modified_at                        
-            portable_data_hash       <<- result$portable_data_hash                 
-            replication_desired      <<- result$replication_desired                
-            replication_confirmed_at <<- result$replication_confirmed_at           
-            replication_confirmed    <<- result$replication_confirmed              
-            updated_at               <<- result$updated_at                         
-            manifest_text            <<- result$manifest_text                      
-            name                     <<- result$name                               
-            description              <<- result$description                        
-            properties               <<- result$properties                         
-            delete_at                <<- result$delete_at                          
-            file_names               <<- result$file_names                         
-            trash_at                 <<- result$trash_at                           
-            is_trashed               <<- result$is_trashed                         
-
-            # Public methods
-
-            getCollectionContent <<- function()
-            {
-                #TODO(Fudo): Use proper URL here.
-                uri <- URLencode(api$getWebDavHostName())
+            private$api <- api
+            result <- private$api$getCollection(uuid)
+
+            self$uuid                     <- result$uuid                               
+            self$etag                     <- result$etag                               
+            self$owner_uuid               <- result$owner_uuid                         
+            self$created_at               <- result$created_at                         
+            self$modified_by_client_uuid  <- result$modified_by_client_uuid            
+            self$modified_by_user_uuid    <- result$modified_by_user_uuid              
+            self$modified_at              <- result$modified_at                        
+            self$portable_data_hash       <- result$portable_data_hash                 
+            self$replication_desired      <- result$replication_desired                
+            self$replication_confirmed_at <- result$replication_confirmed_at           
+            self$replication_confirmed    <- result$replication_confirmed              
+            self$updated_at               <- result$updated_at                         
+            self$manifest_text            <- result$manifest_text                      
+            self$name                     <- result$name                               
+            self$description              <- result$description                        
+            self$properties               <- result$properties                         
+            self$delete_at                <- result$delete_at                          
+            self$file_names               <- result$file_names                         
+            self$trash_at                 <- result$trash_at                           
+            self$is_trashed               <- result$is_trashed                         
+
+            #Todo(Fudo): Replace this when you get access to webDAV server.
+            private$fileItems <- private$getCollectionContent()
 
-                # fetch directory listing via curl and parse XML response
-                h <- curl::new_handle()
-                curl::handle_setopt(h, customrequest = "PROPFIND")
+            private$fileTree <- private$generateTree(private$fileItems)
+        },
 
-                #TODO(Fudo): Use proper token here.
-                curl::handle_setheaders(h, "Authorization" = paste("OAuth2", api$getWebDavToken()))
-                response <- curl::curl_fetch_memory(uri, h)
+        printFileContent = function(pretty = TRUE)
+        {
+            if(pretty)
+                private$fileTree$printContent(0)
+            else
+                print(private$fileItems)
+
+        },
+
+        get = function(relativePath)
+        {
+            treeNode <- private$traverseInOrder(private$fileTree, function(node)
+            {
+                if(node$relativePath == relativePath)
+                    return(node)
+                else
+                    return(NULL)
+            })
 
-                HttpParser()$parseWebDAVResponse(response, uri)
+            if(!is.null(treeNode))
+            {
+                return(private$createSubcollectionTree(treeNode))
             }
+            else
+            {
+                return(NULL)
+            }
+        }
+    ),
+
+    active = list(
+        items = function(value)
+        {
+            if(missing(value))
+                return(private$fileItems)
+            else
+                print("Value is read-only.")
 
-            get <<- function(pathToTheFile)
+            return(NULL)
+        }
+    ),
+    
+    private = list(
+
+        api       = NULL,
+        fileItems = NULL,
+        fileTree  = NULL,
+
+        createSubcollectionTree = function(treeNode)
+        {
+            if(treeNode$hasChildren())
             {
-                fileWithPath <- unlist(stringr::str_split(pathToTheFile, "/"))
-                fileWithPath <- fileWithPath[fileWithPath != ""]
+                children = NULL
 
-                findFileIfExists <- function(name, node)
+                for(child in treeNode$children)
                 {
-                    matchPosition <- match(name, sapply(node$content, function(nodeInSubcollection) {nodeInSubcollection$name}), -1)
-                    if(matchPosition != -1)
-                    {
-                        return(node$content[[matchPosition]])
-                    }
-                    else
-                    {
-                        return(NULL)
-                    }
+                    child <- private$createSubcollectionTree(child)
+                    children <- c(children, child)                   
                 }
+
+                return(Subcollection$new(treeNode$name, treeNode$relativePath, children))
+            }
+            else
+            {
+                if(treeNode$type == "file")
+                    return(ArvadosFile$new(treeNode$name, treeNode$relativePath, private$api, self))
+                else if(treeNode$type == "folder" || treeNode$type == "root")
+                    return(Subcollection$new(treeNode$name, treeNode$relativePath, NULL))
+            }
+        },
+
+        createSubcollectionFromNode = function(treeNode, children)
+        {
+            subcollection = NULL
+            if(treeNode$type == "file")
+                subcollection = ArvadosFile$new(treeNode$name, treeNode$relativePath)
+            else if(treeNode$type == "folder" || treeNode$type == "root")
+                subcollection = Subcollection$new(treeNode$name, treeNode$relativePath, children)
+            
+            subcollection
+        },
+
+        getCollectionContent = function()
+        {
+            #TODO(Fudo): Use proper URL here.
+            uri <- URLencode(paste0(private$api$getWebDavHostName(), "c=", self$uuid))
+
+            # fetch directory listing via curl and parse XML response
+            h <- curl::new_handle()
+            curl::handle_setopt(h, customrequest = "PROPFIND")
+
+            #TODO(Fudo): Use proper token here.
+            curl::handle_setheaders(h, "Authorization" = paste("OAuth2", private$api$getToken()))
+            response <- curl::curl_fetch_memory(uri, h)
+            print(response)
+
+            HttpParser$new()$parseWebDAVResponse(response, uri)
+        },
+
+        #Todo(Fudo): Move tree creation to another file.
+        generateTree = function(collectionContent)
+        {
+            treeBranches <- sapply(collectionContent, function(filePath)
+            {
+                splitPath <- unlist(strsplit(filePath, "/", fixed = TRUE))
+
+                pathEndsWithSlash <- substr(filePath, nchar(filePath), nchar(filePath)) == "/"
                 
-                nodeToCheck = .self$fileContent
-                for(fileNameIndex in 1:length(fileWithPath))
+                branch = private$createBranch(splitPath, pathEndsWithSlash)      
+            })
+
+            root <- TreeNode$new("./", "root")
+            root$relativePath = ""
+
+            sapply(treeBranches, function(branch)
+            {
+                private$addNode(root, branch)
+            })
+
+            root
+        },
+
+        createBranch = function(splitPath, pathEndsWithSlash)
+        {
+            branch <- NULL
+            lastElementIndex <- length(splitPath)
+            
+            lastElementInPathType = "file"
+            if(pathEndsWithSlash)
+                lastElementInPathType = "folder"
+
+            for(elementIndex in lastElementIndex:1)
+            {
+                if(elementIndex == lastElementIndex)
+                {
+                    branch = TreeNode$new(splitPath[[elementIndex]], lastElementInPathType)
+                }
+                else
                 {
-                    nodeToCheck <- findFileIfExists(fileWithPath[fileNameIndex], nodeToCheck)
-                    if(is.null(nodeToCheck))
-                        stop("File or folder you asked for is not part of the collection.")
+                    newFolder = TreeNode$new(splitPath[[elementIndex]], "folder")
+                    newFolder$addChild(branch)
+                    branch = newFolder
                 }
 
-                nodeToCheck
+                branch$relativePath <- paste(unlist(splitPath[1:elementIndex]), collapse = "/")
             }
 
+            branch
+        },
 
-            # Private methods
-            .createCollectionContentTree <- function(fileStructure)
+        addNode = function(container, node)
+        {
+            child = container$getChild(node$name)
+
+            if(is.null(child))
             {
-                #TODO(Fudo): Refactor this.
-                #TODO(Fudo): Find a way to link children to parents. (R has no pointers or references).
-                treeBranches <- sapply(fileStructure, function(filePath)
-                {
-                    fileWithPath <- unlist(stringr::str_split(filePath, "/"))
-                    file <- fileWithPath[length(fileWithPath), drop = T]
-
-                    if(file != "")
-                    {
-                        file <- ArvadosFile(file, api)
-                        file$relativePath <- filePath
-                    }
-                    else
-                    {
-                        file <- NULL
-                    }
-
-                    folders <- fileWithPath[-length(fileWithPath)]
-
-                    subcollections <- sapply(folders, function(folder)
-                    {
-                        folder <- Subcollection(folder)
-                        unname(folder)
-                    })
-
-                    if(!is.null(file))
-                        subcollections <- c(subcollections, file)
-
-                    if(length(subcollections) > 1)
-                    {
-                        for(subcollectionIndex in 1:(length(subcollections) - 1))
-                        {
-                            subcollections[[subcollectionIndex]]$relativePath <- paste(folders[1:(subcollectionIndex)], collapse = "/")
-                            subcollections[[subcollectionIndex]]$add(subcollections[[subcollectionIndex + 1]])
-                        }
-                    }
-                    subcollections[[1]]
-                })
-
-                root <- Subcollection(".")
-
-                addIfExists <- function(firstNode, secondNode)
+                container$addChild(node)
+            }
+            else
+            {
+                private$addNode(child, node$getFirstChild())
+            }
+        },
+
+        traverseInOrder = function(node, predicate)
+        {
+            if(node$hasChildren())
+            {
+                result <- predicate(node)
+
+                if(!is.null(result))
+                    return(result)               
+
+                for(child in node$children)
                 {
-                    firstNodeContent <- sapply(firstNode$content, function(node) {node$name})
-                    if(length(firstNodeContent) == 0)
-                    {
-                        firstNode$add(secondNode)
-                        return()
-                    }
-
-                    matchPosition <- match(secondNode$name, firstNodeContent, -1)
-                    if(matchPosition != -1)
-                    {
-                        addIfExists(firstNode$content[[matchPosition]], secondNode$content[[1]])
-                    }
-                    else
-                    {
-                        firstNode$add(secondNode)
-                    }
+                    result <- private$traverseInOrder(child, predicate)
+
+                    if(!is.null(result))
+                        return(result)
                 }
 
-                sapply(treeBranches, function(branch)
-                {
-                    addIfExists(root, branch)
-                })
+                return(NULL)
+            }
+            else
+            {
+                return(predicate(node))
+            }
+        }
+
+    ),
+
+    cloneable = FALSE
+)
+
+TreeNode <- R6::R6Class(
+
+    "TreeNode",
+
+    public = list(
+
+        name = NULL,
+        relativePath = NULL,
+        children = NULL,
+        parent = NULL,
+        type = NULL,
+
+        initialize = function(name, type)
+        {
+            if(type == "folder")
+                name <- paste0(name, "/")
+
+            self$name <- name
+            self$type <- type
+            self$children <- list()
+        },
+
+        addChild = function(node)
+        {
+            self$children <- c(self$children, node)
+            node$setParent(self)
+            self
+        },
+
+        setParent = function(parent)
+        {
+            self$parent = parent
+        },
 
-                root
+        getChild = function(childName)
+        {
+            for(child in self$children)
+            {
+                if(childName == child$name)
+                    return(child)
             }
 
-            #Todo(Fudo): This is dummy data. Real content will come from WebDAV server.
-            # testFileStructure <- c("math.h", "main.cpp", "emptyFolder/",
-                                   # "java/render.java", "java/test/observer.java",
-                                   # "java/test/observable.java",
-                                   # "csharp/this.cs", "csharp/is.cs",
-                                   # "csharp/dummy.cs", "csharp/file.cs")
-            items  <<- getCollectionContent()
-            fileContent  <<- .createCollectionContentTree(items)
+            return(NULL)
+        },
+
+        hasChildren = function()
+        {
+            if(length(self$children) != 0)
+                return(TRUE)
+            else
+                return(FALSE)
+        },
+
+        getFirstChild = function()
+        {
+            if(!self$hasChildren())
+                return(NULL)
+            else
+                return(self$children[[1]])
+        },
+
+        printContent = function(depth)
+        {
+            indentation <- paste(rep("....", depth), collapse = "")
+            print(paste0(indentation, self$name))
+            
+            for(child in self$children)
+                child$printContent(depth + 1)
         }
-    )
+    ),
+
+    cloneable = FALSE
 )
index fb895bed34505989c4f444871739c45c431302ba..d54207ea6f4a4c6fa8ec18904084be7cdc235b20 100644 (file)
@@ -1,35 +1,24 @@
 #' HttpParser
 #'
-HttpParser <- setRefClass(
+HttpParser <- R6::R6Class(
 
     "HttrParser",
 
-    fields = list(
-    ),
-
-    methods = list(
+    public = list(
         initialize = function() 
         {
         },
 
-        parseCollectionGet = function(serverResponse) 
-        {
-            parsed_response <- httr::content(serverResponse, as = "parsed", type = "application/json")
-
-            #Todo(Fudo): Create new Collection object and populate it
-        },
-
         parseJSONResponse = function(serverResponse) 
         {
             parsed_response <- httr::content(serverResponse, as = "parsed", type = "application/json")
-
-            #Todo(Fudo): Create new Collection object and populate it
         },
 
+        #Todo(Fudo): Test this.
         parseWebDAVResponse = function(response, uri)
         {
-            #Todo(Fudo): Move this to HttpParser.
             text <- rawToChar(response$content)
+            print(text)
             doc <- XML::xmlParse(text, asText=TRUE)
 
             # calculate relative paths
@@ -40,9 +29,8 @@ HttpParser <- setRefClass(
                 })
             )
             result <- result[result != ""]
-            #Todo(Fudo): Test this.
+
             result[-1]
         }
-
     )
 )
index ddb8f71c649e5a8bf6d8af5fc99fc2fc9345efa0..ea46beae03c574a34829721fa58c76c636488db7 100644 (file)
-source("./R/custom_classes.R")
-
-HttpRequest <- setRefClass(
+HttpRequest <- R6::R6Class(
 
     "HttrRequest",
 
-    fields = list(
-
-        GET    = "function",
-        PUT    = "function",
-        POST   = "function",
-        DELETE = "function"
-    ),
+    public = list(
 
-    methods = list(
         initialize = function() 
         {
-            # Public methods
-            GET <<- function(url, headers = NULL, body = NULL,
-                             queryFilters = NULL, limit = NULL, offset = NULL)
-            {
-                headers <- httr::add_headers(unlist(headers))
-                query <- .createQuery(queryFilters, limit, offset)
-                url <- paste0(url, query)
-                print(url)
+        },
 
-                serverResponse <- httr::GET(url = url, config = headers)
-            }
+        GET = function(url, headers = NULL, body = NULL,
+                       queryFilters = NULL, limit = NULL, offset = NULL)
+        {
+            headers <- httr::add_headers(unlist(headers))
+            query <- private$createQuery(queryFilters, limit, offset)
+            url <- paste0(url, query)
 
-            PUT <<- function(url, headers = NULL, body = NULL,
-                             queryFilters = NULL, limit = 100, offset = 0)
-            {
-                headers <- httr::add_headers(unlist(headers))
-                query <- .createQuery(queryFilters, limit, offset)
-                url <- paste0(url, query)
+            serverResponse <- httr::GET(url = url, config = headers)
+        },
 
-                serverResponse <- httr::PUT(url = url, config = headers, body = body)
-            }
+        PUT = function(url, headers = NULL, body = NULL,
+                       queryFilters = NULL, limit = 100, offset = 0)
+        {
+            headers <- httr::add_headers(unlist(headers))
+            query <- private$createQuery(queryFilters, limit, offset)
+            url <- paste0(url, query)
 
-            POST <<- function(url, headers = NULL, body = NULL,
-                              queryFilters = NULL, limit = 100, offset = 0)
-            {
-                headers <- httr::add_headers(unlist(headers))
-                query <- .createQuery(queryFilters, limit, offset)
-                url <- paste0(url, query)
+            serverResponse <- httr::PUT(url = url, config = headers, body = body)
+        },
 
-                serverResponse <- httr::POST(url = url, config = headers, body = body)
-            }
+        POST = function(url, headers = NULL, body = NULL,
+                        queryFilters = NULL, limit = 100, offset = 0)
+        {
+            headers <- httr::add_headers(unlist(headers))
+            query <- private$createQuery(queryFilters, limit, offset)
+            url <- paste0(url, query)
 
-            DELETE <<- function(url, headers = NULL, body = NULL,
-                             queryFilters = NULL, limit = NULL, offset = NULL)
-            {
-                headers <- httr::add_headers(unlist(headers))
-                query <- .createQuery(queryFilters, limit, offset)
-                url <- paste0(url, query)
+            serverResponse <- httr::POST(url = url, config = headers, body = body)
+        },
 
-                serverResponse <- httr::DELETE(url = url, config = headers)
-            }
+        DELETE = function(url, headers = NULL, body = NULL,
+                          queryFilters = NULL, limit = NULL, offset = NULL)
+        {
+            headers <- httr::add_headers(unlist(headers))
+            query <- private$createQuery(queryFilters, limit, offset)
+            url <- paste0(url, query)
 
-            # Private methods
-            .createQuery <- function(filters, limit, offset)
-            {
-                finalQuery <- "?alt=json"
+            serverResponse <- httr::DELETE(url = url, config = headers)
+        }
+    ),
 
-                if(!is.null(filters))
-                {
-                    filters <- sapply(filters, function(filter)
-                    {
-                        if(length(filter) != 3)
-                            stop("Filter list must have exacthey 3 elements.")
+    private = list(
 
-                        attributeAndOperator = filter[c(1, 2)]
-                        filterList = filter[[3]]
-                        filterListIsPrimitive = TRUE
-                        if(length(filterList) > 1)
-                            filterListIsPrimitive = FALSE
+        #Todo(Fudo): Refactor this and find a better way to build
+        # Python array from R list (recursion?)
+        createQuery = function(filters, limit, offset)
+        {
+            finalQuery <- "?alt=json"
 
-                        attributeAndOperator <- sapply(attributeAndOperator, function(component) {
-                            component <- paste0("\"", component, "\"")
-                        })
+            if(!is.null(filters))
+            {
+                filters <- sapply(filters, function(filter)
+                {
+                    if(length(filter) != 3)
+                        stop("Filter list must have exacthey 3 elements.")
 
-                        filterList <- sapply(unlist(filterList), function(filter) {
-                            filter <- paste0("\"", filter, "\"")
-                        })
+                    attributeAndOperator = filter[c(1, 2)]
+                    filterList = filter[[3]]
+                    filterListIsPrimitive = TRUE
+                    if(length(filterList) > 1)
+                        filterListIsPrimitive = FALSE
 
-                        filterList <- paste(filterList, collapse = ",+")
+                    attributeAndOperator <- sapply(attributeAndOperator, function(component) {
+                        component <- paste0("\"", component, "\"")
+                    })
 
-                        if(!filterListIsPrimitive)
-                            filterList <- paste0("[", filterList, "]")
+                    filterList <- sapply(unlist(filterList), function(filter) {
+                        filter <- paste0("\"", filter, "\"")
+                    })
 
-                        filter <- c(attributeAndOperator, filterList)
+                    filterList <- paste(filterList, collapse = ",+")
 
-                        queryParameter <- paste(filter, collapse = ",+")
-                        queryParameter <- paste0("[", queryParameter, "]")
-            
-                    })
+                    if(!filterListIsPrimitive)
+                        filterList <- paste0("[", filterList, "]")
 
-                    filters <- paste(filters, collapse = ",+")
-                    filters <- paste0("[", filters, "]")
+                    filter <- c(attributeAndOperator, filterList)
 
-                    encodedQuery <- URLencode(filters, reserved = T, repeated = T)
+                    queryParameter <- paste(filter, collapse = ",+")
+                    queryParameter <- paste0("[", queryParameter, "]")
+        
+                })
 
-                    finalQuery <- paste0(finalQuery, "&filters=", encodedQuery)
+                filters <- paste(filters, collapse = ",+")
+                filters <- paste0("[", filters, "]")
 
-                    #Todo(Fudo): This is a hack for now. Find a proper solution.
-                    finalQuery <- stringr::str_replace_all(finalQuery, "%2B", "+")
-                }
+                encodedQuery <- URLencode(filters, reserved = T, repeated = T)
 
-                if(!is.null(limit))
-                {
-                    if(!is.numeric(limit))
-                        stop("Limit must be a numeric type.")
-                    
-                    finalQuery <- paste0(finalQuery, "&limit=", limit)
-                }
+                finalQuery <- paste0(finalQuery, "&filters=", encodedQuery)
 
-                if(!is.null(offset))
-                {
-                    if(!is.numeric(offset))
-                        stop("Offset must be a numeric type.")
-                    
-                    finalQuery <- paste0(finalQuery, "&offset=", offset)
-                }
+                #Todo(Fudo): This is a hack for now. Find a proper solution.
+                finalQuery <- stringr::str_replace_all(finalQuery, "%2B", "+")
+            }
+
+            if(!is.null(limit))
+            {
+                if(!is.numeric(limit))
+                    stop("Limit must be a numeric type.")
+                
+                finalQuery <- paste0(finalQuery, "&limit=", limit)
+            }
 
-                finalQuery
+            if(!is.null(offset))
+            {
+                if(!is.numeric(offset))
+                    stop("Offset must be a numeric type.")
+                
+                finalQuery <- paste0(finalQuery, "&offset=", offset)
             }
+
+            finalQuery
         }
-    )
+    ),
+
+    cloneable = FALSE
 )
index bc986bb8ff69d8d0a707ad59efc953ee7260f174..4053546fcb2b5171c2cd505872ba16986bb169d4 100644 (file)
@@ -1,27 +1,35 @@
-#' Subcollection Class
-#' 
-#' @details 
-#' Todo: Update description
-#' Subcollection
-#' 
+#' Arvados SubCollection Object
+#'
+#' Update description
+#'
 #' @export Subcollection
-#' @exportClass Subcollection
-Subcollection <- setRefClass(
+Subcollection <- R6::R6Class(
+
     "Subcollection",
-    fields = list(
-        name         = "character",
-        relativePath = "character",
-        content      = "list"
-    ),
-    methods = list(
-        initialize = function(subcollectionName)
+
+    public = list(
+
+        initialize = function(name, relativePath, children)
         {
-            name <<- subcollectionName
-            content <<- list()
+            private$name <- name
+            private$relativePath <- relativePath
+            private$children <- children
         },
-        add = function(subcollectionContent)
-        {
-            content <<- c(content, subcollectionContent)
-        }
-    )
+
+        getName = function() private$name,
+
+        getRelativePath = function() private$relativePath,
+
+        setParent = function(parent) private$parent <- parent
+    ),
+
+    private = list(
+
+        name = NULL,
+        relativePath = NULL,
+        children = NULL,
+        parent = NULL
+    ),
+    
+    cloneable = FALSE
 )
diff --git a/sdk/R/R/arvados_objects.R b/sdk/R/R/arvados_objects.R
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sdk/R/R/custom_classes.R b/sdk/R/R/custom_classes.R
deleted file mode 100644 (file)
index 22f1f76..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-setClassUnion("characterOrNull", c("character", "NULL"))
-setClassUnion("listOrNull", c("list", "NULL"))
-setClassUnion("numericOrNull", c("numeric", "NULL"))
index 011735803996aa2ee07fb4d0afee26407ada8583..6f4e31ebb6597af2659ec678af72a6d191c716e1 100644 (file)
@@ -4,62 +4,79 @@ Examples of usage:
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-Get collection:
+#Initialize API:
 
-arv <- Arvados("insert_token", "insert_host_name")
-arv$collection_get("uuid")
+arv <- Arvados$new("insert_token", "insert_host_name")
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-List collections:
+#Get collection:
 
-collectionList <- arv$collection_list(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"), limit = 10, offset = 2)
+arv$getCollection("uuid")
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-Delete collection:
+#List collections:
 
-deletedCollection <- arv$collection_delete("uuid")
+collectionList <- arv$listCollections(list("uuid", "=" "aaaaa-bbbbb-ccccccccccccccc"), limit = 10, offset = 2)
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-Update collection:
+#Delete collection:
 
-updatedCollection <- arv$collection_update("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
+deletedCollection <- arv$deleteCollection("uuid")
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-Create collection:
+#Update collection:
 
-updatedCollection <- arv$collection_update("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
+updatedCollection <- arv$updateCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
+
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Create collection:
+
+updatedCollection <- arv$createCollection("uuid", list(collection = list(name = "new_name", description = "new_desciption")))
 
 --------------------------------------------------------------------------------------------------------------------------------
 
 --------------------------------------------------------------------------------------------------------------------------------
 
-Things I'm currently working on and are not finished.
+#Collection manipulation:
 
-Collection manipulation:
+--------------------------------------------------------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------------------------------------------------------
 
-arv <- Arvados("insert_token", "insert_host_name")
+#Create collection object:
 
-//This will be removed
-arv$setWebDavToken("webdav_token")
-arv$setWebDavHostName("full_path_to_the_collection_on_webdav_server")
+arv <- Arvados$new("insert_token", "insert_host_name")
+collection <- Collection$new(arv, "uuid")
 
-collection <- Collection(arv, "uuid")
 --------------------------------------------------------------------------------------------------------------------------------
-This will return all files in collection as character vector.
 
-listOfFilesInCollection <- collection$items
+#Print content of the collection
+
+collection$printFileContent()
+
+#of if you just want a list of relative paths:
+
+collection$printFileContent(pretty = FALSE)
+
 --------------------------------------------------------------------------------------------------------------------------------
 
-This will return ArvadosFile or Subcollection from internal tree-like structure.
+#This will return ArvadosFile or Subcollection from internal tree-like structure.
+
+arvadosFile <- collection$get("location/to/my/file.cpp")
 
-collection <- Collection(arv, "uuid")
+#or
 
-arvadosFile <- collection.get("location/to/my/file.exe")
 arvadosSubcollection <- collection.get("location/to/my/directory/")
 
+--------------------------------------------------------------------------------------------------------------------------------
+
+#Read whole file or just a portion of it.
+
+arvadosFile$read(offset = 1024, length = 512)
 
 --------------------------------------------------------------------------------------------------------------------------------
similarity index 68%
rename from sdk/R/man/Arvados-class.Rd
rename to sdk/R/man/Arvados.Rd
index 315f8511b81a746a8a4ad3300b286dbc2eb63024..6dfb0cedcc239c89898c734eb5e609de5dd18dd8 100644 (file)
@@ -1,10 +1,13 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/Arvados.R
-\docType{class}
-\name{Arvados-class}
-\alias{Arvados-class}
+\docType{data}
+\name{Arvados}
 \alias{Arvados}
 \title{Arvados SDK Object}
+\format{An object of class \code{R6ClassGenerator} of length 24.}
+\usage{
+Arvados
+}
 \description{
 All Arvados logic is inside this class
 }
@@ -16,7 +19,7 @@ All Arvados logic is inside this class
 \item{\code{host}}{Host represents server name we wish to connect to.}
 }}
 
-
 \examples{
-arv = Arvados("token", "host_name")
+arv = Arvados$new("token", "host_name")
 }
+\keyword{datasets}
diff --git a/sdk/R/man/ArvadosFile-class.Rd b/sdk/R/man/ArvadosFile-class.Rd
deleted file mode 100644 (file)
index 7d46419..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/ArvadosFile.R
-\docType{class}
-\name{ArvadosFile-class}
-\alias{ArvadosFile-class}
-\alias{ArvadosFile}
-\title{ArvadosFile Class}
-\description{
-ArvadosFile Class
-}
-\details{
-Todo: Update description
-Subcollection
-}
-
diff --git a/sdk/R/man/ArvadosFile.Rd b/sdk/R/man/ArvadosFile.Rd
new file mode 100644 (file)
index 0000000..f48a71f
--- /dev/null
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/ArvadosFile.R
+\docType{data}
+\name{ArvadosFile}
+\alias{ArvadosFile}
+\title{ArvadosFile Object}
+\format{An object of class \code{R6ClassGenerator} of length 24.}
+\usage{
+ArvadosFile
+}
+\description{
+Update description
+}
+\keyword{datasets}
diff --git a/sdk/R/man/Collection-class.Rd b/sdk/R/man/Collection-class.Rd
deleted file mode 100644 (file)
index b84bbbd..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/Collection.R
-\docType{class}
-\name{Collection-class}
-\alias{Collection-class}
-\alias{Collection}
-\title{Collection Class}
-\arguments{
-\item{uuid}{Object ID}
-
-\item{etag}{Object version}
-
-\item{owner_uuid}{No description}
-
-\item{created_at}{No description}
-
-\item{modified_by_client_uuid}{No description}
-
-\item{modified_by_user_uuid}{No description}
-
-\item{modified_at}{No description}
-
-\item{portable_data_hash}{No description}
-
-\item{replication_desired}{No description}
-
-\item{replication_confirmed_at}{No description}
-
-\item{replication_confirmed}{No description}
-
-\item{updated_at}{No description}
-
-\item{manifest_text}{No description}
-
-\item{name}{No description}
-
-\item{description}{No description}
-
-\item{properties}{No description}
-
-\item{delete_at}{No description}
-
-\item{file_names}{No description}
-
-\item{trash_at}{No description}
-
-\item{is_trashed}{No description}
-}
-\description{
-Collection Class
-}
-\details{
-Todo: Update description
-Collection
-}
-
diff --git a/sdk/R/man/Collection.Rd b/sdk/R/man/Collection.Rd
new file mode 100644 (file)
index 0000000..46c76cb
--- /dev/null
@@ -0,0 +1,17 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Collection.R
+\docType{data}
+\name{Collection}
+\alias{Collection}
+\title{Arvados Collection Object}
+\format{An object of class \code{R6ClassGenerator} of length 24.}
+\usage{
+Collection
+}
+\description{
+Update description
+}
+\examples{
+arv = Collection$new(api, uuid)
+}
+\keyword{datasets}
similarity index 52%
rename from sdk/R/man/HttrParser-class.Rd
rename to sdk/R/man/HttpParser.Rd
index 5a6d1c7d6fb50a69add6a30412bc94b66d27953b..68d314fb72defcaf52888618cfe3590061d2b2cf 100644 (file)
@@ -1,11 +1,14 @@
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/HttpParser.R
-\docType{class}
-\name{HttrParser-class}
-\alias{HttrParser-class}
+\docType{data}
+\name{HttpParser}
 \alias{HttpParser}
 \title{HttpParser}
+\format{An object of class \code{R6ClassGenerator} of length 24.}
+\usage{
+HttpParser
+}
 \description{
 HttpParser
 }
-
+\keyword{datasets}
diff --git a/sdk/R/man/Subcollection-class.Rd b/sdk/R/man/Subcollection-class.Rd
deleted file mode 100644 (file)
index 72449fa..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/Subcollection.R
-\docType{class}
-\name{Subcollection-class}
-\alias{Subcollection-class}
-\alias{Subcollection}
-\title{Subcollection Class}
-\description{
-Subcollection Class
-}
-\details{
-Todo: Update description
-Subcollection
-}
-
diff --git a/sdk/R/man/Subcollection.Rd b/sdk/R/man/Subcollection.Rd
new file mode 100644 (file)
index 0000000..e644e02
--- /dev/null
@@ -0,0 +1,14 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Subcollection.R
+\docType{data}
+\name{Subcollection}
+\alias{Subcollection}
+\title{Arvados SubCollection Object}
+\format{An object of class \code{R6ClassGenerator} of length 24.}
+\usage{
+Subcollection
+}
+\description{
+Update description
+}
+\keyword{datasets}