wCMF
3.6
|
Public Member Functions | |
XMLOutputStrategy ($file, $docType, $dtd, $encoding='UTF-8', $indent=2, $linebreak="\n") | |
writeHeader () | |
writeFooter () | |
writeObject (&$obj) | |
writeToFile ($text) | |
writeObjectContent (&$obj, $curIndent) | |
isWritingOIDs () | |
writeElement (&$obj, $name) | |
getElementName (&$obj) | |
getElementValue (&$obj, $name, $value) | |
writeAttribute (&$obj, $name) | |
getAttributeName (&$obj, $name) | |
getAttributeValue (&$obj, $name, $value) | |
Public Attributes | |
$_id = 0 | |
$_file = '' | |
$_docType = '' | |
$_dtd = '' | |
$_encoding = '' | |
$_fp = 0 | |
$_indent = '' | |
$_linebreak = "\n" | |
$_tagsToClose = null | |
$_lastIndent = -1 | |
$_fileOk = false | |
This OutputStrategy outputs an object's content in a xml file using the default format.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Definition at line 32 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::XMLOutputStrategy | ( | $file, | |
$docType, | |||
$dtd, | |||
$encoding = 'UTF-8' , |
|||
$indent = 2 , |
|||
$linebreak = "\n" |
|||
) |
Constructor.
file | The output file name. |
docType | The document type. |
dtd | The document type definition name. |
encoding | The used encoding (default: UTF-8). |
indent | The number of spaces to indent (default: 2). |
linebreak | The linebreak char to use (default: ). |
Definition at line 54 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::writeHeader | ( | ) |
Write the xml header.
Implements OutputStrategy.
Definition at line 68 of file class.XMLOutputStrategy.php.
References Log\warn(), and writeToFile().
XMLOutputStrategy::writeFooter | ( | ) |
Write the xml footer.
Implements OutputStrategy.
Definition at line 97 of file class.XMLOutputStrategy.php.
References writeToFile().
XMLOutputStrategy::writeObject | ( | & | $obj | ) |
Write the object.
obj | The object to write. |
Implements OutputStrategy.
Definition at line 115 of file class.XMLOutputStrategy.php.
References writeObjectContent(), and writeToFile().
XMLOutputStrategy::writeToFile | ( | $text | ) |
Actually write text to the file.
text | The text to write |
Definition at line 153 of file class.XMLOutputStrategy.php.
Referenced by writeAttribute(), writeElement(), writeFooter(), writeHeader(), writeObject(), and writeObjectContent().
XMLOutputStrategy::writeObjectContent | ( | & | $obj, |
$curIndent | |||
) |
Write the object's content including opening tag, excluding closing tag.
obj | The object to write. |
curIndent | The current indent. |
Definition at line 163 of file class.XMLOutputStrategy.php.
References DATATYPE_ATTRIBUTE, DATATYPE_ELEMENT, getElementName(), isWritingOIDs(), writeAttribute(), writeElement(), and writeToFile().
Referenced by writeObject().
XMLOutputStrategy::isWritingOIDs | ( | ) |
Determine wether the oid should be written to the file. The default implementation returns true.
Definition at line 197 of file class.XMLOutputStrategy.php.
Referenced by writeObjectContent().
XMLOutputStrategy::writeElement | ( | & | $obj, |
$name | |||
) |
Write an object value of type DATATYPE_ELEMENT.
obj | The object to write |
name | The name of the value |
Definition at line 207 of file class.XMLOutputStrategy.php.
References DATATYPE_ELEMENT, getElementValue(), and writeToFile().
Referenced by writeObjectContent().
XMLOutputStrategy::getElementName | ( | & | $obj | ) |
Get the xml element name for an object. The default implementation returns the result of the getType() method.
obj | The object to write |
Definition at line 222 of file class.XMLOutputStrategy.php.
Referenced by writeObjectContent().
XMLOutputStrategy::getElementValue | ( | & | $obj, |
$name, | |||
$value | |||
) |
Get the xml element value for an object. The default implementation replaces newlines by
and applies htmlspecialchars to the result.
obj | The object to write |
name | The name of the element |
value | The value to write |
Definition at line 235 of file class.XMLOutputStrategy.php.
Referenced by writeElement().
XMLOutputStrategy::writeAttribute | ( | & | $obj, |
$name | |||
) |
Write an object value of type DATATYPE_ATTRIBUTE.
obj | The object to write |
name | The name of the value |
Definition at line 245 of file class.XMLOutputStrategy.php.
References DATATYPE_ATTRIBUTE, getAttributeName(), getAttributeValue(), and writeToFile().
Referenced by writeObjectContent().
XMLOutputStrategy::getAttributeName | ( | & | $obj, |
$name | |||
) |
Get the xml attribute name for an object value. The default implementation returns the name of the attribute.
obj | The object to write |
name | The name of the attribute |
Definition at line 261 of file class.XMLOutputStrategy.php.
Referenced by writeAttribute().
XMLOutputStrategy::getAttributeValue | ( | & | $obj, |
$name, | |||
$value | |||
) |
Get the xml attribute value for an object value. The default implementation replaces newlines by
and applies htmlspecialchars to the result.
obj | The object to write |
name | The name of the attribute |
value | The value to write |
Definition at line 274 of file class.XMLOutputStrategy.php.
Referenced by writeAttribute().
XMLOutputStrategy::$_id = 0 |
Definition at line 34 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_file = '' |
Definition at line 35 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_docType = '' |
Definition at line 36 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_dtd = '' |
Definition at line 37 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_encoding = '' |
Definition at line 38 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_fp = 0 |
Definition at line 39 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_indent = '' |
Definition at line 40 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_linebreak = "\n" |
Definition at line 41 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_tagsToClose = null |
Definition at line 42 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_lastIndent = -1 |
Definition at line 43 of file class.XMLOutputStrategy.php.
XMLOutputStrategy::$_fileOk = false |
Definition at line 44 of file class.XMLOutputStrategy.php.