Source for file OutputHandler.abstract.php

Documentation is available at OutputHandler.abstract.php

  1. <?php
  2. /**
  3. * @package harmoni.architecture.output
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: OutputHandler.abstract.php,v 1.6 2007/09/04 20:25:30 adamfranco Exp $
  9. */
  10. require_once(OKI2."/osid/OsidManager.php");
  11.  
  12. /**
  13. * The OutputHander abstract class defines methods for the interaction between
  14. * the Harmoni framework object and output handling classes.
  15. *
  16. *
  17. * @package harmoni.architecture.output
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: OutputHandler.abstract.php,v 1.6 2007/09/04 20:25:30 adamfranco Exp $
  23. */
  24. class OutputHandler
  25. extends OsidManager
  26. {
  27.  
  28. /*******************************************************
  29. * Instance Variables
  30. *********************************************************/
  31.  
  32.  
  33. /**
  34. * @var string $_head; The head content
  35. * @access private
  36. * @since 7/7/05
  37. */
  38. var $_head;
  39.  
  40. /*******************************************************
  41. * Instance Methods
  42. *********************************************************/
  43.  
  44. /**
  45. * Assign the configuration of this Manager. Valid configuration options are as
  46. * follows:
  47. * database_index integer
  48. * database_name string
  49. *
  50. * @param object Properties $configuration (original type: java.util.Properties)
  51. *
  52. * @throws object OsidException An exception with one of the following
  53. * messages defined in org.osid.OsidException: {@link }
  54. * org.osid.OsidException#OPERATION_FAILED OPERATION_FAILED},
  55. * {@link org.osid.OsidException#PERMISSION_DENIED}
  56. * PERMISSION_DENIED}, {@link }
  57. * org.osid.OsidException#CONFIGURATION_ERROR
  58. * CONFIGURATION_ERROR}, {@link }
  59. * org.osid.OsidException#UNIMPLEMENTED UNIMPLEMENTED}, {@link }
  60. * org.osid.OsidException#NULL_ARGUMENT NULL_ARGUMENT}
  61. *
  62. * @access public
  63. */
  64. function assignConfiguration ( $configuration ) {
  65. $this->_configuration =$configuration;
  66. }
  67.  
  68. /**
  69. * Return context of this OsidManager.
  70. *
  71. * @return object OsidContext
  72. *
  73. * @throws object OsidException
  74. *
  75. * @access public
  76. */
  77. function getOsidContext () {
  78. return $this->_osidContext;
  79. }
  80.  
  81. /**
  82. * Assign the context of this OsidManager.
  83. *
  84. * @param object OsidContext $context
  85. *
  86. * @throws object OsidException An exception with one of the following
  87. * messages defined in org.osid.OsidException: {@link }
  88. * org.osid.OsidException#NULL_ARGUMENT NULL_ARGUMENT}
  89. *
  90. * @access public
  91. */
  92. function assignOsidContext ( $context ) {
  93. $this->_osidContext =$context;
  94. }
  95. /**
  96. * Attach this class to the HarmoniObject as the current OutputHandler.
  97. * This method and Harmoni::attachOutputHandler() make up a Double-Dispatch
  98. * design pattern.
  99. *
  100. * @return void
  101. * @access public
  102. * @since 4/4/05
  103. */
  104. function attachToHarmoni () {
  105. $osidContext =$this->getOsidContext();
  106. $harmoni =$osidContext->getContext('harmoni');
  107. $harmoni->attachOutputHandler($this);
  108. }
  109. /**
  110. * Output the content that was returned from an action. This content should
  111. * have been created such that it is a type that this OutputHandler can deal
  112. * with.
  113. *
  114. * @param mixed $returnedContent Content returned by the action
  115. * @param string $printedContent Additional content printed, but not returned.
  116. * @return void
  117. * @access public
  118. * @since 4/4/05
  119. */
  120. function output ( $returnedContent, $printedContent ) {
  121. throwError(new Error("Method <b>".__FUNCTION__."()</b> declared in abstract class <b> ".__CLASS__."</b> has not been overloaded in a child class.","OutputHandler",true));
  122. }
  123. /**
  124. * Set the 'head' html element.
  125. *
  126. * @param string $newHead
  127. * @return void
  128. * @access public
  129. * @since 4/4/05
  130. */
  131. function setHead ( $newHead ) {
  132. $this->_head = $newHead;
  133. }
  134. /**
  135. * Get the 'head' html element.
  136. *
  137. * @return string
  138. * @access public
  139. * @since 4/4/05
  140. */
  141. function getHead () {
  142. return $this->_head;
  143. }
  144. }
  145.  
  146. ?>

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