PSEntry

Framework:
/System/Library/Frameworks/PubSub.framework
Inherits from:
Declared In:
See Also:

Overview

A PSEntry is an entry in a feed object. Entry objects are acquired from the associated feed object.

Most of the attributes for an entry are defined by the RSS 2.0 and Atom 1.0 specs. Any attributes defined by those specs (or nonstandard extensions) that are not natively supported by PSEntry can be retrieved from the entry objects' XMLRepresentation property.

Some PSEntry attributes are specific to the local copy of the entry, such as isRead and receivedDate.

Since the values of the RSS and Atom attributes are derived from data received from the server, they may be missing or incorrect. If you have the opportunity, use attributes generated by the Publication Subscription framework, as it is more reliable. For example, using updatedDate to find entries that have been modified since a certain time would be unreliable. Use receivedDate instead. It is not recommended that you subclass PSEntry.



Methods

-extensionXMLElementsUsingNamespace:

Returns an array of the extension XML elements that are outside of the RSS or Atom standards.


extensionXMLElementsUsingNamespace:


Returns an array of the extension XML elements that are outside of the RSS or Atom standards.

- (NSArray *) extensionXMLElementsUsingNamespace:(NSString *)nameSpace; 
Parameters
nameSpace

The extension XML elements you want to receive. Pass nil to get all extension XML elements, regardless of their namespace.

Return Value

An array containing the extension XML elements requested. Make sure to pass a namespace and not a namespace prefix for the nameSpace parameter. For example, to retrieve the iTunes Podcast elements, use extensionXMLElementsUsingNamespace:@"http://www.itunes.com/dtds/podcast-1.0.dtd", not extensionXMLElementsUsingNamespace:@"itunes". This method attempts to communicate with the PubSubAgent process and causes the agent to launch if it is not already running. If PubSubAgent cannot be contacted, an exception will be thrown with the name PSException. To avoid problems, you should always be prepared to catch an exception thrown by this method.

Availability
Introduced in Mac OS X v10.5.

Properties

alternateURL

The URL to an alternate version of the entry resource. (read-only)

authors

An array of author objects representing the entry's authors. (read-only)

authorsForDisplay

The authors of the entry as a string. (read-only)

baseURL

The base URL for resolving relative links.(read-only)

content

The content of the entry. (read-only)

contributors

An array of author objects that contains the entry's contributors. (read-only)

current

A Boolean value indicating whether an entry still appears in its feed. (read-only)

dateCreated

The date that the entry was created. (read-only)

dateForDisplay

A guaranteed non-nil date for the entry, suitable for displaying or sorting. (read-only)

datePublished

The date that the entry was published. (read-only)

dateUpdated

The date that the entry was last modified. (read-only)

enclosures

An array of enclosure objects of the enclosures of an entry. (read-only)

feed

The feed the receiver belongs to. (read-only)

flagged

A Boolean value indicating whether or not the entry is flagged.

identifier

A string that uniquely identifies an entry. (read-only)

localDateCreated

The date when the entry was created in the local Publication Subscription database. (read-only)

localDateUpdated

The date when the entry was updated in the local Publication Subscription database. (read-only)

read

A Boolean value indicating whether or not the entry is read.

rights

The entry's copyright information. (read-only)

summary

A string that contains the entry's summary. (read-only)

title

The entry's title. (read-only)

titleForDisplay

A string to display as the entry's title. (read-only)

XMLRepresentation

The raw XML entry. (read-only)


alternateURL


The URL to an alternate version of the entry resource. (read-only)

@property (
    readonly,
    retain) NSURL * alternateURL; 
Discussion

Traditionally, the alternate URL corresponds to the HTML version of an entry. The URL is parsed from the element in Atom and the element in RSS. This URL is often called a permalink.

Availability
Introduced in Mac OS X v10.5.

authors


An array of author objects representing the entry's authors. (read-only)

@property (
    readonly,
    retain) NSArray * authors; 
Discussion

The authors correspond to the element in Atom and RSS. This method currently only supports a single author, the first one.

Availability
Introduced in Mac OS X v10.5.

authorsForDisplay


The authors of the entry as a string. (read-only)

@property (
    readonly) NSString* authorsForDisplay; 
Discussion

If there are multiple authors, they are comma-delimited.

Availability
Introduced in Mac OS X v10.5.

baseURL


The base URL for resolving relative links.(read-only)

@property (
    readonly,
    retain) NSURL * baseURL; 
Discussion

The returned URL corresponds to the xml:base attribute on an Atom element or an RSS element. Publication Subscription resolves all parsed URLs to be absolute. However, this is not possible for URLs embedded within an entry's content or summary. If a client chooses to display content in HTML form, the base URL must be set for relative URLs to work.Note: Atom technically allows the xml:base attribute to appear as an attribute of the or

elements. In practice, this seldom occurs. A client may choose to parse these xml:base attributes manually via XMLRepresentation.

Availability
Introduced in Mac OS X v10.5.

content


The content of the entry. (read-only)

@property (
    readonly,
    retain) PSContent * content; 
Discussion

Corresponds to the element in Atom and in RSS.

Availability
Introduced in Mac OS X v10.5.

contributors


An array of author objects that contains the entry's contributors. (read-only)

@property (
    readonly,
    retain) NSArray * contributors; 
Discussion

Corresponds to the element in Atom. There is no RSS equivalent.

Availability
Introduced in Mac OS X v10.5.

current


A Boolean value indicating whether an entry still appears in its feed. (read-only)

@property (
    readonly,
    getter=isCurrent) BOOL current; 
Discussion

Typically, a feed contains 10-15 entries at a time, so as a new entry is added, the oldest entry "falls off." If the property returns NO, the entry has 'fallen off the bottom' of the feed but is still in the PubSub Database.

Availability
Introduced in Mac OS X v10.5.

dateCreated


The date that the entry was created. (read-only)

@property (
    readonly,
    retain) NSDate * dateCreated; 
Discussion

The date corresponds to the element in Dublin Core (http://dublincore.org/). There is no Atom nor RSS equivalent. When it exists, this date is set by either the author's blogging software or the server and is stored in the feed. It may be earlier than datePublished if the entry was not immediately published after being written. To get the local date and time when the entry was received by the user's machine, use the locateDateCreated method instead.

Availability
Introduced in Mac OS X v10.5.

dateForDisplay


A guaranteed non-nil date for the entry, suitable for displaying or sorting. (read-only)

@property (
    readonly,
    retain) NSDate * dateForDisplay; 
Discussion

This returns the entry's datePublished if available, otherwise the dateUpdated; if neither appears in the feed, it falls back on the localDateCreated. Use this method if you need a guaranteed non-nil date, as in sorting or displaying in a table column.

Availability
Introduced in Mac OS X v10.5.

datePublished


The date that the entry was published. (read-only)

@property (
    readonly,
    retain) NSDate * datePublished; 
Discussion

The return value corresponds to the element in Atom and the element in RSS.

Availability
Introduced in Mac OS X v10.5.

dateUpdated


The date that the entry was last modified. (read-only)

@property (
    readonly,
    retain) NSDate * dateUpdated; 
Discussion

The return value corresponds to the elements in Atom. There is no RSS equivalent. To get the local date and time that the latest update was received by the user's machine, use the localDateUpdated method.

Availability
Introduced in Mac OS X v10.5.

enclosures


An array of enclosure objects of the enclosures of an entry. (read-only)

@property (
    readonly,
    retain) NSArray * enclosures; 
Discussion

The enclosures correspond to the element in Atom and the element in RSS. The order of the enclosure objects returned is undefined.

Availability
Introduced in Mac OS X v10.5.

feed


The feed the receiver belongs to. (read-only)

@property (
    readonly) PSFeed * feed; 

Availability
Introduced in Mac OS X v10.5.

flagged


A Boolean value indicating whether or not the entry is flagged.

@property (
    getter=isFlagged,
    setter=setFlagged:) BOOL flagged; 
Discussion

Flagged status of an article is shared among all applications using the Publication Subscription framework. By default, this method returns NO.

Availability
Introduced in Mac OS X v10.5.

identifier


A string that uniquely identifies an entry. (read-only)

@property (
    readonly,
    retain) NSString * identifier; 
Discussion

This identifier can be used as a key to map between PSEntry objects and your application's own data model objects. This identifier is generated internally by the Publication Subscription framework by combining the identifier of the feed with the 'most unique' attribute of the entry. You should not make any assumptions about its format or size, as they may change. (Although Atom defines a mandatory element, it cannot be used for this purpose since the RSS equivalent () is optional. Thus, Publication Subscription uses its own mechanism for uniquely identifying entries. Clients can manually parse the XMLRepresentation output if they need the Atom element or RSS element.)

Availability
Introduced in Mac OS X v10.5.

localDateCreated


The date when the entry was created in the local Publication Subscription database. (read-only)

@property (
    readonly,
    retain) NSDate * localDateCreated; 

Availability
Introduced in Mac OS X v10.5.

localDateUpdated


The date when the entry was updated in the local Publication Subscription database. (read-only)

@property (
    readonly,
    retain) NSDate * localDateUpdated; 

Availability
Introduced in Mac OS X v10.5.

read


A Boolean value indicating whether or not the entry is read.

@property (
    getter=isRead,
    setter=setRead:) BOOL read; 
Discussion

Read status of an article is shared among all applications using the Publication Subscription framework. By default, this method returns NO.

Availability
Introduced in Mac OS X v10.5.

rights


The entry's copyright information. (read-only)

@property (
    readonly,
    retain) NSString * rights; 
Discussion

Corresponds to the element in Atom. There is no RSS equivalent.

Availability
Introduced in Mac OS X v10.5.

summary


A string that contains the entry's summary. (read-only)

@property (
    readonly,
    retain) PSContent * summary; 
Discussion

Corresponds to the

element in Atom. There is no RSS equivalent.

Availability
Introduced in Mac OS X v10.5.

title


The entry's title. (read-only)

@property (
    readonly,
    retain) NSString * title; 
Discussion

Corresponds to the element in both Atom and RSS. <!-- end discussion --> <p></p><dl><dt><i>Availability</i></dt><dd>Introduced in Mac OS X v10.5.</dd> </dl> <hr><!-- headerDoc=instp; uid=//apple_ref/occ/instp/PSEntry/titleForDisplay; name=PSEntry::titleForDisplay --> <a name="//apple_ref/occ/instp/PSEntry/titleForDisplay"></a> <table border="0" cellpadding="2" cellspacing="2" width="300"><tr><td valign="top" height="12" colspan="5" scope="row"><h3><a name="titleForDisplay">titleForDisplay</a></h3> </td></tr></table><hr><p><!-- begin abstract --><p>A string to display as the entry's title. (read-only) <!-- end abstract --></p> <p></p><div class='declaration_indent'> <pre>@property ( <span class="param">readonly</span>) <a href="../../../../../../Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/cl/NSString" target="_top" class="type"><span class="type">NSString</span></a> <span class="type">*</span> <!-- a --><span class="var">titleForDisplay</span><!-- /a -->; </pre> </div> <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font> </h5><!-- begin discussion --><p>This property returns up to the first 100 characters of the entry's summary, or content if there is no summary. <!-- end discussion --> <p></p><dl><dt><i>Availability</i></dt><dd>Introduced in Mac OS X v10.5.</dd> </dl> <hr><!-- headerDoc=instp; uid=//apple_ref/occ/instp/PSEntry/XMLRepresentation; name=PSEntry::XMLRepresentation --> <a name="//apple_ref/occ/instp/PSEntry/XMLRepresentation"></a> <table border="0" cellpadding="2" cellspacing="2" width="300"><tr><td valign="top" height="12" colspan="5" scope="row"><h3><a name="XMLRepresentation">XMLRepresentation</a></h3> </td></tr></table><hr><p><!-- begin abstract --><p>The raw XML entry. (read-only) <!-- end abstract --></p> <p></p><div class='declaration_indent'> <pre>@property ( <span class="param">readonly</span>) <a href="../../../../../../Cocoa/Reference/Foundation/Classes/NSXMLElement_Class/Reference/Reference.html#//apple_ref/occ/cl/NSXMLElement" target="_top" class="type"><span class="type">NSXMLElement</span></a> <span class="type">*</span> <!-- a --><span class="var">XMLRepresentation</span><!-- /a -->; </pre> </div> <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font> </h5><!-- begin discussion --><p>The raw XML is parsed into a DOM tree, and the <entry> or <article> element is returned. <!-- end discussion --> <p></p><dl><dt><i>Availability</i></dt><dd>Introduced in Mac OS X v10.5.</dd> </dl> <p><!-- start of footer --> <!-- start of footer --> <!--#include virtual="../../../../../../../Resources/383/includes/reflib_small_feedback"--> <p> </p> <!--#include virtual="../../../../../../../Resources/383/includes/footer"--> <!-- end of footer --> <!-- end of footer --> Last Updated: 2009-08-12 </p></body></html>