typo 5.2.98 → 5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (302) hide show
  1. data/app/controllers/admin/sidebar_controller.rb +15 -3
  2. data/app/helpers/sidebar_helper.rb +9 -4
  3. data/app/models/feedback.rb +10 -2
  4. data/app/models/page_cache.rb +5 -1
  5. data/app/views/admin/blacklist/_blacklist_patterns.html.erb +2 -0
  6. data/app/views/admin/categories/new.html.erb +1 -1
  7. data/app/views/admin/content/_form.html.erb +3 -3
  8. data/app/views/admin/content/_simple_editor.html.erb +2 -0
  9. data/app/views/admin/content/_visual_editor.html.erb +2 -0
  10. data/app/views/admin/pages/_form.html.erb +5 -5
  11. data/app/views/admin/pages/_simple_editor.html.erb +2 -0
  12. data/app/views/admin/pages/_visual_editor.html.erb +2 -0
  13. data/app/views/articles/_comment_box.html.erb +1 -1
  14. data/app/views/articles/_comment_failed.html.erb +1 -1
  15. data/app/views/articles/read.html.erb +1 -1
  16. data/config/environment.rb +3 -2
  17. data/lib/tasks/release.rake +3 -4
  18. data/lib/typo_version.rb +1 -1
  19. data/public/stylesheets/administration.css +37 -2
  20. data/public/stylesheets/administration_rtl.css +316 -437
  21. data/vendor/actionwebservice/CHANGELOG +320 -0
  22. data/vendor/actionwebservice/MIT-LICENSE +21 -0
  23. data/vendor/actionwebservice/README +381 -0
  24. data/vendor/actionwebservice/Rakefile +173 -0
  25. data/vendor/actionwebservice/TODO +32 -0
  26. data/vendor/actionwebservice/examples/googlesearch/README +143 -0
  27. data/vendor/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb +50 -0
  28. data/vendor/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb +57 -0
  29. data/vendor/actionwebservice/examples/googlesearch/delegated/google_search_service.rb +108 -0
  30. data/vendor/actionwebservice/examples/googlesearch/delegated/search_controller.rb +7 -0
  31. data/vendor/actionwebservice/examples/googlesearch/direct/google_search_api.rb +50 -0
  32. data/vendor/actionwebservice/examples/googlesearch/direct/search_controller.rb +58 -0
  33. data/vendor/actionwebservice/examples/metaWeblog/README +17 -0
  34. data/vendor/actionwebservice/examples/metaWeblog/apis/blogger_api.rb +60 -0
  35. data/vendor/actionwebservice/examples/metaWeblog/apis/blogger_service.rb +34 -0
  36. data/vendor/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb +67 -0
  37. data/vendor/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb +48 -0
  38. data/vendor/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb +16 -0
  39. data/vendor/actionwebservice/generators/web_service/USAGE +28 -0
  40. data/vendor/actionwebservice/generators/web_service/templates/api_definition.rb +5 -0
  41. data/vendor/actionwebservice/generators/web_service/templates/controller.rb +8 -0
  42. data/vendor/actionwebservice/generators/web_service/templates/functional_test.rb +19 -0
  43. data/vendor/actionwebservice/generators/web_service/web_service_generator.rb +29 -0
  44. data/vendor/actionwebservice/lib/action_web_service.rb +66 -0
  45. data/vendor/actionwebservice/lib/action_web_service/api.rb +297 -0
  46. data/vendor/actionwebservice/lib/action_web_service/base.rb +38 -0
  47. data/vendor/actionwebservice/lib/action_web_service/casting.rb +144 -0
  48. data/vendor/actionwebservice/lib/action_web_service/client.rb +3 -0
  49. data/vendor/actionwebservice/lib/action_web_service/client/base.rb +28 -0
  50. data/vendor/actionwebservice/lib/action_web_service/client/soap_client.rb +113 -0
  51. data/vendor/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +58 -0
  52. data/vendor/actionwebservice/lib/action_web_service/container.rb +3 -0
  53. data/vendor/actionwebservice/lib/action_web_service/container/action_controller_container.rb +93 -0
  54. data/vendor/actionwebservice/lib/action_web_service/container/delegated_container.rb +86 -0
  55. data/vendor/actionwebservice/lib/action_web_service/container/direct_container.rb +69 -0
  56. data/vendor/actionwebservice/lib/action_web_service/dispatcher.rb +2 -0
  57. data/vendor/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +207 -0
  58. data/vendor/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +379 -0
  59. data/vendor/actionwebservice/lib/action_web_service/invocation.rb +202 -0
  60. data/vendor/actionwebservice/lib/action_web_service/protocol.rb +4 -0
  61. data/vendor/actionwebservice/lib/action_web_service/protocol/abstract.rb +112 -0
  62. data/vendor/actionwebservice/lib/action_web_service/protocol/discovery.rb +37 -0
  63. data/vendor/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +176 -0
  64. data/vendor/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +242 -0
  65. data/vendor/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +122 -0
  66. data/vendor/actionwebservice/lib/action_web_service/scaffolding.rb +281 -0
  67. data/vendor/actionwebservice/lib/action_web_service/struct.rb +64 -0
  68. data/vendor/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb +26 -0
  69. data/vendor/actionwebservice/lib/action_web_service/support/signature_types.rb +226 -0
  70. data/vendor/actionwebservice/lib/action_web_service/templates/scaffolds/layout.html.erb +65 -0
  71. data/vendor/actionwebservice/lib/action_web_service/templates/scaffolds/methods.html.erb +6 -0
  72. data/vendor/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.html.erb +29 -0
  73. data/vendor/actionwebservice/lib/action_web_service/templates/scaffolds/result.html.erb +30 -0
  74. data/vendor/actionwebservice/lib/action_web_service/test_invoke.rb +110 -0
  75. data/vendor/actionwebservice/lib/action_web_service/version.rb +9 -0
  76. data/vendor/actionwebservice/lib/actionwebservice.rb +1 -0
  77. data/vendor/actionwebservice/setup.rb +1379 -0
  78. data/vendor/actionwebservice/test/abstract_client.rb +183 -0
  79. data/vendor/actionwebservice/test/abstract_dispatcher.rb +547 -0
  80. data/vendor/actionwebservice/test/abstract_unit.rb +33 -0
  81. data/vendor/actionwebservice/test/api_test.rb +102 -0
  82. data/vendor/actionwebservice/test/apis/auto_load_api.rb +3 -0
  83. data/vendor/actionwebservice/test/apis/broken_auto_load_api.rb +2 -0
  84. data/vendor/actionwebservice/test/base_test.rb +42 -0
  85. data/vendor/actionwebservice/test/casting_test.rb +86 -0
  86. data/vendor/actionwebservice/test/client_soap_test.rb +155 -0
  87. data/vendor/actionwebservice/test/client_xmlrpc_test.rb +153 -0
  88. data/vendor/actionwebservice/test/container_test.rb +73 -0
  89. data/vendor/actionwebservice/test/dispatcher_action_controller_soap_test.rb +137 -0
  90. data/vendor/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb +59 -0
  91. data/vendor/actionwebservice/test/fixtures/db_definitions/mysql.sql +8 -0
  92. data/vendor/actionwebservice/test/fixtures/users.yml +12 -0
  93. data/vendor/actionwebservice/test/gencov +3 -0
  94. data/vendor/actionwebservice/test/invocation_test.rb +185 -0
  95. data/vendor/actionwebservice/test/run +6 -0
  96. data/vendor/actionwebservice/test/scaffolded_controller_test.rb +146 -0
  97. data/vendor/actionwebservice/test/struct_test.rb +52 -0
  98. data/vendor/actionwebservice/test/test_invoke_test.rb +112 -0
  99. data/vendor/gems/calendar_date_select-1.15/.specification +56 -0
  100. data/vendor/gems/calendar_date_select-1.15/History.txt +237 -0
  101. data/vendor/gems/calendar_date_select-1.15/MIT-LICENSE +20 -0
  102. data/vendor/gems/calendar_date_select-1.15/Manifest.txt +42 -0
  103. data/vendor/gems/calendar_date_select-1.15/Rakefile +31 -0
  104. data/vendor/gems/calendar_date_select-1.15/Readme.txt +16 -0
  105. data/vendor/gems/calendar_date_select-1.15/init.rb +1 -0
  106. data/vendor/gems/calendar_date_select-1.15/js_test/functional/cds_test.html +334 -0
  107. data/vendor/gems/calendar_date_select-1.15/js_test/prototype.js +4184 -0
  108. data/vendor/gems/calendar_date_select-1.15/js_test/test.css +40 -0
  109. data/vendor/gems/calendar_date_select-1.15/js_test/unit/cds_helper_methods.html +46 -0
  110. data/vendor/gems/calendar_date_select-1.15/js_test/unittest.js +564 -0
  111. data/vendor/gems/calendar_date_select-1.15/lib/calendar_date_select.rb +33 -0
  112. data/vendor/gems/calendar_date_select-1.15/lib/calendar_date_select/calendar_date_select.rb +116 -0
  113. data/vendor/gems/calendar_date_select-1.15/lib/calendar_date_select/form_helpers.rb +225 -0
  114. data/vendor/gems/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb +29 -0
  115. data/vendor/gems/calendar_date_select-1.15/public/blank_iframe.html +2 -0
  116. data/vendor/gems/calendar_date_select-1.15/public/images/calendar_date_select/calendar.gif +0 -0
  117. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/calendar_date_select.js +443 -0
  118. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_american.js +34 -0
  119. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_db.js +27 -0
  120. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_euro_24hr.js +7 -0
  121. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js +7 -0
  122. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_finnish.js +32 -0
  123. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_hyphen_ampm.js +37 -0
  124. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_iso_date.js +46 -0
  125. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/format_italian.js +24 -0
  126. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/de.js +11 -0
  127. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/fi.js +10 -0
  128. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/fr.js +10 -0
  129. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/pl.js +10 -0
  130. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/pt.js +11 -0
  131. data/vendor/gems/calendar_date_select-1.15/public/javascripts/calendar_date_select/locale/ru.js +10 -0
  132. data/vendor/gems/calendar_date_select-1.15/public/stylesheets/calendar_date_select/blue.css +130 -0
  133. data/vendor/gems/calendar_date_select-1.15/public/stylesheets/calendar_date_select/default.css +135 -0
  134. data/vendor/gems/calendar_date_select-1.15/public/stylesheets/calendar_date_select/plain.css +128 -0
  135. data/vendor/gems/calendar_date_select-1.15/public/stylesheets/calendar_date_select/red.css +135 -0
  136. data/vendor/gems/calendar_date_select-1.15/public/stylesheets/calendar_date_select/silver.css +133 -0
  137. data/vendor/gems/calendar_date_select-1.15/spec/calendar_date_select/calendar_date_select_spec.rb +14 -0
  138. data/vendor/gems/calendar_date_select-1.15/spec/calendar_date_select/form_helpers_spec.rb +166 -0
  139. data/vendor/gems/calendar_date_select-1.15/spec/spec_helper.rb +26 -0
  140. data/vendor/gems/coderay-0.8.260/.specification +2 -1
  141. data/vendor/gems/htmlentities-4.0.0/.specification +68 -0
  142. data/vendor/gems/htmlentities-4.0.0/COPYING.txt +21 -0
  143. data/vendor/gems/htmlentities-4.0.0/History.txt +47 -0
  144. data/vendor/gems/htmlentities-4.0.0/README.txt +44 -0
  145. data/vendor/gems/htmlentities-4.0.0/lib/htmlentities.rb +165 -0
  146. data/vendor/gems/htmlentities-4.0.0/lib/htmlentities/html4.rb +257 -0
  147. data/vendor/gems/htmlentities-4.0.0/lib/htmlentities/legacy.rb +27 -0
  148. data/vendor/gems/htmlentities-4.0.0/lib/htmlentities/string.rb +26 -0
  149. data/vendor/gems/htmlentities-4.0.0/lib/htmlentities/xhtml1.rb +258 -0
  150. data/vendor/gems/htmlentities-4.0.0/test/entities_test.rb +206 -0
  151. data/vendor/gems/htmlentities-4.0.0/test/html4_test.rb +24 -0
  152. data/vendor/gems/htmlentities-4.0.0/test/legacy_test.rb +34 -0
  153. data/vendor/gems/htmlentities-4.0.0/test/roundtrip_test.rb +94 -0
  154. data/vendor/gems/htmlentities-4.0.0/test/string_test.rb +24 -0
  155. data/vendor/gems/htmlentities-4.0.0/test/test_all.rb +3 -0
  156. data/vendor/gems/htmlentities-4.0.0/test/xhtml1_test.rb +23 -0
  157. data/vendor/gems/json-1.1.3/.require_paths +4 -0
  158. data/vendor/gems/json-1.1.3/.specification +58 -0
  159. data/vendor/gems/json-1.1.3/CHANGES +93 -0
  160. data/vendor/gems/json-1.1.3/GPL +340 -0
  161. data/vendor/gems/json-1.1.3/README +78 -0
  162. data/vendor/gems/json-1.1.3/RUBY +58 -0
  163. data/vendor/gems/json-1.1.3/Rakefile +309 -0
  164. data/vendor/gems/json-1.1.3/TODO +1 -0
  165. data/vendor/gems/json-1.1.3/VERSION +1 -0
  166. data/vendor/gems/json-1.1.3/benchmarks/benchmark.txt +133 -0
  167. data/vendor/gems/json-1.1.3/benchmarks/benchmark_generator.rb +48 -0
  168. data/vendor/gems/json-1.1.3/benchmarks/benchmark_parser.rb +26 -0
  169. data/vendor/gems/json-1.1.3/benchmarks/benchmark_rails.rb +26 -0
  170. data/vendor/gems/json-1.1.3/bin/edit_json.rb +10 -0
  171. data/vendor/gems/json-1.1.3/bin/prettify_json.rb +76 -0
  172. data/vendor/gems/json-1.1.3/data/example.json +1 -0
  173. data/vendor/gems/json-1.1.3/data/index.html +38 -0
  174. data/vendor/gems/json-1.1.3/data/prototype.js +4184 -0
  175. data/vendor/gems/json-1.1.3/ext/json/ext/generator.bundle +0 -0
  176. data/vendor/gems/json-1.1.3/ext/json/ext/generator/Makefile +149 -0
  177. data/vendor/gems/json-1.1.3/ext/json/ext/generator/extconf.rb +9 -0
  178. data/vendor/gems/json-1.1.3/ext/json/ext/generator/generator.bundle +0 -0
  179. data/vendor/gems/json-1.1.3/ext/json/ext/generator/generator.c +875 -0
  180. data/vendor/gems/json-1.1.3/ext/json/ext/generator/generator.o +0 -0
  181. data/vendor/gems/json-1.1.3/ext/json/ext/generator/unicode.c +182 -0
  182. data/vendor/gems/json-1.1.3/ext/json/ext/generator/unicode.h +53 -0
  183. data/vendor/gems/json-1.1.3/ext/json/ext/generator/unicode.o +0 -0
  184. data/vendor/gems/json-1.1.3/ext/json/ext/parser.bundle +0 -0
  185. data/vendor/gems/json-1.1.3/ext/json/ext/parser/Makefile +149 -0
  186. data/vendor/gems/json-1.1.3/ext/json/ext/parser/extconf.rb +9 -0
  187. data/vendor/gems/json-1.1.3/ext/json/ext/parser/parser.bundle +0 -0
  188. data/vendor/gems/json-1.1.3/ext/json/ext/parser/parser.c +1758 -0
  189. data/vendor/gems/json-1.1.3/ext/json/ext/parser/parser.o +0 -0
  190. data/vendor/gems/json-1.1.3/ext/json/ext/parser/parser.rl +638 -0
  191. data/vendor/gems/json-1.1.3/ext/json/ext/parser/unicode.c +154 -0
  192. data/vendor/gems/json-1.1.3/ext/json/ext/parser/unicode.h +58 -0
  193. data/vendor/gems/json-1.1.3/ext/json/ext/parser/unicode.o +0 -0
  194. data/vendor/gems/json-1.1.3/install.rb +26 -0
  195. data/vendor/gems/json-1.1.3/lib/json.rb +235 -0
  196. data/vendor/gems/json-1.1.3/lib/json/Array.xpm +21 -0
  197. data/vendor/gems/json-1.1.3/lib/json/FalseClass.xpm +21 -0
  198. data/vendor/gems/json-1.1.3/lib/json/Hash.xpm +21 -0
  199. data/vendor/gems/json-1.1.3/lib/json/Key.xpm +73 -0
  200. data/vendor/gems/json-1.1.3/lib/json/NilClass.xpm +21 -0
  201. data/vendor/gems/json-1.1.3/lib/json/Numeric.xpm +28 -0
  202. data/vendor/gems/json-1.1.3/lib/json/String.xpm +96 -0
  203. data/vendor/gems/json-1.1.3/lib/json/TrueClass.xpm +21 -0
  204. data/vendor/gems/json-1.1.3/lib/json/add/core.rb +135 -0
  205. data/vendor/gems/json-1.1.3/lib/json/add/rails.rb +58 -0
  206. data/vendor/gems/json-1.1.3/lib/json/common.rb +354 -0
  207. data/vendor/gems/json-1.1.3/lib/json/editor.rb +1362 -0
  208. data/vendor/gems/json-1.1.3/lib/json/ext.rb +13 -0
  209. data/vendor/gems/json-1.1.3/lib/json/json.xpm +1499 -0
  210. data/vendor/gems/json-1.1.3/lib/json/pure.rb +75 -0
  211. data/vendor/gems/json-1.1.3/lib/json/pure/generator.rb +394 -0
  212. data/vendor/gems/json-1.1.3/lib/json/pure/parser.rb +259 -0
  213. data/vendor/gems/json-1.1.3/lib/json/version.rb +9 -0
  214. data/vendor/gems/json-1.1.3/tests/fixtures/fail1.json +1 -0
  215. data/vendor/gems/json-1.1.3/tests/fixtures/fail10.json +1 -0
  216. data/vendor/gems/json-1.1.3/tests/fixtures/fail11.json +1 -0
  217. data/vendor/gems/json-1.1.3/tests/fixtures/fail12.json +1 -0
  218. data/vendor/gems/json-1.1.3/tests/fixtures/fail13.json +1 -0
  219. data/vendor/gems/json-1.1.3/tests/fixtures/fail14.json +1 -0
  220. data/vendor/gems/json-1.1.3/tests/fixtures/fail18.json +1 -0
  221. data/vendor/gems/json-1.1.3/tests/fixtures/fail19.json +1 -0
  222. data/vendor/gems/json-1.1.3/tests/fixtures/fail2.json +1 -0
  223. data/vendor/gems/json-1.1.3/tests/fixtures/fail20.json +1 -0
  224. data/vendor/gems/json-1.1.3/tests/fixtures/fail21.json +1 -0
  225. data/vendor/gems/json-1.1.3/tests/fixtures/fail22.json +1 -0
  226. data/vendor/gems/json-1.1.3/tests/fixtures/fail23.json +1 -0
  227. data/vendor/gems/json-1.1.3/tests/fixtures/fail24.json +1 -0
  228. data/vendor/gems/json-1.1.3/tests/fixtures/fail25.json +1 -0
  229. data/vendor/gems/json-1.1.3/tests/fixtures/fail27.json +2 -0
  230. data/vendor/gems/json-1.1.3/tests/fixtures/fail28.json +2 -0
  231. data/vendor/gems/json-1.1.3/tests/fixtures/fail3.json +1 -0
  232. data/vendor/gems/json-1.1.3/tests/fixtures/fail4.json +1 -0
  233. data/vendor/gems/json-1.1.3/tests/fixtures/fail5.json +1 -0
  234. data/vendor/gems/json-1.1.3/tests/fixtures/fail6.json +1 -0
  235. data/vendor/gems/json-1.1.3/tests/fixtures/fail7.json +1 -0
  236. data/vendor/gems/json-1.1.3/tests/fixtures/fail8.json +1 -0
  237. data/vendor/gems/json-1.1.3/tests/fixtures/fail9.json +1 -0
  238. data/vendor/gems/json-1.1.3/tests/fixtures/pass1.json +56 -0
  239. data/vendor/gems/json-1.1.3/tests/fixtures/pass15.json +1 -0
  240. data/vendor/gems/json-1.1.3/tests/fixtures/pass16.json +1 -0
  241. data/vendor/gems/json-1.1.3/tests/fixtures/pass17.json +1 -0
  242. data/vendor/gems/json-1.1.3/tests/fixtures/pass2.json +1 -0
  243. data/vendor/gems/json-1.1.3/tests/fixtures/pass26.json +1 -0
  244. data/vendor/gems/json-1.1.3/tests/fixtures/pass3.json +6 -0
  245. data/vendor/gems/json-1.1.3/tests/runner.rb +25 -0
  246. data/vendor/gems/json-1.1.3/tests/test_json.rb +293 -0
  247. data/vendor/gems/json-1.1.3/tests/test_json_addition.rb +161 -0
  248. data/vendor/gems/json-1.1.3/tests/test_json_fixtures.rb +30 -0
  249. data/vendor/gems/json-1.1.3/tests/test_json_generate.rb +100 -0
  250. data/vendor/gems/json-1.1.3/tests/test_json_rails.rb +118 -0
  251. data/vendor/gems/json-1.1.3/tests/test_json_unicode.rb +61 -0
  252. data/vendor/gems/json-1.1.3/tools/fuzz.rb +140 -0
  253. data/vendor/gems/json-1.1.3/tools/server.rb +62 -0
  254. data/vendor/plugins/localization/bin/make_language.rb +2 -2
  255. data/vendor/plugins/localization/lib/localization.rb +2 -2
  256. data/vendor/plugins/will_paginate/CHANGELOG.rdoc +110 -0
  257. data/vendor/plugins/will_paginate/LICENSE +18 -0
  258. data/vendor/plugins/will_paginate/README.rdoc +107 -0
  259. data/vendor/plugins/will_paginate/Rakefile +62 -0
  260. data/vendor/plugins/will_paginate/examples/apple-circle.gif +0 -0
  261. data/vendor/plugins/will_paginate/examples/index.haml +69 -0
  262. data/vendor/plugins/will_paginate/examples/index.html +92 -0
  263. data/vendor/plugins/will_paginate/examples/pagination.css +90 -0
  264. data/vendor/plugins/will_paginate/examples/pagination.sass +91 -0
  265. data/vendor/plugins/will_paginate/init.rb +1 -0
  266. data/vendor/plugins/will_paginate/lib/will_paginate.rb +82 -0
  267. data/vendor/plugins/will_paginate/lib/will_paginate/array.rb +16 -0
  268. data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +146 -0
  269. data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +32 -0
  270. data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +260 -0
  271. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb +170 -0
  272. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb +37 -0
  273. data/vendor/plugins/will_paginate/lib/will_paginate/version.rb +9 -0
  274. data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +383 -0
  275. data/vendor/plugins/will_paginate/test/boot.rb +21 -0
  276. data/vendor/plugins/will_paginate/test/collection_test.rb +143 -0
  277. data/vendor/plugins/will_paginate/test/console +8 -0
  278. data/vendor/plugins/will_paginate/test/database.yml +22 -0
  279. data/vendor/plugins/will_paginate/test/finder_test.rb +476 -0
  280. data/vendor/plugins/will_paginate/test/fixtures/admin.rb +3 -0
  281. data/vendor/plugins/will_paginate/test/fixtures/developer.rb +14 -0
  282. data/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +13 -0
  283. data/vendor/plugins/will_paginate/test/fixtures/project.rb +15 -0
  284. data/vendor/plugins/will_paginate/test/fixtures/projects.yml +6 -0
  285. data/vendor/plugins/will_paginate/test/fixtures/replies.yml +29 -0
  286. data/vendor/plugins/will_paginate/test/fixtures/reply.rb +7 -0
  287. data/vendor/plugins/will_paginate/test/fixtures/schema.rb +38 -0
  288. data/vendor/plugins/will_paginate/test/fixtures/topic.rb +10 -0
  289. data/vendor/plugins/will_paginate/test/fixtures/topics.yml +30 -0
  290. data/vendor/plugins/will_paginate/test/fixtures/user.rb +2 -0
  291. data/vendor/plugins/will_paginate/test/fixtures/users.yml +35 -0
  292. data/vendor/plugins/will_paginate/test/helper.rb +37 -0
  293. data/vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb +36 -0
  294. data/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +73 -0
  295. data/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +11 -0
  296. data/vendor/plugins/will_paginate/test/lib/view_test_process.rb +165 -0
  297. data/vendor/plugins/will_paginate/test/tasks.rake +59 -0
  298. data/vendor/plugins/will_paginate/test/view_test.rb +363 -0
  299. data/vendor/plugins/will_paginate/will_paginate.gemspec +22 -0
  300. data/vendor/plugins/xml_sidebar/lib/xml_sidebar.rb +1 -1
  301. metadata +349 -16
  302. data/migrate.txt +0 -142
@@ -0,0 +1,242 @@
1
+ require 'soap/mapping'
2
+
3
+ # hack to improve the .Net interoperability
4
+ class SOAP::Mapping::Object
5
+ def each_pair
6
+ self.__xmlele.each { |n, v| yield n.name, v.to_s }
7
+ end
8
+ end
9
+
10
+ module ActionWebService
11
+ module Protocol
12
+ module Soap
13
+ # Workaround for SOAP4R return values changing
14
+ class Registry < SOAP::Mapping::Registry
15
+ if SOAP::Version >= "1.5.4"
16
+ def find_mapped_soap_class(obj_class)
17
+ return @map.instance_eval { @obj2soap[obj_class][0] }
18
+ end
19
+
20
+ def find_mapped_obj_class(soap_class)
21
+ return @map.instance_eval { @soap2obj[soap_class][0] }
22
+ end
23
+ end
24
+ end
25
+
26
+ class SoapMarshaler
27
+ attr :namespace
28
+ attr :registry
29
+
30
+ def initialize(namespace=nil)
31
+ @namespace = namespace || 'urn:ActionWebService'
32
+ @registry = Registry.new
33
+ @type2binding = {}
34
+ register_static_factories
35
+ end
36
+
37
+ def soap_to_ruby(obj)
38
+ SOAP::Mapping.soap2obj(obj, @registry)
39
+ end
40
+
41
+ def ruby_to_soap(obj)
42
+ soap = SOAP::Mapping.obj2soap(obj, @registry)
43
+ soap.elename = XSD::QName.new if SOAP::Version >= "1.5.5" && soap.elename == XSD::QName::EMPTY
44
+ soap
45
+ end
46
+
47
+ def register_type(type)
48
+ return @type2binding[type] if @type2binding.has_key?(type)
49
+
50
+ if type.array?
51
+ array_mapping = @registry.find_mapped_soap_class(Array)
52
+ qname = XSD::QName.new(@namespace, soap_type_name(type.element_type.type_class.name) + 'Array')
53
+ element_type_binding = register_type(type.element_type)
54
+ @type2binding[type] = SoapBinding.new(self, qname, type, array_mapping, element_type_binding)
55
+ elsif (mapping = @registry.find_mapped_soap_class(type.type_class) rescue nil)
56
+ qname = mapping[2] ? mapping[2][:type] : nil
57
+ qname ||= soap_base_type_name(mapping[0])
58
+ @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
59
+ else
60
+ qname = XSD::QName.new(@namespace, soap_type_name(type.type_class.name))
61
+ @registry.add(type.type_class,
62
+ SOAP::SOAPStruct,
63
+ typed_struct_factory(type.type_class),
64
+ { :type => qname })
65
+ mapping = @registry.find_mapped_soap_class(type.type_class)
66
+ @type2binding[type] = SoapBinding.new(self, qname, type, mapping)
67
+ end
68
+
69
+ if type.structured?
70
+ type.each_member do |m_name, m_type|
71
+ register_type(m_type)
72
+ end
73
+ end
74
+
75
+ @type2binding[type]
76
+ end
77
+ alias :lookup_type :register_type
78
+
79
+ def annotate_arrays(binding, value)
80
+ if value.nil?
81
+ return
82
+ elsif binding.type.array?
83
+ mark_typed_array(value, binding.element_binding.qname)
84
+ if binding.element_binding.type.custom?
85
+ value.each do |element|
86
+ annotate_arrays(binding.element_binding, element)
87
+ end
88
+ end
89
+ elsif binding.type.structured?
90
+ binding.type.each_member do |name, type|
91
+ member_binding = register_type(type)
92
+ member_value = value.respond_to?('[]') ? value[name] : value.send(name)
93
+ annotate_arrays(member_binding, member_value) if type.custom?
94
+ end
95
+ end
96
+ end
97
+
98
+ private
99
+ def typed_struct_factory(type_class)
100
+ if Object.const_defined?('ActiveRecord')
101
+ if type_class.ancestors.include?(ActiveRecord::Base)
102
+ qname = XSD::QName.new(@namespace, soap_type_name(type_class.name))
103
+ type_class.instance_variable_set('@qname', qname)
104
+ return SoapActiveRecordStructFactory.new
105
+ end
106
+ end
107
+ SOAP::Mapping::Registry::TypedStructFactory
108
+ end
109
+
110
+ def mark_typed_array(array, qname)
111
+ (class << array; self; end).class_eval do
112
+ define_method(:arytype) do
113
+ qname
114
+ end
115
+ end
116
+ end
117
+
118
+ def soap_base_type_name(type)
119
+ xsd_type = type.ancestors.find{ |c| c.const_defined? 'Type' }
120
+ xsd_type ? xsd_type.const_get('Type') : XSD::XSDAnySimpleType::Type
121
+ end
122
+
123
+ def soap_type_name(type_name)
124
+ type_name.gsub(/::/, '..')
125
+ end
126
+
127
+ def register_static_factories
128
+ @registry.add(ActionWebService::Base64, SOAP::SOAPBase64, SoapBase64Factory.new, nil)
129
+ mapping = @registry.find_mapped_soap_class(ActionWebService::Base64)
130
+ @type2binding[ActionWebService::Base64] =
131
+ SoapBinding.new(self, SOAP::SOAPBase64::Type, ActionWebService::Base64, mapping)
132
+ @registry.add(Array, SOAP::SOAPArray, SoapTypedArrayFactory.new, nil)
133
+ @registry.add(::BigDecimal, SOAP::SOAPDouble, SOAP::Mapping::Registry::BasetypeFactory, {:derived_class => true})
134
+ end
135
+ end
136
+
137
+ class SoapBinding
138
+ attr :qname
139
+ attr :type
140
+ attr :mapping
141
+ attr :element_binding
142
+
143
+ def initialize(marshaler, qname, type, mapping, element_binding=nil)
144
+ @marshaler = marshaler
145
+ @qname = qname
146
+ @type = type
147
+ @mapping = mapping
148
+ @element_binding = element_binding
149
+ end
150
+
151
+ def type_name
152
+ @type.custom? ? @qname.name : nil
153
+ end
154
+
155
+ def qualified_type_name(ns=nil)
156
+ if @type.custom?
157
+ "#{ns ? ns : @qname.namespace}:#{@qname.name}"
158
+ else
159
+ ns = XSD::NS.new
160
+ ns.assign(XSD::Namespace, SOAP::XSDNamespaceTag)
161
+ ns.assign(SOAP::EncodingNamespace, "soapenc")
162
+ xsd_klass = mapping[0].ancestors.find{|c| c.const_defined?('Type')}
163
+ return ns.name(XSD::AnyTypeName) unless xsd_klass
164
+ ns.name(xsd_klass.const_get('Type'))
165
+ end
166
+ end
167
+
168
+ def eql?(other)
169
+ @qname == other.qname
170
+ end
171
+ alias :== :eql?
172
+
173
+ def hash
174
+ @qname.hash
175
+ end
176
+ end
177
+
178
+ class SoapActiveRecordStructFactory < SOAP::Mapping::Factory
179
+ def obj2soap(soap_class, obj, info, map)
180
+ unless obj.is_a?(ActiveRecord::Base)
181
+ return nil
182
+ end
183
+ soap_obj = soap_class.new(obj.class.instance_variable_get('@qname'))
184
+ obj.class.columns.each do |column|
185
+ key = column.name.to_s
186
+ value = obj.send(key)
187
+ soap_obj[key] = SOAP::Mapping._obj2soap(value, map)
188
+ end
189
+ soap_obj
190
+ end
191
+
192
+ def soap2obj(obj_class, node, info, map)
193
+ unless node.type == obj_class.instance_variable_get('@qname')
194
+ return false
195
+ end
196
+ obj = obj_class.new
197
+ node.each do |key, value|
198
+ obj[key] = value.data
199
+ end
200
+ obj.instance_variable_set('@new_record', false)
201
+ return true, obj
202
+ end
203
+ end
204
+
205
+ class SoapTypedArrayFactory < SOAP::Mapping::Factory
206
+ def obj2soap(soap_class, obj, info, map)
207
+ unless obj.respond_to?(:arytype)
208
+ return nil
209
+ end
210
+ soap_obj = soap_class.new(SOAP::ValueArrayName, 1, obj.arytype)
211
+ mark_marshalled_obj(obj, soap_obj)
212
+ obj.each do |item|
213
+ child = SOAP::Mapping._obj2soap(item, map)
214
+ soap_obj.add(child)
215
+ end
216
+ soap_obj
217
+ end
218
+
219
+ def soap2obj(obj_class, node, info, map)
220
+ return false
221
+ end
222
+ end
223
+
224
+ class SoapBase64Factory < SOAP::Mapping::Factory
225
+ def obj2soap(soap_class, obj, info, map)
226
+ unless obj.is_a?(ActionWebService::Base64)
227
+ return nil
228
+ end
229
+ return soap_class.new(obj)
230
+ end
231
+
232
+ def soap2obj(obj_class, node, info, map)
233
+ unless node.type == SOAP::SOAPBase64::Type
234
+ return false
235
+ end
236
+ return true, obj_class.new(node.string)
237
+ end
238
+ end
239
+
240
+ end
241
+ end
242
+ end
@@ -0,0 +1,122 @@
1
+ require 'xmlrpc/marshal'
2
+ require 'action_web_service/client/xmlrpc_client'
3
+
4
+ module XMLRPC # :nodoc:
5
+ class FaultException # :nodoc:
6
+ alias :message :faultString
7
+ end
8
+
9
+ class Create
10
+ def wrong_type(value)
11
+ if BigDecimal === value
12
+ [true, value.to_f]
13
+ else
14
+ false
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ module ActionWebService # :nodoc:
21
+ module API # :nodoc:
22
+ class Base # :nodoc:
23
+ def self.xmlrpc_client(endpoint_uri, options={})
24
+ ActionWebService::Client::XmlRpc.new self, endpoint_uri, options
25
+ end
26
+ end
27
+ end
28
+
29
+ module Protocol # :nodoc:
30
+ module XmlRpc # :nodoc:
31
+ def self.included(base)
32
+ base.register_protocol(XmlRpcProtocol)
33
+ end
34
+
35
+ class XmlRpcProtocol < AbstractProtocol # :nodoc:
36
+ def self.create(controller)
37
+ XmlRpcProtocol.new
38
+ end
39
+
40
+ def decode_action_pack_request(action_pack_request)
41
+ service_name = action_pack_request.parameters['action']
42
+ decode_request(action_pack_request.raw_post, service_name)
43
+ end
44
+
45
+ def decode_request(raw_request, service_name)
46
+ method_name, params = XMLRPC::Marshal.load_call(raw_request)
47
+ Request.new(self, method_name, params, service_name)
48
+ rescue
49
+ return nil
50
+ end
51
+
52
+ def encode_request(method_name, params, param_types)
53
+ if param_types
54
+ params = params.dup
55
+ param_types.each_with_index{ |type, i| params[i] = value_to_xmlrpc_wire_format(params[i], type) }
56
+ end
57
+ XMLRPC::Marshal.dump_call(method_name, *params)
58
+ end
59
+
60
+ def decode_response(raw_response)
61
+ [nil, XMLRPC::Marshal.load_response(raw_response)]
62
+ end
63
+
64
+ def encode_response(method_name, return_value, return_type, protocol_options={})
65
+ if return_value && return_type
66
+ return_value = value_to_xmlrpc_wire_format(return_value, return_type)
67
+ end
68
+ return_value = false if return_value.nil?
69
+ raw_response = XMLRPC::Marshal.dump_response(return_value)
70
+ Response.new(raw_response, 'text/xml', return_value)
71
+ end
72
+
73
+ def encode_multicall_response(responses, protocol_options={})
74
+ result = responses.map do |return_value, return_type|
75
+ if return_value && return_type
76
+ return_value = value_to_xmlrpc_wire_format(return_value, return_type)
77
+ return_value = [return_value] unless return_value.nil?
78
+ end
79
+ return_value = false if return_value.nil?
80
+ return_value
81
+ end
82
+ raw_response = XMLRPC::Marshal.dump_response(result)
83
+ Response.new(raw_response, 'text/xml', result)
84
+ end
85
+
86
+ def protocol_client(api, protocol_name, endpoint_uri, options={})
87
+ return nil unless protocol_name == :xmlrpc
88
+ ActionWebService::Client::XmlRpc.new(api, endpoint_uri, options)
89
+ end
90
+
91
+ def value_to_xmlrpc_wire_format(value, value_type)
92
+ if value_type.array?
93
+ value.map{ |val| value_to_xmlrpc_wire_format(val, value_type.element_type) }
94
+ else
95
+ if value.is_a?(ActionWebService::Struct)
96
+ struct = {}
97
+ value.class.members.each do |name, type|
98
+ member_value = value[name]
99
+ next if member_value.nil?
100
+ struct[name.to_s] = value_to_xmlrpc_wire_format(member_value, type)
101
+ end
102
+ struct
103
+ elsif value.is_a?(ActiveRecord::Base)
104
+ struct = {}
105
+ value.attributes.each do |key, member_value|
106
+ next if member_value.nil?
107
+ struct[key.to_s] = member_value
108
+ end
109
+ struct
110
+ elsif value.is_a?(ActionWebService::Base64)
111
+ XMLRPC::Base64.new(value)
112
+ elsif value.is_a?(Exception) && !value.is_a?(XMLRPC::FaultException)
113
+ XMLRPC::FaultException.new(2, value.message)
114
+ else
115
+ value
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,281 @@
1
+ require 'benchmark'
2
+ require 'pathname'
3
+
4
+ module ActionWebService
5
+ module Scaffolding # :nodoc:
6
+ class ScaffoldingError < ActionWebServiceError # :nodoc:
7
+ end
8
+
9
+ def self.included(base)
10
+ base.extend(ClassMethods)
11
+ end
12
+
13
+ # Web service invocation scaffolding provides a way to quickly invoke web service methods in a controller. The
14
+ # generated scaffold actions have default views to let you enter the method parameters and view the
15
+ # results.
16
+ #
17
+ # Example:
18
+ #
19
+ # class ApiController < ActionController
20
+ # web_service_scaffold :invoke
21
+ # end
22
+ #
23
+ # This example generates an +invoke+ action in the +ApiController+ that you can navigate to from
24
+ # your browser, select the API method, enter its parameters, and perform the invocation.
25
+ #
26
+ # If you want to customize the default views, create the following views in "app/views":
27
+ #
28
+ # * <tt>action_name/methods.html.erb</tt>
29
+ # * <tt>action_name/parameters.html.erb</tt>
30
+ # * <tt>action_name/result.html.erb</tt>
31
+ # * <tt>action_name/layout.html.erb</tt>
32
+ #
33
+ # Where <tt>action_name</tt> is the name of the action you gave to ClassMethods#web_service_scaffold.
34
+ #
35
+ # You can use the default views in <tt>RAILS_DIR/lib/action_web_service/templates/scaffolds</tt> as
36
+ # a guide.
37
+ module ClassMethods
38
+ # Generates web service invocation scaffolding for the current controller. The given action name
39
+ # can then be used as the entry point for invoking API methods from a web browser.
40
+ def web_service_scaffold(action_name)
41
+ add_template_helper(Helpers)
42
+ module_eval <<-"end_eval", __FILE__, __LINE__ + 1
43
+ def #{action_name}
44
+ if request.method == :get
45
+ setup_invocation_assigns
46
+ render_invocation_scaffold 'methods'
47
+ end
48
+ end
49
+
50
+ def #{action_name}_method_params
51
+ if request.method == :get
52
+ setup_invocation_assigns
53
+ render_invocation_scaffold 'parameters'
54
+ end
55
+ end
56
+
57
+ def #{action_name}_submit
58
+ if request.method == :post
59
+ setup_invocation_assigns
60
+ protocol_name = params['protocol'] ? params['protocol'].to_sym : :soap
61
+ case protocol_name
62
+ when :soap
63
+ @protocol = Protocol::Soap::SoapProtocol.create(self)
64
+ when :xmlrpc
65
+ @protocol = Protocol::XmlRpc::XmlRpcProtocol.create(self)
66
+ end
67
+ bm = Benchmark.measure do
68
+ @protocol.register_api(@scaffold_service.api)
69
+ post_params = params['method_params'] ? params['method_params'].dup : nil
70
+ params = []
71
+ @scaffold_method.expects.each_with_index do |spec, i|
72
+ params << post_params[i.to_s]
73
+ end if @scaffold_method.expects
74
+ params = @scaffold_method.cast_expects(params)
75
+ method_name = public_method_name(@scaffold_service.name, @scaffold_method.public_name)
76
+ @method_request_xml = @protocol.encode_request(method_name, params, @scaffold_method.expects)
77
+ new_request = @protocol.encode_action_pack_request(@scaffold_service.name, @scaffold_method.public_name, @method_request_xml)
78
+ prepare_request(new_request, @scaffold_service.name, @scaffold_method.public_name)
79
+ self.request = new_request
80
+ if @scaffold_container.dispatching_mode != :direct
81
+ request.parameters['action'] = @scaffold_service.name
82
+ end
83
+ dispatch_web_service_request
84
+ @method_response_xml = response.body
85
+ method_name, obj = @protocol.decode_response(@method_response_xml)
86
+ return if handle_invocation_exception(obj)
87
+ @method_return_value = @scaffold_method.cast_returns(obj)
88
+ end
89
+ @method_elapsed = bm.real
90
+ reset_invocation_response
91
+ render_invocation_scaffold 'result'
92
+ end
93
+ end
94
+
95
+ private
96
+ def setup_invocation_assigns
97
+ @scaffold_class = self.class
98
+ @scaffold_action_name = "#{action_name}"
99
+ @scaffold_container = WebServiceModel::Container.new(self)
100
+ if params['service'] && params['method']
101
+ @scaffold_service = @scaffold_container.services.find{ |x| x.name == params['service'] }
102
+ @scaffold_method = @scaffold_service.api_methods[params['method']]
103
+ end
104
+ end
105
+
106
+ def render_invocation_scaffold(action)
107
+ customized_template = "\#{self.class.controller_path}/#{action_name}/\#{action}"
108
+ default_template = scaffold_path(action)
109
+ if template_exists?(customized_template)
110
+ content = @template.render(:file => customized_template)
111
+ else
112
+ content = @template.render(:file => default_template)
113
+ end
114
+ @template.instance_variable_set("@content_for_layout", content)
115
+ if self.active_layout.nil?
116
+ render :file => scaffold_path("layout")
117
+ else
118
+ render :file => self.active_layout, :use_full_path => true
119
+ end
120
+ end
121
+
122
+ def scaffold_path(template_name)
123
+ File.dirname(__FILE__) + "/templates/scaffolds/" + template_name + ".html.erb"
124
+ end
125
+
126
+ def reset_invocation_response
127
+ erase_render_results
128
+ response.headers = ::ActionController::AbstractResponse::DEFAULT_HEADERS.merge("cookie" => [])
129
+ end
130
+
131
+ def public_method_name(service_name, method_name)
132
+ if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::XmlRpc::XmlRpcProtocol)
133
+ service_name + '.' + method_name
134
+ else
135
+ method_name
136
+ end
137
+ end
138
+
139
+ def prepare_request(new_request, service_name, method_name)
140
+ new_request.parameters.update(request.parameters)
141
+ request.env.each{ |k, v| new_request.env[k] = v unless new_request.env.has_key?(k) }
142
+ if web_service_dispatching_mode == :layered && @protocol.is_a?(ActionWebService::Protocol::Soap::SoapProtocol)
143
+ new_request.env['HTTP_SOAPACTION'] = "/\#{controller_name()}/\#{service_name}/\#{method_name}"
144
+ end
145
+ end
146
+
147
+ def handle_invocation_exception(obj)
148
+ exception = nil
149
+ if obj.respond_to?(:detail) && obj.detail.respond_to?(:cause) && obj.detail.cause.is_a?(Exception)
150
+ exception = obj.detail.cause
151
+ elsif obj.is_a?(XMLRPC::FaultException)
152
+ exception = obj
153
+ end
154
+ return unless exception
155
+ reset_invocation_response
156
+ rescue_action(exception)
157
+ true
158
+ end
159
+ end_eval
160
+ end
161
+ end
162
+
163
+ module Helpers # :nodoc:
164
+ def method_parameter_input_fields(method, type, field_name_base, idx, was_structured=false)
165
+ if type.array?
166
+ return content_tag('em', "Typed array input fields not supported yet (#{type.name})")
167
+ end
168
+ if type.structured?
169
+ return content_tag('em', "Nested structural types not supported yet (#{type.name})") if was_structured
170
+ parameters = ""
171
+ type.each_member do |member_name, member_type|
172
+ label = method_parameter_label(member_name, member_type)
173
+ nested_content = method_parameter_input_fields(
174
+ method,
175
+ member_type,
176
+ "#{field_name_base}[#{idx}][#{member_name}]",
177
+ idx,
178
+ true)
179
+ if member_type.custom?
180
+ parameters << content_tag('li', label)
181
+ parameters << content_tag('ul', nested_content)
182
+ else
183
+ parameters << content_tag('li', label + ' ' + nested_content)
184
+ end
185
+ end
186
+ content_tag('ul', parameters)
187
+ else
188
+ # If the data source was structured previously we already have the index set
189
+ field_name_base = "#{field_name_base}[#{idx}]" unless was_structured
190
+
191
+ case type.type
192
+ when :int
193
+ text_field_tag "#{field_name_base}"
194
+ when :string
195
+ text_field_tag "#{field_name_base}"
196
+ when :base64
197
+ text_area_tag "#{field_name_base}", nil, :size => "40x5"
198
+ when :bool
199
+ radio_button_tag("#{field_name_base}", "true") + " True" +
200
+ radio_button_tag("#{field_name_base}", "false") + "False"
201
+ when :float
202
+ text_field_tag "#{field_name_base}"
203
+ when :time, :datetime
204
+ time = Time.now
205
+ i = 0
206
+ %w|year month day hour minute second|.map do |name|
207
+ i += 1
208
+ send("select_#{name}", time, :prefix => "#{field_name_base}[#{i}]", :discard_type => true)
209
+ end.join
210
+ when :date
211
+ date = Date.today
212
+ i = 0
213
+ %w|year month day|.map do |name|
214
+ i += 1
215
+ send("select_#{name}", date, :prefix => "#{field_name_base}[#{i}]", :discard_type => true)
216
+ end.join
217
+ end
218
+ end
219
+ end
220
+
221
+ def method_parameter_label(name, type)
222
+ name.to_s.capitalize + ' (' + type.human_name(false) + ')'
223
+ end
224
+
225
+ def service_method_list(service)
226
+ action = @scaffold_action_name + '_method_params'
227
+ methods = service.api_methods_full.map do |desc, name|
228
+ content_tag("li", link_to(desc, :action => action, :service => service.name, :method => name))
229
+ end
230
+ content_tag("ul", methods.join("\n"))
231
+ end
232
+ end
233
+
234
+ module WebServiceModel # :nodoc:
235
+ class Container # :nodoc:
236
+ attr :services
237
+ attr :dispatching_mode
238
+
239
+ def initialize(real_container)
240
+ @real_container = real_container
241
+ @dispatching_mode = @real_container.class.web_service_dispatching_mode
242
+ @services = []
243
+ if @dispatching_mode == :direct
244
+ @services << Service.new(@real_container.controller_name, @real_container)
245
+ else
246
+ @real_container.class.web_services.each do |name, obj|
247
+ @services << Service.new(name, @real_container.instance_eval{ web_service_object(name) })
248
+ end
249
+ end
250
+ end
251
+ end
252
+
253
+ class Service # :nodoc:
254
+ attr :name
255
+ attr :object
256
+ attr :api
257
+ attr :api_methods
258
+ attr :api_methods_full
259
+
260
+ def initialize(name, real_service)
261
+ @name = name.to_s
262
+ @object = real_service
263
+ @api = @object.class.web_service_api
264
+ if @api.nil?
265
+ raise ScaffoldingError, "No web service API attached to #{object.class}"
266
+ end
267
+ @api_methods = {}
268
+ @api_methods_full = []
269
+ @api.api_methods.each do |name, method|
270
+ @api_methods[method.public_name.to_s] = method
271
+ @api_methods_full << [method.to_s, method.public_name.to_s]
272
+ end
273
+ end
274
+
275
+ def to_s
276
+ self.name.camelize
277
+ end
278
+ end
279
+ end
280
+ end
281
+ end