| AtomEntry {atom4R} | R Documentation |
Atom Entry class
Description
This class models an atom Entry
Format
R6Class object.
Details
AtomEntry
Value
Object of R6Class for modelling an Atom Entry
Super classes
atom4R::atom4RLogger -> atom4R::AtomAbstractObject -> AtomEntry
Public fields
ididentifier
updatedUpdate date/time
publishedPublication date/time
titleTitle
summarySummary
rightsRights
sourceSource
authorAuthor(s)
contributorContributor(s)
categoryCategory
contentContent
Methods
Public methods
Inherited methods
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()
Method new()
Initializes an AtomEntry
Usage
AtomEntry$new(xml = NULL)
Arguments
xmlobject of class XMLInternalNode-class from XML
Method setId()
Set ID
Usage
AtomEntry$setId(id)
Arguments
idid
Method setUpdated()
Set updated date
Usage
AtomEntry$setUpdated(updated)
Arguments
updatedobject of class
DateorPOSIXt
Method setPublished()
Set published date
Usage
AtomEntry$setPublished(published)
Arguments
publishedobject of class
DateorPOSIXt
Method setTitle()
Set title
Usage
AtomEntry$setTitle(title, type = "text")
Arguments
titletitle
typetype. Default is "text"
Method setSummary()
Set summary
Usage
AtomEntry$setSummary(summary, type = "text")
Arguments
summarysummary
typetype. Default is "text"
Method setRights()
Set rights
Usage
AtomEntry$setRights(rights, type = "text")
Arguments
rightsrights
typetype. Default is "text"
Method setSource()
Set source
Usage
AtomEntry$setSource(source, type = "text")
Arguments
sourcesource
typetype. Default is "text"
Method addAuthor()
Adds author
Usage
AtomEntry$addAuthor(author)
Arguments
authorobject of class AtomAuthor
Returns
TRUE if added, FALSE otherwise
Method delAuthor()
Deletes author
Usage
AtomEntry$delAuthor(author)
Arguments
authorobject of class AtomAuthor
Returns
TRUE if deleted, FALSE otherwise
Method addContributor()
Adds contributor
Usage
AtomEntry$addContributor(contributor)
Arguments
contributorobject of class AtomContributor
Returns
TRUE if added, FALSE otherwise
Method delContributor()
Deletes contributor
Usage
AtomEntry$delContributor(contributor)
Arguments
contributorobject of class AtomContributor
Returns
TRUE if deleted, FALSE otherwise
Method addCategory()
Adds category
Usage
AtomEntry$addCategory(value, term, scheme = NULL, label = NULL)
Arguments
valuevalue
termterm
schemescheme
labellabel
Returns
TRUE if added, FALSE otherwise
Method delCategory()
Deletes category
Usage
AtomEntry$delCategory(value, term, scheme = NULL, label = NULL)
Arguments
valuevalue
termterm
schemescheme
labellabel
Returns
TRUE if deleted, FALSE otherwise
Method addLink()
Adds link
Usage
AtomEntry$addLink(link, rel = "alternate", type = "text/html")
Arguments
linklink
relrelation. Default is "alternate"
typetype. Default is "text/html"
Returns
TRUE if added, FALSE otherwise
Method delLink()
Deletes link
Usage
AtomEntry$delLink(link, rel = "alternate", type = "text/html")
Arguments
linklink
relrelation. Default is "alternate"
typetype. Default is "text/html"
Returns
TRUE if deleted, FALSE otherwise
Method setContent()
Set content
Usage
AtomEntry$setContent(content)
Arguments
contentcontent
Method clone()
The objects of this class are cloneable with this method.
Usage
AtomEntry$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
Examples
## Not run:
#encoding
atom <- AtomEntry$new()
atom$setId("my-atom-entry")
atom$setTitle("My Atom feed entry")
atom$setSummary("My Atom feed entry very comprehensive abstract")
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$addCategory("draft", "dataset")
atom$addCategory("world", "spatial")
atom$addCategory("fisheries", "domain")
xml <- atom$encode()
## End(Not run)