A base class for document type handlers.
Source for this file: /Document/src/interfaces/document.php
Version: | //autogen// |
Child Class | Description |
---|---|
ezcDocumentWiki | Document handler for wiki text documents. |
ezcDocumentBBCode | Document handler for BBCode text documents. |
ezcDocumentPdf | Document handler for PDF documents. |
ezcDocumentXmlBase | A base class for XML based document type handlers. |
ezcDocumentRst | Document handler for RST text documents. |
protected array |
$errors
= array()
Errors occured during the conversion process |
protected ezcDocumentXmlOptions |
$options
XML document base options. |
protected string |
$path
= './'
Current document path, where the operations happen. |
public ezcDocument |
__construct(
[ $options
= null] )
Construct new document |
public abstract void |
createFromDocbook(
$document
)
Create document from docbook document |
public abstract ezcDocumentDocbook |
getAsDocbook(
)
Return document compiled to the docbook format |
public array |
getErrors(
)
Return list of errors occured during visiting the document. |
public string |
getPath(
)
Get document base path |
public void |
loadFile(
$file
)
Create document from file |
public abstract void |
loadString(
$string
)
Create document from input string |
public abstract string |
save(
)
Return document as string |
public void |
setPath(
$path
)
Set document base path |
public void |
triggerError(
$level
, $message
, [ $file
= null] , [ $line
= null] , [ $position
= null] )
Trigger visitor error |
Construct new document
Name | Type | Description |
---|---|---|
$options |
ezcDocumentOptions |
Create document from docbook document
A document of the docbook format is provided and the internal document structure should be created out of this.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Name | Type | Description |
---|---|---|
$document |
ezcDocumentDocbook |
Method | Description |
---|---|
ezcDocumentWiki::createFromDocbook() |
Create document from docbook document |
ezcDocumentConfluenceWiki::createFromDocbook() |
Create document from docbook document |
ezcDocumentDokuwikiWiki::createFromDocbook() |
Create document from docbook document |
ezcDocumentBBCode::createFromDocbook() |
Create document from docbook document |
ezcDocumentPdf::createFromDocbook() |
Create document from docbook document |
ezcDocumentXhtml::createFromDocbook() |
Create document from docbook document |
ezcDocumentOdt::createFromDocbook() |
Create document from docbook document |
ezcDocumentEzXml::createFromDocbook() |
Create document from docbook document |
ezcDocumentDocbook::createFromDocbook() |
Create document from docbook document |
ezcDocumentRst::createFromDocbook() |
Create document from docbook document |
Return document compiled to the docbook format
The internal document structure is compiled to the docbook format and the resulting docbook document is returned.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.
Method | Description |
---|---|
ezcDocumentWiki::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentBBCode::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentPdf::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentXhtml::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentOdt::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentEzXml::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentDocbook::getAsDocbook() |
Return document compiled to the docbook format |
ezcDocumentRst::getAsDocbook() |
Return document compiled to the docbook format |
Return list of errors occured during visiting the document.
May be an empty array, if on errors occured, or a list of ezcDocumentVisitException objects.
Method | Description |
---|---|
ezcDocumentErrorReporting::getErrors() |
Return list of errors occured during visiting the document. |
Get document base path
Create document from file
Create a document of the current type handler class and parse it into a usable internal structure. The default implementation just calls loadString(), but you may want to provide an optimized implementation.
Name | Type | Description |
---|---|---|
$file |
string |
Create document from input string
Create a document of the current type handler class and parse it into a usable internal structure.
Name | Type | Description |
---|---|---|
$string |
string |
Method | Description |
---|---|
ezcDocumentWiki::loadString() |
Create document from input string |
ezcDocumentBBCode::loadString() |
Create document from input string |
ezcDocumentPdf::loadString() |
Create document from input string |
ezcDocumentXmlBase::loadString() |
Create document from input string |
ezcDocumentXhtml::loadString() |
Create document from input string |
ezcDocumentOdt::loadString() |
Create document from input string. |
ezcDocumentRst::loadString() |
Create document from input string |
Return document as string
Serialize the document to a string an return it.
Method | Description |
---|---|
ezcDocumentWiki::save() |
Return document as string |
ezcDocumentBBCode::save() |
Return document as string |
ezcDocumentPdf::save() |
Return document as string |
ezcDocumentXmlBase::save() |
Return document as string |
ezcDocumentXhtml::save() |
Return document as string |
ezcDocumentOdt::save() |
Return document as string |
ezcDocumentDocbook::save() |
Return document as string |
ezcDocumentRst::save() |
Return document as string |
Set document base path
The base path will be used as a base for relative file inclusions in the document.
Name | Type | Description |
---|---|---|
$path |
string |
Trigger visitor error
Emit a vistitor error, and convert it to an exception depending on the error reporting settings.
Name | Type | Description |
---|---|---|
$level |
int | |
$message |
string | |
$file |
string | |
$line |
int | |
$position |
int |
Method | Description |
---|---|
ezcDocumentErrorReporting::triggerError() |
Trigger parser error. |