Skip to content
This repository
Browse code

initial creation

  • Loading branch information...
commit edb5e3b2abda8105376f2a4004a38ca3db4a6265 0 parents
authored February 25, 2011

Showing 108 changed files with 16,891 additions and 0 deletions. Show diff stats Hide diff stats

  1. 202  LICENSE
  2. 178  framework/src/WebWorksAppTemplate-app.xml
  3. 206  framework/src/WebWorksAppTemplate.as
  4. 9  framework/src/blackberry-tablet.xml
  5. 127  framework/src/webworks/FunctionBroker.as
  6. 218  framework/src/webworks/JavaScriptLoader.as
  7. 67  framework/src/webworks/access/Access.as
  8. 64  framework/src/webworks/access/Feature.as
  9. 79  framework/src/webworks/config/ConfigConstants.as
  10. 212  framework/src/webworks/config/ConfigData.as
  11. 267  framework/src/webworks/config/CustomData.as
  12. 85  framework/src/webworks/config/Globals.as
  13. 20  framework/src/webworks/config/TransitionConstants.as
  14. 25  framework/src/webworks/errors/AccessError.as
  15. 43  framework/src/webworks/extension/AppNameSpaceGenerator.as
  16. 129  framework/src/webworks/extension/DefaultExtension.as
  17. 26  framework/src/webworks/extension/IApiExtension.as
  18. 31  framework/src/webworks/extension/SystemNameSpaceGenerator.as
  19. 214  framework/src/webworks/loadingScreen/LoadingScreen.as
  20. 157  framework/src/webworks/loadingScreen/Transitions.as
  21. 285  framework/src/webworks/policy/WidgetPolicy.as
  22. 198  framework/src/webworks/policy/WidgetWebFolderAccess.as
  23. 76  framework/src/webworks/uri/IURIResolver.as
  24. 2,466  framework/src/webworks/uri/URI.as
  25. 139  framework/src/webworks/uri/URIEncodingBitmap.as
  26. 108  framework/src/webworks/util/DeviceURL.as
  27. 116  framework/src/webworks/util/Utilities.as
  28. 174  framework/src/webworks/webkit/WebkitControl.as
  29. 49  framework/src/webworks/webkit/WebkitEvent.as
  30. 18  js_api/BlackBerry/js/common/blackberry_ns.js
  31. 94  js_api/BlackBerry_Application/js/common/app_dispatcher.js
  32. 52  js_api/BlackBerry_Application/js/common/app_ns.js
  33. 76  js_api/BlackBerry_Application/library.xml
  34. 94  js_api/BlackBerry_Application/src/Air/Application/src/blackberry/application/Application.as
  35. 53  js_api/BlackBerry_Application_Events/js/common/app_event_dispatcher.js
  36. 38  js_api/BlackBerry_Application_Events/js/common/app_event_ns.js
  37. 61  js_api/BlackBerry_Application_Events/library.xml
  38. 81  ...lackBerry_Application_Events/src/Air/ApplicationEvents/src/blackberry/applicationEvents/ApplicationEvent.as
  39. 123  js_api/BlackBerry_Invoke/js/common/invoke_dispatcher.js
  40. 78  js_api/BlackBerry_Invoke/js/common/invoke_ns.js
  41. 113  js_api/BlackBerry_Invoke/library.xml
  42. 61  js_api/BlackBerry_Invoke/src/Air/Invoke/src/blackberry/invoke/Invoke.as
  43. 84  js_api/BlackBerry_System/js/common/system_dispatcher.js
  44. 61  js_api/BlackBerry_System/js/common/system_dispatcher_withXHR.js
  45. 88  js_api/BlackBerry_System/js/common/system_ns.js
  46. 70  js_api/BlackBerry_System/js/common/system_ns_withXHR.js
  47. 130  js_api/BlackBerry_System/library.xml
  48. 111  js_api/BlackBerry_System/src/Air/System/src/blackberry/system/System.as
  49. 52  js_api/BlackBerry_System_Events/js/common/system_event_dispatcher.js
  50. 40  js_api/BlackBerry_System_Events/js/common/system_event_ns.js
  51. 72  js_api/BlackBerry_System_Events/library.xml
  52. 73  js_api/BlackBerry_System_Events/src/Air/SystemEvents/src/blackberry/system/event/SystemEvents.as
  53. 120  js_api/BlackBerry_Ui/js/common/dialog/dialog_dispatcher.js
  54. 51  js_api/BlackBerry_Ui/js/common/dialog/dialog_ns.js
  55. 102  js_api/BlackBerry_Ui/library.xml
  56. 112  js_api/BlackBerry_Ui/src/Air/UserInterface/src/blackberry/ui/dialog/Dialog.as
  57. 92  js_api/BlackBerry_Utilities/js/common/Math.uuid.js
  58. 89  js_api/BlackBerry_Utilities/js/common/utilities_ns.js
  59. 80  js_api/BlackBerry_Utilities/library.xml
  60. 29  js_api/BlackBerry_Utilities/src/Air/Utilities/src/blackberry/utils/Utilities.as
  61. BIN  js_api/Common_AS/JSONLibrary/bin/JSONLibrary.swc
  62. 86  js_api/Common_AS/JSONLibrary/src/json/JSON.as
  63. 352  js_api/Common_AS/JSONLibrary/src/json/JSONDecoder.as
  64. 323  js_api/Common_AS/JSONLibrary/src/json/JSONEncoder.as
  65. 92  js_api/Common_AS/JSONLibrary/src/json/JSONParseError.as
  66. 92  js_api/Common_AS/JSONLibrary/src/json/JSONToken.as
  67. 69  js_api/Common_AS/JSONLibrary/src/json/JSONTokenType.as
  68. 708  js_api/Common_AS/JSONLibrary/src/json/JSONTokenizer.as
  69. 16  js_api/globalJS/1_constants.js
  70. 18  js_api/globalJS/2_blackberry_ns.js
  71. 97  js_api/globalJS/3_xhr.js
  72. 56  js_api/globalJS/4_events_ns.js
  73. 241  packager/src/TumblerLauncher/TumblerLauncher.cpp
  74. 182  packager/src/TumblerLauncher/bbwp_mac.c
  75. 277  packager/src/net/rim/tumbler/CmdLineHandler.java
  76. 155  packager/src/net/rim/tumbler/WidgetArchive.java
  77. 373  packager/src/net/rim/tumbler/WidgetPackager.java
  78. 466  packager/src/net/rim/tumbler/airpackager/AirPackager.java
  79. 57  packager/src/net/rim/tumbler/config/WidgetAccess.java
  80. 627  packager/src/net/rim/tumbler/config/WidgetConfig.java
  81. 47  packager/src/net/rim/tumbler/config/WidgetFeature.java
  82. 44  packager/src/net/rim/tumbler/exception/CommandLineException.java
  83. 42  packager/src/net/rim/tumbler/exception/PackageException.java
  84. 45  packager/src/net/rim/tumbler/exception/SessionException.java
  85. 37  packager/src/net/rim/tumbler/exception/ValidationException.java
  86. 58  packager/src/net/rim/tumbler/extension/ConfiguredPathname.java
  87. 61  packager/src/net/rim/tumbler/extension/ExtensionDescriptor.java
  88. 273  packager/src/net/rim/tumbler/extension/ExtensionMap.java
  89. 653  packager/src/net/rim/tumbler/file/FileManager.java
  90. 112  packager/src/net/rim/tumbler/file/TemplateFile.java
  91. 91  packager/src/net/rim/tumbler/file/TemplateWrapper.java
  92. 25  packager/src/net/rim/tumbler/log/LogType.java
  93. 67  packager/src/net/rim/tumbler/log/Logger.java
  94. 73  packager/src/net/rim/tumbler/log/resources/MessageBundle_en_CA.properties
  95. 204  packager/src/net/rim/tumbler/mxmlc/Mxmlc.java
  96. 100  packager/src/net/rim/tumbler/processbuffer/ErrorBuffer.java
  97. 92  packager/src/net/rim/tumbler/processbuffer/ExitBuffer.java
  98. 100  packager/src/net/rim/tumbler/processbuffer/OutputBuffer.java
  99. 206  packager/src/net/rim/tumbler/processbuffer/ProcessBuffer.java
  100. 29  packager/src/net/rim/tumbler/processbuffer/package.html
  101. 22  packager/src/net/rim/tumbler/serialize/WidgetConfigSerializer.java
  102. 314  packager/src/net/rim/tumbler/serialize/WidgetConfig_v1Serializer.java
  103. 334  packager/src/net/rim/tumbler/session/BBWPProperties.java
  104. 286  packager/src/net/rim/tumbler/session/SessionManager.java
  105. 138  packager/src/net/rim/tumbler/signing/SigningSupport.java
  106. 733  packager/src/net/rim/tumbler/xml/ConfigXMLParser.java
  107. 23  packager/src/net/rim/tumbler/xml/XMLParser.java
  108. 27  readme.md
202  LICENSE
... ...
@@ -0,0 +1,202 @@
  1
+
  2
+                                 Apache License
  3
+                           Version 2.0, January 2004
  4
+                        http://www.apache.org/licenses/
  5
+
  6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  7
+
  8
+   1. Definitions.
  9
+
  10
+      "License" shall mean the terms and conditions for use, reproduction,
  11
+      and distribution as defined by Sections 1 through 9 of this document.
  12
+
  13
+      "Licensor" shall mean the copyright owner or entity authorized by
  14
+      the copyright owner that is granting the License.
  15
+
  16
+      "Legal Entity" shall mean the union of the acting entity and all
  17
+      other entities that control, are controlled by, or are under common
  18
+      control with that entity. For the purposes of this definition,
  19
+      "control" means (i) the power, direct or indirect, to cause the
  20
+      direction or management of such entity, whether by contract or
  21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
  22
+      outstanding shares, or (iii) beneficial ownership of such entity.
  23
+
  24
+      "You" (or "Your") shall mean an individual or Legal Entity
  25
+      exercising permissions granted by this License.
  26
+
  27
+      "Source" form shall mean the preferred form for making modifications,
  28
+      including but not limited to software source code, documentation
  29
+      source, and configuration files.
  30
+
  31
+      "Object" form shall mean any form resulting from mechanical
  32
+      transformation or translation of a Source form, including but
  33
+      not limited to compiled object code, generated documentation,
  34
+      and conversions to other media types.
  35
+
  36
+      "Work" shall mean the work of authorship, whether in Source or
  37
+      Object form, made available under the License, as indicated by a
  38
+      copyright notice that is included in or attached to the work
  39
+      (an example is provided in the Appendix below).
  40
+
  41
+      "Derivative Works" shall mean any work, whether in Source or Object
  42
+      form, that is based on (or derived from) the Work and for which the
  43
+      editorial revisions, annotations, elaborations, or other modifications
  44
+      represent, as a whole, an original work of authorship. For the purposes
  45
+      of this License, Derivative Works shall not include works that remain
  46
+      separable from, or merely link (or bind by name) to the interfaces of,
  47
+      the Work and Derivative Works thereof.
  48
+
  49
+      "Contribution" shall mean any work of authorship, including
  50
+      the original version of the Work and any modifications or additions
  51
+      to that Work or Derivative Works thereof, that is intentionally
  52
+      submitted to Licensor for inclusion in the Work by the copyright owner
  53
+      or by an individual or Legal Entity authorized to submit on behalf of
  54
+      the copyright owner. For the purposes of this definition, "submitted"
  55
+      means any form of electronic, verbal, or written communication sent
  56
+      to the Licensor or its representatives, including but not limited to
  57
+      communication on electronic mailing lists, source code control systems,
  58
+      and issue tracking systems that are managed by, or on behalf of, the
  59
+      Licensor for the purpose of discussing and improving the Work, but
  60
+      excluding communication that is conspicuously marked or otherwise
  61
+      designated in writing by the copyright owner as "Not a Contribution."
  62
+
  63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
  64
+      on behalf of whom a Contribution has been received by Licensor and
  65
+      subsequently incorporated within the Work.
  66
+
  67
+   2. Grant of Copyright License. Subject to the terms and conditions of
  68
+      this License, each Contributor hereby grants to You a perpetual,
  69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  70
+      copyright license to reproduce, prepare Derivative Works of,
  71
+      publicly display, publicly perform, sublicense, and distribute the
  72
+      Work and such Derivative Works in Source or Object form.
  73
+
  74
+   3. Grant of Patent License. Subject to the terms and conditions of
  75
+      this License, each Contributor hereby grants to You a perpetual,
  76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
  77
+      (except as stated in this section) patent license to make, have made,
  78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
  79
+      where such license applies only to those patent claims licensable
  80
+      by such Contributor that are necessarily infringed by their
  81
+      Contribution(s) alone or by combination of their Contribution(s)
  82
+      with the Work to which such Contribution(s) was submitted. If You
  83
+      institute patent litigation against any entity (including a
  84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
  85
+      or a Contribution incorporated within the Work constitutes direct
  86
+      or contributory patent infringement, then any patent licenses
  87
+      granted to You under this License for that Work shall terminate
  88
+      as of the date such litigation is filed.
  89
+
  90
+   4. Redistribution. You may reproduce and distribute copies of the
  91
+      Work or Derivative Works thereof in any medium, with or without
  92
+      modifications, and in Source or Object form, provided that You
  93
+      meet the following conditions:
  94
+
  95
+      (a) You must give any other recipients of the Work or
  96
+          Derivative Works a copy of this License; and
  97
+
  98
+      (b) You must cause any modified files to carry prominent notices
  99
+          stating that You changed the files; and
  100
+
  101
+      (c) You must retain, in the Source form of any Derivative Works
  102
+          that You distribute, all copyright, patent, trademark, and
  103
+          attribution notices from the Source form of the Work,
  104
+          excluding those notices that do not pertain to any part of
  105
+          the Derivative Works; and
  106
+
  107
+      (d) If the Work includes a "NOTICE" text file as part of its
  108
+          distribution, then any Derivative Works that You distribute must
  109
+          include a readable copy of the attribution notices contained
  110
+          within such NOTICE file, excluding those notices that do not
  111
+          pertain to any part of the Derivative Works, in at least one
  112
+          of the following places: within a NOTICE text file distributed
  113
+          as part of the Derivative Works; within the Source form or
  114
+          documentation, if provided along with the Derivative Works; or,
  115
+          within a display generated by the Derivative Works, if and
  116
+          wherever such third-party notices normally appear. The contents
  117
+          of the NOTICE file are for informational purposes only and
  118
+          do not modify the License. You may add Your own attribution
  119
+          notices within Derivative Works that You distribute, alongside
  120
+          or as an addendum to the NOTICE text from the Work, provided
  121
+          that such additional attribution notices cannot be construed
  122
+          as modifying the License.
  123
+
  124
+      You may add Your own copyright statement to Your modifications and
  125
+      may provide additional or different license terms and conditions
  126
+      for use, reproduction, or distribution of Your modifications, or
  127
+      for any such Derivative Works as a whole, provided Your use,
  128
+      reproduction, and distribution of the Work otherwise complies with
  129
+      the conditions stated in this License.
  130
+
  131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
  132
+      any Contribution intentionally submitted for inclusion in the Work
  133
+      by You to the Licensor shall be under the terms and conditions of
  134
+      this License, without any additional terms or conditions.
  135
+      Notwithstanding the above, nothing herein shall supersede or modify
  136
+      the terms of any separate license agreement you may have executed
  137
+      with Licensor regarding such Contributions.
  138
+
  139
+   6. Trademarks. This License does not grant permission to use the trade
  140
+      names, trademarks, service marks, or product names of the Licensor,
  141
+      except as required for reasonable and customary use in describing the
  142
+      origin of the Work and reproducing the content of the NOTICE file.
  143
+
  144
+   7. Disclaimer of Warranty. Unless required by applicable law or
  145
+      agreed to in writing, Licensor provides the Work (and each
  146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
  147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  148
+      implied, including, without limitation, any warranties or conditions
  149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
  150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
  151
+      appropriateness of using or redistributing the Work and assume any
  152
+      risks associated with Your exercise of permissions under this License.
  153
+
  154
+   8. Limitation of Liability. In no event and under no legal theory,
  155
+      whether in tort (including negligence), contract, or otherwise,
  156
+      unless required by applicable law (such as deliberate and grossly
  157
+      negligent acts) or agreed to in writing, shall any Contributor be
  158
+      liable to You for damages, including any direct, indirect, special,
  159
+      incidental, or consequential damages of any character arising as a
  160
+      result of this License or out of the use or inability to use the
  161
+      Work (including but not limited to damages for loss of goodwill,
  162
+      work stoppage, computer failure or malfunction, or any and all
  163
+      other commercial damages or losses), even if such Contributor
  164
+      has been advised of the possibility of such damages.
  165
+
  166
+   9. Accepting Warranty or Additional Liability. While redistributing
  167
+      the Work or Derivative Works thereof, You may choose to offer,
  168
+      and charge a fee for, acceptance of support, warranty, indemnity,
  169
+      or other liability obligations and/or rights consistent with this
  170
+      License. However, in accepting such obligations, You may act only
  171
+      on Your own behalf and on Your sole responsibility, not on behalf
  172
+      of any other Contributor, and only if You agree to indemnify,
  173
+      defend, and hold each Contributor harmless for any liability
  174
+      incurred by, or claims asserted against, such Contributor by reason
  175
+      of your accepting any such warranty or additional liability.
  176
+
  177
+   END OF TERMS AND CONDITIONS
  178
+
  179
+   APPENDIX: How to apply the Apache License to your work.
  180
+
  181
+      To apply the Apache License to your work, attach the following
  182
+      boilerplate notice, with the fields enclosed by brackets "[]"
  183
+      replaced with your own identifying information. (Don't include
  184
+      the brackets!)  The text should be enclosed in the appropriate
  185
+      comment syntax for the file format. We also recommend that a
  186
+      file or class name and description of purpose be included on the
  187
+      same "printed page" as the copyright notice for easier
  188
+      identification within third-party archives.
  189
+
  190
+   Copyright [yyyy] [name of copyright owner]
  191
+
  192
+   Licensed under the Apache License, Version 2.0 (the "License");
  193
+   you may not use this file except in compliance with the License.
  194
+   You may obtain a copy of the License at
  195
+
  196
+       http://www.apache.org/licenses/LICENSE-2.0
  197
+
  198
+   Unless required by applicable law or agreed to in writing, software
  199
+   distributed under the License is distributed on an "AS IS" BASIS,
  200
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  201
+   See the License for the specific language governing permissions and
  202
+   limitations under the License.
178  framework/src/WebWorksAppTemplate-app.xml
... ...
@@ -0,0 +1,178 @@
  1
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
  2
+<application xmlns="http://ns.adobe.com/air/application/2.5">
  3
+
  4
+<!-- Adobe AIR Application Descriptor File Template.
  5
+
  6
+	Specifies parameters for identifying, installing, and launching AIR applications.
  7
+
  8
+	xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.5
  9
+			The last segment of the namespace specifies the version 
  10
+			of the AIR runtime required for this application to run.
  11
+			
  12
+	minimumPatchLevel - The minimum patch level of the AIR runtime required to run 
  13
+			the application. Optional.
  14
+-->
  15
+
  16
+	<!-- A universally unique application identifier. Must be unique across all AIR applications.
  17
+	Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
  18
+	<id>WebWorksAppTemplate</id>
  19
+
  20
+	<!-- Used as the filename for the application. Required. -->
  21
+	<filename>WebWorksAppTemplate</filename>
  22
+
  23
+	<!-- The name that is displayed in the AIR application installer. 
  24
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->
  25
+	<name>WebWorksAppTemplate</name>
  26
+	
  27
+	<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
  28
+	Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
  29
+	An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
  30
+	<versionNumber>1.0.0</versionNumber>
  31
+		         
  32
+	<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
  33
+	<!-- <versionLabel></versionLabel> -->
  34
+
  35
+	<!-- Description, displayed in the AIR application installer.
  36
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->
  37
+	<!-- <description></description> -->
  38
+
  39
+	<!-- Copyright information. Optional -->
  40
+	<!-- <copyright></copyright> -->
  41
+
  42
+	<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
  43
+	<!-- <publisherID></publisherID> -->
  44
+
  45
+	<!-- Settings for the application's initial window. Required. -->
  46
+	<initialWindow>
  47
+		<!-- The main SWF or HTML file of the application. Required. -->
  48
+		<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
  49
+		<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
  50
+		
  51
+		<!-- The title of the main window. Optional. -->
  52
+		<!-- <title>Webworks Application</title> -->
  53
+
  54
+		<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
  55
+		<systemChrome>none</systemChrome>
  56
+
  57
+		<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
  58
+		<!-- <transparent></transparent> -->
  59
+
  60
+		<!-- Whether the window is initially visible. Optional. Default false. -->
  61
+		<!-- <visible></visible> -->
  62
+
  63
+		<!-- Whether the user can minimize the window. Optional. Default true. -->
  64
+		<!-- <minimizable></minimizable> -->
  65
+
  66
+		<!-- Whether the user can maximize the window. Optional. Default true. -->
  67
+		<!-- <maximizable></maximizable> -->
  68
+
  69
+		<!-- Whether the user can resize the window. Optional. Default true. -->
  70
+		<!-- <resizable></resizable> -->
  71
+
  72
+		<!-- The window's initial width in pixels. Optional. -->
  73
+		<!-- <width></width> -->
  74
+
  75
+		<!-- The window's initial height in pixels. Optional. -->
  76
+		<!-- <height></height> -->
  77
+
  78
+		<!-- The window's initial x position. Optional. -->
  79
+		<!-- <x></x> -->
  80
+
  81
+		<!-- The window's initial y position. Optional. -->
  82
+		<!-- <y></y> -->
  83
+
  84
+		<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
  85
+		<!-- <minSize></minSize> -->
  86
+
  87
+		<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
  88
+		<!-- <maxSize></maxSize> -->
  89
+	</initialWindow>
  90
+
  91
+	<!-- We recommend omitting the supportedProfiles element, -->
  92
+	<!-- which in turn permits your application to be deployed to all -->
  93
+	<!-- devices supported by AIR. If you wish to restrict deployment -->
  94
+	<!-- (i.e., to only mobile devices) then add this element and list -->
  95
+	<!-- only the profiles which your application does support. -->
  96
+	<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
  97
+
  98
+	<!-- The subpath of the standard default installation location to use. Optional. -->
  99
+	<!-- <installFolder></installFolder> -->
  100
+
  101
+	<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
  102
+	<!-- <programMenuFolder></programMenuFolder> -->
  103
+
  104
+	<!-- The icon the system uses for the application. For at least one resolution,
  105
+	specify the path to a PNG file included in the AIR package. Optional. -->
  106
+	<!-- <icon>
  107
+		<image16x16></image16x16>
  108
+		<image32x32></image32x32>
  109
+		<image36x36></image36x36>
  110
+		<image48x48></image48x48>
  111
+		<image72x72></image72x72>
  112
+		<image128x128></image128x128>
  113
+	</icon> -->
  114
+
  115
+	<!-- Whether the application handles the update when a user double-clicks an update version
  116
+	of the AIR file (true), or the default AIR application installer handles the update (false).
  117
+	Optional. Default false. -->
  118
+	<!-- <customUpdateUI></customUpdateUI> -->
  119
+	
  120
+	<!-- Whether the application can be launched when the user clicks a link in a web browser.
  121
+	Optional. Default false. -->
  122
+	<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
  123
+
  124
+	<!-- Listing of file types for which the application can register. Optional. -->
  125
+	<!-- <fileTypes> -->
  126
+
  127
+		<!-- Defines one file type. Optional. -->
  128
+		<!-- <fileType> -->
  129
+
  130
+			<!-- The name that the system displays for the registered file type. Required. -->
  131
+			<!-- <name></name> -->
  132
+
  133
+			<!-- The extension to register. Required. -->
  134
+			<!-- <extension></extension> -->
  135
+			
  136
+			<!-- The description of the file type. Optional. -->
  137
+			<!-- <description></description> -->
  138
+			
  139
+			<!-- The MIME content type. -->
  140
+			<!-- <contentType></contentType> -->
  141
+			
  142
+			<!-- The icon to display for the file type. Optional. -->
  143
+			<!-- <icon>
  144
+				<image16x16></image16x16>
  145
+				<image32x32></image32x32>
  146
+				<image48x48></image48x48>
  147
+				<image128x128></image128x128>
  148
+			</icon> -->
  149
+			
  150
+		<!-- </fileType> -->
  151
+	<!-- </fileTypes> -->
  152
+
  153
+	<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
  154
+	<!--<android> 
  155
+		<manifestAdditions>
  156
+		<![CDATA[
  157
+			<manifest android:installLocation="auto">
  158
+				<uses-permission android:name="android.permission.INTERNET"/>
  159
+				<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  160
+				<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  161
+				<uses-configuration android:reqFiveWayNav="true"/>
  162
+				<supports-screens android:normalScreens="true"/>
  163
+				<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
  164
+				<application android:enabled="true">
  165
+					<activity android:excludeFromRecents="false">
  166
+						<intent-filter>
  167
+							<action android:name="android.intent.action.MAIN"/>
  168
+							<category android:name="android.intent.category.LAUNCHER"/>
  169
+						</intent-filter>
  170
+					</activity>
  171
+				</application>
  172
+			</manifest>
  173
+		]]>
  174
+		</manifestAdditions> 
  175
+	</android> -->
  176
+	<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
  177
+
  178
+</application>
206  framework/src/WebWorksAppTemplate.as
... ...
@@ -0,0 +1,206 @@
  1
+/*
  2
+ * Copyright 2010 Research In Motion Limited.
  3
+ *
  4
+ * Licensed under the Apache License, Version 2.0 (the "License");
  5
+ * you may not use this file except in compliance with the License.
  6
+ * You may obtain a copy of the License at
  7
+ *
  8
+ *     http://www.apache.org/licenses/LICENSE-2.0
  9
+ *
  10
+ * Unless required by applicable law or agreed to in writing, software
  11
+ * distributed under the License is distributed on an "AS IS" BASIS,
  12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13
+ * See the License for the specific language governing permissions and
  14
+ * limitations under the License.
  15
+ */
  16
+package
  17
+{
  18
+	import flash.desktop.NativeApplication;
  19
+	import flash.display.Bitmap;
  20
+	import flash.display.Shape;
  21
+	import flash.display.Sprite;
  22
+	import flash.display.StageAlign;
  23
+	import flash.display.StageScaleMode;
  24
+	import flash.events.Event;
  25
+	import flash.events.IOErrorEvent;
  26
+	import flash.events.LocationChangeEvent;
  27
+	import flash.filesystem.File;
  28
+	import flash.utils.Dictionary;
  29
+	
  30
+	import qnx.dialog.AlertDialog;
  31
+	import qnx.dialog.DialogSize;
  32
+	import qnx.display.IowWindow;
  33
+	import qnx.events.ExtendedLocationChangeEvent;
  34
+	import qnx.events.JavaScriptCallbackEvent;
  35
+	import qnx.events.WebViewEvent;
  36
+	
  37
+	import webworks.FunctionBroker;
  38
+	import webworks.JavaScriptLoader;
  39
+	import webworks.access.Access;
  40
+	import webworks.config.ConfigConstants;
  41
+	import webworks.config.ConfigData;
  42
+	import webworks.extension.IApiExtension;
  43
+	import webworks.loadingScreen.LoadingScreen;
  44
+	import webworks.loadingScreen.Transitions;
  45
+	import webworks.policy.WidgetPolicy;
  46
+	import webworks.uri.URI;
  47
+	import webworks.webkit.WebkitControl;
  48
+	import webworks.webkit.WebkitEvent;
  49
+
  50
+	[SWF(width="1024", height="600", frameRate="30", backgroundColor="#000000")]
  51
+	public class WebWorksAppTemplate extends Sprite
  52
+	{
  53
+		private static var LOCAL_PROTOCOL:String = "local:///";
  54
+		
  55
+		private var entryURL:String;
  56
+		private var webWindow:WebkitControl;
  57
+        private var errorDialog:AlertDialog;
  58
+		private var loadingScreen:LoadingScreen;
  59
+		private var transitions:Transitions;
  60
+ 		private var broker:FunctionBroker;
  61
+		
  62
+		public function WebWorksAppTemplate() 
  63
+        {			
  64
+			if (stage) {
  65
+				init();
  66
+			} else {
  67
+				addEventListener(Event.ADDED_TO_STAGE, init);
  68
+			}
  69
+		}
  70
+		
  71
+		private function init(e:Event = null):void 
  72
+        {
  73
+			removeEventListener(Event.ADDED_TO_STAGE, init);
  74
+			entryURL = ConfigData.getInstance().getProperty(ConfigConstants.CONTENT);
  75
+			NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, appActive);
  76
+			NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, appBackground);
  77
+			appInitialized();
  78
+		}
  79
+		
  80
+		private function appActive(event:Event):void 
  81
+        {
  82
+			stage.frameRate = 30;
  83
+			webWindow.visible = true;
  84
+			trace("Increased Framerate to " + stage.frameRate + " | " + event);
  85
+		}
  86
+		
  87
+		private function appBackground(event:Event):void 
  88
+        {
  89
+			stage.frameRate = 2;
  90
+			trace("Reduced Framerate to " + stage.frameRate + " | " + event);
  91
+		}
  92
+		
  93
+		private function appInitialized():void 
  94
+        {
  95
+			setupStage();
  96
+			setupWebkit();
  97
+			ConfigData.getInstance().setProperty(ConfigConstants.ENV_WEBVIEW, webWindow.qnxWebView);
  98
+			ConfigData.getInstance().setProperty(ConfigConstants.ENV_APPLICATION, this);
  99
+			loadingScreen = new LoadingScreen(0,0, stage.stageWidth,stage.stageHeight);
  100
+			transitions = new Transitions(loadingScreen);
  101
+			broker = new FunctionBroker(webWindow.qnxWebView);
  102
+			registerExtensions(ConfigData.getInstance().properties);
  103
+		}
  104
+		
  105
+		private function registerExtensions(env:Dictionary):void
  106
+		{
  107
+			var widgetExtensions:Array = ConfigData.getInstance().getProperty(ConfigConstants.WIDGETEXTENSIONS);
  108
+			for(var key:String in widgetExtensions)
  109
+			{
  110
+				var extension:IApiExtension = widgetExtensions[key][ConfigConstants.ENTRYCLASS] as IApiExtension;
  111
+				if (extension != null)
  112
+				{
  113
+					extension.register(env);
  114
+				}
  115
+			}			
  116
+		}
  117
+        
  118
+ 		private function setupStage():void 
  119
+        {
  120
+			stage.scaleMode = StageScaleMode.NO_SCALE;
  121
+			stage.stageFocusRect = false;
  122
+			stage.align = StageAlign.TOP_LEFT;
  123
+		}
  124
+		
  125
+		private function setupWebkit():void 
  126
+        {
  127
+            var creationID:Number = int(Math.random() * 1000000) + new Date().time;
  128
+            webWindow = new WebkitControl(creationID, 0, 0, stage.stageWidth,  stage.stageHeight);
  129
+
  130
+			webWindow.addEventListener(WebkitEvent.TAB_LOAD_COMPLETE, tabLoadComplete);
  131
+			webWindow.addEventListener(WebkitEvent.TAB_LOAD_ERROR, webkitLoadError);
  132
+            webWindow.addEventListener(WebkitEvent.WEBVIEW_CREATED, webkitWindowReady);
  133
+ 			webWindow.addEventListener(WebkitEvent.TAB_LOCATION_CHANGING, webkitLocationChanging);
  134
+			webWindow.addEventListener(WebkitEvent.TAB_LOCATION_CHANGED, webkitLocationChanged);
  135
+			webWindow.addEventListener(WebkitEvent.TAB_UNKNOWNPROTOCOL, handleUnkownProtocol)
  136
+ 			addChild(webWindow);
  137
+		}
  138
+		
  139
+		private function handleUnkownProtocol(event:WebkitEvent):void
  140
+		{
  141
+			broker.handleXHRRequest(event.data);
  142
+		}
  143
+			
  144
+		private function tabLoadComplete(event:WebkitEvent):void 
  145
+        {
  146
+			trace("HTML LOAD DONE");
  147
+		}
  148
+
  149
+		private function webkitWindowReady(event:WebkitEvent):void 
  150
+        {
  151
+			loadURL(entryURL);
  152
+		}
  153
+        
  154
+ 		private function webkitLoadError(event:WebkitEvent):void 
  155
+        {
  156
+			trace("webkitcontrol, load error happened.");
  157
+		} 
  158
+		
  159
+		private function webkitLocationChanging(event:WebkitEvent):void 
  160
+        {
  161
+			trace("webkitLocationChanging event");
  162
+			//register javascript
  163
+			var qnxEvent:ExtendedLocationChangeEvent = event.data as ExtendedLocationChangeEvent;
  164
+			if (qnxEvent == null)
  165
+			{
  166
+				return;
  167
+			}
  168
+			
  169
+			var url:String = qnxEvent.location; 
  170
+					
  171
+			// add loading screen only if the location changes
  172
+			if (url.search(webWindow.qnxWebView.originalLocation) < 0 && loadingScreen.isLoadingScreenRequired(url))
  173
+			{
  174
+				loadingScreen.show(url);
  175
+			}
  176
+
  177
+			if (loadingScreen.firstLaunchFlag) 
  178
+			{
  179
+				loadingScreen.clearFirstLaunchFlag();
  180
+			}
  181
+		}
  182
+		
  183
+		private function webkitLocationChanged(event:WebkitEvent):void 
  184
+		{
  185
+			trace("webkitLocationChanged event");
  186
+			loadingScreen.hideIfNecessary();
  187
+		}
  188
+			
  189
+		public function loadURL(url:String):void 
  190
+        {
  191
+			if (url.indexOf(":") < 0) {
  192
+				url = LOCAL_PROTOCOL + url;
  193
+			}
  194
+			
  195
+			if (loadingScreen.showOnFirstLaunch) {
  196
+				loadingScreen.show(url);
  197
+			}
  198
+			webWindow.go(url);
  199
+		}
  200
+		
  201
+		public function get transitionEffect():Transitions
  202
+		{
  203
+			return transitions;
  204
+		}
  205
+	}
  206
+}
9  framework/src/blackberry-tablet.xml
... ...
@@ -0,0 +1,9 @@
  1
+<qnx>
  2
+<initialWindow>
  3
+<systemChrome>none</systemChrome>
  4
+<transparent>true</transparent>
  5
+</initialWindow>
  6
+<publisher>Sample Inc.</publisher>
  7
+<category>core.internet</category>
  8
+
  9
+</qnx>
127  framework/src/webworks/FunctionBroker.as
... ...
@@ -0,0 +1,127 @@
  1
+/*
  2
+ * Copyright 2010 Research In Motion Limited.
  3
+ *
  4
+ * Licensed under the Apache License, Version 2.0 (the "License");
  5
+ * you may not use this file except in compliance with the License.
  6
+ * You may obtain a copy of the License at
  7
+ *
  8
+ *     http://www.apache.org/licenses/LICENSE-2.0
  9
+ *
  10
+ * Unless required by applicable law or agreed to in writing, software
  11
+ * distributed under the License is distributed on an "AS IS" BASIS,
  12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13
+ * See the License for the specific language governing permissions and
  14
+ * limitations under the License.
  15
+ */
  16
+package webworks
  17
+{
  18
+	import flash.events.EventDispatcher;
  19
+	import flash.events.IEventDispatcher;
  20
+	
  21
+	import qnx.events.JavaScriptCallbackEvent;
  22
+	import qnx.media.QNXStageWebView;
  23
+	
  24
+	import webworks.config.ConfigData;
  25
+	import webworks.errors.AccessError;
  26
+	import webworks.extension.IApiExtension;
  27
+	import webworks.util.DeviceURL;
  28
+	import webworks.util.Utilities;
  29
+	import webworks.webkit.WebkitEvent;
  30
+	
  31
+	/**
  32
+	 * apply the white list rules and delegate the XHR request to AS API 
  33
+	 * 
  34
+	*/
  35
+	public class FunctionBroker extends EventDispatcher
  36
+	{
  37
+		private var webView:QNXStageWebView;
  38
+		
  39
+		public function FunctionBroker(webview:QNXStageWebView, target:IEventDispatcher=null)
  40
+		{
  41
+			webView = webview;
  42
+			super(target);
  43
+		}
  44
+		
  45
+		//handle the event fired by qnx.callExtensionMethod() from javascript
  46
+		//call API specified by the event data and return a JSON string
  47
+		public function handleJSMethodCall(event:JavaScriptCallbackEvent):String
  48
+		{
  49
+			if ( event.name == null ) // event.methodName = device://host/featureid/methodname?par1=val...
  50
+				return null;
  51
+			var device:DeviceURL = new DeviceURL(event.name);
  52
+			
  53
+			if ( !device.isDeviceProtocol() )
  54
+				return null;
  55
+
  56
+			//validate the feature
  57
+			if ( webView == null )
  58
+				return null;
  59
+
  60
+			if ( ConfigData.getInstance().isFeatureAllowed(device.featureName, webView.location))
  61
+			{
  62
+				var extension:IApiExtension = ConfigData.getInstance().getExtension(device.featureName);
  63
+				if ( extension != null )
  64
+				{
  65
+					var obj:Object = extension.invokeFunction(device.methodName, device.query);
  66
+			    	return obj.toString();
  67
+				}
  68
+				else
  69
+				{
  70
+					Utilities.alert(device.featureName + " is not defined", webView);
  71
+					throw new AccessError("Access error:feature not defined",  0);
  72
+				}
  73
+			}
  74
+			else
  75
+			{
  76
+			    Utilities.alert(device.featureName + " is not allowed", webView);
  77
+			    return null;
  78
+			}
  79
+		}
  80
+		
  81
+		//parse the url, check the feature available and invoke the feature
  82
+		public function handleXHRRequest(obj:Object):Object
  83
+		{			
  84
+			if ( webView == null )
  85
+				return null;
  86
+			
  87
+			var deviceUrl:String = null;			
  88
+			//Test if we have an Event or a string, otherwise return
  89
+			//This section is only for testing so that we only comment out as little code as possible to make it work.
  90
+			// In the final version this should only be called with an event
  91
+			if (obj is WebkitEvent)
  92
+			{
  93
+				deviceUrl = obj.data as String;				
  94
+			}
  95
+			else if ( obj is String)
  96
+			{
  97
+				deviceUrl = String(obj);
  98
+			}
  99
+			
  100
+			//var url:String = event.data as String;
  101
+			if ( deviceUrl == null )
  102
+				return null;
  103
+			var device:DeviceURL = new DeviceURL(deviceUrl);
  104
+			
  105
+			if ( !device.isDeviceProtocol() )
  106
+				return null;
  107
+
  108
+			//validate the feature
  109
+			if ( ConfigData.getInstance().isFeatureAllowed(device.featureName, webView.location))
  110
+			{
  111
+				var extension:IApiExtension = ConfigData.getInstance().getExtension(device.featureName);
  112
+				if ( extension != null )
  113
+					return extension.invokeFunction(device.methodName, device.query);
  114
+				else
  115
+				{
  116
+					Utilities.alert(device.featureName + " is not defined!", webView);
  117
+					throw new AccessError("Access error:feature not defined",  0);
  118
+				}
  119
+			}
  120
+			else
  121
+			{
  122
+				Utilities.alert(device.featureName + " is not allowed!", webView);
  123
+				throw new AccessError("Access error: feature is not allowed", 1);
  124
+			}
  125
+		}
  126
+	}	
  127
+}
218  framework/src/webworks/JavaScriptLoader.as
... ...
@@ -0,0 +1,218 @@
  1
+/*
  2
+ * Copyright 2010 Research In Motion Limited.
  3
+ *
  4
+ * Licensed under the Apache License, Version 2.0 (the "License");
  5
+ * you may not use this file except in compliance with the License.
  6
+ * You may obtain a copy of the License at
  7
+ *
  8
+ *     http://www.apache.org/licenses/LICENSE-2.0
  9
+ *
  10
+ * Unless required by applicable law or agreed to in writing, software
  11
+ * distributed under the License is distributed on an "AS IS" BASIS,
  12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13
+ * See the License for the specific language governing permissions and
  14
+ * limitations under the License.
  15
+ */
  16
+package webworks
  17
+{
  18
+	import flash.events.Event;
  19
+	import flash.events.EventDispatcher;
  20
+	import flash.filesystem.*;
  21
+	import flash.net.NetworkInfo;
  22
+	import flash.net.NetworkInterface;
  23
+	
  24
+	import qnx.events.WebViewEvent;
  25
+	
  26
+	import webworks.access.Access;
  27
+	import webworks.access.Feature;
  28
+	import webworks.config.ConfigConstants;
  29
+	import webworks.config.ConfigData;
  30
+	import webworks.extension.AppNameSpaceGenerator;
  31
+	import webworks.extension.IApiExtension;
  32
+	import webworks.extension.SystemNameSpaceGenerator;
  33
+	import webworks.webkit.WebkitControl;
  34
+
  35
+	public class JavaScriptLoader extends  EventDispatcher
  36
+	{
  37
+		private static var globalSharedJSFolder:String = "js/sharedglobal/";
  38
+		
  39
+		private var webkitControl:WebkitControl;
  40
+		private var jsfiles:Array;
  41
+		private var fileToLoad:String;
  42
+		private var index:int = 0;
  43
+		private var event:WebViewEvent;
  44
+		
  45
+		public function JavaScriptLoader(webkitcontrol:WebkitControl)
  46
+		{
  47
+			webkitControl = webkitcontrol;			
  48
+			//Temp workaround code
  49
+			webkitControl.addEventListener(Event.NETWORK_CHANGE, onNetworkChange);
  50
+
  51
+		}
  52
+				
  53
+		//register javascript file for features required by the url
  54
+		public function registerJavaScript(url:String, e:WebViewEvent):void
  55
+		{
  56
+			event = e;
  57
+			jsfiles = getCommonJSFiles();
  58
+			//insert js needed for feautes specified by the access
  59
+			var access:Access = ConfigData.getInstance().getAccessByUrl(url);			
  60
+			if ( access != null )
  61
+			{
  62
+				var features:Array = access.getFeatures();
  63
+				var extension:IApiExtension;
  64
+				var paths:Array;
  65
+				for(var index:String in features)
  66
+				{
  67
+					var feature:Feature = features[index] as Feature;
  68
+					if ( feature == null )
  69
+						continue;
  70
+					var widgetExt:Object = ConfigData.getInstance().getWidgetExtension(feature.getID());
  71
+					if ( widgetExt != null )
  72
+					{
  73
+						//call loadFeature() of the extension
  74
+						extension = widgetExt[ConfigConstants.ENTRYCLASS] as IApiExtension;
  75
+						if ( extension != null )
  76
+							extension.loadFeature(feature.getID(), feature.getVersion());
  77
+						//register js files for the feature
  78
+						paths = widgetExt[ConfigConstants.REQUIREDJSFILES] as Array;
  79
+						jsfiles = jsfiles.concat(paths);
  80
+					}
  81
+				}
  82
+			}
  83
+			
  84
+			if ( jsfiles.length > 0 )
  85
+				loadJavaScriptFiles();
  86
+		}
  87
+		
  88
+		//Load common JavaScript files
  89
+		private function getCommonJSFiles():Array
  90
+		{
  91
+			//loop through the js folder and load all the files
  92
+			var file:File = File.applicationDirectory.resolvePath(globalSharedJSFolder);
  93
+			var files:Array = file.getDirectoryListing();
  94
+			//sort the array based on the "url" field in default way, case-sensitive Z precedes a, ascending a preceds b, 1 preceds 2
  95
+			files.sortOn("url");
  96
+			var urls:Array = new Array();
  97
+			for(var index:String in files){
  98
+				var js:File = files[index];
  99
+				if ( js != null && js.type == ".js" ){
  100
+					var url:String = js.url;
  101
+					trace(url);					
  102
+  				    urls.push(js.url);
  103
+				}
  104
+			}
  105
+			return urls;
  106
+		}
  107
+		
  108
+		//start loading js files in files, start with element at index
  109
+		private function loadJavaScriptFiles():void {
  110
+			index = 0;
  111
+			loadJavaScriptFile();
  112
+		}
  113
+		
  114
+		private function loadJavaScriptFile():void {
  115
+			while(index < jsfiles.length)
  116
+			{
  117
+				fileToLoad = jsfiles[index];				
  118
+
  119
+				var myPattern:RegExp = /app:\//;
  120
+				
  121
+				var file:File = File.applicationDirectory;
  122
+				
  123
+				//Check to see if the file to load has 'app:/' at the begining of the path
  124
+				// if so remove it 
  125
+
  126
+				file = file.resolvePath(fileToLoad.replace(myPattern, ""));
  127
+				
  128
+				//Synchronous Read the file
  129
+				try {
  130
+					var fs:FileStream = new FileStream();
  131
+					fs.open(file, FileMode.READ);
  132
+					var data:String = fs.readUTFBytes(fs.bytesAvailable);
  133
+					
  134
+					webkitControl.executeJavaScript(data);
  135
+					trace("Loaded: " + file.name);
  136
+					
  137
+					fs.close();
  138
+				}catch(e:Error) {
  139
+					trace("ERROR: Unable to load JavaScript file: " + file.name + " message: " + e.toString());
  140
+				}
  141
+				
  142
+				index++;
  143
+			}
  144
+			
  145
+			//Now that all of the original js has been loaded,
  146
+			// load the workaround js
  147
+			loadWorkarounds();
  148
+			
  149
+			dispatchEvent(event);
  150
+		}
  151
+		
  152
+		/*
  153
+		###### Temporary workaround code for blackberry.app and blackberry.system namespaces ######
  154
+		
  155
+		BEGIN WORKAROUND
  156
+		*/
  157
+		private function loadWorkarounds():void
  158
+		{
  159
+			if (ConfigData.getInstance().isFeatureAllowed("blackberry.app", webkitControl.qnxWebView.location)) {				
  160
+				attachAppJsWorkaround();
  161
+			}
  162
+			
  163
+			if (ConfigData.getInstance().isFeatureAllowed("blackberry.system", webkitControl.qnxWebView.location)) {
  164
+				attachSystemJsWorkaround();
  165
+			}
  166
+			
  167
+			trace(event.toString());			
  168
+		}
  169
+		
  170
+		private function onNetworkChange(event:Event):void {
  171
+			saveDataConnectionStateJs(areNetworkInterfacesActive());
  172
+		}
  173
+		
  174
+		
  175
+		private function areNetworkInterfacesActive():Boolean{
  176
+			var areActive : Boolean = false;
  177
+			
  178
+			NetworkInfo.networkInfo.findInterfaces().every(
  179
+				function callback(item:NetworkInterface, index:int, vector:Vector.<NetworkInterface>):Boolean {
  180
+					areActive = item.active || areActive;
  181
+					
  182
+					return !areActive;
  183
+				}, this);
  184
+			
  185
+			return areActive;
  186
+		}
  187
+		
  188
+		private function saveDataConnectionStateJs(haveConnection : Boolean):void {
  189
+			var haveCoverageJs : String = "blackberry.system.dataCoverage = " + haveConnection + ";";
  190
+			trace(haveCoverageJs);
  191
+			webkitControl.executeJavaScript(haveCoverageJs);
  192
+		}
  193
+		
  194
+		private function saveAccessListJs():void {
  195
+			var sysNSGen:SystemNameSpaceGenerator = new SystemNameSpaceGenerator(webkitControl.qnxWebView.location);
  196
+			var accessListInitJs : String = "blackberry.system.accessList = " + sysNSGen.accessListJson + ";";
  197
+			trace(accessListInitJs);
  198
+			webkitControl.executeJavaScript(accessListInitJs);
  199
+		}
  200
+		
  201
+		private function attachSystemJsWorkaround():void{
  202
+			saveAccessListJs();
  203
+			saveDataConnectionStateJs(areNetworkInterfacesActive());
  204
+		}
  205
+		
  206
+		private function attachAppJsWorkaround():void{
  207
+			var appNSGen:AppNameSpaceGenerator = new AppNameSpaceGenerator(ConfigData.getInstance().properties);
  208
+			var workaround:String = appNSGen.appNamespaceWorkaround;	
  209
+			
  210
+			trace(workaround);
  211
+			
  212
+			webkitControl.executeJavaScript(workaround);
  213
+		}
  214
+		/*
  215
+		END WORKAROUND
  216
+		*/
  217
+	}
  218
+}
67  framework/src/webworks/access/Access.as
... ...
@@ -0,0 +1,67 @@
  1
+/*
  2
+ * Copyright 2010 Research In Motion Limited.
  3
+ *
  4
+ * Licensed under the Apache License, Version 2.0 (the "License");
  5
+ * you may not use this file except in compliance with the License.
  6
+ * You may obtain a copy of the License at
  7
+ *
  8
+ *     http://www.apache.org/licenses/LICENSE-2.0
  9
+ *
  10
+ * Unless required by applicable law or agreed to in writing, software
  11
+ * distributed under the License is distributed on an "AS IS" BASIS,
  12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13
+ * See the License for the specific language governing permissions and
  14
+ * limitations under the License.
  15
+ */
  16
+package webworks.access {
  17
+	import webworks.config.ConfigConstants;
  18
+
  19
+	public class Access {
  20
+		
  21
+		//-------------------------------------
  22
+		//  properties
  23
+		//-------------------------------------
  24
+		private var _uri:String;
  25
+		private var _allowSubDomain:Boolean;
  26
+		private var _features:Array;
  27
+		private var _isLocal:Boolean;
  28
+		
  29
+		public function Access(uri:String, allowSubDomain:Boolean, features:Array)
  30
+		{
  31
+			super();
  32
+			
  33
+			_allowSubDomain = allowSubDomain;
  34
+			_features = features;
  35
+			
  36
+			if (uri == ConfigConstants.WIDGET_LOCAL_DOMAIN) {
  37
+				_isLocal = true;
  38
+				_uri = "";
  39
+			} else {
  40
+				_isLocal = false;
  41
+				_uri = uri;
  42
+			}
  43
+		}
  44
+		
  45
+		//-----------------------------------------------------------------------------
  46
+		//
  47
+		//  Methods
  48
+		//
  49
+		//-----------------------------------------------------------------------------
  50
+
  51
+		public function getURI():String {
  52
+			return _uri;
  53
+		}
  54
+		
  55
+		public function allowSubDomain():Boolean {
  56
+			return _allowSubDomain;
  57
+		}
  58
+
  59
+		public function getFeatures():Array {
  60
+			return _features;
  61
+		}
  62
+
  63
+		public function isLocal():Boolean {
  64
+			return _isLocal;
  65
+		}
  66
+	}
  67
+}
64  framework/src/webworks/access/Feature.as
<
... ...
@@ -0,0 +1,64 @@
  1
+/*
  2
+ * Copyright 2010 Research In Motion Limited.
  3
+ *
  4
+ * Licensed under the Apache License, Version 2.0 (the "License");
  5
+ * you may not use this file except in compliance with the License.
  6
+ * You may obtain a copy of the License at
  7
+ *
  8
+ *     http://www.apache.org/licenses/LICENSE-2.0
  9
+ *
  10
+ * Unless required by applicable law or agreed to in writing, software
  11
+ * distributed under the License is distributed on an "AS IS" BASIS,
  12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13
+ * See the License for the specific language governing permissions and
  14
+ * limitations under the License.
  15
+ */
  16
+package webworks.access {
  17
+	public class Feature {
  18
+		
  19
+		//-------------------------------------
  20
+		//  properties
  21
+		//-------------------------------------
  22
+		private var _id:String;
  23
+		private var _isRequired:Boolean;
  24
+		private var _version:String;
  25
+		private var _dependentFeatures:Array;
  26
+		
  27
+		public function Feature(id:String, isRequired:Boolean, version:String, dependentFeatures:Array)
  28
+		{
  29
+			super();
  30
+			
  31
+			_id = id;
  32
+			_isRequired = isRequired;
  33
+			_version = version;
  34
+			_dependentFeatures = dependentFeatures;
  35
+		}
  36
+		
  37
+		//-----------------------------------------------------------------------------
  38
+		//
  39
+		//  Methods
  40
+		//
  41
+		//-----------------------------------------------------------------------------
  42
+
  43
+		public function getID():String {
  44
+			return _id;
  45
+		}
  46
+		
  47
+		public function isRequired():Boolean {
  48
+			return _isRequired;
  49
+		}
  50
+
  51
+		public function getVersion():String {