AtomFeed | R Documentation |
This class models an atom feed
R6Class
object.
AtomFeed
Object of R6Class
for modelling an Atom feed
new(xml)
This method is used to create an Atom Feed
setId(id)
Set identifier
setUpdated(updated)
Set update date (object of class 'character' or 'POSIX')
addLink(link, rel, type)
Adds a link. Default rel
value is set to "alternate". Default
type
value is set to "text/html"
delLink(link, rel, type)
Deletes a link
setSelfLink(link)
Sets a self-relation link
setAlternateLink(link, type)
Sets an alternate-relation link. Default type is "text/html"
setTitle(title)
Set title
setSubtitle(subtitle)
Set subtitle
addAuthor(author)
Adds an author, object of class AtomAuthor
delAuthor(author)
Deletes an author, object of class AtomAuthor
addContributor(contributor)
Adds a contributor, object of class AtomContributor
delContributor(contributor)
Deletes a contributor, object of class AtomContributor
setGenerator(generator, type)
Sets generator
setIcon(icon)
Sets icon
addCategory(term, scheme, label)
Adds a category
delCategory(term, scheme, label)
Deletes a category
addEntry(entry)
Adds an entry, object of class AtomEntry
delEntry(entry)
Deletes an entry, object of class AtomEntry
atom4R::atom4RLogger
-> atom4R::AtomAbstractObject
-> AtomFeed
id
Identifier
updated
Update date
published
Publication date
title
Title
subtitle
Subtitle
rights
Rights (license, use, ...)
author
Author person
contributor
Contributor person
generator
Generator
icon
Icon
logo
Logo
category
Category
link
links
entry
List of entries
atom4R::atom4RLogger$ERROR()
atom4R::atom4RLogger$INFO()
atom4R::atom4RLogger$WARN()
atom4R::atom4RLogger$logger()
atom4R::AtomAbstractObject$addListElement()
atom4R::AtomAbstractObject$contains()
atom4R::AtomAbstractObject$createElement()
atom4R::AtomAbstractObject$decode()
atom4R::AtomAbstractObject$delListElement()
atom4R::AtomAbstractObject$encode()
atom4R::AtomAbstractObject$getClass()
atom4R::AtomAbstractObject$getClassName()
atom4R::AtomAbstractObject$getNamespace()
atom4R::AtomAbstractObject$getNamespaceDefinition()
atom4R::AtomAbstractObject$getRootElement()
atom4R::AtomAbstractObject$getXmlElement()
atom4R::AtomAbstractObject$isDocument()
atom4R::AtomAbstractObject$isFieldInheritedFrom()
atom4R::AtomAbstractObject$print()
atom4R::AtomAbstractObject$save()
atom4R::AtomAbstractObject$setIsDocument()
atom4R::AtomAbstractObject$validate()
new()
Initializes a AtomFeed
AtomFeed$new(xml = NULL)
xml
object of class XMLInternalNode-class from XML
setId()
Set ID
AtomFeed$setId(id)
id
id
setUpdated()
Set updated date
AtomFeed$setUpdated(updated)
updated
object of class Date
or POSIXt
setPublished()
Set published date
AtomFeed$setPublished(published)
published
object of class Date
or POSIXt
addLink()
Adds link
AtomFeed$addLink(link, rel = "alternate", type = "text/html")
link
link
rel
relation. Default is "alternate"
type
type. Default is "text/html"
TRUE
if added, FALSE
otherwise
delLink()
Deletes link
AtomFeed$delLink(link, rel = "alternate", type = "text/html")
link
link
rel
relation. Default is "alternate"
type
type. Default is "text/html"
TRUE
if deleted, FALSE
otherwise
setSelfLink()
Set self link
AtomFeed$setSelfLink(link)
link
link
TRUE
if set, FALSE
otherwise
setAlternateLink()
Set alternate link
AtomFeed$setAlternateLink(link, type = "text/html")
link
link
type
type. Default is "text/html"
TRUE
if set, FALSE
otherwise
setTitle()
Set title
AtomFeed$setTitle(title, type = "text")
title
title
type
type. Default is "text"
setSubtitle()
Set subtitle
AtomFeed$setSubtitle(subtitle, type = "text")
subtitle
subtitle
type
type. Default is "text"
setRights()
Set rights
AtomFeed$setRights(rights, type = "text")
rights
rights
type
type. Default is "text"
addAuthor()
Adds author
AtomFeed$addAuthor(author)
author
object of class AtomAuthor
TRUE
if added, FALSE
otherwise
delAuthor()
Deletes author
AtomFeed$delAuthor(author)
author
object of class AtomAuthor
TRUE
if deleted, FALSE
otherwise
addContributor()
Adds contributor
AtomFeed$addContributor(contributor)
contributor
object of class AtomContributor
TRUE
if added, FALSE
otherwise
delContributor()
Deletes contributor
AtomFeed$delContributor(contributor)
contributor
object of class AtomContributor
TRUE
if deleted, FALSE
otherwise
setGenerator()
Set generator
AtomFeed$setGenerator(generator, type = "text")
generator
generator
type
type. Default is "text"
setIcon()
Set icon
AtomFeed$setIcon(icon)
icon
icon
addCategory()
Adds category
AtomFeed$addCategory(value, term, scheme = NULL, label = NULL)
value
value
term
term
scheme
scheme
label
label
TRUE
if added, FALSE
otherwise
delCategory()
Deletes category
AtomFeed$delCategory(value, term, scheme = NULL, label = NULL)
value
value
term
term
scheme
scheme
label
label
TRUE
if deleted, FALSE
otherwise
addEntry()
Adds an entry
AtomFeed$addEntry(entry)
entry
object of class AtomEntry
TRUE
if added, FALSE
otherwise
delEntry()
Deletes an entry
AtomFeed$delEntry(entry)
entry
object of class AtomEntry
TRUE
if deleted, FALSE
otherwise
clone()
The objects of this class are cloneable with this method.
AtomFeed$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#encoding atom <- AtomFeed$new() atom$setId("my-atom-feed") atom$setTitle("My Atom feed title") atom$setSubtitle("MyAtom feed subtitle") author1 <- AtomAuthor$new( name = "John Doe", uri = "http://www.atomxml.com/johndoe", email = "johndoe@atom4R.com" ) atom$addAuthor(author1) author2 <- AtomAuthor$new( name = "John Doe's sister", uri = "http://www.atomxml.com/johndoesister", email = "johndoesister@atom4R.com" ) atom$addAuthor(author2) contrib1 <- AtomContributor$new( name = "Contrib1", uri = "http://www.atomxml.com/contrib1", email = "contrib1@atom4R.com" ) atom$addContributor(contrib1) contrib2 <- AtomContributor$new( name = "Contrib2", uri = "http://www.atomxml.com/contrib2", email = "contrib2@atom4R.com" ) atom$addContributor(contrib2) atom$setIcon("https://via.placeholder.com/300x150.png/03f/fff?text=atom4R") atom$setSelfLink("http://example.com/atom.feed") atom$setAlternateLink("http://example.com/my-atom-feed") atom$addCategory("draft", "dataset") atom$addCategory("world", "spatial") atom$addCategory("fisheries", "domain") #add entry entry <- AtomEntry$new() entry$setId("my-atom-entry") entry$setTitle("My Atom feed entry") entry$setSummary("My Atom feed entry very comprehensive abstract") author1 <- AtomAuthor$new( name = "John Doe", uri = "http://www.atomxml.com/johndoe", email = "johndoe@atom4R.com" ) entry$addAuthor(author1) author2 <- AtomAuthor$new( name = "John Doe's sister", uri = "http://www.atomxml.com/johndoesister", email = "johndoesister@atom4R.com" ) entry$addAuthor(author2) contrib1 <- AtomContributor$new( name = "Contrib1", uri = "http://www.atomxml.com/contrib1", email = "contrib1@atom4R.com" ) entry$addContributor(contrib1) contrib2 <- AtomContributor$new( name = "Contrib2", uri = "http://www.atomxml.com/contrib2", email = "contrib2@atom4R.com" ) entry$addContributor(contrib2) entry$addCategory("draft", "dataset") entry$addCategory("world", "spatial") entry$addCategory("fisheries", "domain") atom$addEntry(entry) xml <- atom$encode()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.