|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.viewer.CMBDocumentEngine
CMBDocumentEngine is an abstract class that defines the interface any document engine implementation should extend. Document engines plug into CMBDocumentServices and provide rendering and translation support for different document types.
The methods are divided into the following categories:
Note: An abstract class was used rather than an interface in order to extend this interface in the future without requiring currently written document engines to be modified.
Fields inherited from interface com.ibm.mm.viewer.CMBViewerConstants |
DEFAULT_PAGE_NUMBER, ROTATE_0, ROTATE_180, ROTATE_270, ROTATE_90 |
Constructor Summary | |
CMBDocumentEngine()
|
Method Summary | |
boolean |
canEnhance(java.lang.Object hDocument,
java.lang.String destMimeType)
Returns true if the document pages can be enhanced when written in the specified format. |
boolean |
canInvert(java.lang.Object hDocument,
java.lang.String destMimeType)
Returns true if the document page colors can be inverted when written in the specified format. |
boolean |
canLoadDocument(java.lang.String mimeType)
Returns true if the specified document type is handled by the engine. |
boolean |
canPaginate(java.lang.String mimeType)
Returns true if the engine can convert documents of the specified MIME content type as pages. |
boolean |
canProvidePageImage(java.lang.String mimeType)
Returns true if the engine can provide images of pages. |
boolean |
canRotate(java.lang.Object hDocument,
java.lang.String destMimeType)
Returns true if the document pages can be rotated when written in the specified format. |
boolean |
canShowAnnotations(java.lang.Object hDocument,
java.lang.String destMimeType)
Returns true if the document pages can be shown with annotations when written in the specified format. |
boolean |
canWriteDocument(java.lang.String sourceMimeType,
java.lang.String destMimeType)
Returns true if the specified document type can be written by the engine using the writeDocument method in the specified format. |
boolean |
canWriteDocumentFromPages(java.lang.String sourceMimeType,
java.lang.String destMimeType)
Returns true if a series of pages from the document can be written by the engine using the writePages method in the specified format. |
boolean |
canWritePage(java.lang.Object hPage,
java.lang.String destMimeType)
Returns true if a page of the document can be written by the engine using the writePage method in the specified format. |
boolean |
canWritePage(java.lang.String sourceMimeType,
java.lang.String destMimeType)
Returns true if a page of the document can be written by the engine using the writePage method in the specified format. |
void |
dropDocument(java.lang.Object hDocument)
Terminates processing of a document by the document engine. |
void |
dropPage(java.lang.Object hPage)
Terminates processing of a page. |
int |
getImageResolution(java.lang.Object hDocument)
Returns the image resolution of the document in pixels per inch (ppi). |
int |
getNumberOfPages(java.lang.Object hDocument)
Returns the number of pages in the document. |
double |
getPageHeight(java.lang.Object hPage)
Returns the height of the page, in inches. |
java.awt.Image |
getPageImage(java.lang.Object hPage,
int rotation,
double scale,
boolean enhance,
boolean invert,
boolean withAnnotations)
Returns an image of the page. |
double |
getPageMaxScale(java.lang.Object hPage,
java.lang.String destMimeType)
Returns the maximum scale of document pages when written in the specified format. |
java.lang.String |
getPageMimeType(java.lang.Object hPage,
java.lang.String[] preferredMimeTypes)
Returns the engine's desired page format for writing the page. |
double |
getPageMinScale(java.lang.Object hPage,
java.lang.String destMimeType)
Returns the minimum scale of document pages when written in the specified format. |
java.lang.String |
getPageResourceMimeType(java.lang.Object hPage,
java.lang.String resourceId)
Returns the MIME content type for a linked resource of a written page. |
double |
getPageWidth(java.lang.Object hPage)
Returns the width of the page, in inches. |
abstract void |
initialize(CMBDocumentEngineCallbacks callbacks,
java.util.Properties properties)
Initializes the document engine. |
abstract boolean |
isInitialized()
Returns true if the initialize method has been called and the engine initialized successfully. |
java.lang.Object |
loadDocument(java.io.InputStream partStream,
int partStreamSize,
int numberOfParts,
java.lang.String mimeType,
java.io.InputStream annotationStream,
java.io.InputStream resourceStream)
Deprecated. Use loadDocument(InputStream, int, int, String, String, InputStream, InputStream) instead. |
java.lang.Object |
loadDocument(java.io.InputStream partStream,
int partStreamSize,
int numberOfParts,
java.lang.String partMimeType,
java.lang.String docMimeType,
java.io.InputStream annotationStream,
java.io.InputStream resourceStream)
Initializes processing of a document by the document engine. |
java.lang.Object |
loadDocument(java.io.InputStream partStream,
int numberOfParts,
java.lang.String mimeType,
java.io.InputStream annotationStream,
java.io.InputStream resourceStream)
Deprecated. Use loadDocument(InputStream, int, int, String, String, InputStream, InputStream) instead. |
java.lang.Object |
loadDocument(java.io.InputStream partStream,
int numberOfParts,
java.lang.String partMimeType,
java.lang.String docMimeType,
java.io.InputStream annotationStream,
java.io.InputStream resourceStream)
Deprecated. Use loadDocument(InputStream, int, int, String, String, InputStream, InputStream) instead. |
java.lang.Object |
loadPage(java.lang.Object hDocument,
int page)
Initialized processing of a page within the document. |
abstract void |
terminate()
Terminates the engine. |
void |
writeDocument(java.lang.Object hDocument,
java.lang.String destMimeType,
java.io.OutputStream output)
Writes the document to an output stream, in the specified format. |
void |
writeDocumentFromPages(java.lang.Object hDocument,
int startingPage,
int endingPage,
java.lang.String destMimeType,
java.io.OutputStream output,
boolean withAnnotations)
Writes the specified pages to an output stream in the specified format. |
void |
writePage(java.lang.Object hPage,
int rotation,
double scale,
boolean enhance,
boolean invert,
boolean withAnnotations,
java.io.OutputStream output,
java.lang.String destMimeType)
Writes the page to an output stream in the specified format. |
void |
writePage(java.lang.Object hPage,
int rotation,
double scale,
boolean enhance,
boolean invert,
boolean withAnnotations,
java.io.OutputStream output,
java.lang.String destMimeType,
java.lang.String resourcePrefix)
Writes the page to an output stream in the specified format. |
void |
writePageResource(java.lang.Object hPage,
java.lang.String resourceId,
int rotation,
double scale,
boolean enhance,
boolean invert,
boolean withAnnotations,
java.io.OutputStream output)
Writes a linked page resource to the output stream specified. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMBDocumentEngine()
Method Detail |
public abstract void initialize(CMBDocumentEngineCallbacks callbacks, java.util.Properties properties)
callbacks
- methods to get background forms and additional parts of a multi-part document.properties
- engine specific properties.public abstract void terminate()
public abstract boolean isInitialized()
public boolean canLoadDocument(java.lang.String mimeType)
mimeType
- the MIME content type for the document type being tested.public java.lang.Object loadDocument(java.io.InputStream partStream, int numberOfParts, java.lang.String mimeType, java.io.InputStream annotationStream, java.io.InputStream resourceStream) throws java.io.IOException
partStream
- An input stream containing the data for the document. If the document
is a multi-part document, this input stream contains the data for the first part
of the document.numberOfParts
- the number of parts that compose the document. This will be 1 for
a single-part document.mimeType
- the MIME content type of the first part.annotationStream
- An input stream containing the annotations for the document. This will
only have data in those cases where the annotations are stored separately from the document.
The format of the annotations is dependent on the tool that wrote the annotations. Only
those formats understood by the document engine will be processed.resourceStream
- an InputStream containing engine specific resources.public java.lang.Object loadDocument(java.io.InputStream partStream, int numberOfParts, java.lang.String partMimeType, java.lang.String docMimeType, java.io.InputStream annotationStream, java.io.InputStream resourceStream) throws java.io.IOException
partStream
- An input stream containing the data for the document. If the document
is a multi-part document, this input stream contains the data for the first part
of the document.partStreamSize
- The size of the partStream of the first part of the document. For situations in
which the part stream size is known, this api should be used. The size of the additional parts can be
obtained using the CMBDocumentEngineCallbacks getPartSize() interface.The size should be greater than 0
to be valid.numberOfParts
- the number of parts that compose the document. This will be 1 for
a single-part document.partMimeType
- the MIME content type of the first part.docMimeType
- the MIME content type of the document. For single-part documents,
this is the same as the first part.annotationStream
- An input stream containing the annotations for the document. This will
only have data in those cases where the annotations are stored separately from the document.
The format of the annotations is dependent on the tool that wrote the annotations. Only
those formats understood by the document engine will be processed.resourceStream
- an InputStream containing engine specific resources.public java.lang.Object loadDocument(java.io.InputStream partStream, int partStreamSize, int numberOfParts, java.lang.String mimeType, java.io.InputStream annotationStream, java.io.InputStream resourceStream) throws java.io.IOException
partStream
- An input stream containing the data for the document. If the document
is a multi-part document, this input stream contains the data for the first part
of the document.partStreamSize
- The size of the partStream of the first part of the document. For situations in
which the part stream size is known, this api should be used. The size of the additional parts can be
obtained using the CMBDocumentEngineCallbacks getPartSize() interface.The size should be greater than 0
to be valid.numberOfParts
- the number of parts that compose the document. This will be 1 for
a single-part document.mimeType
- the MIME content type of the first part.annotationStream
- An input stream containing the annotations for the document. This will
only have data in those cases where the annotations are stored separately from the document.
The format of the annotations is dependent on the tool that wrote the annotations. Only
those formats understood by the document engine will be processed.resourceStream
- an InputStream containing engine specific resources.public java.lang.Object loadDocument(java.io.InputStream partStream, int partStreamSize, int numberOfParts, java.lang.String partMimeType, java.lang.String docMimeType, java.io.InputStream annotationStream, java.io.InputStream resourceStream) throws java.io.IOException
partStream
- An input stream containing the data for the document. If the document
is a multi-part document, this input stream contains the data for the first part
of the document.partStreamSize
- The size of the partStream of the first part of the document. For situations in
which the part stream size is known, this api should be used. The size of the additional parts can be
obtained using the CMBDocumentEngineCallbacks getPartSize() interface.The size should be greater than 0
to be valid.numberOfParts
- the number of parts that compose the document. This will be 1 for
a single-part document.partMimeType
- the MIME content type of the first part.docMimeType
- the MIME content type of the document. For single-part documents,
this is the same as the first part.annotationStream
- An input stream containing the annotations for the document. This will
only have data in those cases where the annotations are stored separately from the document.
The format of the annotations is dependent on the tool that wrote the annotations. Only
those formats understood by the document engine will be processed.resourceStream
- an InputStream containing engine specific resources.public void dropDocument(java.lang.Object hDocument)
hDocument
- the handle of the document, as returned from loadDocument.public boolean canWriteDocument(java.lang.String sourceMimeType, java.lang.String destMimeType)
sourceMimeType
- the MIME content type for the source document.destMimeType
- the MIME content type for the document to be written.public void writeDocument(java.lang.Object hDocument, java.lang.String destMimeType, java.io.OutputStream output) throws java.io.IOException
hDocument
- the handle of the document, as returned from loadDocument.destMimeType
- the MIME content type for the format that the document is to be written.output
- the output stream where the document is written.public boolean canPaginate(java.lang.String mimeType)
mimeType
- the MIME content type for the document type being tested.public int getNumberOfPages(java.lang.Object hDocument) throws java.io.IOException
hDocument
- the handle of the document, as returned from loadDocument.public java.lang.Object loadPage(java.lang.Object hDocument, int page) throws java.io.IOException
hDocument
- the handle of the document, as returned from loadDocument.page
- the index of the page (zero is the first page)public void dropPage(java.lang.Object hPage)
hPage
- the handle of the page, as returned from loadPage.public double getPageWidth(java.lang.Object hPage)
hPage
- the handle of the page, as returned from loadPage.public double getPageHeight(java.lang.Object hPage)
hPage
- the handle of the page, as returned from loadPage.public boolean canRotate(java.lang.Object hDocument, java.lang.String destMimeType)
hDocument
- the handle of the document, as returned from loadDocumentdestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public double getPageMinScale(java.lang.Object hPage, java.lang.String destMimeType)
hPage
- the handle of the page, as returned from loadPagedestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public double getPageMaxScale(java.lang.Object hPage, java.lang.String destMimeType)
hPage
- the handle of the document, as returned from loadPagedestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public boolean canEnhance(java.lang.Object hDocument, java.lang.String destMimeType)
hDocument
- the handle of the document, as returned from loadDocumentdestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public boolean canInvert(java.lang.Object hDocument, java.lang.String destMimeType)
hDocument
- the handle of the document, as returned from loadDocumentdestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public boolean canShowAnnotations(java.lang.Object hDocument, java.lang.String destMimeType)
hDocument
- the handle of the document, as returned from loadDocumentdestMimeType
- the MIME content of the page when written. If this is null, then
the call is to query capabilities when providing page images.public boolean canWritePage(java.lang.Object hPage, java.lang.String destMimeType)
hPage
- the handle of the page, as returned from loadPage.destMimeType
- the MIME content type for the page.public boolean canWritePage(java.lang.String sourceMimeType, java.lang.String destMimeType)
sourceMimeType
- the MIME content type for the document.destMimeType
- the MIME content type for the page.public java.lang.String getPageMimeType(java.lang.Object hPage, java.lang.String[] preferredMimeTypes)
hPage
- the handle of the page, as returned from loadPage.String[]
- The preferred formats in the desired order that the page to be written into.public void writePage(java.lang.Object hPage, int rotation, double scale, boolean enhance, boolean invert, boolean withAnnotations, java.io.OutputStream output, java.lang.String destMimeType) throws java.io.IOException, CMBDocumentEngineException
hPage
- the handle of the page, as returned from loadPage.rotation
- the rotation of the page. One of the constants ROTATE_0, ROTATE_90, ROTATE_180,
or ROTATE_270.scale
- the scale for the page (1.0 is actual size)enhance
- if true, the page should be enhanced to improve text readability if possible.invert
- if true, the image should be color inverted.output
- the stream to write the page to.destMimeType
- the MIME content type for the format that the page is to be saved.public void writePage(java.lang.Object hPage, int rotation, double scale, boolean enhance, boolean invert, boolean withAnnotations, java.io.OutputStream output, java.lang.String destMimeType, java.lang.String resourcePrefix) throws java.io.IOException, CMBDocumentEngineException
hPage
- the handle of the page, as returned from loadPage.rotation
- the rotation of the page. One of the constants ROTATE_0, ROTATE_90, ROTATE_180,
or ROTATE_270.scale
- the scale for the page (1.0 is actual size)enhance
- if true, the page should be enhanced to improve text readability if possible.invert
- if true, the image should be color inverted.output
- the stream to write the page to.destMimeType
- the MIME content type for the format that the page is to be saved.resourcePrefix
- the prefix to use on linked resources in the generated output
page. (These are typically href's in HTML output.)public java.lang.String getPageResourceMimeType(java.lang.Object hPage, java.lang.String resourceId)
hPage
- the handle of the page, as returned from loadPageresourceId
- the identifier of the resource. For HTML generated pages, this is the
suffix following the resourcePrefix specified when the page was generated.public void writePageResource(java.lang.Object hPage, java.lang.String resourceId, int rotation, double scale, boolean enhance, boolean invert, boolean withAnnotations, java.io.OutputStream output) throws java.io.IOException, CMBDocumentEngineException
hPage
- the handle of the page, as returned from loadPageresourceId
- the identifier of the resource. For HTML generated pages, this is the
suffix following the resourcePrefix specified when the page was generated.rotation
- the rotation of the page. One of the constants ROTATE_0, ROTATE_90, ROTATE_180,
or ROTATE_270.scale
- the scale for the page (1.0 is actual size)enhance
- if true, the page should be enhanced to improve text readability if possible.invert
- if true, the image should be color inverted.output
- the stream to write the page resource to.public boolean canWriteDocumentFromPages(java.lang.String sourceMimeType, java.lang.String destMimeType)
sourceMimeType
- the MIME content type for the document.destMimeType
- the MIME content type for the page.public void writeDocumentFromPages(java.lang.Object hDocument, int startingPage, int endingPage, java.lang.String destMimeType, java.io.OutputStream output, boolean withAnnotations) throws java.io.IOException
hDocument
- the handle of the document, as returned from loadDocument.startingPage
- the index of the starting page (page 0 is the first page)endingPage
- the index of the ending pagedestMimeType
- the MIME content type for the format that the pages are to be saved.output
- the stream to write the page to.withAnnotations
- if true, then the pages should be saved with their annotations.public boolean canProvidePageImage(java.lang.String mimeType)
mimeType
- the MIME content type for the document type being tested.public java.awt.Image getPageImage(java.lang.Object hPage, int rotation, double scale, boolean enhance, boolean invert, boolean withAnnotations)
hPage
- the handle of the page, as returned from loadPage.rotation
- the rotation of the page. One of the constants ROTATE_0, ROTATE_90, ROTATE_180,
or ROTATE_270.scale
- the scale for the page (1.0 is actual size)enhance
- if true, the page should be enhanced to improve text readability if possible.invert
- if true, the image should be color inverted.public int getImageResolution(java.lang.Object hDocument)
hDocument
- the handle of the document, as returned from loadDocument.
|
EIP JavaBeans | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |