Source for file RemoteFileRecordStructure.class.php

Documentation is available at RemoteFileRecordStructure.class.php

  1. <?php
  2. /**
  3. * @since 12/5/06
  4. * @package harmoni.osid_v2.repository
  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: RemoteFileRecordStructure.class.php,v 1.2 2007/09/04 20:25:44 adamfranco Exp $
  10. */
  11.  
  12. require_once(dirname(__FILE__)."/Fields/FileUrlPartStructure.class.php");
  13. require_once(dirname(__FILE__)."/Fields/RemoteFileSizePartStructure.class.php");
  14.  
  15. /**
  16. * The remote file record structure defines files who's data lives at a remote url.
  17. *
  18. * Each Asset has one of the AssetType supported by the Repository. There are
  19. * also zero or more RecordStructures required by the Repository for each
  20. * AssetType. RecordStructures provide structural information. The values for
  21. * a given Asset's RecordStructure are stored in a Record. RecordStructures
  22. * can contain sub-elements which are referred to as PartStructures. The
  23. * structure defined in the RecordStructure and its PartStructures is used in
  24. * for any Records for the Asset. Records have Parts which parallel
  25. * PartStructures.
  26. *
  27. * <p>
  28. * OSID Version: 2.0
  29. * </p>
  30. *
  31. * @since 12/5/06
  32. * @package harmoni.osid_v2.repository
  33. *
  34. * @copyright Copyright &copy; 2005, Middlebury College
  35. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  36. *
  37. * @version $Id: RemoteFileRecordStructure.class.php,v 1.2 2007/09/04 20:25:44 adamfranco Exp $
  38. */
  39. class RemoteFileRecordStructure
  40. extends HarmoniFileRecordStructure
  41. {
  42. /**
  43. * Constructor
  44. *
  45. * @param <##>
  46. * @return object
  47. * @access public
  48. * @since 12/5/06
  49. */
  50. function RemoteFileRecordStructure () {
  51. if (!is_array($this->_partStructures))
  52. $this->_partStructures = array();
  53. $this->_partStructures['FILE_URL'] = new FileUrlPartStructure($this);
  54. $this->HarmoniFileRecordStructure();
  55. unset($this->_partStructures['FILE_DATA'], $this->_partStructures['FILE_SIZE']);
  56. $this->_partStructures['FILE_SIZE'] = new RemoteFileSizePartStructure($this);
  57. }
  58. /**
  59. * Get the display name for this RecordStructure.
  60. *
  61. * @return string
  62. *
  63. * @throws object RepositoryException An exception with one of
  64. * the following messages defined in
  65. * org.osid.repository.RepositoryException may be thrown: {@link }
  66. * org.osid.repository.RepositoryException#OPERATION_FAILED
  67. * OPERATION_FAILED}, {@link }
  68. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  69. * PERMISSION_DENIED}, {@link }
  70. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  71. * CONFIGURATION_ERROR}, {@link }
  72. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  73. * UNIMPLEMENTED}
  74. *
  75. * @access public
  76. */
  77. function getDisplayName() {
  78. return "Remote File";
  79. }
  80. /**
  81. * Get the unique Id for this RecordStructure.
  82. *
  83. * @return object Id
  84. *
  85. * @throws object RepositoryException An exception with one of
  86. * the following messages defined in
  87. * org.osid.repository.RepositoryException may be thrown: {@link }
  88. * org.osid.repository.RepositoryException#OPERATION_FAILED
  89. * OPERATION_FAILED}, {@link }
  90. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  91. * PERMISSION_DENIED}, {@link }
  92. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  93. * CONFIGURATION_ERROR}, {@link }
  94. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  95. * UNIMPLEMENTED}
  96. *
  97. * @access public
  98. */
  99. function getId() {
  100. $idManager = Services::getService("Id");
  101. return $idManager->getId('REMOTE_FILE');
  102. }
  103. }
  104.  
  105. ?>

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