wcmf logo wemove logo

XMLOutputStrategy Class Reference
[Output]

This OutputStrategy outputs an object's content in a xml file using the default format. More...

Inheritance diagram for XMLOutputStrategy:

Inheritance graph
[legend]

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)

Data Fields

 $_id = 0
 $_file = ''
 $_docType = ''
 $_dtd = ''
 $_encoding = ''
 $_fp = 0
 $_indent = ''
 $_linebreak = "\n"
 $_tagsToClose = null
 $_lastIndent = -1
 $_fileOk = false

Detailed Description

This OutputStrategy outputs an object's content in a xml file using the default format.

wCMF - wemove Content Management Framework Copyright (C) 2005-2009 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.

Id
class.XMLOutputStrategy.php 967 2009-03-25 23:37:08Z iherwig

Note:
file locking works not on NFS!
Author:
ingo herwig <ingo@wemove.com>

Definition at line 32 of file class.XMLOutputStrategy.php.


Member Function Documentation

XMLOutputStrategy ( file,
docType,
dtd,
encoding = 'UTF-8',
indent = 2,
linebreak = "\n" 
)

Constructor.

Parameters:
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.

writeHeader (  ) 

Write the xml header.

Implements OutputStrategy.

Definition at line 68 of file class.XMLOutputStrategy.php.

References Log::warn(), and writeToFile().

Here is the call graph for this function:

writeFooter (  ) 

Write the xml footer.

Implements OutputStrategy.

Definition at line 97 of file class.XMLOutputStrategy.php.

References writeToFile().

Here is the call graph for this function:

writeObject ( &$  obj  ) 

Write the object.

Parameters:
obj The object to write.

Implements OutputStrategy.

Definition at line 115 of file class.XMLOutputStrategy.php.

References writeObjectContent(), and writeToFile().

Here is the call graph for this function:

writeToFile ( text  ) 

Actually write text to the file.

Note:
subclasses will override this to implement any final conversion.
Parameters:
text The text to write

Definition at line 153 of file class.XMLOutputStrategy.php.

Referenced by writeAttribute(), writeElement(), writeFooter(), writeHeader(), writeObject(), and writeObjectContent().

writeObjectContent ( &$  obj,
curIndent 
)

Write the object's content including opening tag, excluding closing tag.

Parameters:
obj The object to write.
curIndent The current indent.
Returns:
The name of the opening tag

Definition at line 163 of file class.XMLOutputStrategy.php.

References getElementName(), isWritingOIDs(), writeAttribute(), writeElement(), and writeToFile().

Referenced by writeObject().

Here is the call graph for this function:

isWritingOIDs (  ) 

Determine wether the oid should be written to the file. The default implementation returns true.

Note:
subclasses will override this to implement special application requirements.
Returns:
True/False wether the oid should be written

Definition at line 197 of file class.XMLOutputStrategy.php.

Referenced by writeObjectContent().

writeElement ( &$  obj,
name 
)

Write an object value of type DATATYPE_ELEMENT.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
name The name of the value

Definition at line 207 of file class.XMLOutputStrategy.php.

References getElementValue(), and writeToFile().

Referenced by writeObjectContent().

Here is the call graph for this function:

getElementName ( &$  obj  ) 

Get the xml element name for an object. The default implementation returns the result of the getType() method.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
Returns:
The xml name of the element

Definition at line 222 of file class.XMLOutputStrategy.php.

Referenced by writeObjectContent().

getElementValue ( &$  obj,
name,
value 
)

Get the xml element value for an object. The default implementation replaces newlines by
and applies htmlspecialchars to the result.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
name The name of the element
value The value to write
Returns:
The xml value

Definition at line 235 of file class.XMLOutputStrategy.php.

Referenced by writeElement().

writeAttribute ( &$  obj,
name 
)

Write an object value of type DATATYPE_ATTRIBUTE.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
name The name of the value

Definition at line 245 of file class.XMLOutputStrategy.php.

References getAttributeName(), getAttributeValue(), and writeToFile().

Referenced by writeObjectContent().

Here is the call graph for this function:

getAttributeName ( &$  obj,
name 
)

Get the xml attribute name for an object value. The default implementation returns the name of the attribute.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
name The name of the attribute
Returns:
The xml name of the attribute

Definition at line 261 of file class.XMLOutputStrategy.php.

Referenced by writeAttribute().

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.

Note:
subclasses will override this to implement special application requirements.
Parameters:
obj The object to write
name The name of the attribute
value The value to write
Returns:
The xml value

Definition at line 274 of file class.XMLOutputStrategy.php.

Referenced by writeAttribute().


Field Documentation

$_id = 0

Definition at line 34 of file class.XMLOutputStrategy.php.

$_file = ''

Definition at line 35 of file class.XMLOutputStrategy.php.

$_docType = ''

Definition at line 36 of file class.XMLOutputStrategy.php.

$_dtd = ''

Definition at line 37 of file class.XMLOutputStrategy.php.

$_encoding = ''

Definition at line 38 of file class.XMLOutputStrategy.php.

$_fp = 0

Definition at line 39 of file class.XMLOutputStrategy.php.

$_indent = ''

Definition at line 40 of file class.XMLOutputStrategy.php.

$_linebreak = "\n"

Definition at line 41 of file class.XMLOutputStrategy.php.

$_tagsToClose = null

Definition at line 42 of file class.XMLOutputStrategy.php.

$_lastIndent = -1

Definition at line 43 of file class.XMLOutputStrategy.php.

$_fileOk = false

Definition at line 44 of file class.XMLOutputStrategy.php.


The documentation for this class was generated from the following file:

This page generated via doxygen 1.5.8 Mon Mar 30 01:58:47 2009.
Copyright © 2009 wemove digital solutions GmbH.
sourceforge logo