eTextReader.OEB
Interface OEBPackageFile

All Known Implementing Classes:
OEBPackageFileImpl

public interface OEBPackageFile

This interface allows access to information contained in an Open eBook package file. This file specifies the contents of a particular Open-ebook publication, and contains meta-deta about the publication. Additionally, it contains a linear reading sequence (called a spine) and optionally several tours through the text

Author:
Ryan McFall
See Also:
Open eBook Publication Structure Specification

Method Summary
 java.util.List getContributors()
          Retrieves a list of contributors to the publication
 java.util.List getCreators()
          Retrieves a list of creators for this publication
 java.util.Date getDate(java.lang.String event)
          Retrieves the specified date specified for the publication Specific dates events are not currently defined by the OEB publication structure
 java.lang.String getDescription()
          Returns a (perhaps verbose) description of the publication
 OEBItem getFirstItem()
          Retrieve an OEBItem object corresponding to the first item referenced in the spine
 java.lang.String getFormat()
          Retrieves the format of the publication as a whole
 OEBItem getGuideTableOfContents()
          retrieves the OEBItem corresponding to the "toc" element in the guide, which references an element in the manifest.
 OEBIdentifier getIdentifier(java.lang.String scheme)
          Retrieves a particular identifier
 java.util.List getIdentifiers()
          Retrieves a list of identifiers for this publication
 java.lang.String getLanguage()
          The language of the publication
 OEBItem getLastItem()
          Retrieve an OEBItem object corresponding to the last item referenced in the spine
 OEBItem getManifestItem(java.lang.String id)
          Retrieves a specific item from the manifest
 OEBItem getManifestItem(java.lang.String id, java.util.Set allowedTypes)
          Retrieves a specific item from the manifest with a specific media type.
 java.util.List getManifestItems()
          Retrieves a list of the resources making up this publication
 OEBItem getNextItem(java.lang.String id)
          Retrieve an OEBItem object corresponding to the item after the specified item
 java.lang.String getPackageIdentity()
          Returns the unique identifier for this publication
 OEBItem getPreviousItem(java.lang.String id)
          Retrieve an OEBItem object corresponding to the item before the specified item
 java.lang.String getPublicationTitle()
          Retrieves the human readable title of this publication
 java.lang.String getPublisher()
          Returns a string identifying the publication's publisher
 java.lang.String getRights()
          Retrieves a description of the user's rights for use of this publication.
 java.lang.String getSource()
          Retrieves a source this publication is derived from
 OEBSpine getSpine()
          Retrieves an OEBSpine element for this publication
 java.util.List getSubjects()
          Retrieves the subjects of the publication
 java.lang.String getTableOfContents()
          constructs an HTML document representing the table of contents for the package
 boolean isFirstItem(java.lang.String id)
          Determine whether the OEBItem object identified using the given id is the first item in the spine
 boolean isLastItem(java.lang.String id)
          Determine whether the OEBItem object identified using the given id is the last item in the spine
 java.util.ListIterator listIterator()
          Retrieves an object useful for iterating over the spine elements
 OEBItem lookupURL(java.lang.String url)
          returns the OEB item corresponding to a given URL in the publication
 OEBItem lookupURLByPkgID(java.lang.String url)
          returns the OEB item corresponding to a given URL in the publication based on the PackageIdentity URL
 

Method Detail

getPackageIdentity

java.lang.String getPackageIdentity()
Returns the unique identifier for this publication

Returns:
an OEBIdentifier object corresponding to the dc:Identifier element whose ID is referenced by the unique-identifier attribute of the package element

getPublicationTitle

java.lang.String getPublicationTitle()
Retrieves the human readable title of this publication


getIdentifiers

java.util.List getIdentifiers()
Retrieves a list of identifiers for this publication

Returns:
a List containing OEBIdentifier objects corresponding to the dc:Identifier elements in the publication package

getIdentifier

OEBIdentifier getIdentifier(java.lang.String scheme)
                            throws java.util.NoSuchElementException
Retrieves a particular identifier

Parameters:
scheme - the particular scheme whose identifier is being requested
Returns:
a OEBIdentifier object corresponding to the requested scheme
Throws:
java.util.NoSuchElementException - if no identifier matching the requested scheme can be found

getCreators

java.util.List getCreators()
Retrieves a list of creators for this publication


getSubjects

java.util.List getSubjects()
Retrieves the subjects of the publication

Returns:
a List item containing the subjects of the publication

getDescription

java.lang.String getDescription()
Returns a (perhaps verbose) description of the publication


getPublisher

java.lang.String getPublisher()
Returns a string identifying the publication's publisher


getContributors

java.util.List getContributors()
Retrieves a list of contributors to the publication

Returns:
a List item that contains OEB.OEBContributor objects describing the creators for the publication

getDate

java.util.Date getDate(java.lang.String event)
Retrieves the specified date specified for the publication Specific dates events are not currently defined by the OEB publication structure

Parameters:
event - a string identifying the date being requested, such as the publication date, last modification date, etc.

getFormat

java.lang.String getFormat()
Retrieves the format of the publication as a whole

Returns:
The mime-type of the publication file

getSource

java.lang.String getSource()
Retrieves a source this publication is derived from

Returns:
a String representing the source, or null if there is no prior source

getLanguage

java.lang.String getLanguage()
The language of the publication

Returns:
a string identifying the language of the resource in RFC 3066 format
See Also:
Open eBook description of this element

getRights

java.lang.String getRights()
Retrieves a description of the user's rights for use of this publication. This is not expressed in a formal rights language


getManifestItems

java.util.List getManifestItems()
Retrieves a list of the resources making up this publication

Returns:
a List of OEBItem objects

getManifestItem

OEBItem getManifestItem(java.lang.String id)
                        throws java.util.NoSuchElementException
Retrieves a specific item from the manifest

Parameters:
id - The unique identifier for the resource
Returns:
an OEBItem that corresponds to the given id; the first item found is returned, regardless of its media type
Throws:
java.util.NoSuchElementException - if no item corresponding to the given id exists in the manifest

getManifestItem

OEBItem getManifestItem(java.lang.String id,
                        java.util.Set allowedTypes)
                        throws java.util.NoSuchElementException
Retrieves a specific item from the manifest with a specific media type. The fallbackID attribute of the requested item will be used to locate an appropriate item

Parameters:
id - The unique identifier for the resource
allowedTypes - a set of allowed media types for the resource.
Returns:
an OEBItem that corresponds to the given id, AND has a media type contained in the allowedTypes Set.
Throws:
java.util.NoSuchElementException - if the requested id does not exist, or if now item with an allowable media type is found

getSpine

OEBSpine getSpine()
Retrieves an OEBSpine element for this publication


getFirstItem

OEBItem getFirstItem()
Retrieve an OEBItem object corresponding to the first item referenced in the spine


getLastItem

OEBItem getLastItem()
Retrieve an OEBItem object corresponding to the last item referenced in the spine


getNextItem

OEBItem getNextItem(java.lang.String id)
Retrieve an OEBItem object corresponding to the item after the specified item

Parameters:
id - the unique identifier of the item before the requested item

getPreviousItem

OEBItem getPreviousItem(java.lang.String id)
Retrieve an OEBItem object corresponding to the item before the specified item

Parameters:
id - the unique identifier of the item after the requested item

isLastItem

boolean isLastItem(java.lang.String id)
Determine whether the OEBItem object identified using the given id is the last item in the spine

Parameters:
id - an id identifying the item in the book
Returns:
true if the item is the last item in the book, false otherwise

isFirstItem

boolean isFirstItem(java.lang.String id)
Determine whether the OEBItem object identified using the given id is the first item in the spine

Parameters:
id - an id identifying the item in the book
Returns:
true if the item is the first item in the book, false otherwise

listIterator

java.util.ListIterator listIterator()
Retrieves an object useful for iterating over the spine elements

Returns:
a listIterator object that can be used to retrieve the spine elements in order

lookupURL

OEBItem lookupURL(java.lang.String url)
                  throws java.util.NoSuchElementException
returns the OEB item corresponding to a given URL in the publication

Parameters:
url - the fully specified URL to check
Returns:
an OEBItem for the URL specified by url
Throws:
java.util.NoSuchElementException - if the URL url is not contained in the manifest for this publication

lookupURLByPkgID

OEBItem lookupURLByPkgID(java.lang.String url)
                         throws java.util.NoSuchElementException
returns the OEB item corresponding to a given URL in the publication based on the PackageIdentity URL

Parameters:
url - the fully specified URL to check
Returns:
an OEBItem for the URL specified by url
Throws:
java.util.NoSuchElementException - if the URL url is not contained in the manifest for this publication

getTableOfContents

java.lang.String getTableOfContents()
constructs an HTML document representing the table of contents for the package


getGuideTableOfContents

OEBItem getGuideTableOfContents()
                                throws java.util.NoSuchElementException
retrieves the OEBItem corresponding to the "toc" element in the guide, which references an element in the manifest. Provided only for compatibility with OEB package file specification use getTableOfContents instead, as it is dynamically generated

Throws:
java.util.NoSuchElementException