Source for file ThumbnailDataPartStructure.class.php

Documentation is available at ThumbnailDataPartStructure.class.php

  1. <?php
  2.  
  3. /**
  4. * Each Asset has one of the AssetType supported by the Repository. There are
  5. * also zero or more RecordStructures required by the Repository for each
  6. * AssetType. RecordStructures provide structural information. The values for
  7. * a given Asset's RecordStructure are stored in a Record. RecordStructures
  8. * can contain sub-elements which are referred to as PartStructures. The
  9. * structure defined in the RecordStructure and its PartStructures is used in
  10. * for any Records for the Asset. Records have Parts which parallel
  11. * PartStructures.
  12. *
  13. * <p>
  14. * OSID Version: 2.0
  15. * </p>
  16. *
  17. * @package harmoni.osid_v2.repository
  18. *
  19. * @copyright Copyright &copy;2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  21. *
  22. * @version $Id: ThumbnailDataPartStructure.class.php,v 1.9 2007/09/04 20:25:47 adamfranco Exp $
  23. */
  24. class ThumbnailDataPartStructure extends PartStructure
  25. // extends java.io.Serializable
  26.  
  27. {
  28.  
  29. var $_recordStructure;
  30. function ThumbnailDataPartStructure($recordStructure) {
  31. $this->_recordStructure =$recordStructure;
  32. }
  33. /**
  34. * Get the display name for this PartStructure.
  35. *
  36. * @return string
  37. *
  38. * @throws object RepositoryException An exception with one of
  39. * the following messages defined in
  40. * org.osid.repository.RepositoryException may be thrown: {@link }
  41. * org.osid.repository.RepositoryException#OPERATION_FAILED
  42. * OPERATION_FAILED}, {@link }
  43. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  44. * PERMISSION_DENIED}, {@link }
  45. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  46. * CONFIGURATION_ERROR}, {@link }
  47. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  48. * UNIMPLEMENTED}
  49. *
  50. * @access public
  51. */
  52. function getDisplayName() {
  53. return "Thumbnail Data";
  54. }
  55.  
  56. /**
  57. * Get the description for this PartStructure.
  58. *
  59. * @return string
  60. *
  61. * @throws object RepositoryException An exception with one of
  62. * the following messages defined in
  63. * org.osid.repository.RepositoryException may be thrown: {@link }
  64. * org.osid.repository.RepositoryException#OPERATION_FAILED
  65. * OPERATION_FAILED}, {@link }
  66. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  67. * PERMISSION_DENIED}, {@link }
  68. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  69. * CONFIGURATION_ERROR}, {@link }
  70. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  71. * UNIMPLEMENTED}
  72. *
  73. * @access public
  74. */
  75. function getDescription() {
  76. return "The binary data-stream for the thumbnail.";
  77. }
  78. /**
  79. * Get the Type for this PartStructure.
  80. *
  81. * @return object Type
  82. *
  83. * @throws object RepositoryException An exception with one of
  84. * the following messages defined in
  85. * org.osid.repository.RepositoryException may be thrown: {@link }
  86. * org.osid.repository.RepositoryException#OPERATION_FAILED
  87. * OPERATION_FAILED}, {@link }
  88. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  89. * PERMISSION_DENIED}, {@link }
  90. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  91. * CONFIGURATION_ERROR}, {@link }
  92. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  93. * UNIMPLEMENTED}
  94. *
  95. * @access public
  96. */
  97. function getType() {
  98. if (!isset($this->_type)) {
  99. $this->_type = new HarmoniType("Repository", "edu.middlebury.harmoni", "blob");
  100. }
  101. return $this->_type;
  102. }
  103.  
  104. /**
  105. * Get the unique Id for this PartStructure.
  106. *
  107. * @return object Id
  108. *
  109. * @throws object RepositoryException An exception with one of
  110. * the following messages defined in
  111. * org.osid.repository.RepositoryException may be thrown: {@link }
  112. * org.osid.repository.RepositoryException#OPERATION_FAILED
  113. * OPERATION_FAILED}, {@link }
  114. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  115. * PERMISSION_DENIED}, {@link }
  116. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  117. * CONFIGURATION_ERROR}, {@link }
  118. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  119. * UNIMPLEMENTED}
  120. *
  121. * @access public
  122. */
  123. function getId() {
  124. $idManager = Services::getService("Id");
  125. return $idManager->getId("THUMBNAIL_DATA");
  126. }
  127.  
  128. /**
  129. * Get all the PartStructures in the PartStructure. Iterators return a
  130. * set, one at a time.
  131. *
  132. * @return object PartStructureIterator
  133. *
  134. * @throws object RepositoryException An exception with one of
  135. * the following messages defined in
  136. * org.osid.repository.RepositoryException may be thrown: {@link }
  137. * org.osid.repository.RepositoryException#OPERATION_FAILED
  138. * OPERATION_FAILED}, {@link }
  139. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  140. * PERMISSION_DENIED}, {@link }
  141. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  142. * CONFIGURATION_ERROR}, {@link }
  143. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  144. * UNIMPLEMENTED}
  145. *
  146. * @access public
  147. */
  148. function getPartStructures() {
  149. $array = array();
  150. $obj = new HarmoniNodeIterator($array);
  151. return $obj; // @todo replace with HarmoniPartStructureIterator
  152. }
  153.  
  154. /**
  155. * Return true if this PartStructure is automatically populated by the
  156. * Repository; false otherwise. Examples of the kind of PartStructures
  157. * that might be populated are a time-stamp or the Agent setting the data.
  158. *
  159. * @return boolean
  160. *
  161. * @throws object RepositoryException An exception with one of
  162. * the following messages defined in
  163. * org.osid.repository.RepositoryException may be thrown: {@link }
  164. * org.osid.repository.RepositoryException#OPERATION_FAILED
  165. * OPERATION_FAILED}, {@link }
  166. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  167. * PERMISSION_DENIED}, {@link }
  168. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  169. * CONFIGURATION_ERROR}, {@link }
  170. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  171. * UNIMPLEMENTED}
  172. *
  173. * @access public
  174. */
  175. function isPopulatedByRepository() {
  176. return FALSE;
  177. }
  178.  
  179. /**
  180. * Return true if this PartStructure is mandatory; false otherwise.
  181. *
  182. * @return boolean
  183. *
  184. * @throws object RepositoryException An exception with one of
  185. * the following messages defined in
  186. * org.osid.repository.RepositoryException may be thrown: {@link }
  187. * org.osid.repository.RepositoryException#OPERATION_FAILED
  188. * OPERATION_FAILED}, {@link }
  189. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  190. * PERMISSION_DENIED}, {@link }
  191. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  192. * CONFIGURATION_ERROR}, {@link }
  193. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  194. * UNIMPLEMENTED}
  195. *
  196. * @access public
  197. */
  198. function isMandatory() {
  199. return TRUE;
  200. }
  201. /**
  202. * Return true if this PartStructure is repeatable; false otherwise. This
  203. * is determined by the implementation.
  204. *
  205. * @return boolean
  206. *
  207. * @throws object RepositoryException An exception with one of
  208. * the following messages defined in
  209. * org.osid.repository.RepositoryException may be thrown: {@link }
  210. * org.osid.repository.RepositoryException#OPERATION_FAILED
  211. * OPERATION_FAILED}, {@link }
  212. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  213. * PERMISSION_DENIED}, {@link }
  214. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  215. * CONFIGURATION_ERROR}, {@link }
  216. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  217. * UNIMPLEMENTED}
  218. *
  219. * @access public
  220. */
  221. function isRepeatable() {
  222. return FALSE;
  223. }
  224.  
  225. /**
  226. * Get the RecordStructure associated with this PartStructure.
  227. *
  228. * @return object RecordStructure
  229. *
  230. * @throws object RepositoryException An exception with one of
  231. * the following messages defined in
  232. * org.osid.repository.RepositoryException may be thrown: {@link }
  233. * org.osid.repository.RepositoryException#OPERATION_FAILED
  234. * OPERATION_FAILED}, {@link }
  235. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  236. * PERMISSION_DENIED}, {@link }
  237. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  238. * CONFIGURATION_ERROR}, {@link }
  239. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  240. * UNIMPLEMENTED}
  241. *
  242. * @access public
  243. */
  244. function getRecordStructure() {
  245. return $this->_RecordStructure;
  246. }
  247.  
  248. /**
  249. * Validate a Part against its PartStructure. Return true if valid; false
  250. * otherwise. The status of the Asset holding this Record is not changed
  251. * through this method. The implementation may throw an Exception for any
  252. * validation failures and use the Exception's message to identify
  253. * specific causes.
  254. *
  255. * @param object Part $part
  256. *
  257. * @return boolean
  258. *
  259. * @throws object RepositoryException An exception with one of
  260. * the following messages defined in
  261. * org.osid.repository.RepositoryException may be thrown: {@link }
  262. * org.osid.repository.RepositoryException#OPERATION_FAILED
  263. * OPERATION_FAILED}, {@link }
  264. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  265. * PERMISSION_DENIED}, {@link }
  266. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  267. * CONFIGURATION_ERROR}, {@link }
  268. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  269. * UNIMPLEMENTED}, {@link }
  270. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  271. * NULL_ARGUMENT}
  272. *
  273. * @access public
  274. */
  275. function validatePart($part) {
  276. // we can check if the Part (ie, ValueVersions) has values of the right type.
  277. // @todo
  278. return true;
  279. }
  280. /*******************************************************
  281. * Authority Lists:
  282. * The OSID does not have any support for authority lists.
  283. * These methods could have been placed in another system,
  284. * but have been placed here for ease of locating them.
  285. * Also involved with Authority Lists is a SearchType:
  286. * Repository::edu.middlebury.harmoni::AuthorityValue
  287. * which takes a PartStructure Id and a Value to search on.
  288. *********************************************************/
  289.  
  290. /**
  291. * Answer the authoritative values for this part.
  292. *
  293. * WARNING: NOT in OSID
  294. *
  295. * @return object ObjectIterator
  296. * @access public
  297. * @since 4/25/06
  298. */
  299. function getAuthoritativeValues () {
  300. $array = array();
  301. $iterator = new HarmoniIterator($array);
  302. return $iterator;
  303. }
  304. /**
  305. * Answer true if the value pass is authoritative.
  306. *
  307. * WARNING: NOT in OSID
  308. *
  309. * @param object $value
  310. * @return boolean
  311. * @access public
  312. * @since 4/25/06
  313. */
  314. function isAuthoritativeValue ( $value ) {
  315. return false;
  316. }
  317. /**
  318. * Remove an authoritative value.
  319. *
  320. * WARNING: NOT in OSID
  321. *
  322. * @param object $value
  323. * @return void
  324. * @access public
  325. * @since 4/25/06
  326. */
  327. function removeAuthoritativeValue ( $value ) {
  328. }
  329. /**
  330. * Add an authoritative value
  331. *
  332. * WARNING: NOT in OSID
  333. *
  334. * @param object $value
  335. * @return void
  336. * @access public
  337. * @since 4/25/06
  338. */
  339. function addAuthoritativeValue ( $value ) {
  340. $false = false;
  341. return $false;
  342. }
  343. /**
  344. * Add an authoritative value
  345. *
  346. * WARNING: NOT in OSID
  347. *
  348. * @param string $valueString
  349. * @return void
  350. * @access public
  351. * @since 4/25/06
  352. */
  353. function addAuthoritativeValueAsString ( $valueString ) {
  354. }
  355. /**
  356. * Answer the Primative object appropriate for this part, whose value is
  357. * represented by the input string.
  358. *
  359. * @param string $valueString
  360. * @return object
  361. * @access public
  362. * @since 4/27/06
  363. */
  364. function createValueObjectFromString ( $valueString ) {
  365. $false = false;
  366. return $false;
  367. }
  368. }

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