gfdnavi 1.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. data/ChangeLog +10949 -0
  2. data/LICENCE.txt +57 -0
  3. data/Makefile +18 -0
  4. data/TODO +132 -0
  5. data/app/controllers/analysis_controller.rb +700 -0
  6. data/app/controllers/application.rb +41 -0
  7. data/app/controllers/draw_method_controller.rb +172 -0
  8. data/app/controllers/explorer_controller.rb +197 -0
  9. data/app/controllers/finder_controller.rb +331 -0
  10. data/app/controllers/function_controller.rb +204 -0
  11. data/app/controllers/group_controller.rb +115 -0
  12. data/app/controllers/keyword_attributes_controller.rb +52 -0
  13. data/app/controllers/knowledge_controller.rb +928 -0
  14. data/app/controllers/nodes_controller.rb +515 -0
  15. data/app/controllers/search_controller.rb +341 -0
  16. data/app/controllers/user_controller.rb +337 -0
  17. data/app/helpers/analysis_helper.rb +2 -0
  18. data/app/helpers/application_helper.rb +105 -0
  19. data/app/helpers/description_helper.rb +2 -0
  20. data/app/helpers/function_helper.rb +2 -0
  21. data/app/helpers/group_helper.rb +2 -0
  22. data/app/helpers/search_helper.rb +3 -0
  23. data/app/helpers/user_helper.rb +2 -0
  24. data/app/helpers/work_flow_helper.rb +92 -0
  25. data/app/models/actual_file.rb +3 -0
  26. data/app/models/analysis.rb +715 -0
  27. data/app/models/analysis_history.rb +42 -0
  28. data/app/models/cross_array.rb +22 -0
  29. data/app/models/cross_result.rb +254 -0
  30. data/app/models/derived_spatial_attribute.rb +3 -0
  31. data/app/models/diagram_cache.rb +16 -0
  32. data/app/models/diagram_cache_datum.rb +4 -0
  33. data/app/models/diagram_cache_session.rb +8 -0
  34. data/app/models/directory.rb +21 -0
  35. data/app/models/draw_method.rb +48 -0
  36. data/app/models/draw_method_attribute.rb +8 -0
  37. data/app/models/draw_parameter.rb +12 -0
  38. data/app/models/explorer_query.rb +354 -0
  39. data/app/models/explorer_result.rb +312 -0
  40. data/app/models/function.rb +75 -0
  41. data/app/models/function_argument.rb +6 -0
  42. data/app/models/function_output.rb +4 -0
  43. data/app/models/group.rb +153 -0
  44. data/app/models/image.rb +20 -0
  45. data/app/models/keyword_attribute.rb +179 -0
  46. data/app/models/knowledge.rb +94 -0
  47. data/app/models/knowledge_backup.rb +32 -0
  48. data/app/models/knowledge_figure.rb +16 -0
  49. data/app/models/knowledge_figure_backup.rb +16 -0
  50. data/app/models/knowledge_parser.rb +392 -0
  51. data/app/models/node.rb +605 -0
  52. data/app/models/node_entity_abstract.rb +112 -0
  53. data/app/models/node_lineage.rb +6 -0
  54. data/app/models/node_relation.rb +4 -0
  55. data/app/models/path_node.rb +60 -0
  56. data/app/models/query.rb +193 -0
  57. data/app/models/query_history.rb +12 -0
  58. data/app/models/results.rb +48 -0
  59. data/app/models/sign_up_user.rb +25 -0
  60. data/app/models/spatial_and_time_attribute.rb +11 -0
  61. data/app/models/user.rb +115 -0
  62. data/app/models/user_mailer.rb +48 -0
  63. data/app/models/value_type.rb +3 -0
  64. data/app/models/variable.rb +70 -0
  65. data/app/models/virtual_node.rb +457 -0
  66. data/app/views/analysis/__help_analysis_tab.en.html +57 -0
  67. data/app/views/analysis/__help_draw_share.en.html +12 -0
  68. data/app/views/analysis/__help_draw_tab.en.html +6 -0
  69. data/app/views/analysis/_analysis_function_settings.rhtml +61 -0
  70. data/app/views/analysis/_analysis_settings.rhtml +28 -0
  71. data/app/views/analysis/_diagram.rhtml +70 -0
  72. data/app/views/analysis/_dimension_option.rhtml +59 -0
  73. data/app/views/analysis/_draw_general_settings.rhtml +217 -0
  74. data/app/views/analysis/_draw_settings.rhtml +73 -0
  75. data/app/views/analysis/_history.rhtml +19 -0
  76. data/app/views/analysis/_popular_diagrams.rhtml +42 -0
  77. data/app/views/analysis/_save_form.rhtml +44 -0
  78. data/app/views/analysis/_variables.rhtml +66 -0
  79. data/app/views/analysis/_variables_order.rhtml +56 -0
  80. data/app/views/analysis/index.rhtml +195 -0
  81. data/app/views/analysis/preview.rhtml +3 -0
  82. data/app/views/analysis/save.rhtml +73 -0
  83. data/app/views/analysis/show_diagram.rhtml +42 -0
  84. data/app/views/cross/_display_map.rhtml +201 -0
  85. data/app/views/cross/_result.rhtml +205 -0
  86. data/app/views/cross/_show_result_tree.rhtml +40 -0
  87. data/app/views/cross/_show_results.rhtml +80 -0
  88. data/app/views/cross/_style.rhtml +21 -0
  89. data/app/views/cross/index.rhtml +271 -0
  90. data/app/views/draw_method/_edit_form.rhtml +110 -0
  91. data/app/views/draw_method/create.rhtml +8 -0
  92. data/app/views/draw_method/details.rhtml +113 -0
  93. data/app/views/draw_method/edit.rhtml +8 -0
  94. data/app/views/draw_method/list.rhtml +80 -0
  95. data/app/views/explorer/_display_map.rhtml +199 -0
  96. data/app/views/explorer/_show_result_tree.rhtml +40 -0
  97. data/app/views/explorer/_show_results.rhtml +101 -0
  98. data/app/views/explorer/_style.rhtml +21 -0
  99. data/app/views/explorer/index.rhtml +214 -0
  100. data/app/views/finder/_children.html.erb +84 -0
  101. data/app/views/finder/_children_details.html.erb +74 -0
  102. data/app/views/finder/_children_details_tr.html.erb +196 -0
  103. data/app/views/finder/create_tree.html.erb +15 -0
  104. data/app/views/finder/flex.html.erb +52 -0
  105. data/app/views/finder/index.html.erb +47 -0
  106. data/app/views/finder/show_details.html.erb +3 -0
  107. data/app/views/finder/show_images.html.erb +3 -0
  108. data/app/views/function/_edit_form.rhtml +106 -0
  109. data/app/views/function/create.rhtml +8 -0
  110. data/app/views/function/details.rhtml +96 -0
  111. data/app/views/function/edit.rhtml +8 -0
  112. data/app/views/function/list.rhtml +80 -0
  113. data/app/views/group/add_member.rhtml +13 -0
  114. data/app/views/group/change_owner.rhtml +15 -0
  115. data/app/views/group/create.rhtml +11 -0
  116. data/app/views/group/delete_member.rhtml +14 -0
  117. data/app/views/group/list.rhtml +63 -0
  118. data/app/views/knowledge/_backup.rhtml +135 -0
  119. data/app/views/knowledge/_category.rhtml +58 -0
  120. data/app/views/knowledge/_category_list.rhtml +34 -0
  121. data/app/views/knowledge/_category_table.rhtml +23 -0
  122. data/app/views/knowledge/_comment.rhtml +64 -0
  123. data/app/views/knowledge/_comment_input_form.rhtml +19 -0
  124. data/app/views/knowledge/_comments.rhtml +84 -0
  125. data/app/views/knowledge/_form.rhtml +139 -0
  126. data/app/views/knowledge/_group_figure_form.rhtml +187 -0
  127. data/app/views/knowledge/_layout_figure.rhtml +61 -0
  128. data/app/views/knowledge/_layout_figures_in_a_row_above_text.rhtml +42 -0
  129. data/app/views/knowledge/_layout_figures_under_text.rhtml +45 -0
  130. data/app/views/knowledge/_layout_one_figure_above_text.rhtml +28 -0
  131. data/app/views/knowledge/_summary.rhtml +21 -0
  132. data/app/views/knowledge/edit.rhtml +37 -0
  133. data/app/views/knowledge/list.rhtml +287 -0
  134. data/app/views/knowledge/new.rhtml +23 -0
  135. data/app/views/knowledge/new_from_analysis.rhtml +21 -0
  136. data/app/views/knowledge/show.rhtml +196 -0
  137. data/app/views/layouts/gfdnavi.rhtml +105 -0
  138. data/app/views/nodes/_ancestors.html.erb +89 -0
  139. data/app/views/nodes/_description_methods_table.html.erb +75 -0
  140. data/app/views/nodes/_mode.html.erb +16 -0
  141. data/app/views/nodes/description.html.erb +181 -0
  142. data/app/views/nodes/description_methods.html.erb +1 -0
  143. data/app/views/nodes/edit.html.erb +73 -0
  144. data/app/views/nodes/index.html.erb +25 -0
  145. data/app/views/nodes/show.html.erb +20 -0
  146. data/app/views/search/_children_details_mapsearch.rhtml +68 -0
  147. data/app/views/search/_children_details_tr.rhtml +205 -0
  148. data/app/views/search/_show_grouplist.rhtml +74 -0
  149. data/app/views/search/_show_results.rhtml +43 -0
  150. data/app/views/search/_show_results_global.rhtml +36 -0
  151. data/app/views/search/_show_results_partial.rhtml +39 -0
  152. data/app/views/search/_show_results_partial_groupbyfile.rhtml +50 -0
  153. data/app/views/search/_show_variablelist.rhtml +28 -0
  154. data/app/views/search/mapsearch.rhtml +176 -0
  155. data/app/views/search/remapsearch.rjs +18 -0
  156. data/app/views/search/show_details.rhtml +3 -0
  157. data/app/views/user/add_user.rhtml +30 -0
  158. data/app/views/user/change_password.rhtml +25 -0
  159. data/app/views/user/edit.html.erb +50 -0
  160. data/app/views/user/index.rhtml +162 -0
  161. data/app/views/user/login.rhtml +41 -0
  162. data/app/views/user/logout.rhtml +4 -0
  163. data/app/views/user/signup.rhtml +36 -0
  164. data/app/views/user/signup_succeeded.rhtml +36 -0
  165. data/app/views/user_mailer/authorization_inform.rhtml +15 -0
  166. data/app/views/user_mailer/signup_accepted.rhtml +12 -0
  167. data/app/views/user_mailer/signup_confirm.rhtml +14 -0
  168. data/app/views/user_mailer/signup_inform.rhtml +13 -0
  169. data/app/views/user_mailer/signup_rejected.rhtml +11 -0
  170. data/app/views/work_flow/_push_wsdls.rhtml +55 -0
  171. data/app/views/work_flow/index.rhtml +46 -0
  172. data/config/database.yml.example +35 -0
  173. data/config/environment.rb +68 -0
  174. data/config/gfdnavi.yml.example +95 -0
  175. data/config/load_config.rb +151 -0
  176. data/config/routes.rb +35 -0
  177. data/consistency_checker.rb +129 -0
  178. data/data/gfdnavi_docs/how_to_draw_multiple_images.knlge +68 -0
  179. data/data/gfdnavi_docs/how_to_knowledge.knlge +138 -0
  180. data/data/gfdnavi_docs/how_to_write_document_about_Gfdnavi.knlge +30 -0
  181. data/data/samples/jmadata.SIGEN +8 -0
  182. data/data/samples/jmadata.yml +6 -0
  183. data/data/samples/jmadata/MSM-P/2006.nc.yml +2 -0
  184. data/data/samples/jmadata/MSM-P/2006.yml +17 -0
  185. data/data/samples/jmadata/MSM-P/2006/0101.nc +0 -0
  186. data/data/samples/jmadata/MSM-P/2006/0101.nc.yml +13 -0
  187. data/data/samples/jmadata/MSM-P/2006/0102.nc +0 -0
  188. data/data/samples/jmadata/MSM-P/2006/0103.nc +0 -0
  189. data/data/samples/jmadata/MSM-P/2006/0104.nc +0 -0
  190. data/data/samples/jmadata/MSM-P/2006/0105.nc +0 -0
  191. data/data/samples/jmadata/MSM-P/2006/010[1-3].nc.yml +2 -0
  192. data/data/samples/jmadata/MSM-P/2006/skip_data.rb +96 -0
  193. data/data/samples/jmadata/MSM-P/2006/skip_data.sh +6 -0
  194. data/data/samples/reanalysis.SIGEN +8 -0
  195. data/data/samples/reanalysis/era40.SIGEN +8 -0
  196. data/data/samples/reanalysis/era40.yml +2 -0
  197. data/data/samples/reanalysis/era40/t.jan.nc +0 -0
  198. data/data/samples/reanalysis/era40/t.jan.nc.yml +1 -0
  199. data/data/samples/reanalysis/ncep.SIGEN +9 -0
  200. data/data/samples/reanalysis/ncep/T.jan.100hPa.png +0 -0
  201. data/data/samples/reanalysis/ncep/T.jan.100hPa.png.yml +43 -0
  202. data/data/samples/reanalysis/ncep/T.jan.nc +0 -0
  203. data/data/samples/reanalysis/ncep/T.jan.zonal_mean.nc +0 -0
  204. data/data/samples/reanalysis/ncep/T.jan.zonal_mean.nc.yml +8 -0
  205. data/data/samples/reanalysis/ncep/T.jan_only_root.nc +0 -0
  206. data/data/samples/reanalysis/ncep/T.jan_only_root.nc.yml +4 -0
  207. data/data/samples/reanalysis/ncep/UV.jan.nc +0 -0
  208. data/data/samples/reanalysis/ncep/UV.jan.nc.yml +10 -0
  209. data/data/samples/reanalysis/ncep/UV.jan.nc.yml.ja +11 -0
  210. data/data/samples/sonde_operational.yml +5 -0
  211. data/data/samples/sonde_operational/std_plev.yml +12 -0
  212. data/data/samples/sonde_operational/std_plev/41256.spl.nc +0 -0
  213. data/data/samples/sonde_operational/std_plev/42410.spl.nc +0 -0
  214. data/data/samples/sonde_operational/std_plev/43333.spl.nc +0 -0
  215. data/data/samples/sonde_operational/std_plev/43346.spl.nc +0 -0
  216. data/data/samples/sonde_operational/std_plev/48698.spl.nc +0 -0
  217. data/data/samples/sonde_operational/std_plev/61641.spl.nc +0 -0
  218. data/data/samples/sonde_operational/std_plev/63741.spl.nc +0 -0
  219. data/data/samples/sonde_operational/std_plev/67083.spl.nc +0 -0
  220. data/data/samples/sonde_operational/std_plev/72261.spl.nc +0 -0
  221. data/data/samples/sonde_operational/std_plev/76805.spl.nc +0 -0
  222. data/data/samples/sonde_operational/std_plev/82193.spl.nc +0 -0
  223. data/data/samples/sonde_operational/std_plev/91165.spl.nc +0 -0
  224. data/data/samples/sonde_operational/std_plev/91610.spl.nc +0 -0
  225. data/data/samples/sonde_operational/std_plev/91948.spl.nc +0 -0
  226. data/data/samples/sonde_operational/std_plev/94294.spl.nc +0 -0
  227. data/db/NetCDFparser.rb +406 -0
  228. data/db/create_derived_spatial_attributes.sql +12 -0
  229. data/db/draw_methods/line.yml +6 -0
  230. data/db/draw_methods/scatter.yml +38 -0
  231. data/db/draw_methods/tone.yml +64 -0
  232. data/db/draw_methods/vector.yml +19 -0
  233. data/db/dump_db.rb +43 -0
  234. data/db/functions/additions.yml +10 -0
  235. data/db/functions/cut.yml +10 -0
  236. data/db/functions/division.yml +10 -0
  237. data/db/functions/mean.yml +28 -0
  238. data/db/functions/multiplication.yml +10 -0
  239. data/db/functions/stddev.yml +28 -0
  240. data/db/functions/subtraction.yml +10 -0
  241. data/db/migrate/001_initial_scheme.rb +289 -0
  242. data/db/migrate/002_add_open_id_authentication_tables.rb +20 -0
  243. data/db/register_directory_tree.rb +760 -0
  244. data/db/restore_db.rb +60 -0
  245. data/gfdnavi-install +828 -0
  246. data/install.rb +828 -0
  247. data/lib/activerecord_gfdnavi.rb +31 -0
  248. data/lib/basic_authorization.rb +50 -0
  249. data/lib/create_activeresources.rb +108 -0
  250. data/lib/execute_analysis.rb +472 -0
  251. data/lib/file_gfdnavi.rb +38 -0
  252. data/lib/gphys_gfdnavi.rb +81 -0
  253. data/lib/localdir.rb +110 -0
  254. data/lib/login_system.rb +110 -0
  255. data/lib/multibytes.rb +20 -0
  256. data/lib/narray_yaml.rb +58 -0
  257. data/lib/no_rdb_base.rb +40 -0
  258. data/lib/opendapdir.rb +171 -0
  259. data/lib/tar.rb +127 -0
  260. data/lib/tasks/clean.rake +65 -0
  261. data/lib/tasks/setup.rake +316 -0
  262. data/lib/tasks/update.rake +62 -0
  263. data/lib/vizshot_gfdnavi.rb +224 -0
  264. data/public/crossdomain.xml +4 -0
  265. data/public/flex/NodeTreeDescriptor.as +55 -0
  266. data/public/flex/TreeNode.as +253 -0
  267. data/public/flex/finder.mxml +304 -0
  268. data/public/flex/finder.swf +0 -0
  269. data/public/flex/gfdnavi.mxml +52 -0
  270. data/public/flex/gfdnavi.swf +0 -0
  271. data/public/images/Help_S-shots/dir_tree_with_add.jpg +0 -0
  272. data/public/images/analyze.gif +0 -0
  273. data/public/images/circle.gif +0 -0
  274. data/public/images/create_from_analysis_button.png +0 -0
  275. data/public/images/delete.png +0 -0
  276. data/public/images/down.png +0 -0
  277. data/public/images/drawbutton.gif +0 -0
  278. data/public/images/gfdnavi_home_logo.png +0 -0
  279. data/public/images/gfdnavi_logo_big.png +0 -0
  280. data/public/images/gfdnavi_logo_med.png +0 -0
  281. data/public/images/gfdnavi_logo_mini.png +0 -0
  282. data/public/images/gfdnavi_logo_nobg_big.png +0 -0
  283. data/public/images/gfdnavi_logo_nobg_med.png +0 -0
  284. data/public/images/gfdnavi_logo_nobg_small.png +0 -0
  285. data/public/images/gfdnavi_logo_small.png +0 -0
  286. data/public/images/gfdnavi_logo_xsmall.png +0 -0
  287. data/public/images/hbar.png +0 -0
  288. data/public/images/helpmark16.png +0 -0
  289. data/public/images/helpmark18.png +0 -0
  290. data/public/images/kikyu_g.gif +0 -0
  291. data/public/images/kikyu_r.gif +0 -0
  292. data/public/images/map_icon_g.gif +0 -0
  293. data/public/images/map_icon_r.gif +0 -0
  294. data/public/images/new_knowledge.png +0 -0
  295. data/public/images/openid.png +0 -0
  296. data/public/images/read_in_the_form.png +0 -0
  297. data/public/images/slider_f.gif +0 -0
  298. data/public/images/slider_f_red.gif +0 -0
  299. data/public/images/star1.gif +0 -0
  300. data/public/images/star2.gif +0 -0
  301. data/public/images/startanim.gif +0 -0
  302. data/public/images/stopanim.gif +0 -0
  303. data/public/images/tree/DL.png +0 -0
  304. data/public/images/tree/anal_viz.png +0 -0
  305. data/public/images/tree/analyze_visualize_checked_items.png +0 -0
  306. data/public/images/tree/binary.png +0 -0
  307. data/public/images/tree/details.png +0 -0
  308. data/public/images/tree/download_checked_items.png +0 -0
  309. data/public/images/tree/folder.png +0 -0
  310. data/public/images/tree/folder_close.gif +0 -0
  311. data/public/images/tree/image2.png +0 -0
  312. data/public/images/tree/knowledge.png +0 -0
  313. data/public/images/tree/knowledges.png +0 -0
  314. data/public/images/tree/last.gif +0 -0
  315. data/public/images/tree/last.png +0 -0
  316. data/public/images/tree/minus.gif +0 -0
  317. data/public/images/tree/minus_simple.gif +0 -0
  318. data/public/images/tree/none.gif +0 -0
  319. data/public/images/tree/none.png +0 -0
  320. data/public/images/tree/plus.gif +0 -0
  321. data/public/images/tree/plus_simple.gif +0 -0
  322. data/public/images/tree/show.png +0 -0
  323. data/public/images/tree/show_checked_items.png +0 -0
  324. data/public/images/tree/t.gif +0 -0
  325. data/public/images/tree/t.png +0 -0
  326. data/public/images/tree/tate.gif +0 -0
  327. data/public/images/tree/tate.png +0 -0
  328. data/public/images/up.png +0 -0
  329. data/public/images/vbar.png +0 -0
  330. data/public/images/white.bmp +0 -0
  331. data/public/images/x.gif +0 -0
  332. data/public/index.html +100 -0
  333. data/public/javascripts/AC_OETags.js +269 -0
  334. data/public/javascripts/analysis.js +751 -0
  335. data/public/javascripts/application.js +29 -0
  336. data/public/javascripts/directory_tree.js +102 -0
  337. data/public/javascripts/draw_method.js +83 -0
  338. data/public/javascripts/excanvas.js +704 -0
  339. data/public/javascripts/function.js +107 -0
  340. data/public/javascripts/gfdnavi.js +175 -0
  341. data/public/javascripts/knowledge.js +384 -0
  342. data/public/javascripts/mapsearch.js +313 -0
  343. data/public/javascripts/progress.js +42 -0
  344. data/public/javascripts/resizable_box.js +164 -0
  345. data/public/javascripts/slider.js +260 -0
  346. data/public/javascripts/tab.js +17 -0
  347. data/public/javascripts/work_flow.js +452 -0
  348. data/public/stylesheets/analysis.css +111 -0
  349. data/public/stylesheets/description.css +71 -0
  350. data/public/stylesheets/gfdnavi.css +141 -0
  351. data/public/stylesheets/knowledge.css +218 -0
  352. data/public/stylesheets/search.css +184 -0
  353. data/public/stylesheets/tree.css +45 -0
  354. data/public/stylesheets/tree_for_ie.css +3 -0
  355. data/public/stylesheets/work_flow.css +78 -0
  356. data/script/cleaner +11 -0
  357. data/script/server_ssl +131 -0
  358. data/test/fixtures/diagram_cache_data.yml +5 -0
  359. data/test/fixtures/diagram_cache_sessions.yml +6 -0
  360. data/test/fixtures/diagram_caches.yml +6 -0
  361. data/test/fixtures/directories.yml +57 -0
  362. data/test/fixtures/draw_parameters.yml +6 -0
  363. data/test/fixtures/function_arguments.yml +15 -0
  364. data/test/fixtures/function_outputs.yml +15 -0
  365. data/test/fixtures/functions.yml +29 -0
  366. data/test/fixtures/group_members.yml +33 -0
  367. data/test/fixtures/groups.yml +25 -0
  368. data/test/fixtures/images.yml +12 -0
  369. data/test/fixtures/keyword_attributes.yml +73 -0
  370. data/test/fixtures/knowledges.yml +10 -0
  371. data/test/fixtures/node_relations.yml +11 -0
  372. data/test/fixtures/nodes.yml +298 -0
  373. data/test/fixtures/sign_up_users.yml +8 -0
  374. data/test/fixtures/spatial_and_time_attributes.yml +29 -0
  375. data/test/fixtures/user_mailer/authorization_inform +11 -0
  376. data/test/fixtures/user_mailer/signup_accepted +10 -0
  377. data/test/fixtures/user_mailer/signup_confirm +17 -0
  378. data/test/fixtures/user_mailer/signup_inform +10 -0
  379. data/test/fixtures/user_mailer/signup_rejected +9 -0
  380. data/test/fixtures/users.yml +31 -0
  381. data/test/fixtures/value_types.yml +10 -0
  382. data/test/fixtures/variables.yml +17 -0
  383. data/test/functional/analysis_controller_test.rb +169 -0
  384. data/test/functional/description_controller_test.rb +18 -0
  385. data/test/functional/function_controller_test.rb +18 -0
  386. data/test/functional/group_controller_test.rb +18 -0
  387. data/test/functional/search_controller_test.rb +83 -0
  388. data/test/functional/user_controller_test.rb +77 -0
  389. data/test/functional/webservice_analysis_api_test.rb +12 -0
  390. data/test/functional/work_flow_controller_test.rb +18 -0
  391. data/test/test_helper.rb +28 -0
  392. data/test/unit/diagram_cache_datum_test.rb +10 -0
  393. data/test/unit/diagram_cache_session_test.rb +10 -0
  394. data/test/unit/diagram_cache_test.rb +10 -0
  395. data/test/unit/directory_test.rb +49 -0
  396. data/test/unit/draw_parameter_test.rb +10 -0
  397. data/test/unit/function_argument_test.rb +10 -0
  398. data/test/unit/function_output_test.rb +10 -0
  399. data/test/unit/function_test.rb +10 -0
  400. data/test/unit/group_test.rb +48 -0
  401. data/test/unit/image_test.rb +13 -0
  402. data/test/unit/keyword_attribute_test.rb +33 -0
  403. data/test/unit/knowledge_test.rb +13 -0
  404. data/test/unit/node_relation_test.rb +20 -0
  405. data/test/unit/node_test.rb +85 -0
  406. data/test/unit/sign_up_user_test.rb +20 -0
  407. data/test/unit/spatial_and_time_attribute_test.rb +29 -0
  408. data/test/unit/user_mailer_test.rb +101 -0
  409. data/test/unit/user_test.rb +134 -0
  410. data/test/unit/value_type_test.rb +10 -0
  411. data/test/unit/variable_test.rb +35 -0
  412. data/vendor/plugins/acts_as_list/README +23 -0
  413. data/vendor/plugins/acts_as_list/init.rb +3 -0
  414. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
  415. data/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
  416. data/vendor/plugins/acts_as_tree/README +26 -0
  417. data/vendor/plugins/acts_as_tree/Rakefile +22 -0
  418. data/vendor/plugins/acts_as_tree/init.rb +1 -0
  419. data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
  420. data/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
  421. data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
  422. data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
  423. data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
  424. data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
  425. data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
  426. data/vendor/plugins/will_paginate/CHANGELOG +92 -0
  427. data/vendor/plugins/will_paginate/LICENSE +18 -0
  428. data/vendor/plugins/will_paginate/README.rdoc +131 -0
  429. data/vendor/plugins/will_paginate/Rakefile +62 -0
  430. data/vendor/plugins/will_paginate/examples/apple-circle.gif +0 -0
  431. data/vendor/plugins/will_paginate/examples/index.haml +69 -0
  432. data/vendor/plugins/will_paginate/examples/index.html +92 -0
  433. data/vendor/plugins/will_paginate/examples/pagination.css +90 -0
  434. data/vendor/plugins/will_paginate/examples/pagination.sass +91 -0
  435. data/vendor/plugins/will_paginate/init.rb +1 -0
  436. data/vendor/plugins/will_paginate/lib/will_paginate.rb +86 -0
  437. data/vendor/plugins/will_paginate/lib/will_paginate/array.rb +16 -0
  438. data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +145 -0
  439. data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +32 -0
  440. data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +247 -0
  441. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb +132 -0
  442. data/vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb +39 -0
  443. data/vendor/plugins/will_paginate/lib/will_paginate/version.rb +9 -0
  444. data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +373 -0
  445. data/vendor/plugins/will_paginate/will_paginate.gemspec +21 -0
  446. metadata +586 -0
@@ -0,0 +1,12 @@
1
+ create view derived_spatial_attributes
2
+ as
3
+ select s2.id,s.variable_id,s2.directory_id,s2.longitude_lb,s2.latitude_lb,
4
+ s2.longitude_rt,s2.latitude_rt,s2.lon_ax_name,s2.lat_ax_name
5
+ from spatial_attributes s, spatial_attributes s2, variables v, directories d
6
+ where s.longitude_lb=0 and s.latitude_lb=0 and s.longitude_rt=0 and s.latitude_rt=0
7
+ and v.id = s.variable_id and v.directory_id = d.id and d.id = s2.directory_id
8
+ union
9
+ select *
10
+ from spatial_attributes
11
+ where not(longitude_lb=0 and latitude_lb=0 and longitude_rt=0 and latitude_rt=0)
12
+ and not(variable_id IS NULL);
@@ -0,0 +1,6 @@
1
+ :name: line
2
+ :description: line plot
3
+ :ndims: 1
4
+ :nvars: 1
5
+ :vizshot_method: line
6
+ :attributes: []
@@ -0,0 +1,38 @@
1
+ :name: scatter
2
+ :description: scatter plot
3
+ :ndims: 1
4
+ :nvars: 2
5
+ :vizshot_method: scatter
6
+ :attributes: []
7
+ :script: |
8
+ newfrm = opt.delete(:newfrm)
9
+ GGraph::scatter(gphys, gphys1, newfrm, opt)
10
+
11
+ :ggraph: |
12
+ gropn_1_if_not_yet
13
+ unless defined?(@@scater_options)
14
+ @@scater_options = Misc::KeywordOptAutoHelp.new(
15
+ ['title', nil, 'Title of the figure'],
16
+ ['annotate', true, 'if false, do not put texts on the right margin even when newframe==true'],
17
+ ['index', 1, 'mark index'],
18
+ ['type', 2, 'mark type'],
19
+ ['size', 0.01, 'marks size']
20
+ )
21
+ end
22
+ opts = @@scater_options.interpret(options)
23
+ gphys = gphys.first1D.copy
24
+ gphys1 = gphys1.first1D.copy
25
+ len = gphys.length
26
+ unless len == gphys1.length
27
+ raise ArgumentError, "length of gphys and gphys1 do not agree with each other"
28
+ end
29
+ x = gphys.data
30
+ y = gphys1.data
31
+ if newframe
32
+ fig(x,y)
33
+ axes(x,y)
34
+ title( opts['title'] )
35
+ annotate(gphys.lost_axes) if opts['annotate']
36
+ end
37
+ DCL::uumrkz(x.val, y.val, opts['type'], opts['index'], opts['size'])
38
+
@@ -0,0 +1,64 @@
1
+ :name: tone
2
+ :description: tone and contour plot
3
+ :ndims: 2
4
+ :nvars: 1
5
+ :vizshot_method: tone_cont
6
+ :setting_html: |
7
+ <div>
8
+ <%= check_box("analysis", "tone_tone") %>
9
+ <label for="analysis_tone">Draw tone</label>
10
+ <%= check_box("analysis", "tone_contour") %>
11
+ <label for="analysis_contour">Draw contour</label>
12
+ <br/>
13
+ <label for="analysis_min">minimum tone level</label>
14
+ <%= text_field("analysis", "tone_min", :size => 4, :maxlength => 12) %>
15
+ <br/>
16
+ <label for="analysis_max">maximum tone level</label>
17
+ <%= text_field("analysis", "tone_max", :size => 4, :maxlength => 12) %>
18
+ <br/>
19
+ <label for="analysis_nlev">num of tone levels</label>
20
+ <%= text_field("analysis", "tone_nlev", :size => 2, :maxlength => 2) %>
21
+ <br/>
22
+ <%= check_box("analysis", "tone_log") %>
23
+ <label for="Color bar">Logarithmic levels</label>
24
+ <br/>
25
+ <label for="analysis_levels">comma-separated tone levels:</label>
26
+ <%= text_field("analysis", "tone_levels", :size => 30, :maxlength => 200) %>
27
+ <br/>
28
+ <%= check_box("analysis", "tone_color_bar") %>
29
+ <label for="Color bar">Color bar</label>
30
+ </div>
31
+
32
+ :attributes:
33
+ - :name: tone
34
+ :default: true
35
+ :type: boolean
36
+ :parser: vizshot
37
+ - :name: contour
38
+ :default: true
39
+ :type: boolean
40
+ :parser: vizshot
41
+ - :name: min
42
+ :type: float
43
+ :optional: true
44
+ :parser: ggraph
45
+ - :name: max
46
+ :type: float
47
+ :optional: true
48
+ :parser: ggraph
49
+ - :name: nlev
50
+ :type: int
51
+ :optional: true
52
+ :parser: ggraph
53
+ - :name: levels
54
+ :type: array_float
55
+ :optional: true
56
+ :parser: ggraph
57
+ - :name: color_bar
58
+ :default: true
59
+ :type: boolean
60
+ :parser: vizshot
61
+ - :name: log
62
+ :default: false
63
+ :type: boolean
64
+ :parser: ggraph
@@ -0,0 +1,19 @@
1
+ :name: vector
2
+ :description: vector plot
3
+ :ndims: 2
4
+ :nvars: 2
5
+ :vizshot_method: vector
6
+ :attributes: []
7
+ :setting_html: |
8
+ <%
9
+ @order_type = "vector"
10
+ @order_names = %w(X Y)
11
+ @num_for_each = 2
12
+ @group_name = "diagram"
13
+ @order = @analysis.draw_variables_order
14
+ %>
15
+ <div>
16
+ X-Y component
17
+ <%= render(:partial => "variables_order") %>
18
+ </div>
19
+
data/db/dump_db.rb ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), "..", "config", "environment")
4
+
5
+ tables = %w( functions function_outputs value_types function_arguments
6
+ diagram_caches diagram_cache_data diagram_cache_sessions
7
+ )
8
+
9
+ hash = Hash.new
10
+
11
+ exist_tables = ActiveRecord::Base.connection.tables
12
+ tables.each do |table_name|
13
+
14
+ model_name = table_name.classify
15
+ model_name += "e" if table_name == "diagram_caches"
16
+ if exist_tables.include?(table_name)
17
+ ar = ActiveRecord.class_eval(model_name)
18
+ ary = Array.new
19
+ ar.find(:all).each{|row|
20
+ ary.push row.attributes
21
+ }
22
+ hash[ar.table_name] = ary if ary.length > 0
23
+ end
24
+
25
+ end
26
+
27
+ if hash.length == 0
28
+ exit
29
+ end
30
+
31
+ dt = DateTime.now
32
+ fname = File.join(File.dirname(__FILE__),
33
+ "database_save-#{dt.year}#{"%02i"%dt.month}#{"%02i"%dt.day}#{"%02i"%dt.hour}#{"%02i"%dt.min}#{"%02i"%dt.sec}")
34
+
35
+ if File.exist?(fname)
36
+ abort "file already exists: #{File.basename(fname)}"
37
+ end
38
+
39
+ File.open(fname, "w"){|file|
40
+ file.write hash.to_yaml
41
+ }
42
+
43
+ print "sucessed to dump database data to #{fname}\n"
@@ -0,0 +1,10 @@
1
+ :name: addition
2
+ :description: add two data
3
+ :nvars: 2
4
+ :script: |
5
+ [gphys0 + gphys1]
6
+
7
+ :outputs:
8
+ - :name: sum
9
+ :subscript: sum
10
+ :description: sum of two data
@@ -0,0 +1,10 @@
1
+ :name: cut
2
+ :description: cut out a subset of data
3
+ :nvars: 1
4
+ :script: |
5
+ [gphys0.copy]
6
+
7
+ :outputs:
8
+ - :name: subset
9
+ :subscript: sub
10
+ :description: a subset
@@ -0,0 +1,10 @@
1
+ :name: division
2
+ :description: division a data by the other
3
+ :nvars: 2
4
+ :script: |
5
+ [gphys0 / gphys1]
6
+
7
+ :outputs:
8
+ - :name: quotient
9
+ :subscript: quot
10
+ :description: quotient of two data
@@ -0,0 +1,28 @@
1
+ :name: mean
2
+ :description: averaging on the specific dimensions
3
+ :nvars: 1
4
+ :script: |
5
+ [gphys0.mean(*arg0)]
6
+
7
+ :setting_html: |
8
+ <label for="analysis[function_arguments][0]">
9
+ the dimensions for mean
10
+ </label>
11
+ <select id="analysis[function_arguments][0]" name="analysis[function_arguments][0][]" multiple>
12
+ <%
13
+ @analysis.dimensions.each{|dim|
14
+ dname = dim[:name]
15
+ %>
16
+ <option <%=@analysis.function_arguments[0]==dname ? "selected" : ""%>><%=h(dname)%></option>
17
+ <% } %>
18
+ </select>
19
+
20
+ :arguments:
21
+ - :description: the dimension for mean
22
+ :value_type: array_string
23
+ :default: []
24
+ :position: 0
25
+ :outputs:
26
+ - :name: mean
27
+ :subscript: mean
28
+ :description: mean
@@ -0,0 +1,10 @@
1
+ :name: multiplication
2
+ :description: multiplication of two data
3
+ :nvars: 2
4
+ :script: |
5
+ [gphys0 * gphys1]
6
+
7
+ :outputs:
8
+ - :name: product
9
+ :subscript: prod
10
+ :description: product of two data
@@ -0,0 +1,28 @@
1
+ :name: stddev
2
+ :description: the first dimensional standard deviation
3
+ :nvars: 1
4
+ :script: |
5
+ [gphys0.stddev(*arg0)]
6
+
7
+ :setting_html: |
8
+ <label for="analysis[function_arguments][0]">
9
+ the dimensions for stddev
10
+ </label>
11
+ <select id="analysis[function_arguments][0]" name="analysis[function_arguments][0][]" multiple>
12
+ <%
13
+ @analysis.dimensions.each{|dim|
14
+ dname = dim[:name]
15
+ %>
16
+ <option <%=@analysis.function_arguments[0]==dname ? "selected" : ""%>><%=h(dname)%></option>
17
+ <% } %>
18
+ </select>
19
+
20
+ :arguments:
21
+ - :description: the dimension for standard deviation
22
+ :value_type: array_string
23
+ :default: []
24
+ :position: 0
25
+ :outputs:
26
+ - :name: stddev
27
+ :subscript: stddev
28
+ :description: standard deviation
@@ -0,0 +1,10 @@
1
+ :name: subtraction
2
+ :description: subtraction a data from the other
3
+ :nvars: 2
4
+ :script: |
5
+ [gphys0 - gphys1]
6
+
7
+ :outputs:
8
+ - :name: difference
9
+ :subscript: diff
10
+ :description: difference of two data
@@ -0,0 +1,289 @@
1
+ class InitialScheme < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ create_table "nodes", :force => true do |t|
5
+ t.column "parent_id", :integer
6
+ t.column "name", :string, :null => false
7
+ t.column "path", :string, :null => false
8
+ t.column "node_type", :integer, :null => false
9
+ # 0: directory
10
+ # 1: variable, 2: image
11
+ # 3: knowledge, 4: function, 5: draw_method
12
+ t.column "mtime", :datetime, :null => false
13
+ t.column "owner_id", :integer, :null => false
14
+ t.column "other_mode", :integer, :default => 4, :null => false
15
+ t.column "rgroups", :integer, :length => 12, :default => 0 # 64bit
16
+ t.column "wgroups", :integer, :length => 12, :default => 0 # 64bit
17
+ t.column "size", :integer, :length => 12 # 64bit
18
+ t.column "guest_owner_id", :integer
19
+ t.column "file", :string
20
+ t.column "other_readable", :boolean, :null => false
21
+ t.column "groups_readable", :integer, :length=>12, :null=>false #64bit
22
+ t.string "title", :null => true
23
+ t.text "description", :null => true
24
+ t.timestamps
25
+ end
26
+ add_index :nodes, :path, :unique => true
27
+
28
+ create_table "guest_owners", :force => true do |t|
29
+ t.column "name", :string, :null => false
30
+ t.column "email", :string
31
+ t.column "identifier", :string, :null => false
32
+ end
33
+
34
+ create_table "directories", :force => true do |t|
35
+ t.column "node_id", :integer, :null => false
36
+ t.column "plain_file", :boolean, :default => false, :null => false
37
+ t.column "downloadable", :boolean, :default => true, :null => false
38
+ end
39
+
40
+ create_table "actual_files", :force => true do |t|
41
+ t.column "variable_id", :integer, :null => false
42
+ t.column "path", :string, :null => false
43
+ end
44
+
45
+ create_table "variables", :force => true do |t|
46
+ t.column "node_id", :integer, :null => false
47
+ end
48
+
49
+ create_table "images", :force => true do |t|
50
+ t.column "node_id", :integer, :null => false
51
+ t.column "vizshot", :text
52
+ end
53
+
54
+ create_table "knowledges", :force => true do |t|
55
+ t.column "node_id", :integer, :null => false
56
+ t.column "category", :string, :null => false
57
+ # t.column "title", :string, :null => false
58
+ t.column "creator", :string
59
+ t.column "textbody", :text, :null => false
60
+ t.column "description", :text
61
+ t.column "default_layout", :integer, :null => false
62
+ t.column "horizontal_figures", :integer, :null => false
63
+ t.column "figures_size_status", :integer, :null => false
64
+ # �w�肵���}�̑傫���̒P�ʂƁA�c�����A0�`3�̐����l�ŕ\��
65
+ # | height | width
66
+ # % | 00 | 01
67
+ # px | 10 | 11
68
+ t.column "figures_size_number", :integer, :null => false
69
+ t.column "comment_on", :integer # �R�����g���ɂȂ���Knowledge��node_id���i�[
70
+ t.column "comment_number", :integer # ���Ԗڂ̃R�����g��
71
+ end
72
+
73
+ create_table "knowledge_figures", :force => true do |t|
74
+ t.column "knowledge_id", :integer
75
+ t.column "image_id", :integer
76
+ t.column "caption", :text, :null => false
77
+ end
78
+
79
+ create_table "knowledge_backups", :force => true do |t|
80
+ t.column "title", :string, :null => false
81
+ t.column "creator", :string
82
+ t.column "textbody", :text, :null => false
83
+ t.column "description", :text
84
+ t.column "default_layout", :integer, :null => false
85
+ t.column "horizontal_figures", :integer, :null => false
86
+ t.column "figures_size_status", :integer, :null => false
87
+ t.column "figures_size_number", :integer, :null => false
88
+ t.column "comment_on", :integer
89
+ t.column "comment_number", :integer
90
+ t.column "mtime", :datetime, :null => false
91
+ t.column "backup_on", :string, :null => false
92
+ t.column "version_number", :integer, :null => false
93
+ t.column "temporary", :boolean, :null => false
94
+ t.column "owner_id", :integer, :null => false
95
+ t.column "rgroups", :integer, :length => 12, :default => 0 # 64bit
96
+ t.column "other_mode", :integer, :default => 4, :null => false
97
+ end
98
+
99
+ create_table "knowledge_figure_backups", :force => true do |t|
100
+ t.column "knowledge_backup_id", :integer, :null => false
101
+ t.column "image_id", :integer
102
+ t.column "caption", :text, :null => false
103
+ end
104
+
105
+ create_table "node_relations", :force => true do |t|
106
+ t.column "name", :text, :null => false
107
+ t.column "reference", :integer, :null => false
108
+ t.column "referenced_by", :integer, :null => false
109
+ end
110
+ add_index :node_relations, :reference
111
+ add_index :node_relations, :referenced_by
112
+
113
+ create_table "keyword_attributes", :force => true do |t|
114
+ t.column "node_id", :integer, :null => false
115
+ t.column "name", :string, :null => false
116
+ t.column "value", :text
117
+ t.column "num_value", :binary
118
+ t.column "lang", :string
119
+ end
120
+
121
+ create_table "spatial_and_time_attributes", :force => true do |t|
122
+ t.column "node_id", :integer, :null => false
123
+ t.column "longitude_lb", :float, :default => nil
124
+ t.column "latitude_lb", :float, :default => nil
125
+ t.column "longitude_rt", :float, :default => nil
126
+ t.column "latitude_rt", :float, :default => nil
127
+ t.column "starttime", :datetime, :default => nil
128
+ t.column "endtime", :datetime, :default => nil
129
+ end
130
+
131
+ create_table "value_types", :force => true do |t|
132
+ t.column "name", :string, :null => false
133
+ end
134
+
135
+ create_table "functions", :force => true do |t|
136
+ t.column "node_id", :integer, :null => false
137
+ t.column "description", :text
138
+ t.column "nvars", :integer, :null => false
139
+ t.column "script", :text, :null => false
140
+ t.column "setting_html", :text
141
+ t.column "default", :boolean, :default => false
142
+ end
143
+
144
+ create_table "function_outputs", :force => true do |t|
145
+ t.column "function_id", :integer, :null => false
146
+ t.column "name", :string, :null => false
147
+ t.column "description", :text
148
+ t.column "subscript", :string, :null => false
149
+ t.column "position", :integer
150
+ end
151
+
152
+ create_table "function_arguments", :force => true do |t|
153
+ t.column "function_id", :integer, :null => false
154
+ t.column "description", :text
155
+ t.column "value_type_id", :integer, :null => false
156
+ t.column "default", :string
157
+ t.column "position", :integer
158
+ end
159
+
160
+ create_table "draw_methods", :force => true do |t|
161
+ t.column "node_id", :integer, :null => false
162
+ t.column "description", :text
163
+ t.column "ndims", :integer, :null => false
164
+ t.column "nvars", :integer, :null => false
165
+ t.column "vizshot_method", :string, :null => false
166
+ t.column "script", :text
167
+ t.column "ggraph", :text
168
+ t.column "setting_html", :text
169
+ t.column "default", :boolean, :default => false
170
+ end
171
+
172
+ create_table "draw_method_attributes", :force => true do |t|
173
+ t.column "draw_method_id", :integer, :null => false
174
+ t.column "name", :string, :null => false
175
+ t.column "value_type_id", :integer, :null => false
176
+ t.column "default", :string
177
+ t.column "optional", :boolean, :default => false, :null => false
178
+ t.column "parser", :string
179
+ end
180
+
181
+ create_table "users", :force => true do |t|
182
+ t.column "login", :string, :null => false
183
+ t.column "password", :string, :null => false
184
+ t.column "full_name", :string, :null => false
185
+ t.column "email_address", :string, :null => false
186
+ t.column "affiliation", :string, :null => false
187
+ t.column "super_user", :boolean, :default => false, :null => false
188
+ t.column "groups", :integer, :length => 12, :default => 0
189
+ # t.column "openid", :boolean
190
+ t.column "internal_user", :boolean, :default => false, :null => false
191
+ end
192
+
193
+ create_table "sign_up_users", :force => true do |t|
194
+ t.column "login", :string, :null => false
195
+ t.column "password", :string, :null => false
196
+ t.column "full_name", :string, :null => false
197
+ t.column "email_address", :string, :null => false
198
+ t.column "affiliation", :string, :null => false
199
+ # t.column "openid", :boolean
200
+ end
201
+
202
+ create_table "groups", :force => true do |t|
203
+ t.column "name", :string, :null => false
204
+ t.column "owner_id", :integer, :null => false
205
+ t.column "description", :string, :null => true
206
+ end
207
+
208
+ ## create_table "group_members", :force => true do |t|
209
+ ## t.column "group_id", :integer, :null => false
210
+ ## t.column "user_id", :integer, :null => false
211
+ ## end
212
+
213
+ create_table "diagram_caches", :force => true do |t|
214
+ t.column "vizshot", :text, :null => false
215
+ t.column "path", :string, :null => false
216
+ t.column "label", :string, :null => false
217
+ end
218
+
219
+ create_table "diagram_cache_data", :force => true do |t|
220
+ t.column "diagram_cache_id", :integer, :null => false
221
+ t.column "variable_id", :integer, :null => false
222
+ end
223
+
224
+ create_table "diagram_cache_sessions", :force => true do |t|
225
+ t.column "diagram_cache_id", :integer, :null => false
226
+ t.column "session", :string, :null => false
227
+ t.column "share", :boolean, :default => true, :null => false
228
+ end
229
+
230
+ create_table "draw_parameters", :force => true do |t|
231
+ t.column "node_id", :integer, :null => false
232
+ t.column "name", :string, :null => false
233
+ t.column "value", :string, :null => false
234
+ end
235
+
236
+ create_table "query_histories", :force => true do |t|
237
+ t.column "args", :string
238
+ t.column "querytype", :string
239
+ t.column "user_id", :integer
240
+ t.column "time", :datetime
241
+ t.column "description", :string
242
+ t.column "queryset_id", :int
243
+ t.column "conditions", :text
244
+ t.column "count", :integer
245
+ t.column "session_id", :string
246
+ end
247
+
248
+ create_table "node_lineages", :force => true do |t|
249
+ t.column "ancestor", :integer, :null=>false
250
+ t.column "descendant", :integer, :null=>false
251
+ t.column "rel_depth", :integer, :default=>1, :null=>false
252
+ end
253
+ add_index :node_lineages, :ancestor
254
+ add_index :node_lineages, :descendant
255
+
256
+ end
257
+
258
+ def self.down
259
+
260
+ drop_table(:nodes) rescue nil
261
+ drop_table(:guest_owners) rescue nil
262
+ drop_table(:directories) rescue nil
263
+ drop_table(:actual_files) rescue nil
264
+ drop_table(:variables) rescue nil
265
+ drop_table(:images) rescue nil
266
+ drop_table(:knowledges) rescue nil
267
+ drop_table(:knowledge_figures) rescue nil
268
+ drop_table(:node_relations) rescue nil
269
+ drop_table(:keyword_attributes) rescue nil
270
+ drop_table(:spatial_and_time_attributes) rescue nil
271
+ drop_table(:draw_method_attributes) rescue nil
272
+ drop_table(:draw_methods) rescue nil
273
+ drop_table(:function_outputs) rescue nil
274
+ drop_table(:function_arguments) rescue nil
275
+ drop_table(:functions) rescue nil
276
+ drop_table(:value_types) rescue nil
277
+ drop_table(:users) rescue nil
278
+ drop_table(:sign_up_users) rescue nil
279
+ drop_table(:groups) rescue nil
280
+ ## drop_table(:group_members) rescue nil
281
+ drop_table(:diagram_caches) rescue nil
282
+ drop_table(:diagram_cache_data) rescue nil
283
+ drop_table(:diagram_cache_sessions) rescue nil
284
+ drop_table(:draw_parameters) rescue nil
285
+ drop_table(:query_histories) rescue nil
286
+ drop_table(:node_lineages) rescue nil
287
+
288
+ end
289
+ end