parlement 0.2 → 0.3

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 (125) hide show
  1. data/CHANGES +14 -4
  2. data/README +25 -5
  3. data/Rakefile +21 -21
  4. data/app/controllers/account_controller.rb +5 -1
  5. data/app/controllers/elt_controller.rb +7 -10
  6. data/app/controllers/person_controller.rb +9 -0
  7. data/app/controllers/subscriber_controller.rb +21 -0
  8. data/app/helpers/elt_helper.rb +25 -13
  9. data/app/helpers/mailman.rb +9 -92
  10. data/app/helpers/subscriber_helper.rb +2 -0
  11. data/app/models/attachment.rb +2 -0
  12. data/app/models/elt.rb +64 -2
  13. data/app/models/mail.rb +198 -0
  14. data/app/models/mail_notify.rb +63 -0
  15. data/app/models/person.rb +8 -1
  16. data/app/views/account/_login.rhtml +31 -28
  17. data/app/views/account/_show.rhtml +4 -4
  18. data/app/views/elt/_elt.rhtml +23 -28
  19. data/app/views/elt/_list.rhtml +6 -2
  20. data/app/views/elt/new.rhtml +1 -1
  21. data/app/views/elt/show.rhtml +32 -10
  22. data/app/views/layouts/top.rhtml +16 -10
  23. data/app/views/mail_notify/publish.text.html.rhtml +46 -0
  24. data/app/views/mail_notify/publish.text.plain.rhtml +2 -0
  25. data/app/views/person/_listElts.rhtml +33 -0
  26. data/app/views/person/show.rhtml +21 -19
  27. data/config/boot.rb +2 -0
  28. data/config/environment.rb +19 -13
  29. data/config/environments/development.rb +3 -1
  30. data/config/environments/production.rb +2 -0
  31. data/config/environments/test.rb +2 -0
  32. data/config/routes.rb +5 -2
  33. data/db/ROOT/mail.txt +2 -0
  34. data/db/ROOT/parlement/news/release0.2.txt +8 -0
  35. data/db/ROOT/parlement/news/release0.3.txt +11 -0
  36. data/db/ROOT/parlement/test.txt +6 -1
  37. data/db/ROOT/parlement.txt +23 -30
  38. data/db/ROOT/perso.txt +17 -18
  39. data/db/development_structure.sql +133 -217
  40. data/db/schema.rb +83 -0
  41. data/db/schema.sql +11 -15
  42. data/lib/data_import.rb +3 -1
  43. data/public/attachment/file/architecture.png +0 -0
  44. data/public/attachment/file/architecture.svg +8972 -0
  45. data/public/attachment/file/security.svg +8960 -0
  46. data/public/images/Sleep-Deprivation-5.JPG +0 -0
  47. data/public/images/eltBackground.png +0 -0
  48. data/public/images/eltBackground.svg +89 -0
  49. data/public/images/orange_by_darren_Hester_350o.jpg +0 -0
  50. data/public/images/rails.png +0 -0
  51. data/public/images/smile.png +0 -0
  52. data/public/images/smile.svg +257 -0
  53. data/public/images/world.png +0 -0
  54. data/public/images/world.svg +170 -0
  55. data/public/javascripts/controls.js +30 -1
  56. data/public/javascripts/dragdrop.js +210 -145
  57. data/public/javascripts/effects.js +261 -399
  58. data/public/javascripts/ie7.js +6 -0
  59. data/public/javascripts/prototype.js +131 -72
  60. data/public/oldindex.html +270 -71
  61. data/public/stylesheets/default.css +189 -215
  62. data/script/about +1 -1
  63. data/script/breakpointer +1 -1
  64. data/script/console +1 -1
  65. data/script/destroy +1 -1
  66. data/script/generate +1 -1
  67. data/script/performance/benchmarker +1 -1
  68. data/script/performance/profiler +1 -1
  69. data/script/plugin +1 -1
  70. data/script/process/reaper +1 -1
  71. data/script/process/spawner +1 -1
  72. data/script/process/spinner +1 -1
  73. data/script/runner +1 -1
  74. data/script/server +1 -1
  75. data/test/fixtures/elts.yml +2 -0
  76. data/test/fixtures/mail/mail_ruby +27 -0
  77. data/test/fixtures/mail/mail_rubyChild +28 -0
  78. data/test/fixtures/mail/mail_rubyWithAttachment +7932 -0
  79. data/test/fixtures/mail/mail_rubyWithSubject +27 -0
  80. data/test/fixtures/mails.yml +7 -1
  81. data/test/fixtures/people.yml +5 -0
  82. data/test/fixtures/subscribers.yml +11 -0
  83. data/test/functional/account_controller_test.rb +38 -37
  84. data/test/functional/subscriber_controller_test.rb +128 -0
  85. data/test/test_helper.rb +44 -0
  86. data/test/unit/attachment_test.rb +1 -1
  87. data/test/unit/elt_test.rb +3 -2
  88. data/test/unit/mail_notify_test.rb +37 -0
  89. data/test/unit/mail_test.rb +124 -1
  90. data/test/unit/notifier_test.rb +0 -14
  91. data/test/unit/person_test.rb +2 -1
  92. data/test/unit/subscriber_test.rb +35 -0
  93. data/test/unit/user_test.rb +3 -3
  94. data/vendor/plugins/file_column/CHANGELOG +64 -0
  95. data/vendor/plugins/file_column/README +54 -0
  96. data/vendor/plugins/file_column/Rakefile +36 -0
  97. data/vendor/plugins/file_column/TODO +6 -0
  98. data/vendor/plugins/file_column/init.rb +12 -0
  99. data/vendor/plugins/file_column/lib/file_column.rb +719 -0
  100. data/vendor/plugins/file_column/lib/file_column_helper.rb +145 -0
  101. data/vendor/plugins/file_column/lib/file_compat.rb +28 -0
  102. data/vendor/plugins/file_column/lib/magick_file_column.rb +188 -0
  103. data/vendor/plugins/file_column/lib/validations.rb +112 -0
  104. data/vendor/plugins/file_column/test/abstract_unit.rb +90 -0
  105. data/vendor/plugins/file_column/test/connection.rb +17 -0
  106. data/vendor/plugins/file_column/test/file_column_helper_test.rb +97 -0
  107. data/vendor/plugins/file_column/test/file_column_test.rb +630 -0
  108. data/vendor/plugins/file_column/test/fixtures/entry.rb +32 -0
  109. data/vendor/plugins/file_column/test/fixtures/invalid-image.jpg +1 -0
  110. data/vendor/plugins/file_column/test/fixtures/kerb.jpg +0 -0
  111. data/vendor/plugins/file_column/test/fixtures/mysql.sql +25 -0
  112. data/vendor/plugins/file_column/test/fixtures/schema.rb +10 -0
  113. data/vendor/plugins/file_column/test/fixtures/skanthak.png +0 -0
  114. data/vendor/plugins/file_column/test/magick_test.rb +251 -0
  115. data/vendor/plugins/file_column/test/magick_view_only_test.rb +21 -0
  116. data/vendor/plugins/guid/README.TXT +19 -0
  117. data/vendor/plugins/guid/init.rb +23 -0
  118. data/vendor/plugins/guid/lib/usesguid.rb +37 -0
  119. data/vendor/plugins/guid/lib/uuid22.rb +43 -0
  120. data/vendor/plugins/guid/lib/uuidtools.rb +565 -0
  121. metadata +83 -15
  122. data/db/ROOT/CV.txt +0 -166
  123. data/lib/file_column.rb +0 -263
  124. data/lib/file_column_helper.rb +0 -45
  125. /data/{lib → vendor/plugins/file_column/lib}/rails_file_column.rb +0 -0
metadata CHANGED
@@ -1,10 +1,10 @@
1
- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: parlement
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.2"
7
- date: 2005-12-04 00:00:00 +01:00
6
+ version: "0.3"
7
+ date: 2006-02-23 00:00:00 +01:00
8
8
  summary: Trusted Direct Democracy on a forum
9
9
  require_paths:
10
10
  - lib
@@ -12,7 +12,7 @@ email: emmanuel.charpentier@free.fr
12
12
  homepage: http://leparlement.org
13
13
  rubyforge_project: parlement
14
14
  description: "This is a forum and mailing list project, which aims to be a complete Direct Democracy implementation where everybody can propose polls, vote on them, or delegate their voice to someone else. Trust through: - cluster - PGP signatures - electoral lists"
15
- autorequire: rails, meta_project
15
+ autorequire: rails
16
16
  default_executable:
17
17
  bindir: bin
18
18
  has_rdoc: false
@@ -28,10 +28,10 @@ cert_chain:
28
28
  authors:
29
29
  - Emmanuel Charpentier
30
30
  files:
31
+ - CHANGES
32
+ - COPYING
31
33
  - Rakefile
32
34
  - README
33
- - COPYING
34
- - CHANGES
35
35
  - app/apis
36
36
  - app/controllers
37
37
  - app/helpers
@@ -41,25 +41,30 @@ files:
41
41
  - app/controllers/elt_controller.rb
42
42
  - app/controllers/account_controller.rb
43
43
  - app/controllers/person_controller.rb
44
+ - app/controllers/subscriber_controller.rb
44
45
  - app/helpers/application_helper.rb
45
46
  - app/helpers/elt_helper.rb
46
47
  - app/helpers/person_helper.rb
47
48
  - app/helpers/live_tree.rb
48
49
  - app/helpers/mailman.rb
49
50
  - app/helpers/account_helper.rb
50
- - app/models/person.rb
51
- - app/models/elt.rb
51
+ - app/helpers/subscriber_helper.rb
52
+ - app/models/notifier.rb
52
53
  - app/models/user.rb
54
+ - app/models/person.rb
53
55
  - app/models/mail.rb
54
- - app/models/attachment.rb
55
- - app/models/notifier.rb
56
+ - app/models/elt.rb
57
+ - app/models/mail_notify.rb
56
58
  - app/models/user_notify.rb
59
+ - app/models/attachment.rb
57
60
  - app/views/layouts
58
61
  - app/views/elt
59
62
  - app/views/account
60
63
  - app/views/notifier
61
64
  - app/views/person
62
65
  - app/views/_help.rhtml
66
+ - app/views/subscriber
67
+ - app/views/mail_notify
63
68
  - app/views/layouts/top.rhtml
64
69
  - app/views/layouts/scaffold.rhtml
65
70
  - app/views/elt/_elt.rhtml
@@ -76,6 +81,9 @@ files:
76
81
  - app/views/account/_show.rhtml
77
82
  - app/views/notifier/changeEmail.rhtml
78
83
  - app/views/person/show.rhtml
84
+ - app/views/person/_listElts.rhtml
85
+ - app/views/mail_notify/publish.text.html.rhtml
86
+ - app/views/mail_notify/publish.text.plain.rhtml
79
87
  - config/environments
80
88
  - config/database.yml
81
89
  - config/routes.rb
@@ -88,12 +96,13 @@ files:
88
96
  - db/schema.sql
89
97
  - db/development_structure.sql
90
98
  - db/ROOT
99
+ - db/schema.rb
91
100
  - db/ROOT/perso
92
101
  - db/ROOT/parlement.txt
93
102
  - db/ROOT/perso.txt
94
- - db/ROOT/CV.txt
95
103
  - db/ROOT/parlement
96
104
  - db/ROOT/parleR.txt
105
+ - db/ROOT/mail.txt
97
106
  - db/ROOT/parlement/security.txt
98
107
  - db/ROOT/parlement/test.txt
99
108
  - db/ROOT/parlement/security
@@ -101,11 +110,10 @@ files:
101
110
  - db/ROOT/parlement/news.txt
102
111
  - db/ROOT/parlement/security/anonymity.txt
103
112
  - db/ROOT/parlement/news/release0.1.txt
113
+ - db/ROOT/parlement/news/release0.2.txt
114
+ - db/ROOT/parlement/news/release0.3.txt
104
115
  - lib/localization.rb
105
116
  - lib/tasks
106
- - lib/file_column_helper.rb
107
- - lib/file_column.rb
108
- - lib/rails_file_column.rb
109
117
  - lib/data_import.rb
110
118
  - lib/login_system.rb
111
119
  - lib/user_system.rb
@@ -132,6 +140,15 @@ files:
132
140
  - public/images/live_tree_loading_spinner.gif
133
141
  - public/images/image
134
142
  - public/images/webfeed.gif
143
+ - public/images/rails.png
144
+ - public/images/orange_by_darren_Hester_350o.jpg
145
+ - public/images/Sleep-Deprivation-5.JPG
146
+ - public/images/eltBackground.png
147
+ - public/images/smile.png
148
+ - public/images/smile.svg
149
+ - public/images/eltBackground.svg
150
+ - public/images/world.png
151
+ - public/images/world.svg
135
152
  - public/javascripts/prototype.js
136
153
  - public/javascripts/effects.js
137
154
  - public/javascripts/dragdrop.js
@@ -139,11 +156,15 @@ files:
139
156
  - public/javascripts/live_tree.js
140
157
  - public/javascripts/scriptaculous.js
141
158
  - public/javascripts/slider.js
159
+ - public/javascripts/ie7.js
142
160
  - public/stylesheets/scaffold.css
143
161
  - public/stylesheets/default.css
144
162
  - public/stylesheets/live_tree.css
145
163
  - public/attachment/file
146
164
  - public/attachment/file/tmp
165
+ - public/attachment/file/architecture.png
166
+ - public/attachment/file/architecture.svg
167
+ - public/attachment/file/security.svg
147
168
  - public/engine_files/README
148
169
  - public/engine_files/login_engine
149
170
  - public/engine_files/login_engine/stylesheets
@@ -177,9 +198,17 @@ files:
177
198
  - test/fixtures/attachments.yml
178
199
  - test/fixtures/mails.yml
179
200
  - test/fixtures/notifier
180
- - test/functional/elt_controller_test.rb
201
+ - test/fixtures/mail
202
+ - test/fixtures/subscribers.yml
203
+ - test/fixtures/mail_notify
204
+ - test/fixtures/mail/mail_ruby
205
+ - test/fixtures/mail/mail_rubyWithSubject
206
+ - test/fixtures/mail/mail_rubyWithAttachment
207
+ - test/fixtures/mail/mail_rubyChild
208
+ - test/functional/subscriber_controller_test.rb
181
209
  - test/functional/account_controller_test.rb
182
210
  - test/functional/person_controller_test.rb
211
+ - test/functional/elt_controller_test.rb
183
212
  - test/mocks/development
184
213
  - test/mocks/test
185
214
  - test/mocks/test/user_notify.rb
@@ -190,9 +219,13 @@ files:
190
219
  - test/unit/person_test.rb
191
220
  - test/unit/attachment_test.rb
192
221
  - test/unit/user_test.rb
222
+ - test/unit/mail_notify_test.rb
223
+ - test/unit/subscriber_test.rb
193
224
  - vendor/plugins
194
225
  - vendor/plugins/login_engine
195
226
  - vendor/plugins/engines
227
+ - vendor/plugins/guid
228
+ - vendor/plugins/file_column
196
229
  - vendor/plugins/login_engine/test
197
230
  - vendor/plugins/login_engine/app
198
231
  - vendor/plugins/login_engine/db
@@ -257,6 +290,39 @@ files:
257
290
  - vendor/plugins/engines/lib/action_mailer_extensions.rb
258
291
  - vendor/plugins/engines/lib/dependencies_extensions.rb
259
292
  - vendor/plugins/engines/lib/action_view_extensions.rb
293
+ - vendor/plugins/guid/lib
294
+ - vendor/plugins/guid/README.TXT
295
+ - vendor/plugins/guid/init.rb
296
+ - vendor/plugins/guid/lib/usesguid.rb
297
+ - vendor/plugins/guid/lib/uuid22.rb
298
+ - vendor/plugins/guid/lib/uuidtools.rb
299
+ - vendor/plugins/file_column/test
300
+ - vendor/plugins/file_column/lib
301
+ - vendor/plugins/file_column/Rakefile
302
+ - vendor/plugins/file_column/TODO
303
+ - vendor/plugins/file_column/init.rb
304
+ - vendor/plugins/file_column/CHANGELOG
305
+ - vendor/plugins/file_column/README
306
+ - vendor/plugins/file_column/test/fixtures
307
+ - vendor/plugins/file_column/test/connection.rb
308
+ - vendor/plugins/file_column/test/abstract_unit.rb
309
+ - vendor/plugins/file_column/test/file_column_helper_test.rb
310
+ - vendor/plugins/file_column/test/magick_view_only_test.rb
311
+ - vendor/plugins/file_column/test/file_column_test.rb
312
+ - vendor/plugins/file_column/test/magick_test.rb
313
+ - vendor/plugins/file_column/test/public
314
+ - vendor/plugins/file_column/test/fixtures/schema.rb
315
+ - vendor/plugins/file_column/test/fixtures/kerb.jpg
316
+ - vendor/plugins/file_column/test/fixtures/mysql.sql
317
+ - vendor/plugins/file_column/test/fixtures/entry.rb
318
+ - vendor/plugins/file_column/test/fixtures/invalid-image.jpg
319
+ - vendor/plugins/file_column/test/fixtures/skanthak.png
320
+ - vendor/plugins/file_column/lib/rails_file_column.rb
321
+ - vendor/plugins/file_column/lib/validations.rb
322
+ - vendor/plugins/file_column/lib/file_compat.rb
323
+ - vendor/plugins/file_column/lib/magick_file_column.rb
324
+ - vendor/plugins/file_column/lib/file_column_helper.rb
325
+ - vendor/plugins/file_column/lib/file_column.rb
260
326
  test_files:
261
327
  - test/unit/mail_test.rb
262
328
  - test/unit/elt_test.rb
@@ -264,6 +330,8 @@ test_files:
264
330
  - test/unit/person_test.rb
265
331
  - test/unit/attachment_test.rb
266
332
  - test/unit/user_test.rb
333
+ - test/unit/mail_notify_test.rb
334
+ - test/unit/subscriber_test.rb
267
335
  rdoc_options: []
268
336
 
269
337
  extra_rdoc_files: []
data/db/ROOT/CV.txt DELETED
@@ -1,166 +0,0 @@
1
- Chef de projet, Architecte, J2EE, rails
2
-
3
- <style>
4
- body { text-align:left; }
5
- br, .sidebar, .parent, .eltInfo { display:none; }
6
- h1 {
7
- padding-bottom:0px;
8
- text-align:center; }
9
- h2 {
10
- text-transform:uppercase;
11
- border-bottom:solid 2pt #333;
12
- font-weight:bolder;
13
- font-size:normal; }
14
- h3 {
15
- font-weight:bolder;
16
- font-size:larger;
17
- margin-left:1em; }
18
- h1, h2, h3 { background:none; }
19
- p { margin-left:2em; }
20
- ul { margin-left:1em; }
21
- .eltSubs { border:none; }
22
-
23
- @media print {
24
- html, body { border:none; padding:0px; margin:0px; }
25
- a, a:link, a:visited, a:hover, a:active {
26
- color:black;
27
- text-decoration:none; }
28
- }
29
- </style>
30
-
31
- !{float:right;margin-left:1em;}/images/image/20030520echarp.jpg!
32
-
33
-
34
- <div style="text-align:center; margin-left:8em">
35
- <div class="title">Emmanuel Charpentier</div>
36
- <div>75015 Paris</div>
37
- <div>N� en F�vrier 1973</div>
38
- <div>email: emmanuel.charpentier@free.fr</div>
39
- </div>
40
-
41
- Prendre en charge depuis le d�but un projet ambitieux, le mener jusqu'� ses
42
- utilisateurs.
43
-
44
- Etre p�renne et ind�pendant avec les Logiciels Libres.
45
-
46
- h2. Comp�tences
47
-
48
- Langages : java, ruby, J2EE, XML/XSLT, SQL, UML.
49
-
50
- Bases de donn�es : "PostgreSQL":http://www.postgresql.org,
51
- "HsqlDB":http://hsqldb.org, "MySQL":http://www.mysql.com.
52
-
53
- Frameworks : "Cocoon":http://cocoon.apache.org, "Ruby on
54
- Rails":http://rubyonrails.org, "struts":http://struts.apache.org.
55
-
56
- Logiciels : "JBoss":http://jboss.org, "JOnAS":http://jonas.objectweb.org,
57
- "Tomcat":http://tomcat.apache.org, "Jetty":http://jetty.mortbay.org,
58
- "Middlegen":http://boss.bekk.no/boss/middlegen/,
59
- "XDoclet":http://xdoclet.sourceforge.net, "Ant":http://ant.apache.org,
60
- "Docbook":http://www.docbook.org, "vi":http://vim.sourceforge.net,
61
- "planner":http://planner.imendio.org.
62
-
63
- Syst�me d'exploitation : gnu/Linux, "debian":http://debian.org.
64
-
65
- Langue �trang�re : Anglais bilingue (Bac+4 en �cosse).
66
-
67
-
68
- h2. Exp�rience professionnelle
69
-
70
- h3. Chef de projet -- Editronics Education puis projet de cr�ation d'entreprise
71
-
72
- D�cembre 2002 - Avril 2005
73
-
74
- Conception, architecture et r�alisation du projet
75
- "OpenCartable":http://ecolecolier.dyndns.org : un site web de m�diation
76
- p�dagogique � destination des professeurs et de leurs �l�ves, et organis�
77
- autour des manuels des �diteurs scolaires.
78
-
79
- Condition notable: monter en charge jusqu'� 1 million d'utilisateurs,
80
- l'�ducation nationale.
81
-
82
- Participation � la conception fonctionnelle, d�finition de modules permettant
83
- de diviser les fonctionnalit�s en �l�ments techniques ind�pendants.
84
-
85
- Mise en place et gestion d'une �quipe de 6 personnes, organisation et
86
- r�partition des t�ches, suivi et participation aux r�alisations. R�le de
87
- d�veloppeur senior et de formateur.
88
-
89
- Choix des outils: _java, cocoon, JBoss, PostgreSQL, XML/XSLT, DocBook, cvs_.
90
- M�thode de d�veloppement dite "agile programming".
91
-
92
- D�finition du format des manuels: xml DocBook enrichi du namespace LOM
93
- (Learning Object Metadata).
94
-
95
- Passage du projet en GPL et d�veloppement sur le GForge de l'adullact � partir
96
- de 2004.
97
-
98
- h3. D�veloppeur -- "Soft and Com":http://www.soft-and-com.fr
99
-
100
- Novembre 2004 - D�cembre 2004
101
-
102
- Prise en charge d'un projet web EDI (Electronic Data Interchange) permettant
103
- aux constructeurs et fournisseurs automobiles de g�rer leurs �changes de
104
- pi�ces. Cycle complet commande-livraison-facture.
105
-
106
- _java, cocoon, HsqlDB, PostgreSQL, XML/XSLT, svn_
107
-
108
- h3. Auditeur -- "Apog�e Communications":http://www.colt-telecom.fr
109
-
110
- Novembre 2003 - D�cembre 2003
111
-
112
- Audit de s�curit� sur une application bancaire. Analyse de l'environnement, du
113
- serveur applicatif et de librairies d'encryption. _java, WebMethods_
114
-
115
- h3. Consultant, chef de projet -- "Alcove":http://www.alcove.com
116
-
117
- Mars 2001 - Novembre 2002
118
-
119
- * D�buts sur le projet i-cart@ble (devenu OpenCartable) comme chef de projet d'une �quipe Alcove. Reprise du fonctionnel du projet i-m@nuel, en le reconstruisant autour de logiciels libres
120
- * Formations et pr�sentations _java/J2EE/XML_, notamment � LinuxExpo (http://emmanuel.charpentier.free.fr/FreeJ2EE/)
121
- * Audit de s�curit� d'une application web bancaire (_vignette, tcl/tk_).
122
- * R�ponses � appels d'offres, support aux commerciaux
123
-
124
- h3. Projet personnel -- "VeniVidiVoti":http://sf.net/projects/vvv
125
-
126
- Novembre 2000 - F�vrier 2001
127
-
128
- Site web d'�criture collaborative.
129
-
130
- Moteur d'un outil permettant � un groupe d'utilisateurs d'�crire
131
- d�mocratiquement presque tout type de texte structur�. M�lange de d�mocratie
132
- directe et repr�sentative.
133
-
134
- _java, JBoss, Cocoon, PostgreSQL, XML/XSLT, cvs_
135
-
136
- h3. D�veloppeur, Chef de projet technique -- Fi System
137
-
138
- Juin 1999 - Octobre 2000
139
-
140
- * InfoVista: prise en charge de la g�n�ration de rapports synth�tisant les donn�es recueillies par les logiciels de cet �diteur. _jsp, XML_
141
- * Renault: conception et r�alisation de l'intranet de gestion du parc v�hiculaires. _jsp, WebSphere, Oracle_
142
- * France T�l�com: r�alisation du site de prise de commandes pour les entreprises. _jsp, base de donn�es objet_
143
-
144
- h3. D�veloppeur -- Altran Technologies
145
-
146
- Janvier 1998 - Mai 1999
147
-
148
- * IDMatics (Thomson): analyse et r�alisation des modules de consultation et contr�le qualit� d'un syst�me de production de permis de conduire. _WinDev_
149
- * Bouygues: passage � l'euro du syst�me de gestion. Cr�ation d'une calculatrice/convertisseur graphique. _C++, MFC, SQL Serveur_
150
- * General Electric Medical Systems: sp�cifications et d�veloppement d'�volutions de la plate-forme de supervision d'un syst�me � rayons X. _PLM, temps r�el_
151
- * Noos: d�veloppement d'un module de remise clients li� � une base de donn�es de grand volume. _Oracle, PL/SQL_
152
- * Syseca (Thomson): d�veloppement d'un serveur de situation temps r�el (enregistrement/playback des donn�es) d'un syst�me de commandement H24. _C++, OMT_
153
-
154
-
155
- h2. Formation
156
-
157
- h3. 1997 -- Ing�nieur en Informatique
158
-
159
- "UTBM":http://www.utbm.fr (Belfort, France). Sp�cialisation en ing�nierie des
160
- logiciels et de la connaissance.
161
-
162
- h3. 1995 -- Ing�nieur en M�canique
163
-
164
- "Strathclyde University":http://www.strath.ac.uk (Glasgow, Ecosse).
165
- Sp�cialisation en thermodynamique et m�canique des fluides.
166
-
data/lib/file_column.rb DELETED
@@ -1,263 +0,0 @@
1
- require 'fileutils'
2
- require 'tempfile'
3
-
4
- module FileColumn # :nodoc:
5
- def self.append_features(base)
6
- super
7
- base.extend(ClassMethods)
8
- end
9
-
10
- # The FileColumn module allows you to easily handle file uploads. You can designate
11
- # one or more columns of your model's table as "file columns" like this:
12
- #
13
- # class Entry < ActiveRecord::Base
14
- #
15
- # file_column :image
16
- # end
17
- #
18
- # Now, by default, an uploaded file "test.png" for an entry object with primary key 42 will
19
- # be stored in in "public/entry/image/42/test.png". The filename "test.png" will be stored
20
- # in the record's +image+ column.
21
- #
22
- # The methods of this module are automatically included into ActiveRecord::Base as class
23
- # methods, so that you can use them in your models.
24
- #
25
- # == Generated Methods
26
- #
27
- # After calling "<tt>file_column :image</tt>" as in the example above, a number of instance methods
28
- # will automatically be generated, all prefixed by "image":
29
- #
30
- # * <tt>Entry#image=(uploaded_file)</tt>: this will handle a newly uploaded file (see below). Note that
31
- # you can simply call your upload field "entry[image]" in your view (or use the helper).
32
- # * <tt>Entry#image</tt>: This will return an absolute path (as a string) to the currently uploaded file
33
- # or nil if no file has been uploaded
34
- # * <tt>Entry#image_relative_path</tt>: This will return a path relative to this file column's base
35
- # directory
36
- # as a string or nil if no file has been uploaded. This would be "42/test.png" in the example.
37
- # * <tt>Entry#image_just_uploaded?</tt>: Returns true if a new file has been uploaded to this instance.
38
- # You can use this in <tt>before_validation</tt> to resize images on newly uploaded files, for example.
39
- #
40
- # You can access the raw value of the "image" column (which will contain the filename) via the
41
- # <tt>ActiveRecord::Base#attributes</tt> or <tt>ActiveRecord::Base#[]</tt> methods like this:
42
- #
43
- # entry['image'] # e.g."test.png"
44
- #
45
- # == Storage of uploaded file
46
- #
47
- # For a model class +Entry+ and a column +image+, all files will be stored under
48
- # "public/entry/image". A sub-directory named after the primary key of the object will
49
- # be created, so that files can be stored using their real filename. For example, a file
50
- # "test.png" stored in an Entry object with id 42 will be stored in
51
- #
52
- # public/entry/image/42/test.png
53
- #
54
- # Files will be moved to this location in an +after_save+ callback. They will be stored in
55
- # a temporary location previously as explained in the next section.
56
- #
57
- # == Handling of form redisplay
58
- #
59
- # Suppose you have a form for creating a new object where the user can upload an image. The form may
60
- # have to be re-displayed because of validation errors. The uploaded file has to be stored somewhere so
61
- # that the user does not have to upload it again. FileColumn will store these in a temporary directory
62
- # (called "tmp" and located under the column's base directory by default) so that it can be moved to
63
- # the final location if the object is successfully created. If the form is never completed, though, you
64
- # can easily remove all the images in this "tmp" directory once per day or so.
65
- #
66
- # So in the example above, the image "test.png" would first be stored in
67
- # "public/entry/image/tmp/<some_random_key>/test.png" and be moved to
68
- # "public/entry/image/<primary_key>/test.png".
69
- #
70
- # This temporary location of newly uploaded files has another advantage when updating objects. If the
71
- # update fails for some reasons (e.g. due to validations), the existing image will not be overwritten, so
72
- # it has a kind of "transactional behaviour".
73
- module ClassMethods
74
-
75
- DEFAULT_OPTIONS = {
76
- "root_path" => File.join(RAILS_ROOT, "public"),
77
- "web_root" => ""
78
- }.freeze
79
-
80
- # handle one or more attributes as "file-upload" columns, generating additional methods as explained
81
- # above. You should pass the names of the attributes as symbols, like this:
82
- #
83
- # file_column :image, :another_image
84
- def file_column(*args)
85
- options = DEFAULT_OPTIONS.dup
86
- options.update(args.pop) if args.last.is_a?(Hash)
87
-
88
- options["base_path"] ||= File.join(options["root_path"], Inflector.underscore(self.name).to_s)
89
- options["base_url"] ||= options["web_root"]+"/"+Inflector.underscore(self.name).to_s+"/"
90
- args.each do |attr|
91
- store_dir = File.join(options["base_path"], attr.to_s)
92
- tmp_base_dir = File.join(store_dir, "tmp")
93
- FileUtils.mkpath([store_dir,tmp_base_dir])
94
-
95
- column_attr = attr.to_s
96
- column_read_method = attr.to_sym
97
- column_write_method = (attr.to_s+"=").to_sym
98
- read_temp_method = "#{attr}_temp".to_sym
99
- write_temp_method = "#{attr}_temp=".to_sym
100
- column_relative_path_method = (attr.to_s+"_relative_path").to_sym
101
- column_options_method = "#{attr}_options".to_sym
102
- just_uploaded_method = "#{attr}_just_uploaded?".to_sym
103
-
104
- # symbols for callback methods
105
- column_after_save_method = (attr.to_s+"_after_save").to_sym
106
- column_after_destroy_method = (attr.to_s+"_after_destroy").to_sym
107
-
108
- tmp_dir_attribute = "@#{attr}_temp".to_sym
109
- just_uploaded_attribute = "@#{attr}_just_uploaded".to_sym
110
-
111
- define_method column_read_method do
112
- relative_path = self.send column_relative_path_method
113
- return nil unless relative_path
114
- File.join(store_dir, relative_path)
115
- end
116
-
117
- define_method column_relative_path_method do
118
- filename = read_attribute column_attr
119
- return nil unless filename and !filename.empty?
120
- tmp_dir = instance_variable_get tmp_dir_attribute
121
- if tmp_dir
122
- File.join("tmp",tmp_dir,filename)
123
- else
124
- File.join(self.id.to_s,filename)
125
- end
126
-
127
- end
128
-
129
- define_method column_write_method do |file|
130
- if file.nil? and read_attribute(column_attr)
131
- if (tmp_dir = instance_variable_get tmp_dir_attribute)
132
- # delete temporary image immediately
133
- FileColumn.remove_file_with_dir(File.join(tmp_base_dir,tmp_dir,
134
- read_attribute(column_attr)))
135
- remove_instance_variable tmp_dir_attribute
136
- end
137
- write_attribute column_attr, nil
138
- end
139
- return nil unless file and file.size > 0
140
-
141
- tmp_dir = FileColumn.generate_temp_name
142
- FileUtils.mkdir(File.join(tmp_base_dir, tmp_dir))
143
-
144
- filename = FileColumn::sanitize_filename(file.original_filename)
145
- local_file_path = File.join(tmp_base_dir,tmp_dir,filename)
146
-
147
- # stored uploaded file into local_file_path
148
- # If it was a Tempfile object, the temporary file will be
149
- # cleaned up automatically, so we do not have to care for this
150
- if file.respond_to?(:local_path) and file.local_path and File.exists?(file.local_path)
151
- FileUtils.copy_file(file.local_path, local_file_path)
152
- elsif file.respond_to?(:read)
153
- File.open(local_file_path, "wb") { |f| f.write(file.read) }
154
- else
155
- raise ArgumentError.new("Do not know how to handle #{file.inspect}")
156
- end
157
-
158
- # if there already was an old temporary file, remove it
159
- if (old_tmp_dir = instance_variable_get tmp_dir_attribute)
160
- FileColumn.remove_file_with_dir(File.join(tmp_base_dir,old_tmp_dir,
161
- read_attribute(column_attr)))
162
- end
163
-
164
- instance_variable_set tmp_dir_attribute, tmp_dir
165
- write_attribute column_attr, filename
166
- instance_variable_set just_uploaded_attribute, true
167
- end
168
-
169
- define_method read_temp_method do
170
- tmp_dir = instance_variable_get tmp_dir_attribute
171
- return nil unless tmp_dir
172
- File.join(tmp_dir, read_attribute(column_attr))
173
- end
174
-
175
- define_method write_temp_method do |temp_path|
176
- return nil if temp_path == ""
177
- raise ArgumentError.new("invalid format of '#{temp_path}'") unless temp_path =~ %r{^((\d+\.)+\d+)/([^/].+)$}
178
- tmp_dir, filename = $1, FileColumn.sanitize_filename($3)
179
-
180
- if instance_variable_get(tmp_dir_attribute).nil?
181
- instance_variable_set tmp_dir_attribute, tmp_dir
182
- write_attribute column_attr, filename
183
- else
184
- # if tmp_dir_attribute is already set we have already uploaded
185
- # a new file via column=, which takes precedence over the old
186
- # temporary image. However, we can clean up the old image right now
187
- FileColumn.remove_file_with_dir(File.join(tmp_base_dir,tmp_dir,filename))
188
- end
189
- end
190
-
191
- define_method column_after_save_method do
192
- if instance_variable_get tmp_dir_attribute
193
- # we have a newly uploaded image, move it to the correct location
194
-
195
- # create a directory named after the primary key, first
196
- dir = File.join(store_dir,self.id.to_s)
197
- FileUtils.mkdir(dir) unless File.exists?(dir)
198
-
199
- # move the temporary file over
200
- local_path = self.send(column_read_method)
201
- FileUtils.mv local_path, dir
202
-
203
- # remove all old files in the directory
204
- # we do this _after_ moving the file to avoid a short period of
205
- # time where none of the two files is available
206
- filename = File.basename(local_path)
207
- FileUtils.rm(
208
- Dir.entries(dir).reject!{ |e| [".",".."].include?(e) or e == filename }.
209
- collect{ |e| File.join(dir,e) }
210
- )
211
-
212
- # cleanup temporary file
213
- Dir.rmdir(File.dirname(local_path))
214
- remove_instance_variable tmp_dir_attribute
215
- elsif read_attribute(column_attr).nil?
216
- # we do not have a file stored anymore, make sure
217
- # to remove it from disk if needed
218
- FileUtils.rm_rf File.join(store_dir, self.id.to_s)
219
- end
220
- end
221
- after_save column_after_save_method
222
-
223
- define_method column_after_destroy_method do
224
- local_path = self.send(column_read_method)
225
- FileColumn.remove_file_with_dir(local_path) if local_path
226
- end
227
- after_destroy column_after_destroy_method
228
-
229
- define_method just_uploaded_method do
230
- instance_variable_get just_uploaded_attribute
231
- end
232
-
233
- define_method column_options_method do
234
- options
235
- end
236
-
237
- private column_after_save_method, column_after_destroy_method
238
- end
239
- end
240
-
241
- end
242
-
243
- private
244
-
245
- def self.generate_temp_name
246
- now = Time.now
247
- "#{now.to_i}.#{now.usec}.#{Process.pid}"
248
- end
249
-
250
- def self.sanitize_filename(filename)
251
- filename = File.basename(filename.gsub("\\", "/")) # work-around for IE
252
- filename.gsub(/[^a-zA-Z0-9\.\-\+_]/,"_")
253
- filename = "_#{filename}" if filename =~ /^\.+$/
254
- filename
255
- end
256
-
257
- def self.remove_file_with_dir(path)
258
- return unless File.file?(path)
259
- FileUtils.rm_f path
260
- dir = File.dirname(path)
261
- Dir.rmdir(dir) if File.exists?(dir)
262
- end
263
- end