Source for file XMLPartStructureExporter.class.php

Documentation is available at XMLPartStructureExporter.class.php

  1. <?php
  2. /**
  3. * @since 10/17/05
  4. * @package polyphony.exporter
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: XMLPartStructureExporter.class.php,v 1.7 2007/09/19 14:04:45 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * Exports into XML for use with the XML Importer
  14. *
  15. * @since 10/17/05
  16. * @package polyphony.exporter
  17. *
  18. * @copyright Copyright &copy; 2005, Middlebury College
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  20. *
  21. * @version $Id: XMLPartStructureExporter.class.php,v 1.7 2007/09/19 14:04:45 adamfranco Exp $
  22. */
  23. class XMLPartStructureExporter {
  24. /**
  25. * Constructor
  26. *
  27. * creates a new instantiation of the partstructure exporter
  28. *
  29. * @param resource
  30. * @access public
  31. * @since 10/17/05
  32. */
  33. function XMLPartStructureExporter ($xmlFile) {
  34. $this->_xml =$xmlFile;
  35. $this->_childExporterList = null;
  36. $this->_childElementList = null;
  37. }
  38.  
  39. /**
  40. * Exports the object given and children if available
  41. *
  42. * @param object HarmoniPartStructure
  43. * @access public
  44. * @since 10/17/05
  45. */
  46. function export ($pS) {
  47. $this->_object =$pS;
  48. $this->_myId =$this->_object->getId();
  49. $type =$this->_object->getType();
  50.  
  51. fwrite($this->_xml,
  52. "\t\t<partstructure ".
  53. "id=\"".$this->_myId->getIdString()."\" ".
  54. "xml:id=\"".$this->_myId->getIdString()."\" ".
  55. "isMandatory=\"".(($this->_object->isMandatory())?"TRUE":"FALSE")."\" ".
  56. "isRepeatable=\"".(($this->_object->isRepeatable())?"TRUE":"FALSE")."\" ".
  57. "isPopulated=\"".(($this->_object->isPopulatedByRepository())?"TRUE":"FALSE").
  58. "\">\n".
  59. "\t\t\t<name>".$this->_object->getDisplayName()."</name>\n".
  60. "\t\t\t<description><![CDATA[".$this->_object->getDescription()."]]></description>\n".
  61. "\t\t\t<type>\n\t\t\t\t<domain>".$type->getDomain()."</domain>\n".
  62. "\t\t\t\t<authority>".$type->getAuthority()."</authority>\n".
  63. "\t\t\t\t<keyword>".$type->getKeyword()."</keyword>\n");
  64. if ($type->getDescription() != "")
  65. fwrite($this->_xml,
  66. "\t\t\t\t<description><![CDATA[".$type->getDescription()."]]></description>\n");
  67. fwrite($this->_xml,
  68. "\t\t\t</type>\n".
  69. "\t\t</partstructure>\n");
  70. }
  71. }
  72. ?>

Documentation generated on Wed, 19 Sep 2007 10:28:40 -0400 by phpDocumentor 1.3.0RC3