CkAtom Java Programming Reference Documentation
CkAtom
Represents an Atom document. The Atom API allows one to download, create and modify Atom documents.
Properties
// str is a CkString object (output) LastErrorHtml( str )
Error information in HTML format for the last method called.
// str is a CkString object (output) LastErrorText( str )
Error information in plain-text format for the last method called.
// str is a CkString object (output) LastErrorXml( str )
Error information in XML format for the last method called.
// Returns an integer value get_NumEntries( )
Number of entries in the Atom document.
Methods
// tag is a string (input) // value is a string (input) // Returns an integer value AddElement( tag, value )
Adds a new element to the Atom document. The tag is a string such as "title", "subtitle", "summary", etc.
// tag is a string (input) // dateTime is a SYSTEMTIME object (output) // Returns an integer value AddElementDate( tag, dateTime )
Adds a new date-formatted element to the Atom document. The tag is a string such as "created", "modified", "issued", etc.
// tag is a string (input) // htmlStr is a string (input) // Returns an integer value AddElementHtml( tag, htmlStr )
Adds a new HTML formatted element to the Atom document.
// tag is a string (input) // xmlStr is a string (input) // Returns an integer value AddElementXHtml( tag, xmlStr )
Adds a new XHTML formatted element to the Atom document.
// tag is a string (input) // xmlStr is a string (input) // Returns an integer value AddElementXml( tag, xmlStr )
Adds a new XML formatted element to the Atom document.
// xmlStr is a string (input) AddEntry( xmlStr )
Adds an "entry" Atom XML document to the caller's Atom document.
// rel is a string (input) // href is a string (input) // title is a string (input) // typ is a string (input) AddLink( rel, href, title, typ )
Adds a link to the Atom document.
// tag is a string (input) // name is a string (input) // uri is a string (input) // email is a string (input) AddPerson( tag, name, uri, email )
Adds a person to the Atom document. The tag should be a string such as "author", "contributor", etc. If a piece of information is not known, an empty string or NULL value may be passed.
// tag is a string (input) // index is an integer (input) DeleteElement( tag, index )
Removes the Nth occurance of a given element from the Atom document. Indexing begins at 0. For example, to remove the 2nd category, set tag = "category" and index = 1.
// tag is a string (input) // index is an integer (input) // attrName is a string (input) DeleteElementAttr( tag, index, attrName )
Remove an attribute from an element.The index should be 0 unless there are multiple elements having the same tag, in which case it selects the Nth occurrence based on the index ( 0 = first occurrence ).
// tag is a string (input) // index is an integer (input) DeletePerson( tag, index )
Deletes a person from the Atom document. The tag is a string such as "author". The index should be 0 unless there are multiple elements having the same tag, in which case it selects the Nth occurrence based on the index. For example, DeletePerson("author",2) deletes the 3rd author.
// url is a string (input) // Returns a boolean value DownloadAtom( url )
Download an Atom feed from the Internet and load it into the Atom object. Returns true for success, false for failure.
// tag is a string (input) // index is an integer (input) // outStr is a CkString object (output) // Returns a boolean value GetElement( tag, index, outStr )
Returns the content of the Nth element having a specified tag. Returns true for success, false for failure.
// tag is a string (input) // index is an integer (input) // attrName is a string (input) // outStr is a CkString object (output) // Returns a boolean value GetElementAttr( tag, index, attrName, outStr )
Returns the value of an element's attribute. The element is selected by the tag name and the index (the Nth element having a specific tag) and the attribute is selected by name. Returns true for success, false for failure.
// tag is a string (input) // Returns an integer value GetElementCount( tag )
The number of elements having a specific tag.
// tag is a string (input) // index is an integer (input) // sysTime is a SYSTEMTIME object (output) // Returns a boolean value GetElementDate( tag, index, sysTime )
Returns an element's value as a Date.
// index is an integer (input) GetEntry( index )
Returns the Nth entry as an Atom object. (Indexing begins at 0)
// relName is a string (input) // outStr is a CkString object (output) // Returns a boolean value GetLinkHref( relName, outStr )
Returns the href attribute of the link having a specified "rel" attribute (such as "service.feed", "alternate", etc.). Returns true for success, false for failure.
// tag is a string (input) // index is an integer (input) // tag2 is a string (input) // outStr is a CkString object (output) // Returns a boolean value GetPersonInfo( tag, index, tag2, outStr )
Returns a piece of information about a person. To get the 2nd author's name, call GetPersonInfo("author",1,"name"). Returns true for success, false for failure.
// attrName is a string (input) // outStr is a CkString object (output) // Returns a boolean value GetTopAttr( attrName, outStr )
Returns the value of an attribute on the top-level XML node. The tag of a top-level Atom XML node is typically "feed" or "entry", and it might have attributes such as "xmlns" and "xml:lang". Returns true for success, false for failure.
// tag is a string (input) // Returns a boolean value HasElement( tag )
True (1) if the element exists in the Atom document. Otherwise 0.
// xmlStr is a string (input) // Returns a boolean value LoadXml( xmlStr )
Loads the Atom document from an XML string.
NewEntry( )
Initializes the Atom document to be a new "entry".
NewFeed( )
Initializes the Atom document to be a new "feed".
// filename is a string (input) // Returns a boolean value SaveLastError( filename )
Saves the last error information to an XML formatted file.
// tag is a string (input) // index is an integer (input) // attrName is a string (input) // attrValue is a string (input) SetElementAttr( tag, index, attrName, attrValue )
Adds or replaces an attribute on an element.
// attrName is a string (input) // value is a string (input) SetTopAttr( attrName, value )
Adds or replaces an attribute on the top-level XML node of the Atom document.
// outStr is a CkString object (output) // Returns a boolean value ToXmlString( outStr )
Serializes the Atom document to an XML string. Returns true for success, false for failure.
// tag is a string (input) // index is an integer (input) // value is a string (input) UpdateElement( tag, index, value )
Replaces the content of an element.
// tag is a string (input) // index is an integer (input) // dateTime is a SYSTEMTIME object (output) UpdateElementDate( tag, index, dateTime )
Replaces the content of a date-formatted element.
// tag is a string (input) // index is an integer (input) // htmlStr is a string (input) UpdateElementHtml( tag, index, htmlStr )
Replaces the content of an HTML element.
// tag is a string (input) // index is an integer (input) // xmlStr is a string (input) UpdateElementXHtml( tag, index, xmlStr )
Replaces the content of an XHTML element.
// tag is a string (input) // index is an integer (input) // xmlStr is a string (input) UpdateElementXml( tag, index, xmlStr )
Replaces the content of an XML element.
// tag is a string (input) // index is an integer (input) // name is a string (input) // uri is a string (input) // email is a string (input) UpdatePerson( tag, index, name, uri, email )
Replaces the content of a person. To update the 3rd author, call UpdatePerson("author",2,"new name","new URL","new email"). If a piece of information is not known, pass an empty string or a NULL.
// tag is a string (input) // index is an integer (input) // Returns a string getElement( tag, index )
Returns the content of the Nth element having a specified tag.
// tag is a string (input) // index is an integer (input) // attrName is a string (input) // Returns a string getElementAttr( tag, index, attrName )
Returns the value of an element's attribute. The element is selected by the tag name and the index (the Nth element having a specific tag) and the attribute is selected by name.
// relName is a string (input) // Returns a string getLinkHref( relName )
Returns the href attribute of the link having a specified "rel" attribute (such as "service.feed", "alternate", etc.).
// tag is a string (input) // index is an integer (input) // tag2 is a string (input) // Returns a string getPersonInfo( tag, index, tag2 )
Returns a piece of information about a person. To get the 2nd author's name, call GetPersonInfo("author",1,"name").
// attrName is a string (input) // Returns a string getTopAttr( attrName )
Returns the value of an attribute on the top-level XML node. The tag of a top-level Atom XML node is typically "feed" or "entry", and it might have attributes such as "xmlns" and "xml:lang".
// Returns a string lastErrorHtml( )
Error information in HTML format for the last method called.
// Returns a string lastErrorText( )
Error information in plain-text format for the last method called.
// Returns a string lastErrorXml( )
Error information in XML format for the last method called.
// Returns a string toXmlString( )
Serializes the Atom document to an XML string.
|