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() |
org.mozilla.javascript.Scriptable |
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() |
org.mozilla.javascript.NativeArray |
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.Object author) |
void |
jsSet_category(java.lang.Object category) |
void |
jsSet_contributor(java.lang.Object contributor) |
void |
jsSet_id(java.lang.Object id) |
void |
jsSet_link(java.lang.Object 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 org.mozilla.javascript.Scriptable 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.ScriptableObjectpublic void jsSet_id(java.lang.Object id)
public java.lang.String jsGet_id()
public void jsSet_author(java.lang.Object 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.wso2.mashup.MashupFault
jsSet_updated in interface
org.wso2.mashup.hostobjects.feed.IFeedorg.wso2.mashup.MashupFaultpublic java.lang.String jsGet_updated()
jsGet_updated in interface
org.wso2.mashup.hostobjects.feed.IFeedpublic void jsSet_category(java.lang.Object 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.Object 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.IFeedpublic void jsSet_link(java.lang.Object link)
jsSet_link in interface
org.wso2.mashup.hostobjects.feed.IFeedpublic org.mozilla.javascript.NativeArray jsGet_link()
jsGet_link in interface
org.wso2.mashup.hostobjects.feed.IFeedpublic 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)
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)
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 org.wso2.mashup.MashupFault
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.IOExceptionorg.wso2.mashup.MashupFault
public 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
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 org.wso2.mashup.MashupFault
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.IOExceptionorg.wso2.mashup.MashupFault