rsence 2.0.0.10.pre → 2.0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/.yardopts +10 -0
  2. data/INSTALL.rdoc +52 -86
  3. data/{LICENSE → LICENSE.txt} +0 -0
  4. data/README.rdoc +52 -49
  5. data/VERSION +1 -1
  6. data/bin/rsence +4 -6
  7. data/conf/default_conf.yaml +314 -305
  8. data/conf/default_strings.yaml +70 -71
  9. data/docs/ExampleGuiPlugin.rdoc +193 -0
  10. data/{js/comm/comm/autosync/js.inc → docs/JavascriptBundles.rdoc} +0 -0
  11. data/docs/PluginBundleInfo.rdoc +173 -0
  12. data/docs/PluginBundles.rdoc +96 -0
  13. data/docs/Values.rdoc +163 -0
  14. data/js/comm/{comm/autosync → autosync}/autosync.js +1 -2
  15. data/js/comm/{comm → autosync}/js.inc +0 -0
  16. data/js/comm/{comm/comm.js → comm.js} +1 -0
  17. data/js/comm/{comm/queue/js.inc → js.inc} +0 -0
  18. data/js/comm/jsloader/jsloader.js +2 -4
  19. data/js/comm/{comm/session → queue}/js.inc +0 -0
  20. data/js/comm/{comm/queue → queue}/queue.js +1 -0
  21. data/js/comm/{comm/sessionwatcher → session}/js.inc +0 -0
  22. data/js/comm/{comm/session → session}/session.js +4 -3
  23. data/js/comm/{comm/transporter → sessionwatcher}/js.inc +0 -0
  24. data/js/comm/{comm/sessionwatcher → sessionwatcher}/sessionwatcher.js +1 -0
  25. data/js/comm/{comm/urlresponder → transporter}/js.inc +0 -0
  26. data/js/comm/{comm/transporter → transporter}/transporter.js +1 -0
  27. data/js/comm/{comm/values → urlresponder}/js.inc +0 -0
  28. data/js/comm/{comm/urlresponder → urlresponder}/urlresponder.js +1 -0
  29. data/js/comm/{reloadapp → values}/js.inc +0 -0
  30. data/js/comm/{comm/values → values}/values.js +1 -0
  31. data/js/controls/button/button.js +10 -1
  32. data/js/controls/checkbox/checkbox.js +2 -0
  33. data/js/controls/dialogs/alert_sheet/alert_sheet.js +1 -0
  34. data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +1 -0
  35. data/js/controls/dialogs/sheet/sheet.js +1 -0
  36. data/js/controls/imageview/imageview.js +1 -0
  37. data/js/controls/passwordcontrol/passwordcontrol.js +1 -0
  38. data/js/controls/progress/progressbar/progressbar.js +1 -0
  39. data/js/controls/progress/progressindicator/progressindicator.js +1 -0
  40. data/js/controls/radiobutton/radiobutton.js +3 -1
  41. data/js/controls/sliders/slider/slider.js +1 -0
  42. data/js/controls/sliders/vslider/vslider.js +1 -0
  43. data/js/controls/stepper/stepper.js +1 -0
  44. data/js/controls/stringview/stringview.js +2 -2
  45. data/js/controls/tab/tab.js +7 -5
  46. data/js/controls/textarea/textarea.js +1 -0
  47. data/js/controls/textcontrol/textcontrol.js +3 -1
  48. data/js/controls/uploader/uploader.js +1 -0
  49. data/js/controls/validatorview/validatorview.js +62 -59
  50. data/js/controls/window/window.js +1 -0
  51. data/js/core/class/class.js +2 -1
  52. data/js/core/elem/elem.js +27 -27
  53. data/js/core/event/event.js +3 -874
  54. data/js/{comm/sha → core/rsence_ns}/js.inc +0 -0
  55. data/js/core/rsence_ns/rsence_ns.js +15 -0
  56. data/js/{controls/datetime → datetime}/calendar/calendar.js +1 -0
  57. data/js/{comm/values/value → datetime/calendar}/js.inc +0 -0
  58. data/js/{controls/datetime → datetime}/calendar/themes/default/calendar.css +0 -0
  59. data/js/{controls/datetime → datetime}/calendar/themes/default/calendar.html +0 -0
  60. data/js/{controls/datetime → datetime}/calendar/themes/default/calendar_arrows-ie6.gif +0 -0
  61. data/js/{controls/datetime → datetime}/calendar/themes/default/calendar_arrows.png +0 -0
  62. data/js/{controls/datetime → datetime}/datetimevalue/datetimevalue.js +1 -0
  63. data/js/{comm/values/valuematrix → datetime/datetimevalue}/js.inc +0 -0
  64. data/js/{controls/datetime/calendar → datetime/timesheet}/js.inc +0 -0
  65. data/js/{controls/datetime → datetime}/timesheet/themes/default/timesheet.css +0 -0
  66. data/js/{controls/datetime → datetime}/timesheet/themes/default/timesheet.html +0 -0
  67. data/js/{controls/datetime → datetime}/timesheet/timesheet.js +1 -0
  68. data/js/{controls/datetime/datetimevalue → datetime/timesheet_item}/js.inc +0 -0
  69. data/js/{controls/datetime → datetime}/timesheet_item/themes/default/timesheet_item.css +0 -0
  70. data/js/{controls/datetime → datetime}/timesheet_item/themes/default/timesheet_item.html +0 -0
  71. data/js/{controls/datetime → datetime}/timesheet_item/timesheet_item.js +1 -0
  72. data/js/{controls/datetime/timesheet → datetime/timesheet_item_edit}/js.inc +0 -0
  73. data/js/{controls/datetime → datetime}/timesheet_item_edit/timesheet_item_edit.js +1 -1
  74. data/js/foundation/application/application.js +1 -2
  75. data/js/foundation/control/control.js +1 -4
  76. data/js/foundation/control/controldefaults/controldefaults.js +1 -4
  77. data/js/foundation/control/dummyvalue/dummyvalue.js +1 -0
  78. data/js/foundation/control/dyncontrol/dyncontrol.js +1 -2
  79. data/js/foundation/control/eventresponder/eventresponder.js +11 -3
  80. data/js/{controls/datetime/timesheet_item → foundation/control/valuematrix}/js.inc +0 -0
  81. data/js/{comm/values → foundation/control}/valuematrix/valuematrix.js +2 -5
  82. data/js/foundation/control/valueresponder/valueresponder.js +3 -1
  83. data/js/foundation/eventmanager/eventmanager.js +884 -0
  84. data/js/{controls/datetime/timesheet_item_edit → foundation/eventmanager}/js.inc +0 -0
  85. data/js/foundation/geom/point/point.js +2 -2
  86. data/js/foundation/geom/rect/rect.js +1 -0
  87. data/js/foundation/json_renderer/json_renderer.js +2 -0
  88. data/js/foundation/system/system.js +2 -1
  89. data/js/foundation/thememanager/thememanager.js +29 -23
  90. data/js/{controls/lists/checkboxlist → foundation/value}/js.inc +0 -0
  91. data/js/{comm/values → foundation}/value/value.js +1 -0
  92. data/js/foundation/view/markupview/markupview.js +2 -1
  93. data/js/foundation/view/morphanimation/morphanimation.js +1 -0
  94. data/js/foundation/view/view.js +6 -12
  95. data/js/foundation/view/viewdefaults/viewdefaults.js +1 -0
  96. data/js/{controls/lists → lists}/checkboxlist/checkboxlist.js +1 -0
  97. data/js/{controls/lists/listitems → lists/checkboxlist}/js.inc +0 -0
  98. data/js/{controls/lists/radiobuttonlist → lists/listitems}/js.inc +0 -0
  99. data/js/{controls/lists → lists}/listitems/listitems.js +22 -3
  100. data/js/lists/radiobuttonlist/js.inc +0 -0
  101. data/js/{controls/lists → lists}/radiobuttonlist/radiobuttonlist.js +2 -12
  102. data/js/util/reloadapp/js.inc +0 -0
  103. data/js/{comm → util}/reloadapp/reloadapp.js +10 -8
  104. data/js/{comm → util}/reloadapp/themes/default/reloadapp_warning-ie6.gif +0 -0
  105. data/js/{comm → util}/reloadapp/themes/default/reloadapp_warning.png +0 -0
  106. data/js/util/sha/js.inc +0 -0
  107. data/js/{comm → util}/sha/sha.js +27 -33
  108. data/js/views/centerview/centerview.js +33 -3
  109. data/js/views/inlineview/inlineview.js +1 -0
  110. data/js/views/scrollview/scrollview.js +1 -0
  111. data/lib/conf/argv.rb +34 -22
  112. data/lib/conf/default.rb +165 -173
  113. data/lib/daemon/daemon.rb +9 -9
  114. data/lib/daemon/sigcomm.rb +4 -4
  115. data/lib/http/broker.rb +30 -27
  116. data/lib/http/rackup.rb +2 -3
  117. data/lib/http/request.rb +1 -2
  118. data/lib/http/response.rb +10 -10
  119. data/lib/plugins/dependencies.rb +2 -1
  120. data/lib/plugins/gui_plugin.rb +77 -50
  121. data/lib/plugins/guiparser.rb +26 -22
  122. data/lib/plugins/plugin.rb +207 -427
  123. data/lib/plugins/plugin_base.rb +162 -0
  124. data/lib/plugins/plugin_plugins.rb +21 -15
  125. data/lib/plugins/plugin_sqlite_db.rb +45 -20
  126. data/lib/plugins/pluginmanager.rb +10 -5
  127. data/lib/plugins/plugins.rb +65 -31
  128. data/lib/plugins/servlet.rb +74 -26
  129. data/lib/rsence.rb +32 -0
  130. data/lib/session/msg.rb +131 -96
  131. data/lib/session/sessionmanager.rb +5 -4
  132. data/lib/session/sessionstorage.rb +4 -3
  133. data/lib/transporter/transporter.rb +30 -21
  134. data/lib/util/gzstring.rb +4 -2
  135. data/lib/util/ruby19_fixes.rb +18 -0
  136. data/lib/values/hvalue.rb +139 -88
  137. data/lib/values/valuemanager.rb +60 -46
  138. data/plugins/client_pkg/client_pkg.rb +6 -5
  139. data/plugins/client_pkg/lib/client_pkg_build.rb +5 -5
  140. data/plugins/client_pkg/lib/client_pkg_serve.rb +8 -0
  141. data/plugins/index_html/index_html.rb +3 -1
  142. data/plugins/index_html/tmpl/index.html +2 -3
  143. data/plugins/main/js/main.js +84 -0
  144. data/plugins/main/main.rb +54 -27
  145. data/plugins/ticket/lib/common.rb +4 -2
  146. data/plugins/ticket/lib/favicon.rb +3 -2
  147. data/plugins/ticket/lib/file.rb +2 -2
  148. data/plugins/ticket/lib/img.rb +2 -2
  149. data/plugins/ticket/lib/objblob.rb +2 -2
  150. data/plugins/ticket/lib/rsrc.rb +2 -2
  151. data/plugins/ticket/lib/upload.rb +9 -8
  152. data/plugins/ticket/ticket.rb +141 -8
  153. data/setup/welcome/welcome.rb +1 -0
  154. metadata +76 -72
  155. data/lib/plugins/plugin_util.rb +0 -107
  156. data/plugins/index_html/tmpl/startup_index.html +0 -29
  157. data/plugins/main/js/riassence_ns.js +0 -87
  158. data/setup/legacy/info.yaml +0 -18
  159. data/setup/legacy/legacy.rb +0 -17
  160. data/setup/welcome/gui/welcome.yaml +0 -68
  161. data/setup/welcome/text/welcome.html +0 -8
@@ -1,107 +0,0 @@
1
- ## RSence
2
- # Copyright 2010 Riassence Inc.
3
- # http://riassence.com/
4
- #
5
- # You should have received a copy of the GNU General Public License along
6
- # with this software package. If not, contact licensing@riassence.com
7
- ##
8
-
9
- module ::RSence
10
- module Plugins
11
-
12
- # This module contains common functionality for both the Plugin and
13
- # the Servlet base classes.
14
- module PluginUtil
15
-
16
- include RSence
17
-
18
- # Extend to do any initial configuration. Not doing anything by default.
19
- def init
20
- end
21
-
22
- # Extend this method to open objects like streams and database connections.
23
- # It is called when everything is constructed after all plugins are loaded.
24
- def open
25
- end
26
-
27
- # Extend to save your plugin state or store any data that needs to be
28
- # persistent. It's always called before close, but doesn't necessarily mean
29
- # a close call is imminent.
30
- def flush
31
- end
32
-
33
- # Extend this method to close objects like streams and database connections.
34
- # It's called when plugins are about to be destructed, so don't expect any
35
- # calls after it has been called. When this method is called, it's the last
36
- # chance to save persistent data before being destructed, so implement
37
- # the +#flush+ method for primarily storing data.
38
- def close
39
- end
40
-
41
- # Returns the contents of the file given as +path+.
42
- #
43
- # The plugin bundle's path is used as the prefix, unless +path+ starts with '/' or '..'
44
- #
45
- # If the file doesn't exist, it returns +false+.
46
- def file_read( path )
47
- path = bundle_path( path )
48
- return false unless File.exist?( path )
49
- return File.read( path )
50
- end
51
-
52
- def yaml_read( path )
53
- file_data = file_read( path )
54
- if not file_data
55
- return false
56
- else
57
- return YAML.load( file_data )
58
- end
59
- end
60
-
61
- # Writes the +data+ into the file +path+.
62
- #
63
- # The plugin bundle's path is used as the prefix, unless +path+ starts with '/' or '..'
64
- #
65
- # It returns a success code (+false+ for failure and +true+ for success).
66
- def file_write( path, data )
67
- path = bundle_path( path )
68
- begin
69
- datafile = File.open( path, 'wb' )
70
- datafile.write( data )
71
- datafile.close
72
- return true
73
- rescue => e
74
- warn "file_write error for path #{path} #{e}"
75
- return false
76
- end
77
- end
78
- alias file_save file_write
79
-
80
- # Makes a full path using the plugin bundle as the 'local path'.
81
- # The (optional) +prefix+ is a subdirectory in the bundle,
82
- # the +suffix+ is the file extension.
83
- def bundle_path( path, prefix=false, suffix=false )
84
- if suffix
85
- path = "#{path}#{suffix}" unless path.end_with?(suffix)
86
- end
87
- if prefix
88
- path = File.join( prefix, path )
89
- end
90
- path = File.expand_path( path, @path )
91
- return path
92
- end
93
-
94
- def compose_plugin_path( *args )
95
- warn "'compose_plugin_path' is deprecated. Use 'bundle_path' instead."
96
- bundle_path( *args )
97
- end
98
-
99
- # Helper method to return the time formatted according to the HTTP RFC
100
- def httime(time=false)
101
- time = Time.new unless time
102
- return time.gmtime.strftime('%a, %d %b %Y %H:%M:%S %Z')
103
- end
104
-
105
- end
106
- end
107
- end
@@ -1,29 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en">
4
- <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
- <!-- This page is served to you by RSence - http://riassence.com/ -->
6
- <title>__DEFAULT_TITLE__</title>
7
- <style type="text/css">body{margin:0;padding:0;background-color:#ddd;font-family:Arial,sans-serif;}</style>
8
- __SCRIPT_DEPS__
9
- <script type="text/javascript" src="__CLIENT_BASE__/js/core.js"></script>
10
- <!--[if lt IE 7]><script type="text/javascript" src="__CLIENT_BASE__/js/iefix.js"></script><![endif]-->
11
-
12
- <script type="text/javascript">
13
-
14
- /** Runtime configuration: **/
15
- HCLIENT_REV='__CLIENT_REV__';
16
- HCLIENT_BASE='__CLIENT_BASE__';
17
- HCLIENT_HELLO='__CLIENT_HELLO__';
18
- HThemeManager.themePath='__CLIENT_BASE__/themes';
19
-
20
- /** Startup sequence: **/
21
- COMM.Transporter.busy = true;
22
- LOAD(function(){
23
- __STARTUP_SEQUENCE__
24
- COMM.Transporter.busy = false;
25
- });
26
-
27
- </script>
28
-
29
- </head><body id="body"><noscript>__NOSCRIPT__</noscript></body></html>
@@ -1,87 +0,0 @@
1
- RSence = {
2
-
3
- // List of apps initialized utilizing GUITrees, by GUIPlugin name
4
- apps: { },
5
-
6
- // Subview that utilizes GUITrees
7
- GUIView: HControl.extend({
8
-
9
- }),
10
-
11
- // Application that handles GUITrees, populates its values dynamically
12
- GUIApp: HApplication.extend({
13
- constructor: function(_options){
14
-
15
- var
16
- _this = this,
17
-
18
- // Application priority
19
- _priority = _options.priority?_options.priority:100,
20
-
21
- // Application label / title
22
- _label = _options.label?_options.label:'Untitled Application',
23
-
24
- // Application description (multiline)
25
- _descr = _options.descr?_options.descr:'No Description',
26
-
27
- // Allow multiple instances?
28
- _allowMulti = _options.allowMulti?_options.allowMulti:false,
29
-
30
- // The GUI Tree
31
- _valueObj = _options.valueObj?_options.valueObj:false,
32
-
33
- // Signal input (from server to client)
34
- _sigInput = _options.sigInput?COMM.Values.values[_options.sigInput]:false,
35
-
36
- // Signal output (from client to server)
37
- _sigOutput = _options.sigOutput?COMM.Values.values[_options.sigOutput]:false,
38
-
39
- // Icon image url.
40
- // Minimum size is 16x16 and multiple sizes are stacked on top of each other,
41
- // largest topmost, smaller versions aligned left below in size order.
42
- // Image formats supported are: SVG (except for IE), PNG (all), GIF (all), JPG (all).
43
- // Recommended formats are: SVG and PNG24 with transparency / translucency.
44
- // Size has to be a factor of two; 16,32,64,128,256,512 are valid dimensions:
45
- // 32x32 -> 32x32 single icon
46
- // 32x48 -> 32x32 and 16x16
47
- // 512x512 -> 512x512 single icon
48
- // 512x768 -> 512x512, 256x256
49
- // 512x640 -> 512x512, 128x128
50
- // 512x896 -> 512x512, 256x256 and 128x128
51
- // etc..
52
- _iconUrl = _options.iconUrl?COMM.Values.values[_options.iconUrl]:false;
53
-
54
- // Construct the application base:
55
- _this.base( _priority, _label );
56
-
57
- // Options combined from vars above
58
- _this.options = {
59
- label: _label,
60
- descr: _descr,
61
- allowMulti: _allowMulti,
62
- sigInput: _sigInput,
63
- sigOutput: _sigOutput,
64
- icon: { url: _iconUrl, width: null, height: null },
65
- pid: this.appId,
66
- views: []
67
- };
68
-
69
- _this.valueObj = _valueObj;
70
- _this.value = _valueObj.value;
71
-
72
- // _this.app = _this;
73
-
74
- //
75
- // _this.renderer = COMM.JSONRenderer.extend({
76
- //
77
- // }).nu( _this.value, _this );
78
- },
79
-
80
- die: function(){
81
- this.base();
82
-
83
- }
84
-
85
- })
86
- };
87
-
@@ -1,18 +0,0 @@
1
-
2
- # The human-readable product name of the package
3
- title: Legacy Compatibility Plugin
4
-
5
- # The human-readable version of the package
6
- version: 1.0.0
7
-
8
- # A brief description of the package (rdoc formatting supported)
9
- description: |
10
- This bundle provides compatibility for older plugins that rely on
11
- some global variables.
12
-
13
- # A flag (when false) prevents the plugin from automatically reload when changed.
14
- reloadable: false
15
-
16
- # System version requirement.
17
- sys_version: '>= 2.0.0'
18
-
@@ -1,17 +0,0 @@
1
-
2
- # This Plugin contains some namespace mappings of what used to exist in RSence 1.x
3
- class LegacyPlugin < Servlet
4
- def init
5
- super
6
- $PLUGINS = @plugins
7
- $config = ::RSence.config
8
- $TICKETSERVE = @plugins[:ticketservices]
9
- end
10
- end
11
-
12
- module ::Riassence
13
- module Server
14
- include RSence
15
- end
16
- end
17
-
@@ -1,68 +0,0 @@
1
- type: GUITree
2
- version: 0.6
3
-
4
- dependencies:
5
- - default_theme
6
- - controls
7
-
8
- class: RSence.GUIApp
9
- options:
10
- title: Welcome App
11
- priority: 20
12
- subviews:
13
- - class: HSheet
14
- rect: [ 0, 0, 600, 500 ]
15
- bind: :values.close
16
- extend:
17
- refreshValue: |
18
- function(){
19
- this.base();
20
- if ( this.value==1 ) {
21
- this.app.die();
22
- }
23
- }
24
- subviews:
25
- - class: HScrollView
26
- rect: [ 0, 0, 550, 300, 0, 42 ]
27
- options:
28
- scrollX: false
29
- scrollY: auto
30
- style:
31
- - [ 'background-color', 'white' ]
32
- - [ 'border-bottom', '1px solid black' ]
33
- subviews:
34
- - class: HImageView
35
- rect: [ 18, 10, 559, 110 ]
36
- options:
37
- value: http://rsence.org/rsence_org_logo.gif
38
- - class: HView
39
- rect: [ null, 95, 310, 25, 35, null ]
40
- options:
41
- html: |
42
- <i style="font-family:Helvetica,Arial,sans-serif;font-size:16px;">
43
- <a style="color:#28c;font-weight:bold" href="http://rsence.org/">http://www.rsence.org/</a>
44
- </i>
45
- style:
46
- - - text-align
47
- - right
48
- - class: HInlineView
49
- rect: [ 0, 0, null, null, 0, 0 ]
50
- options:
51
- html: :text.welcome
52
- style:
53
- - - font-family
54
- - 'Helvetica, Arial, sans-serif'
55
- - - font-size
56
- - 16px
57
- - - line-height
58
- - 20px
59
- - class: HClickValueButton
60
- rect: [ null, null, 60, 24, 8, 8 ]
61
- bind: :values.close
62
- options:
63
- label: Close
64
- - class: HCheckbox
65
- rect: [ null, null, 130, 24, 74, 8 ]
66
- bind: :values.dont_show_again
67
- options:
68
- label: Don't show again
@@ -1,8 +0,0 @@
1
- <div style="margin-left:40px;margin-top:140px;margin-right:20px">
2
- <h1>Congratulations!</h1>
3
- <p>This message is served to you by RSence running in your new environment.</p>
4
- <p>The next time you create an RSence environment, use the <code>--blank</code> option of the <code>rsence&nbsp;initenv</code> command to avoid this message.</p>
5
- <p>Use the <code>rsence help</code> command to learn more about the <code>rsence</code> command-line tool and its various commands and options.</p>
6
- <p>You may want to install or write some software to run in your new RSence environment next.</p>
7
- <p>Go to <a href="http://rsence.org/">rsence.org</a> to learn more about RSence.</p>
8
- </span>