Allows you to connect to an ‘Alfresco’ content management repository and interact with its contents using simple and intuitive functions.
Before you can interact and manage content you will need access to an ‘Alfresco’ content management repository.
This guide will help you get started with ‘Alfresco’.
You will need to know the root URL for the ‘Alfresco’ content management repository, http://localhost:8080 when installed locally.
Install the development version from github with:
# install.packages("remotes")
::install_github("rwetherall/alfr") remotes
Install release version from CRAN with:
install.packages("alfr")
In order to communicate with the Alfresco repository you must first establish a session connection. The location of the respository is required to do this, along with valid user credentials.
<- alf_session("http://localhost:8080", "admin", "admin") session
All content is stored on a repository node so before we can upload
binary content we must first create a node to store it within. In this
example we are creating a node called myFile2.txt
in the
folder test
. -root-
is used to reference the
root repository node.
<- alf_node.new(session, "-root-", list(name="myFile2.txt", nodeType="cm:content", relativePath="test")) my_file
Now content can be uploaded into the nodes content property where it will be stored in the Alfresco repository.
<- my_file$content$update("resources/testuploaddoc.txt") my_file
Get a reference to the node you want to read content from.
<- alf_node.new(session, "-root-", relativePath="test/myFile2.txt") my_file
Content stored in a repository node can then be read to the client by opening a connection and reading the contents.
<- my_file$content$as.file("resources/download.txt") %>% file("r")
con <- readLines(con)
content_lines close(con)
With a reference to the node that you want to delete from the repository.
alf_node.delete(session, node$id)