|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
OEBPackageFile | This interface allows access to information contained in an Open eBook package file. |
TitleHandler |
Class Summary | |
---|---|
Heading | a convenience class that groups information about a document heading into a single structure |
HTMLTitleHandler | This class is used to determine the title from a document whose media type is text/html. |
OEBContributor | A simple wrapper class that combines a contributor name and the role that contributor played in creating the publication |
OEBIdentifier | A simple wrapper class that combines a String identifier and the scheme of that identifier (for example, ISBN, DOI, URL) |
OEBItem | This class encapsulates information about a single resource that is part of the package file. |
OEBPackageFileImpl | An implementation of the methods in the OEBPackageFile interface that works by constructing a DOM model of the package file |
OEBSpine | Provides a simple means to manage the items in a Open eBook package's spine element. |
The OEB package contains classes that encapsulate the data in an Open eBook publication's package file. This file provides meta-data about the publication, a description of the resources making up the publication and at least one ordering of how those resources should be presented to the user.
The main class of interest is OEB.OEBPackageFileImpl
, which provides
methods to manipulate the information contained in the package file. Here
is a brief example of how you would construct an OEBPackageFileImpl and
then manipulate it to get information about a specific publication:
OEBPackageFile pack = new OEBPackageFileImpl ("http://www.cs.hope.edu/120ebook/CSCI120.oebpf"); System.out.println ("Package title: " + pack.getPublicationTitle ()); System.out.println ("Package description: " + pack.getDescription ()); System.out.println ("Manifest information:"); List manifest = pack.getManifestItems (); java.util.Iterator it = manifest.iterator (); while (it.hasNext ()) { Object itemObj = null; try { itemObj = it.next (); OEBItem item = (OEBItem) itemObj; System.out.println ("ID: " + item.getID()); System.out.println ("href: " + item.getHref()); System.out.println ("Media-type: " + item.getMediaType()); } catch (ClassCastException badItem) { System.out.println (badItem + ": " + itemObj.getClass().toString()); } } // iterating through manifest // Test out the various methods of the spine element ListIterator lit = pack.listIterator (); System.out.println ("Spine information: "); while (lit.hasNext ()) { OEBItem item = (OEBItem) lit.next (); System.out.println ("ID: " + item.getID()); System.out.println ("href: " + item.getHref()); System.out.println ("Media-type: " + item.getMediaType()); } // iterating through spine
An example of an Open eBook package file is located here
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |