java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.wso2.mashup.hostobjects.atom.AtomFeedHostObject
public class AtomFeedHostObject
This is a Mozilla Rhino Host Object implementation which tries to provide a javascript representation of the AtomFeed defined in the ATOM specification
Per RFC4287:
The "atom:feed" element is the document (i.e., top-level) element of
an Atom Feed Document, acting as a container for metadata and data
associated with the feed. Its element children consist of metadata
elements followed by zero or more atom:entry child elements.
atomFeed =
element atom:feed {
atomCommonAttributes,
(atomAuthor*
& atomCategory*
& atomContributor*
& atomGenerator?
& atomIcon?
& atomId
& atomLink*
& atomLogo?
& atomRights?
& atomSubtitle?
& atomTitle
& atomUpdated
& extensionElement*),
atomEntry*
}
This specification assigns no significance to the order of atom:entry
elements within the feed.
The following child elements are defined by this specification (note
that the presence of some of these elements is required):
o atom:feed elements MUST contain one or more atom:author elements,
unless all of the atom:feed element's child atom:entry elements
contain at least one atom:author element.
o atom:feed elements MAY contain any number of atom:category
elements.
o atom:feed elements MAY contain any number of atom:contributor
elements.
o atom:feed elements MUST NOT contain more than one atom:generator
element.
o atom:feed elements MUST NOT contain more than one atom:icon
element.
o atom:feed elements MUST NOT contain more than one atom:logo
element.
o atom:feed elements MUST contain exactly one atom:id element.
o atom:feed elements SHOULD contain one atom:link element with a rel
attribute value of "self". This is the preferred URI for
retrieving Atom Feed Documents representing this Atom feed.
o atom:feed elements MUST NOT contain more than one atom:link
element with a rel attribute value of "alternate" that has the
same combination of type and hreflang attribute values.
o atom:feed elements MAY contain additional atom:link elements
beyond those described above.
o atom:feed elements MUST NOT contain more than one atom:rights
element.
o atom:feed elements MUST NOT contain more than one atom:subtitle
element.
o atom:feed elements MUST contain exactly one atom:title element.
o atom:feed elements MUST contain exactly one atom:updated element.
If multiple atom:entry elements with the same atom:id value appear in
an Atom Feed Document, they represent the same entry. Their
atom:updated timestamps SHOULD be different. If an Atom Feed
Document contains multiple entries with the same atom:id, Atom
Processors MAY choose to display all of them or some subset of them.
One typical behavior would be to display only the entry with the
latest atom:updated timestamp.
| Field Summary |
|---|
| Fields inherited from class org.mozilla.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
| Fields inherited from interface org.mozilla.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
AtomFeedHostObject()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getClassName()
|
void |
jsConstructor()
Constructor the user will be using inside javaScript |
static org.mozilla.javascript.Scriptable |
jsFunction_addEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
Adds a new Entry to the end of the Feeds collection of entries |
static AtomEntryHostObject[] |
jsFunction_getEntries(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
Returns the complete set of entries contained in this feed |
static org.mozilla.javascript.Scriptable |
jsFunction_getEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
Retrieves the first entry in the feed with the given atom:id value |
static org.mozilla.javascript.Scriptable |
jsFunction_insertEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
Adds a new Entry to the start of the Feeds collection of entries |
static org.mozilla.javascript.Scriptable |
jsFunction_writeTo(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
Serializes the Feed to a given local file |
java.lang.String |
jsGet_author()
|
java.lang.String |
jsGet_category()
|
java.lang.String |
jsGet_contributor()
|
java.lang.String |
jsGet_id()
|
java.lang.String[] |
jsGet_link()
|
java.lang.String |
jsGet_rights()
|
java.lang.String |
jsGet_title()
|
java.lang.String |
jsGet_updated()
|
org.mozilla.javascript.Scriptable |
jsGet_XML()
Returns the E4X XML contents of this AtomFeed object |
void |
jsSet_author(java.lang.String author)
|
void |
jsSet_category(java.lang.String category)
|
void |
jsSet_contributor(java.lang.String contributor)
|
void |
jsSet_id(java.lang.Object id)
|
void |
jsSet_link(java.lang.String link)
|
void |
jsSet_rights(java.lang.Object rights)
|
void |
jsSet_title(java.lang.Object title)
|
void |
jsSet_updated(java.lang.Object updated)
|
| Methods inherited from class org.mozilla.javascript.ScriptableObject |
|---|
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AtomFeedHostObject()
| Method Detail |
|---|
public void jsConstructor()
jsConstructor in interface org.wso2.mashup.hostobjects.feed.IFeedpublic java.lang.String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObject
public void jsSet_id(java.lang.Object id)
throws org.apache.abdera.i18n.iri.IRISyntaxException
org.apache.abdera.i18n.iri.IRISyntaxException
public java.lang.String jsGet_id()
throws org.apache.abdera.i18n.iri.IRISyntaxException
org.apache.abdera.i18n.iri.IRISyntaxExceptionpublic void jsSet_author(java.lang.String author)
jsSet_author in interface org.wso2.mashup.hostobjects.feed.IFeedpublic java.lang.String jsGet_author()
jsGet_author in interface org.wso2.mashup.hostobjects.feed.IFeed
public void jsSet_updated(java.lang.Object updated)
throws org.apache.axis2.AxisFault
jsSet_updated in interface org.wso2.mashup.hostobjects.feed.IFeedorg.apache.axis2.AxisFaultpublic java.lang.String jsGet_updated()
jsGet_updated in interface org.wso2.mashup.hostobjects.feed.IFeedpublic void jsSet_category(java.lang.String category)
jsSet_category in interface org.wso2.mashup.hostobjects.feed.IFeedpublic java.lang.String jsGet_category()
jsGet_category in interface org.wso2.mashup.hostobjects.feed.IFeedpublic void jsSet_contributor(java.lang.String contributor)
jsSet_contributor in interface org.wso2.mashup.hostobjects.feed.IFeedpublic java.lang.String jsGet_contributor()
jsGet_contributor in interface org.wso2.mashup.hostobjects.feed.IFeed
public void jsSet_link(java.lang.String link)
throws org.apache.abdera.i18n.iri.IRISyntaxException
jsSet_link in interface org.wso2.mashup.hostobjects.feed.IFeedorg.apache.abdera.i18n.iri.IRISyntaxException
public java.lang.String[] jsGet_link()
throws org.apache.abdera.i18n.iri.IRISyntaxException
jsGet_link in interface org.wso2.mashup.hostobjects.feed.IFeedorg.apache.abdera.i18n.iri.IRISyntaxExceptionpublic void jsSet_title(java.lang.Object title)
jsSet_title in interface org.wso2.mashup.hostobjects.feed.IFeedpublic java.lang.String jsGet_title()
jsGet_title in interface org.wso2.mashup.hostobjects.feed.IFeedpublic void jsSet_rights(java.lang.Object rights)
public java.lang.String jsGet_rights()
public org.mozilla.javascript.Scriptable jsGet_XML()
jsGet_XML in interface org.wso2.mashup.hostobjects.feed.IFeed
public static org.mozilla.javascript.Scriptable jsFunction_addEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws java.io.IOException
cx - Provides the current contextthisObj - Gives an instance of the js object from which this method was calledarguments - Argumets can be either an AtomEntryHostObject or NonefunObj -
java.io.IOException
public static org.mozilla.javascript.Scriptable jsFunction_insertEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws java.io.IOException
Adds a new Entry to the start of the Feeds collection of entries
cx - Provides the current contextthisObj - Gives an instance of the js object from which this method was calledarguments - Argumets can be either an AtomEntryHostObject or NonefunObj -
java.io.IOException
public static org.mozilla.javascript.Scriptable jsFunction_getEntry(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws java.io.IOException
Retrieves the first entry in the feed with the given atom:id value
cx - Provides the current contextthisObj - Gives an instance of the js object from which this method was calledarguments - A String representation of the Atom Entry's idfunObj -
java.io.IOException
public static AtomEntryHostObject[] jsFunction_getEntries(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws java.io.IOException
Returns the complete set of entries contained in this feed
cx - Provides the current contextthisObj - Gives an instance of the js object from which this method was calledarguments - No arguments requiredfunObj -
java.io.IOException
public static org.mozilla.javascript.Scriptable jsFunction_writeTo(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws java.io.IOException
cx - Provides the current contextthisObj - Gives an instance of the js object from which this method was calledarguments - The expected argument is a String representing the file pathfunObj -
java.io.IOException