talia_core 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data/VERSION.yml +4 -0
  2. data/config/database.yml +19 -0
  3. data/config/database.yml.example +35 -0
  4. data/config/rdfstore.yml +13 -0
  5. data/config/rdfstore.yml.example +13 -0
  6. data/config/rdfstore.yml.rdflite_example +16 -0
  7. data/config/rdfstore.yml.redland_example +46 -0
  8. data/config/talia_core.yml +14 -0
  9. data/config/talia_core.yml.example +42 -0
  10. data/generators/generator_helpers.rb +49 -0
  11. data/generators/talia_admin/USAGE +1 -0
  12. data/generators/talia_admin/talia_admin_generator.rb +19 -0
  13. data/generators/talia_admin/templates/controllers/admin/background_controller.rb +50 -0
  14. data/generators/talia_admin/templates/controllers/admin/custom_templates_controller.rb +25 -0
  15. data/generators/talia_admin/templates/controllers/admin/locales_controller.rb +15 -0
  16. data/generators/talia_admin/templates/controllers/admin/sources_controller.rb +71 -0
  17. data/generators/talia_admin/templates/controllers/admin/translations_controller.rb +61 -0
  18. data/generators/talia_admin/templates/controllers/admin/users_controller.rb +48 -0
  19. data/generators/talia_admin/templates/controllers/admin_controller.rb +7 -0
  20. data/generators/talia_admin/templates/helpers/admin/background_helper.rb +60 -0
  21. data/generators/talia_admin/templates/helpers/admin/custom_templates_helper.rb +5 -0
  22. data/generators/talia_admin/templates/helpers/admin/locales_helper.rb +2 -0
  23. data/generators/talia_admin/templates/helpers/admin/sources_helper.rb +65 -0
  24. data/generators/talia_admin/templates/helpers/admin/translations_helper.rb +51 -0
  25. data/generators/talia_admin/templates/helpers/admin/users_helper.rb +2 -0
  26. data/generators/talia_admin/templates/helpers/admin_helper.rb +11 -0
  27. data/generators/talia_admin/templates/public/images/backend/body_bg.gif +0 -0
  28. data/generators/talia_admin/templates/public/images/backend/footer_bg.gif +0 -0
  29. data/generators/talia_admin/templates/public/images/backend/header.jpg +0 -0
  30. data/generators/talia_admin/templates/public/images/backend/header_bg.gif +0 -0
  31. data/generators/talia_admin/templates/public/images/backend/menu.jpg +0 -0
  32. data/generators/talia_admin/templates/public/images/backend/menu_bg.gif +0 -0
  33. data/generators/talia_admin/templates/public/images/backend/opednid.gif +0 -0
  34. data/generators/talia_admin/templates/public/images/backend/page_bg.jpg +0 -0
  35. data/generators/talia_admin/templates/public/images/backend/triangolino.gif +0 -0
  36. data/generators/talia_admin/templates/public/images/backend/triangolino_full.gif +0 -0
  37. data/generators/talia_admin/templates/public/javascripts/backend.js +24 -0
  38. data/generators/talia_admin/templates/public/javascripts/lowpro.js +321 -0
  39. data/generators/talia_admin/templates/public/stylesheets/backend.css +466 -0
  40. data/generators/talia_admin/templates/test/fixtures/users.yml +32 -0
  41. data/generators/talia_admin/templates/test/functional/admin/custom_templates_controller_test.rb +8 -0
  42. data/generators/talia_admin/templates/test/functional/admin/locales_controller_test.rb +35 -0
  43. data/generators/talia_admin/templates/test/functional/admin/sources_controller_test.rb +109 -0
  44. data/generators/talia_admin/templates/test/functional/admin/translations_controller_test.rb +93 -0
  45. data/generators/talia_admin/templates/test/functional/admin/users_controller_test.rb +67 -0
  46. data/generators/talia_admin/templates/test/functional/admin_controller_test.rb +15 -0
  47. data/generators/talia_admin/templates/test/unit/user_test.rb +134 -0
  48. data/generators/talia_admin/templates/views/admin/background/_finished.html.erb +9 -0
  49. data/generators/talia_admin/templates/views/admin/background/_pending.html.erb +1 -0
  50. data/generators/talia_admin/templates/views/admin/background/_progress.html.erb +15 -0
  51. data/generators/talia_admin/templates/views/admin/background/_running.html.erb +11 -0
  52. data/generators/talia_admin/templates/views/admin/background/environment.html.erb +12 -0
  53. data/generators/talia_admin/templates/views/admin/background/show.html.erb +17 -0
  54. data/generators/talia_admin/templates/views/admin/background/stderr.html.erb +6 -0
  55. data/generators/talia_admin/templates/views/admin/background/stdin.html.erb +6 -0
  56. data/generators/talia_admin/templates/views/admin/background/stdout.html.erb +6 -0
  57. data/generators/talia_admin/templates/views/admin/custom_templates/_content_form_column.rhtml +2 -0
  58. data/generators/talia_admin/templates/views/admin/custom_templates/_template_type_form_column.rhtml +2 -0
  59. data/generators/talia_admin/templates/views/admin/index.html.erb +5 -0
  60. data/generators/talia_admin/templates/views/admin/locales/new.html.erb +9 -0
  61. data/generators/talia_admin/templates/views/admin/sources/_data.html.erb +6 -0
  62. data/generators/talia_admin/templates/views/admin/sources/_data_form.html.erb +15 -0
  63. data/generators/talia_admin/templates/views/admin/sources/_form.html.erb +7 -0
  64. data/generators/talia_admin/templates/views/admin/sources/_list.html.erb +3 -0
  65. data/generators/talia_admin/templates/views/admin/sources/_notice.html.erb +1 -0
  66. data/generators/talia_admin/templates/views/admin/sources/_predicate.html.erb +22 -0
  67. data/generators/talia_admin/templates/views/admin/sources/_predicates.html.erb +15 -0
  68. data/generators/talia_admin/templates/views/admin/sources/_sources.html.erb +17 -0
  69. data/generators/talia_admin/templates/views/admin/sources/_upload.html.erb +6 -0
  70. data/generators/talia_admin/templates/views/admin/sources/edit.html.erb +6 -0
  71. data/generators/talia_admin/templates/views/admin/sources/index.html.erb +5 -0
  72. data/generators/talia_admin/templates/views/admin/translations/_new_translation.html.erb +7 -0
  73. data/generators/talia_admin/templates/views/admin/translations/_translation.html.erb +10 -0
  74. data/generators/talia_admin/templates/views/admin/translations/edit.html.erb +16 -0
  75. data/generators/talia_admin/templates/views/admin/users/_form.html.erb +10 -0
  76. data/generators/talia_admin/templates/views/admin/users/_form_roles.html.erb +8 -0
  77. data/generators/talia_admin/templates/views/admin/users/edit.html.erb +12 -0
  78. data/generators/talia_admin/templates/views/admin/users/index.html.erb +22 -0
  79. data/generators/talia_admin/templates/views/admin/users/new.html.erb +5 -0
  80. data/generators/talia_admin/templates/views/admin/users/show.html.erb +6 -0
  81. data/generators/talia_admin/templates/views/layouts/admin.html.erb +56 -0
  82. data/generators/talia_base/USAGE +5 -0
  83. data/generators/talia_base/talia_base_generator.rb +62 -0
  84. data/generators/talia_base/templates/app/controllers/custom_templates_controller.rb +27 -0
  85. data/generators/talia_base/templates/app/controllers/ontologies_controller.rb +13 -0
  86. data/generators/talia_base/templates/app/controllers/sessions_controller.rb +90 -0
  87. data/generators/talia_base/templates/app/controllers/source_data/show.html.erb +2 -0
  88. data/generators/talia_base/templates/app/controllers/source_data_controller.rb +43 -0
  89. data/generators/talia_base/templates/app/controllers/sources_controller.rb +62 -0
  90. data/generators/talia_base/templates/app/controllers/types_controller.rb +23 -0
  91. data/generators/talia_base/templates/app/helpers/custom_templates_helper.rb +2 -0
  92. data/generators/talia_base/templates/app/helpers/ontologies_helper.rb +2 -0
  93. data/generators/talia_base/templates/app/helpers/sessions_helper.rb +2 -0
  94. data/generators/talia_base/templates/app/helpers/source_data/show.html.erb +2 -0
  95. data/generators/talia_base/templates/app/helpers/source_data_helper.rb +2 -0
  96. data/generators/talia_base/templates/app/helpers/sources_helper.rb +39 -0
  97. data/generators/talia_base/templates/app/helpers/types_helper.rb +2 -0
  98. data/generators/talia_base/templates/app/views/ontologies/index.builder +10 -0
  99. data/generators/talia_base/templates/app/views/ontologies/show.builder +7 -0
  100. data/generators/talia_base/templates/app/views/sessions/new.html.erb +33 -0
  101. data/generators/talia_base/templates/app/views/source_data/show.html.erb +2 -0
  102. data/generators/talia_base/templates/app/views/sources/_form.html.erb +15 -0
  103. data/generators/talia_base/templates/app/views/sources/edit.html.erb +9 -0
  104. data/generators/talia_base/templates/app/views/sources/index.html.erb +2 -0
  105. data/generators/talia_base/templates/app/views/sources/new.html.erb +8 -0
  106. data/generators/talia_base/templates/app/views/sources/show.html.erb +19 -0
  107. data/generators/talia_base/templates/app/views/types/index.html.erb +4 -0
  108. data/generators/talia_base/templates/app/views/types/show.html.erb +3 -0
  109. data/generators/talia_base/templates/config/routes.rb +83 -0
  110. data/generators/talia_base/templates/config/talia_initializer.rb +8 -0
  111. data/generators/talia_base/templates/migrations/bj_migration.rb +10 -0
  112. data/generators/talia_base/templates/migrations/constraint_migration.rb +24 -0
  113. data/generators/talia_base/templates/migrations/create_active_sources.rb +15 -0
  114. data/generators/talia_base/templates/migrations/create_custom_templates.rb +17 -0
  115. data/generators/talia_base/templates/migrations/create_data_records.rb +27 -0
  116. data/generators/talia_base/templates/migrations/create_open_id.rb +26 -0
  117. data/generators/talia_base/templates/migrations/create_progress_jobs.rb +18 -0
  118. data/generators/talia_base/templates/migrations/create_roles.rb +20 -0
  119. data/generators/talia_base/templates/migrations/create_semantic_properties.rb +14 -0
  120. data/generators/talia_base/templates/migrations/create_semantic_relations.rb +17 -0
  121. data/generators/talia_base/templates/migrations/create_sessions.rb +16 -0
  122. data/generators/talia_base/templates/migrations/create_users.rb +20 -0
  123. data/generators/talia_base/templates/migrations/create_workflows.rb +28 -0
  124. data/generators/talia_base/templates/migrations/populate_users.rb +11 -0
  125. data/generators/talia_base/templates/migrations/upgrade_relations.rb +12 -0
  126. data/generators/talia_base/templates/ontologies/hyper_ontology.owl +1462 -0
  127. data/generators/talia_base/templates/ontologies/hyper_ontology.pprj +9351 -0
  128. data/generators/talia_base/templates/ontologies/hyper_ontology.repository +6 -0
  129. data/generators/talia_base/templates/ontologies/scholar_0.1.owl +109 -0
  130. data/generators/talia_base/templates/script/configure_talia +292 -0
  131. data/generators/talia_base/templates/script/prepare_images +100 -0
  132. data/generators/talia_base/templates/talia.sh +51 -0
  133. data/generators/talia_base/templates/tasks/talia_core.rk +1 -0
  134. data/lib/loader_helper.rb +9 -0
  135. data/lib/talia_core.rb +0 -2
  136. data/lib/talia_dependencies.rb +5 -0
  137. data/lib/talia_util/rake_tasks.rb +223 -0
  138. data/tasks/talia_core_tasks.rake +2 -0
  139. metadata +138 -13
@@ -0,0 +1,466 @@
1
+ /* ***************** ************** ************** */
2
+ /* ***************** BODY *************** */
3
+ /* ***************** ************** ************** */
4
+ * {margin: 0; padding: 0;}
5
+ body {
6
+ text-align:center;
7
+ color: #333;
8
+ margin:0;
9
+ padding: 0;
10
+ border: 0;
11
+ background: #FFF url(/images/backend/header_bg.gif) top left repeat-x;
12
+ font-family: Avenir, Arial, "Lucida Grande", Verdana, "Bitstream Vera Sans", Helvetica, sans-serif;
13
+ font-size:0.8125em;
14
+ }
15
+
16
+ /* ***************** ************** ************** */
17
+ /* ***************** CLASSI ************** */
18
+ /* ***************** ************** ************** */
19
+ .nascosto{
20
+ display:none;
21
+ }
22
+
23
+ .floatClear {
24
+ clear: both;
25
+ }
26
+
27
+ .backlink {
28
+ padding-bottom: 3ex;
29
+ }
30
+
31
+ .background_item {
32
+ padding-bottom: 0.5ex;
33
+ }
34
+
35
+ .background_box {
36
+ padding-left: 3ex;
37
+ padding-bottom: 2ex;
38
+ padding-top: 1ex;
39
+ }
40
+
41
+ .background_progress {
42
+ margin-bottom: 2ex;
43
+ width: 600px;
44
+ background: #dcd4cf;
45
+ border: 2px solid #55453c;
46
+ height: 30px;
47
+ }
48
+
49
+ .background_progress_bar {
50
+ text-align: right;
51
+ float: left;
52
+ background: #a19792;
53
+ height: 24px;
54
+ padding-top: 6px;
55
+ }
56
+
57
+ .background_progress_caption {
58
+ margin-right: 6px;
59
+ color: #55453c;
60
+ font-weight: bold;
61
+ }
62
+
63
+ .output {
64
+ margin: 3ex;
65
+ }
66
+
67
+ /* ***************** ************** ************** */
68
+ /* ***************** TAG ************** */
69
+ /* ***************** ************** ************** */
70
+ h1{
71
+ color: #9e0b0f;
72
+ font-size: 20px;
73
+ font-weight: normal;
74
+ font-family:Georgia, "Times New Roman", Times, serif;
75
+ margin-bottom: 10px;
76
+ }
77
+
78
+ h2{
79
+ color: #55453c;
80
+ font-size: 20px;
81
+ font-weight: normal;
82
+ font-family:Georgia, "Times New Roman", Times, serif;
83
+ margin-bottom: 10px;
84
+ }
85
+
86
+ p{
87
+ margin-bottom: 13px;
88
+ font-size: 0.88em;
89
+ line-height: 1.5em;
90
+ }
91
+
92
+ a{
93
+ color: #9e0b0f;
94
+ text-decoration: none;
95
+ }
96
+
97
+ a:hover{
98
+ color: #9e0b0f;
99
+ text-decoration: underline;
100
+ }
101
+
102
+ /* ***************** ************** ************** */
103
+ /* ***************** PAGINA (contiene tutto) ************** */
104
+ /* ***************** ************** ************** */
105
+ #paginaExt{
106
+ padding:0; border:0;
107
+ position: relative;
108
+ margin: 0 0;
109
+ /* width:800px; */
110
+ width:100%;
111
+ }
112
+
113
+ #paginaInt{
114
+ margin:0; padding:0; border:0;
115
+ width:100%;
116
+ }
117
+
118
+ /* ***************** ************** ************** */
119
+ /* ***************** HEADER ************** */
120
+ /* ***************** ************** ************** */
121
+ #testata{
122
+ display: block;
123
+ height: 181px;
124
+ width:100%;
125
+ background: transparent url(/images/backend/header.jpg) top left no-repeat;
126
+ }
127
+ #testata h1{
128
+ display: none;
129
+ }
130
+ #testata p{
131
+ display: none;
132
+ }
133
+
134
+ /* ***************** ************** ************** */
135
+ /* ***************** MENU ************** */
136
+ /* ***************** ************** ************** */
137
+ #menu{
138
+ display: block;
139
+ height: 45px;
140
+ width: 800px;
141
+ width:100%;
142
+ background: url(/images/backend/menu_bg.gif) top left repeat-x;
143
+ text-align: left;
144
+ margin: 0; padding: 0;
145
+ }
146
+ #menu ul{
147
+ width: auto;
148
+ padding: 14px 0 0 25px;
149
+ margin: 0;
150
+ height: 45px;
151
+ background: url(/images/backend/menu.jpg) top left no-repeat;
152
+ background-position: -180px 0;
153
+ }
154
+ #menu li{
155
+ display: inline;
156
+ list-style: none;
157
+ letter-spacing: 1.1px;
158
+ text-align: center;
159
+ margin: 0 20px 0 00px;
160
+ }
161
+ #menu li a{
162
+ color: #a19792;
163
+ text-decoration: none;
164
+ text-transform: uppercase;
165
+ font-size: 11px;
166
+ font-weight: bold;
167
+ background: transparent url(/images/backend/triangolino.gif) bottom center no-repeat;
168
+ padding-bottom: 6px;
169
+ }
170
+ #menu li a:hover{
171
+ color: #FFFFFF;
172
+ background: transparent url(/images/backend/triangolino_full.gif) bottom center no-repeat;
173
+ }
174
+
175
+ /* ***************** ************** ************** */
176
+ /* ***************** CONTENUTI ************** */
177
+ /* ***************** ************** ************** */
178
+ #contenuti{
179
+ background-color:#fff;
180
+ width: 780px;
181
+ width:100%;
182
+
183
+ padding: 0 0 0 0;
184
+ text-align: center;
185
+ }
186
+
187
+ #contenutoInterno{
188
+ width: 900px;
189
+ padding: 20px 25px;
190
+ text-align: left;
191
+ }
192
+
193
+ #contenutoInterno ul{
194
+ list-style: none;
195
+ font-size: 1.1em;
196
+ }
197
+ #contenutoInterno ul li{
198
+ list-style: none;
199
+ margin: 0 0 10px 0;
200
+ }
201
+ #contenutoInterno ul li a{
202
+ background: transparent url(/images/backend/icona.gif) center left no-repeat;
203
+ padding: 0 0 0 0px;
204
+ }
205
+ #contenutoInterno ul li a:hover{
206
+ }
207
+
208
+
209
+ /* ***************** ************** ************** */
210
+ /* ***************** PAGINE SPECIFICHE ************** */
211
+ /* ***************** ************** ************** */
212
+
213
+ /* Pagina accesso login */
214
+ #password_login {
215
+ border: 10px solid #dcd4cf;
216
+ /*
217
+ width: 300px;
218
+ height: 200px;
219
+ float: left;
220
+ */
221
+ text-align:center;
222
+ padding: 20px;
223
+ }
224
+ #password_login a{
225
+ font-size: 0.8em;
226
+ }
227
+ #openid_login {
228
+ border: 10px solid #dcd4cf;
229
+ /*
230
+ width: 300px;
231
+ height: 200px;
232
+ float: left;
233
+ */
234
+ text-align:center;
235
+ padding: 20px;
236
+ margin: 20px 0 0 0;
237
+ }
238
+ label#openid_label {
239
+ display: inline;
240
+ line-height: 30px;
241
+ background: transparent url(/images/backend/opednid.gif) center left no-repeat;
242
+ padding: 20px 20px 20px 35px;
243
+ height: 30px;
244
+ }
245
+ #openid_login a{
246
+ font-size: 0.8em;
247
+ }
248
+
249
+ /* Menu principale */
250
+ div.main_menu_box a{
251
+ border: 10px solid #dcd4cf;
252
+ width: 200px;
253
+ height: 5em;
254
+ line-height: 5em;
255
+ float: left;
256
+ text-align:center;
257
+ padding: 0 20px;
258
+
259
+ font-size: 20px;
260
+ font-family:Georgia, "Times New Roman", Times, serif;
261
+ }
262
+
263
+ div.main_menu_box a:hover{
264
+ background-color: #dcd4cf;
265
+ border: 10px solid #d3c8c2;
266
+ text-decoration: none;
267
+ }
268
+
269
+ #users_access a{
270
+ margin-right: 30px;
271
+ }
272
+ #sources_access a{
273
+ margin-right: 30px;
274
+ }
275
+
276
+ #custom_templates_access a{
277
+ margin-right: 30px;
278
+ }
279
+
280
+ #translations_access a{
281
+ }
282
+
283
+ .rdf_header {
284
+ margin-top: 15px;
285
+ padding-left: 10px;
286
+ background: #333 url(/images/rdf_header_bg.gif) repeat-x top left;
287
+ color: #fff;
288
+ font-weight: bold;
289
+ font-size: 1em;
290
+ }
291
+
292
+ .add, .remove, .trash {
293
+ border: none;
294
+ }
295
+
296
+ .add {
297
+ float: right;
298
+ margin-top: -18px;
299
+ margin-right: 8px;
300
+ }
301
+
302
+ .predicates {
303
+ padding-left: 10px;
304
+ }
305
+
306
+ #data ul {
307
+ list-style-type: none;
308
+ }
309
+
310
+ #data p {
311
+ margin-top: 25px;
312
+ }
313
+
314
+ .data {
315
+ font-size: .7em;
316
+ padding: 2px;
317
+ margin-right: 2px;
318
+ }
319
+
320
+ .file {
321
+ background-color: #ff9;
322
+ }
323
+
324
+ .text {
325
+ background-color: #009;
326
+ color: #fff;
327
+ }
328
+
329
+ .xml {
330
+ background-color: #090;
331
+ color: #fff;
332
+ }
333
+
334
+ .image {
335
+ background-color: #900;
336
+ color: #fff;
337
+ }
338
+
339
+ .wmv {
340
+ background-color: #009;
341
+ color: #fff;
342
+ }
343
+
344
+ .mp4 {
345
+ background-color: #099;
346
+ color: #fff;
347
+ }
348
+
349
+ .small {
350
+ font-size: .4em;
351
+ }
352
+
353
+ .grey {
354
+ color: #ccc;
355
+ }
356
+
357
+ .italic {
358
+ font-style: italic;
359
+ }
360
+
361
+ #data_form {
362
+ margin-top: 15px;
363
+ padding: 10px;
364
+ background-color: #ccc;
365
+ }
366
+
367
+ div.uploadStatus {
368
+ margin: 5px;
369
+ }
370
+
371
+ div.progressBar {
372
+ display: none;
373
+ margin: 5px;
374
+ }
375
+
376
+ div.progressBar div.border {
377
+ background-color: #fff;
378
+ border: 1px solid grey;
379
+ width: 100%;
380
+ }
381
+
382
+ div.progressBar div.background {
383
+ background-color: #0c0;
384
+ height: 18px;
385
+ width: 0%;
386
+ }
387
+
388
+ /* PAGINA TRANSLATIONS */
389
+ input.translation {
390
+ width: 180px;
391
+ }
392
+
393
+ /* Input field inside the table */
394
+ table tr td input {
395
+ width: 500px;
396
+ padding: 4px;
397
+ }
398
+
399
+
400
+ /* ***************** ************** ************** */
401
+ /* ***************** FOOTER ************** */
402
+ /* ***************** ************** ************** */
403
+ #footer_wrap {
404
+ padding:0;
405
+ border:0;
406
+ position: relative;
407
+ margin: 0 auto 0 auto;
408
+ width:780px;
409
+ background: #40332b url(/images/backend/footer_bg.gif) top left repeat-x;
410
+ }
411
+ #footer {
412
+ position: relative;
413
+ width: 780px;
414
+ padding: 40px 0 0 30px;
415
+ font-size: 1.00em;
416
+ line-height: 1.6em;
417
+ color: #a79578;
418
+ margin: 0 auto;
419
+ }
420
+ #footer p {
421
+ padding-bottom: 20px;
422
+ }
423
+ .box {
424
+ width: 150px;
425
+ float: left;
426
+ margin-right: 43px;
427
+ z-index: 99;
428
+ }
429
+ .box h1 {
430
+ color: #fffffe;
431
+ font-size: 1.1em;
432
+ font-weight: normal;
433
+ margin-bottom: 30px;
434
+ font-family: Avenir, Arial, "Lucida Grande", Verdana, "Bitstream Vera Sans", Helvetica, sans-serif;
435
+ }
436
+ .box li {
437
+ padding-bottom: 10px;
438
+ }
439
+ .box a:link, .box a:visited {
440
+ color: #fffffe;
441
+ background: #2e251e;
442
+ padding: 2px 5px;
443
+ padding-bottom: 4px;
444
+ text-decoration:none;
445
+ }
446
+ .box a:hover {
447
+ color: #fffffe;
448
+ background: #ad0000;
449
+ text-decoration: none;
450
+ }
451
+ .box a:active {
452
+ color: #fffffe;
453
+ text-decoration:none;
454
+ }
455
+ #footer img {
456
+ margin-right: 30px;
457
+ }
458
+
459
+ /* SIMPLE BIT FIX */
460
+ .group:after {
461
+ content: ".";
462
+ display: block;
463
+ height: 0;
464
+ clear: both;
465
+ visibility: hidden;
466
+ }
@@ -0,0 +1,32 @@
1
+ quentin:
2
+ login: quentin
3
+ email: quentin@example.com
4
+ salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
5
+ crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
6
+ created_at: <%= 5.days.ago.to_s :db %>
7
+ open_id: http://quentin.myopenid.com/
8
+ roles: user_role
9
+
10
+ aaron:
11
+ login: aaron
12
+ email: aaron@example.com
13
+ salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
14
+ crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
15
+ created_at: <%= 1.days.ago.to_s :db %>
16
+
17
+ admin:
18
+ login: admin
19
+ email: admin@talia.org
20
+ salt: c8d13be260ba82f798b06f100152d347cc4840ba
21
+ crypted_password: ccc2e10b38106d5833fb817407973a996d392310
22
+ roles: admin_role
23
+
24
+ hyper:
25
+ login: hyper
26
+ email: system@hyper.org
27
+ salt: c8d13be260ba82f798b06f100152d347cc4840ba
28
+ crypted_password: 981668d16c4646a510ed3ffaf28d05fe68035666
29
+
30
+ someone:
31
+ login: someone
32
+ email: someone@hyper.org
@@ -0,0 +1,8 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+
3
+ class Admin::CustomTemplatesControllerTest < ActionController::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,35 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+
3
+ class Admin::LocalesControllerTest < ActionController::TestCase
4
+ def setup
5
+ i18n_setup
6
+ end
7
+
8
+ def teardown
9
+ i18n_teardown
10
+ end
11
+
12
+ def test_should_get_new
13
+ get :new
14
+ assert_select "form" do
15
+ assert_select "[action=?]", "/admin/locales"
16
+ assert_select "input[type=text][name=name]", :count => 1
17
+ assert_select "input[type=text][name=code]", :count => 1
18
+ assert_select "input[type=submit][value=?]", "Create"
19
+ assert_select "a[href=?]", "/admin/translations", :value => "back to the translations"
20
+ end
21
+ end
22
+
23
+ def test_create
24
+ post :create, :name => "Italian", :code => 'it-IT'
25
+ assert_equal({:english => 'en-GB', :italian => 'it-IT'}, I18n.locales)
26
+ assert_redirected_to edit_admin_translation_path('it-IT')
27
+ end
28
+
29
+ def test_should_report_error_on_invalid_locale_creation
30
+ post :create, :name => "Italian", :code => 'it-PO'
31
+ assert_equal({:english => 'en-GB'}, I18n.locales)
32
+ assert_template 'new'
33
+ assert_flash_error "Invalid locale, please check the format and make sure the language is available."
34
+ end
35
+ end
@@ -0,0 +1,109 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+
3
+ class Admin::SourcesControllerTest < ActionController::TestCase
4
+ include ActionView::Helpers::JavaScriptHelper
5
+ include ActionView::Helpers::TagHelper
6
+
7
+ # def test_should_get_index
8
+ # login_as :admin
9
+ # get :index
10
+ # assert_response :success
11
+ # assert_not_nil assigns(:sources)
12
+ # end
13
+
14
+ def _ignore_test_should_get_edit
15
+ login_as :admin
16
+ get :edit, :id => source.id
17
+ assert_response :success
18
+
19
+ assert_select '.predicate' do
20
+ assert_select '.should_destroy'
21
+ end
22
+
23
+ assert_select "#source_uri[value=?]", N::LOCAL + source.label
24
+ assert_select "#data ul li" do
25
+ assert_select "a", data_record.location
26
+ assert_select "a[href=?]", "/source_data/#{data_record.type}/#{data_record.location}"
27
+ end
28
+ end
29
+
30
+ def test_should_update_source
31
+ login_as :admin
32
+ put :update, :id => source.id, :source => { }
33
+ assert_redirected_to :action => 'index'
34
+ end
35
+
36
+ # def test_should_add_relation_with_existing_source
37
+ # login_as :admin
38
+ # put :update, :id => source.label, :source => params
39
+ # assert(source.direct_predicates_objects.include?("#{N::LOCAL}one"))
40
+ # end
41
+
42
+ # def test_should_add_source_relation_with_unexistent_source
43
+ # login_as :admin
44
+ # put :update, :id => source.label, :source => params(predicates_attributes_for_unexistent_source)
45
+ # assert(TaliaCore::Source.exists?(N::LOCAL + 'four'))
46
+ # assert(source.direct_predicates_objects.include?("#{N::LOCAL}Four"))
47
+ # end
48
+
49
+ # def test_should_remove_source_relation
50
+ # login_as :admin
51
+ # source.talias::attribute << TaliaCore::Source.find('two')
52
+ # put :update, :id => source.label, :source => params(predicates_attributes_for_destroyable_relation)
53
+ # assert(!source.direct_predicates_objects.include?("#{N::LOCAL}two"))
54
+ # end
55
+
56
+ def _ignore_test_should_show_data_records_list
57
+ login_as :admin
58
+ get :edit, :id => source.label
59
+ assert_select('h2', 'Files')
60
+ assert_select '#data' do
61
+ assert_select('ul#list') do
62
+ assert_select('span.data')
63
+ end
64
+ end
65
+ end
66
+
67
+ def _ignore_test_show_upload_form
68
+ login_as :admin
69
+ get :edit, :id => source.label
70
+ html = %(<a href="#" id="upload_link" onclick="try {
71
+ Element.update(&quot;data_form&quot;, &quot;\u003Cform action=\&quot;/source_data/create\&quot; enctype=\&quot;multipart/form-data\&quot; method=\&quot;post\&quot; onsubmit=\&quot;if (this.action.indexOf('upload_id') \u0026lt; 0){ this.action += '?upload_id=1'; }this.target = 'UploadTarget1';$('UploadStatus1').innerHTML='Upload starting...'; if($('UploadProgressBar1')){$('UploadProgressBar1').firstChild.firstChild.style.width='0%'}; if (document.uploadStatus1) { document.uploadStatus1.stop(); }document.uploadStatus1 = new Ajax.PeriodicalUpdater('UploadStatus1','/source_data/upload_status?upload_id=1', Object.extend({asynchronous:true, evalScripts:true, onComplete:function(request){$('UploadStatus1').innerHTML='Upload finished.';if($('UploadProgressBar1')){$('UploadProgressBar1').firstChild.firstChild.style.width='100%'};document.uploadStatus1 = null; onFinishedUpload()}},{decay:1.8,frequency:2.0})); return true\&quot;\u003E\u003Ciframe id=\&quot;UploadTarget1\&quot; name=\&quot;UploadTarget1\&quot; src=\&quot;\&quot; style=\&quot;width:0px;height:0px;border:0\&quot;\u003E\u003C/iframe\u003E\n \u003Cinput id=\&quot;data_record[source_record_id]\&quot; name=\&quot;data_record[source_record_id]\&quot; type=\&quot;hidden\&quot; value=\&quot;247\&quot; /\u003E\n \u003Cinput id=\&quot;data_record_file\&quot; name=\&quot;data_record[file]\&quot; size=\&quot;30\&quot; type=\&quot;file\&quot; /\u003E\n \u003Cinput id=\&quot;data_record_submit\&quot; name=\&quot;commit\&quot; onclick=\&quot;showUploadProgressBar();\&quot; type=\&quot;submit\&quot; value=\&quot;Upload\&quot; /\u003E or \u003Ca href=\&quot;#\&quot; onclick=\&quot;try {\n$(\u0026quot;data_form\u0026quot;).visualEffect(\u0026quot;fade\u0026quot;, {\u0026quot;duration\u0026quot;: 0.001});\n$(\u0026quot;upload_link\u0026quot;).visualEffect(\u0026quot;appear\u0026quot;, {\u0026quot;duration\u0026quot;: 0.4});\nElement.update(\u0026quot;data_form\u0026quot;, \u0026quot;\u0026quot;);\n} catch (e) { alert('RJS error:\\n\\n' + e.toString()); alert('$(\\\u0026quot;data_form\\\u0026quot;).visualEffect(\\\u0026quot;fade\\\u0026quot;, {\\\u0026quot;duration\\\u0026quot;: 0.001});\\n$(\\\u0026quot;upload_link\\\u0026quot;).visualEffect(\\\u0026quot;appear\\\u0026quot;, {\\\u0026quot;duration\\\u0026quot;: 0.4});\\nElement.update(\\\u0026quot;data_form\\\u0026quot;, \\\u0026quot;\\\u0026quot;);'); throw e }; return false;\&quot;\u003Ecancel\u003C/a\u003E\n \u003Cdiv class=\&quot;progressBar\&quot; id=\&quot;UploadProgressBar1\&quot;\u003E\u003Cdiv class=\&quot;border\&quot;\u003E\u003Cdiv class=\&quot;background\&quot;\u003E\u003Cdiv class=\&quot;foreground\&quot;\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003Cdiv class=\&quot;uploadStatus\&quot; id=\&quot;UploadStatus1\&quot;\u003E\u003C/div\u003E\n\u003C/form\u003E \n&quot;);
72
+ $(&quot;upload_link&quot;).visualEffect(&quot;fade&quot;, {&quot;duration&quot;: 0.001});
73
+ $(&quot;data_form&quot;).visualEffect(&quot;appear&quot;, {&quot;duration&quot;: 0.4});
74
+ } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\&quot;data_form\&quot;, \&quot;\\u003Cform action=\\\&quot;/source_data/create\\\&quot; enctype=\\\&quot;multipart/form-data\\\&quot; method=\\\&quot;post\\\&quot; onsubmit=\\\&quot;if (this.action.indexOf(\'upload_id\') \\u0026lt; 0){ this.action += \'?upload_id=1\'; }this.target = \'UploadTarget1\';$(\'UploadStatus1\').innerHTML=\'Upload starting...\'; if($(\'UploadProgressBar1\')){$(\'UploadProgressBar1\').firstChild.firstChild.style.width=\'0%\'}; if (document.uploadStatus1) { document.uploadStatus1.stop(); }document.uploadStatus1 = new Ajax.PeriodicalUpdater(\'UploadStatus1\',\'/source_data/upload_status?upload_id=1\', Object.extend({asynchronous:true, evalScripts:true, onComplete:function(request){$(\'UploadStatus1\').innerHTML=\'Upload finished.\';if($(\'UploadProgressBar1\')){$(\'UploadProgressBar1\').firstChild.firstChild.style.width=\'100%\'};document.uploadStatus1 = null; onFinishedUpload()}},{decay:1.8,frequency:2.0})); return true\\\&quot;\\u003E\\u003Ciframe id=\\\&quot;UploadTarget1\\\&quot; name=\\\&quot;UploadTarget1\\\&quot; src=\\\&quot;\\\&quot; style=\\\&quot;width:0px;height:0px;border:0\\\&quot;\\u003E\\u003C/iframe\\u003E\\n \\u003Cinput id=\\\&quot;data_record[source_record_id]\\\&quot; name=\\\&quot;data_record[source_record_id]\\\&quot; type=\\\&quot;hidden\\\&quot; value=\\\&quot;247\\\&quot; /\\u003E\\n \\u003Cinput id=\\\&quot;data_record_file\\\&quot; name=\\\&quot;data_record[file]\\\&quot; size=\\\&quot;30\\\&quot; type=\\\&quot;file\\\&quot; /\\u003E\\n \\u003Cinput id=\\\&quot;data_record_submit\\\&quot; name=\\\&quot;commit\\\&quot; onclick=\\\&quot;showUploadProgressBar();\\\&quot; type=\\\&quot;submit\\\&quot; value=\\\&quot;Upload\\\&quot; /\\u003E or \\u003Ca href=\\\&quot;#\\\&quot; onclick=\\\&quot;try {\\n$(\\u0026quot;data_form\\u0026quot;).visualEffect(\\u0026quot;fade\\u0026quot;, {\\u0026quot;duration\\u0026quot;: 0.001});\\n$(\\u0026quot;upload_link\\u0026quot;).visualEffect(\\u0026quot;appear\\u0026quot;, {\\u0026quot;duration\\u0026quot;: 0.4});\\nElement.update(\\u0026quot;data_form\\u0026quot;, \\u0026quot;\\u0026quot;);\\n} catch (e) { alert(\'RJS error:\\\\n\\\\n\' + e.toString()); alert(\'$(\\\\\\u0026quot;data_form\\\\\\u0026quot;).visualEffect(\\\\\\u0026quot;fade\\\\\\u0026quot;, {\\\\\\u0026quot;duration\\\\\\u0026quot;: 0.001});\\\\n$(\\\\\\u0026quot;upload_link\\\\\\u0026quot;).visualEffect(\\\\\\u0026quot;appear\\\\\\u0026quot;, {\\\\\\u0026quot;duration\\\\\\u0026quot;: 0.4});\\\\nElement.update(\\\\\\u0026quot;data_form\\\\\\u0026quot;, \\\\\\u0026quot;\\\\\\u0026quot;);\'); throw e }; return false;\\\&quot;\\u003Ecancel\\u003C/a\\u003E\\n \\u003Cdiv class=\\\&quot;progressBar\\\&quot; id=\\\&quot;UploadProgressBar1\\\&quot;\\u003E\\u003Cdiv class=\\\&quot;border\\\&quot;\\u003E\\u003Cdiv class=\\\&quot;background\\\&quot;\\u003E\\u003Cdiv class=\\\&quot;foreground\\\&quot;\\u003E\\u003C/div\\u003E\\u003C/div\\u003E\\u003C/div\\u003E\\u003C/div\\u003E\\u003Cdiv class=\\\&quot;uploadStatus\\\&quot; id=\\\&quot;UploadStatus1\\\&quot;\\u003E\\u003C/div\\u003E\\n\\u003C/form\\u003E \\n\&quot;);\n$(\&quot;upload_link\&quot;).visualEffect(\&quot;fade\&quot;, {\&quot;duration\&quot;: 0.001});\n$(\&quot;data_form\&quot;).visualEffect(\&quot;appear\&quot;, {\&quot;duration\&quot;: 0.4});'); throw e }; return false;">upload</a></p>)
75
+ assert_select('#upload_link', :onclick => html)
76
+ end
77
+
78
+ private
79
+ def source
80
+ @source ||= TaliaCore::Source.find("something")
81
+ end
82
+
83
+ def params(attributes = predicates_attributes)
84
+ {"uri"=>N::LOCAL + source.label, "primary_source"=>"false" }.merge(attributes)
85
+ end
86
+
87
+ def predicates_attributes
88
+ {"predicates_attributes"=>[{"name"=>"attribute", "uri"=>N::LOCAL.to_s, "namespace"=>namespace, "titleized"=>'One'}]}
89
+ end
90
+
91
+ def predicates_attributes_for_unexistent_source
92
+ {"predicates_attributes"=>[{"name"=>"attribute", "uri"=>N::LOCAL.to_s, "namespace"=>namespace, "titleized"=>'Four', "should_destroy" => ''}]}
93
+ end
94
+
95
+ def predicates_attributes_for_destroyable_relation
96
+ {"predicates_attributes"=>[{"name"=>"attribute", "uri"=>N::LOCAL.to_s, "namespace"=>namespace, "titleized"=>'Two', "should_destroy" => '1'}]}
97
+ end
98
+
99
+ def namespace
100
+ unless N::URI.shortcut_exists?(:talias)
101
+ N::Namespace.shortcut(:talias, "http://trac.talia.discovery-project.eu/wiki/StructuralOntology#")
102
+ end
103
+ :talias
104
+ end
105
+
106
+ def data_record
107
+ @data_record ||= TaliaCore::DataTypes::DataRecord.find(:first)
108
+ end
109
+ end