Source for file RepositoryManager.php

Documentation is available at RepositoryManager.php

  1. <?php
  2. include_once(dirname(__FILE__)."/../OsidManager.php");
  3. /**
  4. * <p>
  5. * The RepositoryManager supports creating and deleting Repositories and Assets
  6. * as well as getting the various Types used.
  7. * </p>
  8. *
  9. * <p>
  10. * All implementations of OsidManager (manager) provide methods for accessing
  11. * and manipulating the various objects defined in the OSID package. A manager
  12. * defines an implementation of an OSID. All other OSID objects come either
  13. * directly or indirectly from the manager. New instances of the OSID objects
  14. * are created either directly or indirectly by the manager. Because the OSID
  15. * objects are defined using interfaces, create methods must be used instead
  16. * of the new operator to create instances of the OSID objects. Create methods
  17. * are used both to instantiate and persist OSID objects. Using the
  18. * OsidManager class to define an OSID's implementation allows the application
  19. * to change OSID implementations by changing the OsidManager package name
  20. * used to load an implementation. Applications developed using managers
  21. * permit OSID implementation substitution without changing the application
  22. * source code. As with all managers, use the OsidLoader to load an
  23. * implementation of this interface.
  24. * </p>
  25. *
  26. * <p></p>
  27. *
  28. * <p>
  29. * OSID Version: 2.0
  30. * </p>
  31. *
  32. * <p>
  33. * Licensed under the {@link org.osid.SidImplementationLicenseMIT MIT}
  34. * O.K.I&#46; OSID Definition License}.
  35. * </p>
  36. *
  37. * @package org.osid.repository
  38. */
  39. class RepositoryManager
  40. extends OsidManager
  41. {
  42. /**
  43. * Create a new Repository of the specified Type. The implementation of
  44. * this method sets the Id for the new object.
  45. *
  46. * @param string $displayName
  47. * @param string $description
  48. * @param object Type $repositoryType
  49. *
  50. * @return object Repository
  51. *
  52. * @throws object RepositoryException An exception with one of
  53. * the following messages defined in
  54. * org.osid.repository.RepositoryException may be thrown: {@link }
  55. * org.osid.repository.RepositoryException#OPERATION_FAILED
  56. * OPERATION_FAILED}, {@link }
  57. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  58. * PERMISSION_DENIED}, {@link }
  59. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  60. * CONFIGURATION_ERROR}, {@link }
  61. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  62. * UNIMPLEMENTED}, {@link }
  63. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  64. * NULL_ARGUMENT}, {@link }
  65. * org.osid.repository.RepositoryException#UNKNOWN_TYPE
  66. * UNKNOWN_TYPE}
  67. *
  68. * @access public
  69. */
  70. function createRepository ( $displayName, $description, $repositoryType ) {
  71. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  72. }
  73.  
  74. /**
  75. * Delete a Repository.
  76. *
  77. * @param object Id $repositoryId
  78. *
  79. * @throws object RepositoryException An exception with one of
  80. * the following messages defined in
  81. * org.osid.repository.RepositoryException may be thrown: {@link }
  82. * org.osid.repository.RepositoryException#OPERATION_FAILED
  83. * OPERATION_FAILED}, {@link }
  84. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  85. * PERMISSION_DENIED}, {@link }
  86. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  87. * CONFIGURATION_ERROR}, {@link }
  88. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  89. * UNIMPLEMENTED}, {@link }
  90. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  91. * NULL_ARGUMENT}, {@link }
  92. * org.osid.repository.RepositoryException#UNKNOWN_ID UNKNOWN_ID}
  93. *
  94. * @access public
  95. */
  96. function deleteRepository ( $repositoryId ) {
  97. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  98. }
  99.  
  100. /**
  101. * Get all the Repositories. Iterators return a set, one at a time.
  102. *
  103. * @return object RepositoryIterator
  104. *
  105. * @throws object RepositoryException An exception with one of
  106. * the following messages defined in
  107. * org.osid.repository.RepositoryException may be thrown: {@link }
  108. * org.osid.repository.RepositoryException#OPERATION_FAILED
  109. * OPERATION_FAILED}, {@link }
  110. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  111. * PERMISSION_DENIED}, {@link }
  112. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  113. * CONFIGURATION_ERROR}, {@link }
  114. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  115. * UNIMPLEMENTED}, {@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 getRepositories () {
  124. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  125. }
  126.  
  127. /**
  128. * Get all the Repositories of the specified Type. Iterators return a set,
  129. * one at a time.
  130. *
  131. * @param object Type $repositoryType
  132. *
  133. * @return object RepositoryIterator
  134. *
  135. * @throws object RepositoryException An exception with one of
  136. * the following messages defined in
  137. * org.osid.repository.RepositoryException may be thrown: {@link }
  138. * org.osid.repository.RepositoryException#OPERATION_FAILED
  139. * OPERATION_FAILED}, {@link }
  140. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  141. * PERMISSION_DENIED}, {@link }
  142. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  143. * CONFIGURATION_ERROR}, {@link }
  144. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  145. * UNIMPLEMENTED}, {@link }
  146. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  147. * NULL_ARGUMENT}, {@link }
  148. * org.osid.repository.RepositoryException#UNKNOWN_TYPE
  149. * UNKNOWN_TYPE}
  150. *
  151. * @access public
  152. */
  153. function getRepositoriesByType ( $repositoryType ) {
  154. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  155. }
  156.  
  157. /**
  158. * Get the Repository with the specified unique Id.
  159. *
  160. * @param object Id $repositoryId
  161. *
  162. * @return object Repository
  163. *
  164. * @throws object RepositoryException An exception with one of
  165. * the following messages defined in
  166. * org.osid.repository.RepositoryException may be thrown: {@link }
  167. * org.osid.repository.RepositoryException#OPERATION_FAILED
  168. * OPERATION_FAILED}, {@link }
  169. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  170. * PERMISSION_DENIED}, {@link }
  171. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  172. * CONFIGURATION_ERROR}, {@link }
  173. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  174. * UNIMPLEMENTED}, {@link }
  175. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  176. * NULL_ARGUMENT}, {@link }
  177. * org.osid.repository.RepositoryException#UNKNOWN_ID UNKNOWN_ID}
  178. *
  179. * @access public
  180. */
  181. function getRepository ( $repositoryId ) {
  182. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  183. }
  184.  
  185. /**
  186. * Get the Asset with the specified unique Id.
  187. *
  188. * @param object Id $assetId
  189. *
  190. * @return object Asset
  191. *
  192. * @throws object RepositoryException An exception with one of
  193. * the following messages defined in
  194. * org.osid.repository.RepositoryException may be thrown: {@link }
  195. * org.osid.repository.RepositoryException#OPERATION_FAILED
  196. * OPERATION_FAILED}, {@link }
  197. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  198. * PERMISSION_DENIED}, {@link }
  199. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  200. * CONFIGURATION_ERROR}, {@link }
  201. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  202. * UNIMPLEMENTED}, {@link }
  203. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  204. * NULL_ARGUMENT}, {@link }
  205. * org.osid.repository.RepositoryException#UNKNOWN_ID UNKNOWN_ID}
  206. *
  207. * @access public
  208. */
  209. function getAsset ( $assetId ) {
  210. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  211. }
  212.  
  213. /**
  214. * Get the Asset with the specified unique Id that is appropriate for the
  215. * date specified. The specified date allows a Repository implementation
  216. * to support Asset versioning.
  217. *
  218. * @param object Id $assetId
  219. * @param int $date
  220. *
  221. * @return object Asset
  222. *
  223. * @throws object RepositoryException An exception with one of
  224. * the following messages defined in
  225. * org.osid.repository.RepositoryException may be thrown: {@link }
  226. * org.osid.repository.RepositoryException#OPERATION_FAILED
  227. * OPERATION_FAILED}, {@link }
  228. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  229. * PERMISSION_DENIED}, {@link }
  230. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  231. * CONFIGURATION_ERROR}, {@link }
  232. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  233. * UNIMPLEMENTED}, {@link }
  234. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  235. * NULL_ARGUMENT}, {@link }
  236. * org.osid.repository.RepositoryException#NO_OBJECT_WITH_THIS_DATE
  237. * NO_OBJECT_WITH_THIS_DATE}
  238. *
  239. * @access public
  240. */
  241. function getAssetByDate ( $assetId, $date ) {
  242. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  243. }
  244.  
  245. /**
  246. * Get all the dates for the Asset with the specified unique Id. These
  247. * dates allows a Repository implementation to support Asset versioning.
  248. *
  249. * @param object Id $assetId
  250. *
  251. * @return object LongValueIterator
  252. *
  253. * @throws object RepositoryException An exception with one of
  254. * the following messages defined in
  255. * org.osid.repository.RepositoryException may be thrown: {@link }
  256. * org.osid.repository.RepositoryException#OPERATION_FAILED
  257. * OPERATION_FAILED}, {@link }
  258. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  259. * PERMISSION_DENIED}, {@link }
  260. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  261. * CONFIGURATION_ERROR}, {@link }
  262. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  263. * UNIMPLEMENTED}, {@link }
  264. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  265. * NULL_ARGUMENT}
  266. *
  267. * @access public
  268. */
  269. function getAssetDates ( $assetId ) {
  270. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  271. }
  272.  
  273. /**
  274. * Perform a search of the specified Type and get all the Assets that
  275. * satisfy the SearchCriteria. The search is performed for all specified
  276. * Repositories. Iterators return a set, one at a time.
  277. *
  278. * @param object Repository[] $repositories
  279. * @param object mixed $searchCriteria (original type: java.io.Serializable)
  280. * @param object Type $searchType
  281. * @param object Properties $searchProperties
  282. *
  283. * @return object AssetIterator
  284. *
  285. * @throws object RepositoryException An exception with one of
  286. * the following messages defined in
  287. * org.osid.repository.RepositoryException may be thrown: {@link }
  288. * org.osid.repository.RepositoryException#OPERATION_FAILED
  289. * OPERATION_FAILED}, {@link }
  290. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  291. * PERMISSION_DENIED}, {@link }
  292. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  293. * CONFIGURATION_ERROR}, {@link }
  294. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  295. * UNIMPLEMENTED}, {@link }
  296. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  297. * NULL_ARGUMENT}, {@link }
  298. * org.osid.repository.RepositoryException#UNKNOWN_TYPE
  299. * UNKNOWN_TYPE}, {@link }
  300. * org.osid.repository.RepositoryException#UNKNOWN_REPOSITORY
  301. * UNKNOWN_REPOSITORY}
  302. *
  303. * @access public
  304. */
  305. function getAssetsBySearch ( $repositories, $searchCriteria, $searchType, $searchProperties ) {
  306. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  307. }
  308.  
  309. /**
  310. * Create in a Repository a copy of an Asset. The Id, AssetType, and
  311. * Repository for the new Asset is set by the implementation. All Records
  312. * are similarly copied.
  313. *
  314. * @param object Repository $repository
  315. * @param object Id $assetId
  316. *
  317. * @return object Id
  318. *
  319. * @throws object RepositoryException An exception with one of
  320. * the following messages defined in
  321. * org.osid.repository.RepositoryException may be thrown: {@link }
  322. * org.osid.repository.RepositoryException#OPERATION_FAILED
  323. * OPERATION_FAILED}, {@link }
  324. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  325. * PERMISSION_DENIED}, {@link }
  326. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  327. * CONFIGURATION_ERROR}, {@link }
  328. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  329. * UNIMPLEMENTED}, {@link }
  330. * org.osid.repository.RepositoryException#NULL_ARGUMENT
  331. * NULL_ARGUMENT}, {@link }
  332. * org.osid.repository.RepositoryException#UNKNOWN_ID UNKNOWN_ID}
  333. *
  334. * @access public
  335. */
  336. function copyAsset ( $repository, $assetId ) {
  337. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  338. }
  339.  
  340. /**
  341. * Get all the RepositoryTypes in this RepositoryManager. RepositoryTypes
  342. * are used to categorize Repositories. Iterators return a set, one at a
  343. * time.
  344. *
  345. * @return object TypeIterator
  346. *
  347. * @throws object RepositoryException An exception with one of
  348. * the following messages defined in
  349. * org.osid.repository.RepositoryException may be thrown: {@link }
  350. * org.osid.repository.RepositoryException#OPERATION_FAILED
  351. * OPERATION_FAILED}, {@link }
  352. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  353. * PERMISSION_DENIED}, {@link }
  354. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  355. * CONFIGURATION_ERROR}, {@link }
  356. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  357. * UNIMPLEMENTED}
  358. *
  359. * @access public
  360. */
  361. function getRepositoryTypes () {
  362. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  363. }
  364. }
  365.  
  366. ?>

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