Class Jonah_Api
Jonah external API interface.
This file defines Jonah's external API interface. Other
applications can interact with Jonah through this API.
Copyright 2002-2012 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (BSD). If you did not
did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE.
-
Horde_Registry_Api
-
Jonah_Api
Methods summary
public
array
|
#
listFeeds( )
Get a list of stored channels.
Get a list of stored channels.
Returns
array An array of channels
|
public
array
|
#
stories( integer $channel_id, array $filter = array() )
Return the requested stories
Return the requested stories
Parameters
- $channel_id
- The channel to get the stories from.
- $filter
- Additional, optional filters.
<pre>max_stories The maximum number of stories to get.
start_at The story number to start retrieving.
order How to order the results.</pre>
Returns
array An array of story information
|
public
array
|
#
story( integer $channel_id, integer $story_id, boolean $read = true )
Fetches a story from a requested channel.
Fetches a story from a requested channel.
Parameters
- $channel_id
- The channel id to fetch.
- $story_id
- The story id to fetch.
- $read
- Whether to update the read count.
Returns
array An array of story data
|
public
|
#
publish( integer $channel_id, array $story )
Publish a new story
Parameters
- $channel_id
- The channel id
- $story
- The story array. Can contain:
<pre>(string)title [REQUIRED] The story title.
(string)description [REQUIRED] The short description.
(string)body_type [OPTIONAL] The body type (text/html).
(string)body [OPTIONAL] The story body.
(string)url [OPTIONAL] The url <span class="php-keyword1">for</span> the story <span class="php-keyword2">link</span>.
(<span class="php-keyword1">array</span>)tags [OPTIONAL] Tags</pre>
Throws
Horde_Exception_PermissionDenied
|
public
array
|
#
listTagInfo( array $tags = array(), array $channel_id = null )
Retrieve the list of used tag_names, tag_ids and the total number
of resources that are linked to that tag.
Retrieve the list of used tag_names, tag_ids and the total number
of resources that are linked to that tag.
Parameters
- $tags
- <p>An optional array of tag_ids. If omitted, all tags
will be included.</p>
- $channel_id
- An optional array of channel_ids.
Returns
array An array containing tag_name, and total
|
public
Array
|
#
getTagIds( array $names )
Return a set of tag_ids, given the tag name
Return a set of tag_ids, given the tag name
Parameters
- $names
- An array of names to search for
Returns
Array An array of tag_name => tag_ids
|
public
An
|
#
searchTags( array $names, array $filter = array(), boolean $raw = false )
Searches internal channels for stories tagged with all requested tags.
Returns an application-agnostic array (useful for when doing a tag search
across multiple applications).
Searches internal channels for stories tagged with all requested tags.
Returns an application-agnostic array (useful for when doing a tag search
across multiple applications).
The 'raw' story array can be returned instead by setting $raw = true.
Parameters
- $names
- <p>An array of tag_names to search for
(AND'd together).</p>
- $filter
- An array of optional filter parameters.
<pre><span class="php-keyword2">max</span> The maximum number of stories to <span class="php-keyword1">return</span>.
from The number of the story to start with.
channel_id An <span class="php-keyword1">array</span> of channel_ids to limit the search to.
order How to order the results (a Jonah::ORDER_* <span class="php-keyword2">constant</span>)</pre>
- $raw
- Return the raw story data?
Returns
An array of results with the following structure:
'title' - The title for this resource.
'desc' - A terse description of this resource.
'view_url' - The URL to view this resource.
'app' - The Horde application this resource belongs to.
|
public
mixed
|
#
storyCount( integer $channel_id )
Get the count of stories in the specified channel
Get the count of stories in the specified channel
Parameters
Returns
mixed The story count
|