rsence 2.0.0.5.pre → 2.0.0.6.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/README.rdoc +2 -2
  2. data/VERSION +1 -1
  3. data/bin/rsence +4 -1
  4. data/conf/default_conf.yaml +1 -1
  5. data/conf/rsence_command_strings.yaml +444 -0
  6. data/js/comm/comm/autosync/autosync.js +1 -1
  7. data/js/comm/comm/comm.js +1 -1
  8. data/js/comm/comm/queue/queue.js +1 -1
  9. data/js/comm/comm/session/session.js +1 -1
  10. data/js/comm/comm/sessionwatcher/sessionwatcher.js +1 -1
  11. data/js/comm/comm/transporter/transporter.js +1 -1
  12. data/js/comm/comm/urlresponder/urlresponder.js +1 -1
  13. data/js/comm/comm/values/values.js +1 -1
  14. data/js/comm/jsloader/jsloader.js +1 -1
  15. data/js/comm/reloadapp/reloadapp.js +1 -1
  16. data/js/comm/sha/sha.js +1 -1
  17. data/js/comm/values/value/value.js +1 -1
  18. data/js/comm/values/valuematrix/valuematrix.js +1 -1
  19. data/js/controls/button/button.js +1 -1
  20. data/js/controls/checkbox/checkbox.js +1 -1
  21. data/js/controls/datetime/calendar/calendar.js +1 -1
  22. data/js/controls/datetime/datetimevalue/datetimevalue.js +1 -1
  23. data/js/controls/datetime/timesheet/timesheet.js +1 -1
  24. data/js/controls/datetime/timesheet_item/timesheet_item.js +1 -1
  25. data/js/controls/datetime/timesheet_item_edit/timesheet_item_edit.js +1 -1
  26. data/js/controls/dialogs/alert_sheet/alert_sheet.js +1 -1
  27. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +1 -1
  28. data/js/controls/dialogs/sheet/sheet.js +1 -1
  29. data/js/controls/imageview/imageview.js +1 -1
  30. data/js/controls/lists/checkboxlist/checkboxlist.js +1 -1
  31. data/js/controls/lists/listitems/listitems.js +1 -1
  32. data/js/controls/lists/radiobuttonlist/radiobuttonlist.js +1 -1
  33. data/js/controls/passwordcontrol/passwordcontrol.js +1 -1
  34. data/js/controls/progress/progressbar/progressbar.js +1 -1
  35. data/js/controls/progress/progressindicator/progressindicator.js +1 -1
  36. data/js/controls/radiobutton/radiobutton.js +1 -1
  37. data/js/controls/sliders/slider/slider.js +1 -1
  38. data/js/controls/sliders/vslider/vslider.js +1 -1
  39. data/js/controls/stepper/stepper.js +1 -1
  40. data/js/controls/stringview/stringview.js +1 -1
  41. data/js/controls/tab/tab.js +1 -1
  42. data/js/controls/textarea/textarea.js +1 -1
  43. data/js/controls/textcontrol/textcontrol.js +1 -1
  44. data/js/controls/uploader/uploader.js +1 -1
  45. data/js/controls/validatorview/validatorview.js +6 -2
  46. data/js/controls/window/window.js +1 -1
  47. data/js/core/class/class.js +1 -1
  48. data/js/core/elem/elem.js +1 -1
  49. data/js/core/event/event.js +1 -1
  50. data/js/core/iefix/iefix.js +1 -1
  51. data/js/foundation/application/application.js +1 -1
  52. data/js/foundation/control/control.js +1 -1
  53. data/js/foundation/control/controldefaults/controldefaults.js +1 -1
  54. data/js/foundation/control/dummyvalue/dummyvalue.js +1 -1
  55. data/js/foundation/control/dyncontrol/dyncontrol.js +1 -1
  56. data/js/foundation/control/eventresponder/eventresponder.js +1 -1
  57. data/js/foundation/control/valueresponder/valueresponder.js +1 -1
  58. data/js/foundation/geom/point/point.js +1 -1
  59. data/js/foundation/geom/rect/rect.js +1 -1
  60. data/js/foundation/json_renderer/json_renderer.js +1 -1
  61. data/js/foundation/system/system.js +1 -1
  62. data/js/foundation/thememanager/thememanager.js +1 -1
  63. data/js/foundation/view/markupview/markupview.js +1 -1
  64. data/js/foundation/view/morphanimation/morphanimation.js +1 -1
  65. data/js/foundation/view/view.js +1 -1
  66. data/js/foundation/view/viewdefaults/viewdefaults.js +1 -1
  67. data/js/views/centerview/centerview.js +1 -1
  68. data/js/views/inlineview/inlineview.js +1 -1
  69. data/js/views/scrollview/scrollview.js +1 -1
  70. data/lib/conf/argv.rb +719 -1006
  71. data/lib/conf/default.rb +14 -3
  72. data/lib/daemon/daemon.rb +1 -1
  73. data/lib/daemon/sigcomm.rb +1 -1
  74. data/lib/http/broker.rb +5 -1
  75. data/lib/http/rackup.rb +1 -1
  76. data/lib/http/request.rb +1 -1
  77. data/lib/http/response.rb +2 -2
  78. data/lib/plugins/dependencies.rb +36 -0
  79. data/lib/plugins/gui_plugin.rb +83 -80
  80. data/lib/plugins/guiparser.rb +7 -3
  81. data/lib/plugins/plugin.rb +308 -307
  82. data/lib/plugins/plugin_plugins.rb +5 -1
  83. data/lib/plugins/plugin_sqlite_db.rb +5 -1
  84. data/lib/plugins/plugin_util.rb +22 -0
  85. data/lib/plugins/pluginmanager.rb +95 -95
  86. data/lib/plugins/plugins.rb +117 -0
  87. data/lib/plugins/servlet.rb +47 -57
  88. data/lib/session/msg.rb +1 -1
  89. data/lib/session/sessionmanager.rb +1 -1
  90. data/lib/session/sessionstorage.rb +2 -2
  91. data/lib/transporter/transporter.rb +1 -2
  92. data/lib/values/hvalue.rb +7 -3
  93. data/lib/values/valuemanager.rb +7 -1
  94. data/plugins/client_pkg/client_pkg.rb +15 -48
  95. data/plugins/client_pkg/info.yaml +1 -1
  96. data/plugins/client_pkg/lib/client_pkg_build.rb +1 -1
  97. data/plugins/client_pkg/lib/client_pkg_cache.rb +1 -1
  98. data/plugins/index_html/index_html.rb +5 -6
  99. data/plugins/index_html/info.yaml +21 -0
  100. data/plugins/index_html/tmpl/index.html +1 -1
  101. data/plugins/index_html/tmpl/startup_index.html +1 -1
  102. data/plugins/main/info.yaml +21 -0
  103. data/plugins/main/main.rb +1 -5
  104. data/plugins/{ticketservices → ticket}/lib/common.rb +92 -2
  105. data/plugins/{ticketservices → ticket}/lib/favicon.rb +1 -1
  106. data/plugins/{ticketservices → ticket}/lib/file.rb +1 -1
  107. data/plugins/{ticketservices → ticket}/lib/img.rb +1 -1
  108. data/plugins/{ticketservices → ticket}/lib/objblob.rb +1 -1
  109. data/plugins/{ticketservices → ticket}/lib/rsrc.rb +1 -1
  110. data/plugins/{ticketservices → ticket}/lib/upload.rb +60 -31
  111. data/plugins/{ticketservices/ticketservices.rb → ticket/ticket.rb} +50 -118
  112. data/{plugins → setup}/legacy/info.yaml +0 -0
  113. data/{plugins → setup}/legacy/legacy.rb +2 -0
  114. data/setup/welcome/welcome.rb +1 -1
  115. metadata +27 -21
  116. data/conf/config.yaml +0 -4
  117. data/conf/local_conf.yaml.devel +0 -14
  118. data/lib/conf/wizard.rb +0 -303
  119. data/plugins/client_pkg/log/build_log +0 -0
  120. data/plugins/legacy/disabled +0 -0
  121. data/plugins/legacy/disabled- +0 -0
data/conf/config.yaml DELETED
@@ -1,4 +0,0 @@
1
- :http_server:
2
- :port: 8002
3
- :index_html:
4
- :title: "Hellou"
@@ -1,14 +0,0 @@
1
- ---
2
- :plugin_paths:
3
- - demos
4
- :http_server:
5
- :latency: 0
6
- :rack_handler:
7
- :rack_require: mongrel
8
- :bind_address: 0.0.0.0
9
- :port: 8001
10
- :database:
11
- :ses_db: sqlite://var/db/rsence_ses.db
12
- :client_pkg:
13
- :no_obfuscation: true
14
- :no_whitespace_removal: true
data/lib/conf/wizard.rb DELETED
@@ -1,303 +0,0 @@
1
- #--
2
- ## Riassence Framework
3
- # Copyright 2008 Riassence Inc.
4
- # http://riassence.com/
5
- #
6
- # You should have received a copy of the GNU General Public License along
7
- # with this software package. If not, contact licensing@riassence.com
8
- ##
9
- #++
10
-
11
-
12
- require 'rubygems'
13
- require 'highline/import'
14
-
15
- require 'randgen'
16
-
17
- class ConfigWizard
18
-
19
- # returns a deep copy of source_hash using Marshal
20
- # (I wish there was a better way)
21
- def hash_deep_copy(source_hash)
22
- return Marshal.restore( Marshal.dump(source_hash) )
23
- end
24
-
25
- # returns a pound ('#') char, unless @conf and @config values differ
26
- def cdiff(confkeys)
27
- conf1 = @conf
28
- conf2 = @config
29
- # recurse into config hash
30
- confkeys.each do |confkey|
31
- conf1 = conf1[confkey]
32
- conf2 = conf2[confkey]
33
- end
34
- # return '' if the values differ, '#' if they are the same
35
- #puts "#{conf1.inspect} vs #{conf2.inspect}"
36
- if conf1 != conf2
37
- return ''
38
- else
39
- return '#'
40
- end
41
- end
42
-
43
- # makes a copy of the default configuration for comparisons
44
- def initialize( config )
45
- @config = config
46
- @conf = {
47
- :database => hash_deep_copy( config[:database] ),
48
- :http_server => hash_deep_copy( config[:http_server] )
49
- }
50
- end
51
-
52
- # asks y/n and returns boleans,
53
- # the default tells if which one is for just enter
54
- def yesno(default=false)
55
- if default
56
- question = "Y/n? "
57
- else
58
- question = "y/N? "
59
- end
60
- print question
61
- answer = $stdin.gets.strip.downcase[0]
62
- answer = answer.chr if answer
63
- if answer == 'n'
64
- return false
65
- elsif answer == 'y'
66
- return true
67
- elsif answer == nil
68
- return default
69
- else
70
- return nil
71
- end
72
- end
73
-
74
- # configuration dialog for database connectivity
75
- def ask_about_mysql
76
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
77
- puts " MySQL configuration"
78
- puts
79
- puts " This feature requires an mysql account with "
80
- puts " sufficient privileges of creating databases,"
81
- puts " tables and users. "
82
- puts
83
- puts " This account is used for persistent session storage "
84
- puts " and it is also the default database for plugins."
85
- puts
86
- puts " The default rsence account is configured as:"
87
- puts
88
- puts " Hostname: #{@conf[:database][:auth_setup][:host].inspect}"
89
- puts " Username: #{@conf[:database][:auth_setup][:user].inspect}"
90
- puts " Password: #{@conf[:database][:auth_setup][:pass].inspect}"
91
- puts " Database: #{@conf[:database][:auth_setup][:db].inspect}"
92
- puts " Port: #{@conf[:database][:auth_setup][:port].inspect}"
93
- puts
94
- print " Correct, "
95
- is_correct = nil
96
- is_correct = yesno(true) until is_correct != nil
97
- unless is_correct
98
- @conf[:database][:auth_setup][:host] = ask("Hostname (or IP address)?") do |q|
99
- q.default = @conf[:database][:auth_setup][:host]
100
- end
101
- @conf[:database][:auth_setup][:user] = ask("Username?") do |q|
102
- q.default = @conf[:database][:auth_setup][:user]
103
- end
104
- @conf[:database][:auth_setup][:pass] = ask("Password?") do |q|
105
- q.default = @conf[:database][:auth_setup][:pass]
106
- end
107
- @conf[:database][:auth_setup][:db] = ask("Database?") do |q|
108
- q.default = @conf[:database][:auth_setup][:db]
109
- end
110
- @conf[:database][:auth_setup][:port] = ask("Port?") do |q|
111
- q.default = @conf[:database][:auth_setup][:port]
112
- end
113
- end
114
- puts
115
- print " Re-edit these settings, "
116
- re_edit = yesno(false) until re_edit != nil
117
- if re_edit
118
- ask_about_mysql
119
- else
120
- db_auth = @conf[:database][:auth_setup]
121
- return "mysql://#{db_auth[:user]}:#{db_auth[:pass]}@#{db_auth[:host]}:#{db_auth[:port]}/#{db_auth[:db]}"
122
- end
123
- end
124
-
125
- # configuration dialog for the web server
126
- def ask_about_httpd
127
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
128
- puts " HTTP Server configuration"
129
- puts
130
- puts " Riassence Framework runs its HTTP Server as:"
131
- puts
132
- puts " Server: #{@conf[:http_server][:rack_require].inspect}"
133
- puts " Address: #{@conf[:http_server][:bind_address].inspect}"
134
- puts " Port: #{@conf[:http_server][:port].inspect}"
135
- puts
136
- puts
137
- print " Correct, "
138
- is_correct = yesno(true) until is_correct != nil
139
- unless is_correct
140
- server_type = ''
141
- until ['mongrel','webrick','thin','ebb'].include?(server_type)
142
- server_type = ask("Server Type? (valid: mongrel, webrick, thin, ebb)") do |q|
143
- q.default = @conf[:http_server][:rack_require]
144
- end
145
- end
146
- @conf[:http_server][:rack_require] = server_type
147
- @conf[:http_server][:bind_address] = ask("Address? (0.0.0.0 binds to all)") do |q|
148
- q.default = @conf[:http_server][:bind_address]
149
- end
150
- @conf[:http_server][:port] = ask("Port number?") do |q|
151
- q.default = @conf[:http_server][:port]
152
- end
153
- end
154
- end
155
-
156
- def file_ok?(path)
157
- return false if path == ''
158
- if File.exist?(File.split(path)[0])
159
- if File.directory?(File.split(path)[0])
160
- if File.writable?(File.split(path)[0])
161
- if File.exist?(path)
162
- if File.file?(path)
163
- return true if File.writable?(path) and File.readable?(path)
164
- puts " Invalid path; #{path} is not writable or readable."
165
- return false
166
- end
167
- puts " Invalid path; #{path} exists and is not a file."
168
- return false
169
- end
170
- return true
171
- end
172
- puts " Invalid path; the directory #{File.split(path)[0]} is not writable."
173
- return false
174
- end
175
- puts " Invalid path; the parent directory #{File.split(path)[0]} is not a directory."
176
- return false
177
- end
178
- puts " Invalid path; the parent directory #{File.split(path)[0]} does not exist."
179
- return false
180
- end
181
-
182
- def ask_about_sqlite
183
- sqlite_path = File.join(SERVER_PATH,'var','db','rsence_ses.db')
184
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
185
- puts " SQLite database configuration"
186
- puts
187
- puts " SQLite is configured using file names. The default is:"
188
- puts " #{sqlite_path.inspect}"
189
- puts
190
- print " Correct, "
191
- is_correct = yesno(true) until is_correct != nil
192
- unless is_correct
193
- new_sqlite_path = ''
194
- until file_ok?(new_sqlite_path)
195
- new_sqlite_path = ask(" Database file path? ") do |q|
196
- q.default = sqlite_path
197
- end
198
- end
199
- sqlite_path = new_sqlite_path
200
- end
201
- return "sqlite://#{sqlite_path}"
202
- end
203
-
204
- def ask_about_other_db( other_db_string = '' )
205
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
206
- puts " All Sequel-compatible database drivers are supported."
207
- puts
208
- puts " To configure another database engine, please enter a db url."
209
- puts " The format is usually: 'engine://username:password@host:port/database_name'"
210
- puts " For more details, see: http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html"
211
- puts
212
- input_db_string = ''
213
- until input_db_string != ''
214
- input_db_string = ask(" Database connection string: ") do |q|
215
- q.default = other_db_string
216
- end
217
- end
218
- other_db_string = input_db_string
219
- print "Correct, "
220
- is_correct = yesno(true) until is_correct != nil
221
- if is_correct
222
- return other_db_string
223
- else
224
- ask_about_other_db( other_db_string )
225
- end
226
- end
227
-
228
- def ask_about_db
229
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
230
- puts " Session database configuration"
231
- puts
232
- puts " Riassence Framework requires a database for persistant"
233
- puts " session storage. This feature allows the server"
234
- puts " to be restarted without losing user sessions."
235
- puts
236
- puts " The default database engine is SQLite."
237
- puts
238
- puts " Select one of the following:"
239
- puts " 1 - SQLite"
240
- puts " 2 - MySQL"
241
- puts " 3 - Other (custom Sequel database url)"
242
- db_type = ''
243
- until ['1','2','3'].include?(db_type)
244
- db_type = ask("Database engine? ") do |q|
245
- q.default = '1'
246
- end
247
- end
248
- if db_type == '1'
249
- db_connection_string = ask_about_sqlite
250
- elsif db_type == '2'
251
- db_connection_string = ask_about_mysql
252
- elsif db_type == '3'
253
- db_connection_string = ask_about_other_db
254
- end
255
- puts
256
- puts " The database connection string is:"
257
- puts " #{db_connection_string}"
258
- puts
259
- print " Correct, "
260
- db_ok = yesno(true) until db_ok != nil
261
- if not db_ok
262
- ask_about_db
263
- else
264
- @conf[:database][:ses_db] = db_connection_string
265
- end
266
- end
267
-
268
- def run( local_config_file_path )
269
- puts
270
- puts
271
- puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
272
- puts " This Riassence Framework instance is not configured."
273
- puts
274
- puts " To configure, create a configuration file:"
275
- puts " #{local_config_file_path}"
276
- puts
277
- puts " You may also answer a few simple questions to create"
278
- puts " a configuration file template."
279
- puts
280
- print " Do you want to run the configuration tool, "
281
- configure_now = yesno(true) until configure_now != nil
282
- unless configure_now
283
- puts
284
- puts " OK. No configuration at this time. Can't continue; exit."
285
- exit
286
- end
287
- ask_about_db
288
- ask_about_httpd
289
- puts
290
- puts "Configuration done!"
291
- puts
292
- puts "Writing #{local_config_file_path.inspect}..."
293
- f = File.open( local_config_file_path, 'w' )
294
- f.write( YAML.dump( @conf ) )
295
- f.close
296
- puts
297
- puts "Edit #{local_config_file_path} to change the configuration."
298
- puts
299
- return @conf
300
- end
301
- end
302
-
303
-
File without changes
File without changes
File without changes