Source for file Node.php

Documentation is available at Node.php

  1. <?php
  2. /**
  3. * Node is a Hierarchy's representation of an external object that is one of a
  4. * number of similar objects to be organized. Nodes must be connected to a
  5. * Hierarchy.
  6. *
  7. * <p>
  8. * OSID Version: 2.0
  9. * </p>
  10. *
  11. * <p>
  12. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  13. * O.K.I&#46; OSID Definition License}.
  14. * </p>
  15. *
  16. * @package org.osid.hierarchy
  17. */
  18. class Node
  19. {
  20. /**
  21. * Get the unique Id for this Node.
  22. *
  23. * @return object Id
  24. *
  25. * @throws object HierarchyException An exception with one of
  26. * the following messages defined in
  27. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  28. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  29. * OPERATION_FAILED}, {@link }
  30. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  31. * PERMISSION_DENIED}, {@link }
  32. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  33. * CONFIGURATION_ERROR}, {@link }
  34. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  35. * UNIMPLEMENTED}
  36. *
  37. * @access public
  38. */
  39. function getId () {
  40. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  41. }
  42.  
  43. /**
  44. * Get the display name for this Node.
  45. *
  46. * @return string
  47. *
  48. * @throws object HierarchyException An exception with one of
  49. * the following messages defined in
  50. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  51. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  52. * OPERATION_FAILED}, {@link }
  53. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  54. * PERMISSION_DENIED}, {@link }
  55. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  56. * CONFIGURATION_ERROR}, {@link }
  57. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  58. * UNIMPLEMENTED}
  59. *
  60. * @access public
  61. */
  62. function getDisplayName () {
  63. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  64. }
  65.  
  66. /**
  67. * Get the description for this Node.
  68. *
  69. * @return string
  70. *
  71. * @throws object HierarchyException An exception with one of
  72. * the following messages defined in
  73. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  74. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  75. * OPERATION_FAILED}, {@link }
  76. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  77. * PERMISSION_DENIED}, {@link }
  78. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  79. * CONFIGURATION_ERROR}, {@link }
  80. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  81. * UNIMPLEMENTED}
  82. *
  83. * @access public
  84. */
  85. function getDescription () {
  86. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  87. }
  88.  
  89. /**
  90. * Get the parents of this Node. To get other ancestors use the Hierarchy
  91. * traverse method.
  92. *
  93. * @return object NodeIterator
  94. *
  95. * @throws object HierarchyException An exception with one of
  96. * the following messages defined in
  97. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  98. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  99. * OPERATION_FAILED}, {@link }
  100. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  101. * PERMISSION_DENIED}, {@link }
  102. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  103. * CONFIGURATION_ERROR}, {@link }
  104. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  105. * UNIMPLEMENTED}
  106. *
  107. * @access public
  108. */
  109. function getParents () {
  110. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  111. }
  112.  
  113. /**
  114. * Get the children of this Node. To get other descendants use the
  115. * Hierarchy traverse method.
  116. *
  117. * @return object NodeIterator
  118. *
  119. * @throws object HierarchyException An exception with one of
  120. * the following messages defined in
  121. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  122. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  123. * OPERATION_FAILED}, {@link }
  124. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  125. * PERMISSION_DENIED}, {@link }
  126. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  127. * CONFIGURATION_ERROR}, {@link }
  128. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  129. * UNIMPLEMENTED}
  130. *
  131. * @access public
  132. */
  133. function getChildren () {
  134. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  135. }
  136.  
  137. /**
  138. * Get the Type for this Node.
  139. *
  140. * @return object Type
  141. *
  142. * @throws object HierarchyException An exception with one of
  143. * the following messages defined in
  144. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  145. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  146. * OPERATION_FAILED}, {@link }
  147. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  148. * PERMISSION_DENIED}, {@link }
  149. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  150. * CONFIGURATION_ERROR}, {@link }
  151. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  152. * UNIMPLEMENTED}
  153. *
  154. * @access public
  155. */
  156. function getType () {
  157. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  158. }
  159.  
  160. /**
  161. * Update the description of this Node.
  162. *
  163. * @param string $description
  164. *
  165. * @throws object HierarchyException An exception with one of
  166. * the following messages defined in
  167. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  168. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  169. * OPERATION_FAILED}, {@link }
  170. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  171. * PERMISSION_DENIED}, {@link }
  172. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  173. * CONFIGURATION_ERROR}, {@link }
  174. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  175. * UNIMPLEMENTED}, {@link }
  176. * org.osid.hierarchy.HierarchyException#NULL_ARGUMENT
  177. * NULL_ARGUMENT}
  178. *
  179. * @access public
  180. */
  181. function updateDescription ( $description ) {
  182. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  183. }
  184.  
  185. /**
  186. * Update the name of this Node. Node name changes are permitted since the
  187. * Hierarchy's integrity is based on the Node's unique Id.
  188. *
  189. * @param string $displayName
  190. *
  191. * @throws object HierarchyException An exception with one of
  192. * the following messages defined in
  193. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  194. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  195. * OPERATION_FAILED}, {@link }
  196. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  197. * PERMISSION_DENIED}, {@link }
  198. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  199. * CONFIGURATION_ERROR}, {@link }
  200. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  201. * UNIMPLEMENTED}, {@link }
  202. * org.osid.hierarchy.HierarchyException#NULL_ARGUMENT
  203. * NULL_ARGUMENT}
  204. *
  205. * @access public
  206. */
  207. function updateDisplayName ( $displayName ) {
  208. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  209. }
  210.  
  211. /**
  212. * Return true if this Node is a leaf; false otherwise. A Node is a leaf
  213. * if it has no children.
  214. *
  215. * @return boolean
  216. *
  217. * @throws object HierarchyException An exception with one of
  218. * the following messages defined in
  219. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  220. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  221. * OPERATION_FAILED}, {@link }
  222. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  223. * PERMISSION_DENIED}, {@link }
  224. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  225. * CONFIGURATION_ERROR}, {@link }
  226. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  227. * UNIMPLEMENTED}
  228. *
  229. * @access public
  230. */
  231. function isLeaf () {
  232. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  233. }
  234.  
  235. /**
  236. * Return true if this Node is a root; false otherwise.
  237. *
  238. * @return boolean
  239. *
  240. * @throws object HierarchyException An exception with one of
  241. * the following messages defined in
  242. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  243. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  244. * OPERATION_FAILED}, {@link }
  245. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  246. * PERMISSION_DENIED}, {@link }
  247. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  248. * CONFIGURATION_ERROR}, {@link }
  249. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  250. * UNIMPLEMENTED}
  251. *
  252. * @access public
  253. */
  254. function isRoot () {
  255. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  256. }
  257.  
  258. /**
  259. * Link a parent to this Node.
  260. *
  261. * @param object Id $nodeId
  262. *
  263. * @throws object HierarchyException An exception with one of
  264. * the following messages defined in
  265. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  266. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  267. * OPERATION_FAILED}, {@link }
  268. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  269. * PERMISSION_DENIED}, {@link }
  270. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  271. * CONFIGURATION_ERROR}, {@link }
  272. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  273. * UNIMPLEMENTED}, {@link }
  274. * org.osid.hierarchy.HierarchyException#NULL_ARGUMENT
  275. * NULL_ARGUMENT}, {@link }
  276. * org.osid.hierarchy.HierarchyException#NODE_TYPE_NOT_FOUND
  277. * NODE_TYPE_NOT_FOUND}, {@link }
  278. * org.osid.hierarchy.HierarchyException#SINGLE_PARENT_HIERARCHY
  279. * SINGLE_PARENT_HIERARCHY}, {@link }
  280. * org.osid.hierarchy.HierarchyException#ALREADY_ADDED
  281. * ALREADY_ADDED}, {@link }
  282. * org.osid.hierarchy.HierarchyException#ATTEMPTED_RECURSION
  283. * ATTEMPTED_RECURSION}
  284. *
  285. * @access public
  286. */
  287. function addParent ( $nodeId ) {
  288. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  289. }
  290.  
  291. /**
  292. * Unlink a parent from this Node.
  293. *
  294. * @param object Id $parentId
  295. *
  296. * @throws object HierarchyException An exception with one of
  297. * the following messages defined in
  298. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  299. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  300. * OPERATION_FAILED}, {@link }
  301. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  302. * PERMISSION_DENIED}, {@link }
  303. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  304. * CONFIGURATION_ERROR}, {@link }
  305. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  306. * UNIMPLEMENTED}, {@link }
  307. * org.osid.hierarchy.HierarchyException#NULL_ARGUMENT
  308. * NULL_ARGUMENT}, {@link }
  309. * org.osid.hierarchy.HierarchyException#NODE_TYPE_NOT_FOUND
  310. * NODE_TYPE_NOT_FOUND}, {@link }
  311. * org.osid.hierarchy.HierarchyException#SINGLE_PARENT_HIERARCHY
  312. * SINGLE_PARENT_HIERARCHY}, {@link }
  313. * org.osid.hierarchy.HierarchyException#INCONSISTENT_STATE
  314. * INCONSISTENT_STATE}
  315. *
  316. * @access public
  317. */
  318. function removeParent ( $parentId ) {
  319. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  320. }
  321.  
  322. /**
  323. * Changes the parent of this Node by adding a new parent and removing the
  324. * old parent.
  325. *
  326. * @param object Id $oldParentId
  327. * @param object Id $newParentId
  328. *
  329. * @throws object HierarchyException An exception with one of
  330. * the following messages defined in
  331. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  332. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  333. * OPERATION_FAILED}, {@link }
  334. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  335. * PERMISSION_DENIED}, {@link }
  336. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  337. * CONFIGURATION_ERROR}, {@link }
  338. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  339. * UNIMPLEMENTED}, {@link }
  340. * org.osid.hierarchy.HierarchyException#NULL_ARGUMENT
  341. * NULL_ARGUMENT}, {@link }
  342. * org.osid.hierarchy.HierarchyException#NODE_TYPE_NOT_FOUND
  343. * NODE_TYPE_NOT_FOUND}, {@link }
  344. * org.osid.hierarchy.HierarchyException#ATTEMPTED_RECURSION
  345. * ATTEMPTED_RECURSION}
  346. *
  347. * @access public
  348. */
  349. function changeParent ( $oldParentId, $newParentId ) {
  350. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  351. }
  352. }
  353.  
  354. ?>

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