PHP Class OpdsGenerator, BicBucStriim

Mostra file Open project: rvolz/BicBucStriim

Public Properties

Property Type Description
$bbs_root
$bbs_version
$calibre_dir
$l10n
$updated
$xmlw

Public Methods

Method Description
__construct ( string $bbs_root, string $bbs_version, string $calibre_dir, string $calibre_modtime, object $l10n = NULL ) [__construct description]
acquisitionCatalogLink ( string $href, $rel = NULL, string $title = NULL ) Link to an OPDS acquisition catalog
authorsNamesForInitialCatalog ( $of = NULL, array $entries, string $initial ) generate a list of author entries with book counts
authorsRootCatalog ( $of = NULL, array $entries ) Generate a list of initials of author names
booksForAuthorCatalog ( $of = NULL, array $entries, string $initial, string $author, boolean $protected, integer $page, integer $next, integer $last ) generate a list of book entries for an author
booksForSeriesCatalog ( $of = NULL, array $entries, string $initial, $series, boolean $protected, integer $page, integer $next, integer $last ) generate a list of book entries for a series
booksForTagCatalog ( $of = NULL, array $entries, string $initial, string $tag, boolean $protected, integer $page, integer $next, integer $last ) generate a list of book entries for a tag
closeStream ( $of = NULL ) : string Close the XML stream and output the result
detailsLink ( string $href, string $title ) Link to a OPDS entry document with the complete book details
directDownloadLink ( string $href, string $type ) Link directly to the downloadable ressource
footer ( ) Close the OPDS feed
header ( string $title, string $subtitle, string $id, string $title_ext = '' ) Start the OPDS feed
imageLink ( string $href ) Link to a full image
indirectDownloadLink ( string $href, string $type ) Link indirectly to the downloadable ressource, to allow for authentication via HTML
link ( string $href, string $type, string $rel = NULL, string $title = NULL, string $indirectType = NULL ) Write an ATOM link
navigationCatalogLink ( string $href, $rel = NULL, string $title = NULL ) Link to an OPDS navigation catalog
navigationEntry ( string $title, string $id, string $content, string $url, $type, string $rel = 'subsection' ) Write an OPDS navigation entry
newestCatalog ( $of = NULL, array $entries, boolean $protected ) Generate an acquisition catalog for the newest books
openStream ( $of = NULL ) Open and initialize the XML stream
partialAcquisitionEntry ( array $entry, boolean $protected ) Write a catalog entry for a book title with acquisition links
rootCatalog ( $of = NULL ) : string Create the root OPDS catalog, which is a navigation catalog mentioning all available catalogs.
searchCatalog ( $of = NULL, array $entries, boolean $protected, integer $page, integer $next, integer $last, string $search, integer $total, integer $page_size ) : XML Generate a paginated acquisition catalog for books as search results
searchDescriptor ( $of = NULL, sringg $fragment ) : XML Create an OpenSearch descriptor
searchLink ( ) : xml Link to the OpenSearch document
seriesNamesForInitialCatalog ( $of = NULL, array $entries, string $initial ) generate a list of series entries with book counts
seriesRootCatalog ( $of = NULL, array $entries ) Generate a list of initials of series names
tagsNamesForInitialCatalog ( $of = NULL, array $entries, string $initial ) generate a list of tag entries with book counts
tagsRootCatalog ( $of = NULL, array $entries ) Generate a list of initials of tag names
thumbnailLink ( string $href ) Link to a thumbnail pic
titlesCatalog ( $of = NULL, array $entries, boolean $protected, integer $page, integer $next, integer $last ) Generate a paginated acquisition catalog for the all books

Method Details

__construct() public method

[__construct description]
public __construct ( string $bbs_root, string $bbs_version, string $calibre_dir, string $calibre_modtime, object $l10n = NULL )
$bbs_root string Root URL for BicBucStriim, e.g. '/bbs'
$bbs_version string BBS version
$calibre_dir string calibre library dir
$calibre_modtime string Modification time of Calibre library, in ATOM format
$l10n object Initialized localization helper

authorsNamesForInitialCatalog() public method

generate a list of author entries with book counts
public authorsNamesForInitialCatalog ( $of = NULL, array $entries, string $initial )
$entries array an array of Authors
$initial string the initial character

authorsRootCatalog() public method

Generate a list of initials of author names
public authorsRootCatalog ( $of = NULL, array $entries )
$entries array an array of Items

booksForAuthorCatalog() public method

generate a list of book entries for an author
public booksForAuthorCatalog ( $of = NULL, array $entries, string $initial, string $author, boolean $protected, integer $page, integer $next, integer $last )
$entries array an array of Books
$initial string the initial character
$author string the author
$protected boolean download protection y/n?
$page integer number of page to show, minimum 0
$next integer number of the next page to show, or NULL
$last integer number of the last page

booksForSeriesCatalog() public method

generate a list of book entries for a series
public booksForSeriesCatalog ( $of = NULL, array $entries, string $initial, $series, boolean $protected, integer $page, integer $next, integer $last )
$entries array an array of Books
$initial string the initial character
$protected boolean download protection y/n?
$page integer number of page to show, minimum 0
$next integer number of the next page to show, or NULL
$last integer number of the last page

booksForTagCatalog() public method

generate a list of book entries for a tag
public booksForTagCatalog ( $of = NULL, array $entries, string $initial, string $tag, boolean $protected, integer $page, integer $next, integer $last )
$entries array an array of Books
$initial string the initial character
$tag string the tag
$protected boolean download protection y/n?
$page integer number of page to show, minimum 0
$next integer number of the next page to show, or NULL
$last integer number of the last page

closeStream() public method

Close the XML stream and output the result
public closeStream ( $of = NULL ) : string
return string The XML string or NULL if output is sent to the URI

header() public method

Start the OPDS feed
public header ( string $title, string $subtitle, string $id, string $title_ext = '' )
$title string OPDS feed title
$subtitle string OPDS feed subtitle
$id string feed-specific part of the id, appendend to 'urn:bicbucstriim:'
$title_ext string optional extionsion for title, not translated

navigationEntry() public method

Write an OPDS navigation entry
public navigationEntry ( string $title, string $id, string $content, string $url, $type, string $rel = 'subsection' )
$title string title string (text)
$id string id detail, appended to 'urn:bicbucstriim:nav-'
$content string content description (text)
$url string catalog url, appended to bbs_root.'/opds'
$rel string optional relation according to OPDS spec

newestCatalog() public method

Generate an acquisition catalog for the newest books
public newestCatalog ( $of = NULL, array $entries, boolean $protected )
$entries array an array of Book
$protected boolean true = we need password authentication before a download

openStream() public method

Open and initialize the XML stream
public openStream ( $of = NULL )

partialAcquisitionEntry() public method

Write a catalog entry for a book title with acquisition links
public partialAcquisitionEntry ( array $entry, boolean $protected )
$entry array the book and its details
$protected boolean true = use an indirect acquisition link, else a direct one

rootCatalog() public method

Create the root OPDS catalog, which is a navigation catalog mentioning all available catalogs.
public rootCatalog ( $of = NULL ) : string
return string if $output is a URI NULL, else the XML is returned as a string.

searchCatalog() public method

Generate a paginated acquisition catalog for books as search results
public searchCatalog ( $of = NULL, array $entries, boolean $protected, integer $page, integer $next, integer $last, string $search, integer $total, integer $page_size ) : XML
$entries array an array of Book
$protected boolean true = we need password authentication before a download
$page integer number of page to show, minimum 0
$next integer number of the nextPage to show, or NULL
$last integer number of the last page
$search string search terms
$total integer total number of search results
$page_size integer number of entries per search page
return XML stream the search result feed

searchDescriptor() public method

Create an OpenSearch descriptor
public searchDescriptor ( $of = NULL, sringg $fragment ) : XML
$fragment sringg path fragment for search operation
return XML stream the OpenSearch descriptor

seriesNamesForInitialCatalog() public method

generate a list of series entries with book counts
public seriesNamesForInitialCatalog ( $of = NULL, array $entries, string $initial )
$entries array an array of Series
$initial string the initial character

seriesRootCatalog() public method

Generate a list of initials of series names
public seriesRootCatalog ( $of = NULL, array $entries )
$entries array an array of Items

tagsNamesForInitialCatalog() public method

generate a list of tag entries with book counts
public tagsNamesForInitialCatalog ( $of = NULL, array $entries, string $initial )
$entries array an array of Tags
$initial string the initial character

tagsRootCatalog() public method

Generate a list of initials of tag names
public tagsRootCatalog ( $of = NULL, array $entries )
$entries array an array of Items

titlesCatalog() public method

Generate a paginated acquisition catalog for the all books
public titlesCatalog ( $of = NULL, array $entries, boolean $protected, integer $page, integer $next, integer $last )
$entries array an array of Book
$protected boolean true = we need password authentication before a download
$page integer number of page to show, minimum 0
$next integer number of the next page to show, or NULL
$last integer number of the last page

Property Details

$bbs_root public_oe property

public $bbs_root

$bbs_version public_oe property

public $bbs_version

$calibre_dir public_oe property

public $calibre_dir

$l10n public_oe property

public $l10n

$updated public_oe property

public $updated

$xmlw public_oe property

public $xmlw