soap_report.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Configures the WSReport SOAP service
  5. * @package chamilo.webservices
  6. */
  7. require_once __DIR__.'/webservice_report.php';
  8. require_once __DIR__.'/soap.php';
  9. $s = WSSoapServer::singleton();
  10. $s->wsdl->addComplexType(
  11. 'user_id',
  12. 'complexType',
  13. 'struct',
  14. 'all',
  15. '',
  16. array(
  17. 'user_id_field_name' => array(
  18. 'name' => 'user_id_field_name',
  19. 'type' => 'xsd:string',
  20. ),
  21. 'user_id_value' => array(
  22. 'name' => 'user_id_value',
  23. 'type' => 'xsd:string',
  24. ),
  25. )
  26. );
  27. $s->wsdl->addComplexType(
  28. 'course_id',
  29. 'complexType',
  30. 'struct',
  31. 'all',
  32. '',
  33. array(
  34. 'course_id_field_name' => array(
  35. 'name' => 'course_id_field_name',
  36. 'type' => 'xsd:string',
  37. ),
  38. 'course_id_value' => array(
  39. 'name' => 'course_id_value',
  40. 'type' => 'xsd:string',
  41. ),
  42. )
  43. );
  44. $s->wsdl->addComplexType(
  45. 'session_id',
  46. 'complexType',
  47. 'struct',
  48. 'all',
  49. '',
  50. array(
  51. 'session_id_field_name' => array(
  52. 'name' => 'session_id_field_name',
  53. 'type' => 'xsd:string',
  54. ),
  55. 'session_id_value' => array(
  56. 'name' => 'session_id_value',
  57. 'type' => 'xsd:string',
  58. ),
  59. )
  60. );
  61. /*
  62. $s->wsdl->addComplexType(
  63. 'user_result',
  64. 'complexType',
  65. 'struct',
  66. 'all',
  67. '',
  68. array(
  69. 'user_id_value' => array('name' => 'user_id_value', 'type' => 'xsd:string'),
  70. 'result' => array('name' => 'result', 'type' => 'tns:result')
  71. )
  72. );*/
  73. $s->wsdl->addComplexType(
  74. 'user_result',
  75. 'complexType',
  76. 'struct',
  77. 'all',
  78. '',
  79. array(
  80. 'id' => array('name' => 'id', 'type' => 'xsd:string'),
  81. 'title' => array('name' => 'title', 'type' => 'xsd:string'),
  82. )
  83. );
  84. $s->wsdl->addComplexType(
  85. 'progress_result',
  86. 'complexType',
  87. 'struct',
  88. 'all',
  89. '',
  90. array(
  91. 'progress_bar_mode' => array(
  92. 'name' => 'progress_bar_mode',
  93. 'type' => 'xsd:string',
  94. ),
  95. 'progress_db' => array('name' => 'progress_db', 'type' => 'xsd:string'),
  96. )
  97. );
  98. $s->wsdl->addComplexType(
  99. 'score_result',
  100. 'complexType',
  101. 'struct',
  102. 'all',
  103. '',
  104. array(
  105. 'min_score' => array('name' => 'min_score', 'type' => 'xsd:string'),
  106. 'max_score' => array('name' => 'max_score', 'type' => 'xsd:string'),
  107. 'mastery_score' => array(
  108. 'name' => 'mastery_score',
  109. 'type' => 'xsd:string',
  110. ),
  111. 'current_score' => array(
  112. 'name' => 'current_score',
  113. 'type' => 'xsd:string',
  114. ),
  115. )
  116. );
  117. $s->wsdl->addComplexType(
  118. 'user_result_array',
  119. 'complexType',
  120. 'array',
  121. '',
  122. 'SOAP-ENC:Array',
  123. array(),
  124. array(
  125. array(
  126. 'ref' => 'SOAP-ENC:arrayType',
  127. 'wsdl:arrayType' => 'tns:user_result[]',
  128. ),
  129. ),
  130. 'tns:user_result'
  131. );
  132. $s->register(
  133. 'WSReport.GetTimeSpentOnPlatform',
  134. array(
  135. 'secret_key' => 'xsd:string',
  136. 'user_id_field_name' => 'xsd:string',
  137. 'user_id_value' => 'xsd:string',
  138. ),
  139. array('return' => 'xsd:string')
  140. );
  141. $s->register(
  142. 'WSReport.GetTimeSpentOnCourse',
  143. array(
  144. 'secret_key' => 'xsd:string',
  145. 'user_id_field_name' => 'xsd:string',
  146. 'user_id_value' => 'xsd:string',
  147. 'course_id_field_name' => 'xsd:string',
  148. 'course_id_value' => 'xsd:string',
  149. ),
  150. array('return' => 'xsd:string')
  151. );
  152. $s->register(
  153. 'WSReport.GetTimeSpentOnCourseInSession',
  154. array(
  155. 'secret_key' => 'xsd:string',
  156. 'user_id_field_name' => 'xsd:string',
  157. 'user_id_value' => 'xsd:string',
  158. 'course_id_field_name' => 'xsd:string',
  159. 'course_id_value' => 'xsd:string',
  160. 'session_id_field_name' => 'xsd:string',
  161. 'session_id_value' => 'xsd:string',
  162. ),
  163. array('return' => 'xsd:string')
  164. );
  165. $s->register(
  166. 'WSReport.GetTimeSpentOnLearnpathInCourse',
  167. array(
  168. 'secret_key' => 'xsd:string',
  169. 'user_id_field_name' => 'xsd:string',
  170. 'user_id_value' => 'xsd:string',
  171. 'course_id_field_name' => 'xsd:string',
  172. 'course_id_value' => 'xsd:string',
  173. 'learnpath_id' => 'xsd:string',
  174. ),
  175. array('return' => 'xsd:string')
  176. );
  177. $s->register(
  178. 'WSReport.GetLearnpathsByCourse',
  179. array(
  180. 'secret_key' => 'xsd:string',
  181. 'user_id_field_name' => 'xsd:string',
  182. 'user_id_value' => 'xsd:string',
  183. 'course_id_field_name' => 'xsd:string',
  184. 'course_id_value' => 'xsd:string',
  185. ),
  186. array('return' => 'tns:user_result_array')
  187. );
  188. $s->register(
  189. 'WSReport.GetLearnpathProgress',
  190. array(
  191. 'secret_key' => 'xsd:string',
  192. 'user_id_field_name' => 'xsd:string',
  193. 'user_id_value' => 'xsd:string',
  194. 'course_id_field_name' => 'xsd:string',
  195. 'course_id_value' => 'xsd:string',
  196. 'learnpath_id' => 'xsd:string',
  197. ),
  198. array('return' => 'tns:progress_result')
  199. );
  200. $s->register(
  201. 'WSReport.GetLearnpathHighestLessonLocation',
  202. array(
  203. 'secret_key' => 'xsd:string',
  204. 'user_id_field_name' => 'xsd:string',
  205. 'user_id_value' => 'xsd:string',
  206. 'course_id_field_name' => 'xsd:string',
  207. 'course_id_value' => 'xsd:string',
  208. 'learnpath_id' => 'xsd:string',
  209. ),
  210. array('return' => 'xsd:string')
  211. );
  212. $s->register(
  213. 'WSReport.GetLearnpathScoreSingleItem',
  214. array(
  215. 'secret_key' => 'xsd:string',
  216. 'user_id_field_name' => 'xsd:string',
  217. 'user_id_value' => 'xsd:string',
  218. 'course_id_field_name' => 'xsd:string',
  219. 'course_id_value' => 'xsd:string',
  220. 'learnpath_id' => 'xsd:string',
  221. 'learnpath_item_id' => 'xsd:string',
  222. ),
  223. array('return' => 'tns:score_result')
  224. );
  225. $s->register(
  226. 'WSReport.GetLearnpathStatusSingleItem',
  227. array(
  228. 'secret_key' => 'xsd:string',
  229. 'user_id_field_name' => 'xsd:string',
  230. 'user_id_value' => 'xsd:string',
  231. 'course_id_field_name' => 'xsd:string',
  232. 'course_id_value' => 'xsd:string',
  233. 'learnpath_id' => 'xsd:string',
  234. 'learnpath_item_id' => 'xsd:string',
  235. ),
  236. array('return' => 'xsd:string')
  237. );
  238. $s->register(
  239. 'WSReport.test',
  240. array(),
  241. array('return' => 'xsd:string')
  242. );