Documentation

Jonah_Api extends Horde_Registry_Api
in package

Jonah external API interface.

This file defines Jonah's external API interface. Other applications can interact with Jonah through this API.

Copyright 2002-2017 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.

Tags
author

Michael J. Rubinsky mrubinsk@horde.org

Table of Contents

commentCallback()  : mixed
Callback for comment API
getTagIds()  : array<string|int, mixed>
Return a set of tag_ids, given the tag name
hasComments()  : bool
Check if comments are allowed.
listFeeds()  : array<string|int, mixed>
Get a list of stored channels.
listTagInfo()  : array<string|int, mixed>
Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
publish()  : mixed
Publish a new story
searchTags()  : An
Searches internal channels for stories tagged with all requested tags.
stories()  : array<string|int, mixed>
Return the requested stories
story()  : array<string|int, mixed>
Fetches a story from a requested channel.
storyCount()  : mixed
Get the count of stories in the specified channel

Methods

commentCallback()

Callback for comment API

public commentCallback(mixed $story_id) : mixed
Parameters
$story_id : mixed
Return values
mixed

Name of object on success | false on failure

getTagIds()

Return a set of tag_ids, given the tag name

public getTagIds(array<string|int, mixed> $names) : array<string|int, mixed>
Parameters
$names : array<string|int, mixed>

An array of names to search for

Return values
array<string|int, mixed>

An array of tag_name => tag_ids

hasComments()

Check if comments are allowed.

public hasComments() : bool
Return values
bool

listFeeds()

Get a list of stored channels.

public listFeeds() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of channels

listTagInfo()

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.

public listTagInfo([array<string|int, mixed> $tags = array() ][, array<string|int, mixed> $channel_id = null ]) : array<string|int, mixed>
Parameters
$tags : array<string|int, mixed> = array()

An optional array of tag_ids. If omitted, all tags will be included.@deprecated and currently ignored.

$channel_id : array<string|int, mixed> = null

An optional array of channel_ids. @todo - only the first requested channel is honored.

Return values
array<string|int, mixed>

An array containing tag_name, and total

publish()

Publish a new story

public publish(int $channel_id, array<string|int, mixed> $story) : mixed
Parameters
$channel_id : int

The channel id

$story : array<string|int, mixed>

The story array. Can contain:

 (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 for the story link.
 (array)tags         [OPTIONAL]    Tags
Tags
throws
Horde_Exception_PermissionDenied
Return values
mixed

searchTags()

Searches internal channels for stories tagged with all requested tags.

public searchTags(array<string|int, mixed> $names[, array<string|int, mixed> $filter = array() ][, bool $raw = false ]) : An

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 : array<string|int, mixed>

An array of tag_names to search for (AND'd together).

$filter : array<string|int, mixed> = array()

An array of optional filter parameters.

   max       The maximum number of stories to return.
   from      The number of the story to start with.
   channel_id  (integer) A channel_id to restrict to.
   order     How to order the results (a Jonah::ORDER_* constant)
$raw : bool = false

Return the raw story data?

Tags
TODO

Refactor to match the other application's searchTags API signature.

Return values
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.

stories()

Return the requested stories

public stories(int $channel_id[, array<string|int, mixed> $filter = array() ]) : array<string|int, mixed>
Parameters
$channel_id : int

The channel to get the stories from.

$filter : array<string|int, mixed> = array()

Additional, optional filters.

  max_stories  The maximum number of stories to get.
  start_at     The story number to start retrieving.
  order        How to order the results.
Return values
array<string|int, mixed>

An array of story information

story()

Fetches a story from a requested channel.

public story(int $channel_id, int $story_id[, bool $read = true ]) : array<string|int, mixed>
Parameters
$channel_id : int

The channel id to fetch.

$story_id : int

The story id to fetch.

$read : bool = true

Whether to update the read count.

Return values
array<string|int, mixed>

An array of story data

storyCount()

Get the count of stories in the specified channel

public storyCount(int $channel_id) : mixed
Parameters
$channel_id : int
Return values
mixed

The story count

Search results