Class TranscodingActionPagination

Description

Transcoding action that paginates lenghty XHTML content to speed up content delivery on mobile devices with limited bandwidth, and possibly limited memory.

Previous/Next links are added to the page.

The content is divided into blocks. Possible blocks are the elements of the XHTML Modularization 1.1 standard that allow whose minimal content model contains "Flow" or "Block", plus list containers: http://www.w3.org/TR/xhtml-modularization/abstract_modules.html

Two types of blocks are supported:

  • containers that may be further subdivided: html, body, div, blockquote
  • atomic blocks: head, p, h1, h2, h3, h4, h5, h6, pre, address, hr, table,
form, ul, ol, dl

Atomic blocks are not further sub-divided and appear as they stand in a page.

The object fall-back mechanism is not supported and is likely to produce weird results if the fall-back content contains blocks.

Some atomic blocks are likely to be supported as containers in a future version of this action (e.g. ul, ol, dl). Other block elements that may appear within atomic blocks (e.g. li, dd, th, td) are processed as regular inline content.

The action expects the blocks to be well-formed: closing tags must be set appropriately and properly nested. The action does not require inline content to be well-formed.

Several options may need to be precised through calls to TranscodingAction::setOption() prior to using this action:

  • mobile_device: contains the DDR property reference that the transcoding uses to tell whether the requesting device is mobile or not. The action uses the is_wireless_device property of the WURFL namespace when the option is not set.
  • page_index => the index of the page to return (first page has index 1). The first page is returned when not set.
  • max_size => maximum allowed size per page in bytes. Defaults to 10Kb. The size includes the markup size and the size of the images. The action tries to accomodate this setting as much as it can, but note it may not always be possible, for instance when an atomic block is too large.
  • max_markup_size => maximum allowed size for the markup of the page in bytes. Defaults to 10Kb. The limitation mentioned for max_size applies here as well.
  • nav_block => The HTML code for the navigation block (previous/next links) A simple div with previous/next links, the index of current page and the number of pages is returned when not set.
  • prev_nav_block => The HTML code for the previous page link. The block is displayed when current page is not the first page.
  • next_nav_block => The HTML code for the next page link. The block is displayed when current page is not the last page.
  • base_uri => The URI of the page that is being processed which also acts as the base URI to resolve relative URIs for images
  • uri_mappings => The list of URI mappings to use to convert an absolute HTTP URI to a local file. Mappings must be separated by a space. Each mapping consists of a root URI and a root folder separated by a '|'. Ex: http://example.com/img/|/var/www/img/

Located in /common/transcoding/transcodingactionpagination.php (line 95)

TranscodingAction
   |
   --TranscodingActionPagination
Method Summary
string apply (string $content, Evidence $evidence)
Variables
Methods
apply (line 181)

Paginates the given content when it is too big.

  • return: The transcoded content. Returns an array of strings if requested to return all pages with a -1 page_index option.
  • exception: SystemException The evidence is not valid.
  • access: public
string apply (string $content, Evidence $evidence)
  • Evidence $evidence: The evidence that identifies the requesting device.
  • string $content: The HTML content to transcode.

Redefinition of:
TranscodingAction::apply()
Applies the transcoding action to the given content, using the capabilities of the device identified by the given evidence.

Inherited Methods

Inherited From TranscodingAction

TranscodingAction::__construct()
TranscodingAction::apply()
TranscodingAction::getNextBlock()
TranscodingAction::getOption()
TranscodingAction::getPropertyValue()
TranscodingAction::getPropertyValuePr()
TranscodingAction::getRelativeUri()
TranscodingAction::initOption()
TranscodingAction::initProperty()
TranscodingAction::initPropertyValues()
TranscodingAction::mapAbsoluteUriToFile()
TranscodingAction::mapFileToAbsoluteUri()
TranscodingAction::mapFileToUri()
TranscodingAction::mapUriToFile()
TranscodingAction::resolveUri()
TranscodingAction::setOption()
TranscodingAction::unparse_url()

Documentation generated on Tue, 17 Nov 2009 19:00:40 +0100 by phpDocumentor 1.4.2