Public Member Functions | Public Attributes | Protected Member Functions

AtomHandler Class Reference

Inheritance diagram for AtomHandler:
Collaboration diagram for AtomHandler:

List of all members.

Public Member Functions

 __construct ()
 is_auth ($force=false)
 create_atom_wrapper ($alternate, $self, $id, $updated=null)
 add_pagination_links ($xml, $count)
 add_posts ($xml, $posts)
 add_comments ($xml, $comments)
 act_collection ()
 act_entry ()
 act_rsd ()
 act_introspection ()
 act_tag_collection ()
 act_comments ($params=array())
 act_entry_comments ()
 get_comments ($params=array())
 get_entry ($slug)
 put_entry ($slug)
 delete_entry ($slug)
 get_collection ($params=array())
 post_collection ()

Public Attributes

 $user = null

Protected Member Functions

 tidy_xml ($xml)

Detailed Description

Habari AtomHandler class Produces Atom feeds and accepts Atom Publishing Protocol input

Todo:
Apply system error handling

Definition at line 17 of file atomhandler.php.


Constructor & Destructor Documentation

AtomHandler::__construct (  ) 

Constructor for AtomHandler class. Set some default formatting for Atom output.

Definition at line 26 of file atomhandler.php.


Member Function Documentation

AtomHandler::act_collection (  ) 

Handle incoming requests for Atom entry collections

Definition at line 264 of file atomhandler.php.

AtomHandler::act_comments ( params = array()  ) 

Handle incoming requests for the Atom entry collection for all comments

Definition at line 450 of file atomhandler.php.

Referenced by act_entry_comments().

AtomHandler::act_entry (  ) 

function act_entry 'index' should be 'slug'

Definition at line 282 of file atomhandler.php.

AtomHandler::act_entry_comments (  ) 

Handle incoming requests for the Atom entry collection for comments on an entry

Definition at line 460 of file atomhandler.php.

AtomHandler::act_introspection (  ) 

Handle incoming requests for the introspection document

Definition at line 399 of file atomhandler.php.

AtomHandler::act_rsd (  ) 

Handle incoming requests for RSD

Todo:
Move the internal list of supported feeds into options to allow dynamic editing of capabilities

List of APIs supported by the RSD Refer to namespace for required elements/attributes.

Definition at line 305 of file atomhandler.php.

AtomHandler::act_tag_collection (  ) 

Handle incoming requests for the Atom entry collection for a specific tag

Definition at line 440 of file atomhandler.php.

AtomHandler::add_comments ( xml,
comments 
)

Add comments as items in the provided xml structure

Parameters:
SimpleXMLElement $xml The document to add to
array $comments An array of Comments to add to the XML
Returns:
SimpleXMLElement The resultant XML with added comments

Definition at line 232 of file atomhandler.php.

Referenced by get_comments().

AtomHandler::add_pagination_links ( xml,
count 
)

Adds pagination link rels to feeds

Parameters:
SimpleXMLElement $xml The Atom feed.
int $count The total number of items of the type in the feed.
Returns:
The altered XML feed.

Definition at line 123 of file atomhandler.php.

Referenced by get_collection(), and get_comments().

AtomHandler::add_posts ( xml,
posts 
)

Add posts as items in the provided xml structure

Parameters:
SimpleXMLElement $xml The document to add to
array $posts An array of Posts to add to the XML
Returns:
SimpleXMLElement The resultant XML with added posts

Definition at line 180 of file atomhandler.php.

Referenced by get_collection().

AtomHandler::create_atom_wrapper ( alternate,
self,
id,
updated = null 
)

Creates a basic Atom-format XML structure

Parameters:
string $alternate the IRI of an alternate version.
string $self The preferred URI for retrieving Atom Feed Documents representing this Atom feed.
string $id a permanent, universally unique identifier for an the feed.
DateTime $updated The most recent update in the collection to which this feed applies.
Returns:
SimpleXMLElement The requested Atom document

Definition at line 67 of file atomhandler.php.

Referenced by get_collection(), and get_comments().

AtomHandler::delete_entry ( slug  ) 

Delete a post based on the HTTP DELETE request via Atom

Parameters:
string $slug The post slug to delete

Definition at line 682 of file atomhandler.php.

Referenced by act_entry().

AtomHandler::get_collection ( params = array()  ) 

Output a post collection based on the provided parameters.

Parameters:
array $params An array of parameters as passed to Posts::get() to retrieve posts.

Definition at line 700 of file atomhandler.php.

Referenced by act_collection(), and act_tag_collection().

AtomHandler::get_comments ( params = array()  ) 

Output an Atom collection of comments based on the supplied parameters.

Parameters:
array $params An array of parameters passed to Comments::get() to retrieve comments

Definition at line 477 of file atomhandler.php.

Referenced by act_comments().

AtomHandler::get_entry ( slug  ) 

Output the Atom entry for a specific slug

Parameters:
string $slug The slug to get the entry for

Definition at line 546 of file atomhandler.php.

Referenced by act_entry(), and post_collection().

AtomHandler::is_auth ( force = false  ) 

Check if a user is authenticated for Atom editing

Todo:

This entire function should be put into the User class somehow.

X-WSSE

Parameters:
bool $force Force authorization? If so, basic HTTP_AUTH is displayed if not authed
Returns:
User The logged-in user

Definition at line 39 of file atomhandler.php.

Referenced by add_comments(), add_posts(), delete_entry(), get_collection(), get_entry(), post_collection(), and put_entry().

AtomHandler::post_collection (  ) 

Accepts an Atom entry for insertion as a new post.

Definition at line 817 of file atomhandler.php.

Referenced by act_collection().

AtomHandler::put_entry ( slug  ) 

Updates (editing) a post entry that is sent via APP.

Parameters:
string $slug The slug of the entry to save

Definition at line 611 of file atomhandler.php.

Referenced by act_entry().

AtomHandler::tidy_xml ( xml  )  [protected]

Use Tidy to tidy XML output for debugging by humans

Parameters:
string $xml The unformatted input XML
Returns:
string Formatted XML

Definition at line 791 of file atomhandler.php.

Referenced by get_collection(), and get_entry().


The documentation for this class was generated from the following file: