fabricator 0.0.1

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 (61) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +63 -0
  3. data/PostInstall.txt +7 -0
  4. data/README.rdoc +48 -0
  5. data/Rakefile +28 -0
  6. data/app_generators/pureapp/USAGE +5 -0
  7. data/app_generators/pureapp/pureapp_generator.rb +151 -0
  8. data/app_generators/pureapp/templates/actionscript.properties +20 -0
  9. data/app_generators/pureapp/templates/authentication_module.mxml +27 -0
  10. data/app_generators/pureapp/templates/common/constants.as +12 -0
  11. data/app_generators/pureapp/templates/dashboard_module.mxml +28 -0
  12. data/app_generators/pureapp/templates/flex.properties +2 -0
  13. data/app_generators/pureapp/templates/html-template/AC_OETags.js +276 -0
  14. data/app_generators/pureapp/templates/html-template/history/history.css +6 -0
  15. data/app_generators/pureapp/templates/html-template/history/history.js +645 -0
  16. data/app_generators/pureapp/templates/html-template/history/historyFrame.html +29 -0
  17. data/app_generators/pureapp/templates/html-template/index.template.html +121 -0
  18. data/app_generators/pureapp/templates/html-template/playerProductInstall.swf +0 -0
  19. data/app_generators/pureapp/templates/libs/PureMVC_AS3_MultiCore_1_0_5.swc +0 -0
  20. data/app_generators/pureapp/templates/libs/Utility_AS3_MultiCore_Pipes_1_1.swc +0 -0
  21. data/app_generators/pureapp/templates/libs/fabrication-0.6-flex.swc +0 -0
  22. data/app_generators/pureapp/templates/libs/fabrication_license.txt +7 -0
  23. data/app_generators/pureapp/templates/libs/puremvc_multicore_license.txt +61 -0
  24. data/app_generators/pureapp/templates/libs/puremvc_pipes_license.txt +63 -0
  25. data/app_generators/pureapp/templates/mainapp.mxml +22 -0
  26. data/app_generators/pureapp/templates/modules/authentication/controller/authentication_module_startup_command.as +22 -0
  27. data/app_generators/pureapp/templates/modules/authentication/model/authentication_proxy.as +20 -0
  28. data/app_generators/pureapp/templates/modules/authentication/view/authentication_module_mediator.as +31 -0
  29. data/app_generators/pureapp/templates/modules/authentication/view/components/sign_in_view.mxml +48 -0
  30. data/app_generators/pureapp/templates/modules/authentication/view/sign_in_view_mediator.as +48 -0
  31. data/app_generators/pureapp/templates/modules/dashboard/controller/dashboard_module_startup_command.as +22 -0
  32. data/app_generators/pureapp/templates/modules/dashboard/view/components/nav_bar.mxml +14 -0
  33. data/app_generators/pureapp/templates/modules/dashboard/view/components/todo_list.mxml +21 -0
  34. data/app_generators/pureapp/templates/modules/dashboard/view/dashboard_module_mediator.as +37 -0
  35. data/app_generators/pureapp/templates/modules/dashboard/view/nav_bar_mediator.as +45 -0
  36. data/app_generators/pureapp/templates/modules/dashboard/view/todo_list_mediator.as +23 -0
  37. data/app_generators/pureapp/templates/project.properties +18 -0
  38. data/app_generators/pureapp/templates/properties.yml +6 -0
  39. data/app_generators/pureapp/templates/shell/controller/add_module_command.as +18 -0
  40. data/app_generators/pureapp/templates/shell/controller/change_selected_module_command.as +23 -0
  41. data/app_generators/pureapp/templates/shell/controller/load_dashboard_module_command.as +16 -0
  42. data/app_generators/pureapp/templates/shell/controller/remove_module_command.as +21 -0
  43. data/app_generators/pureapp/templates/shell/controller/startup_command.as +30 -0
  44. data/app_generators/pureapp/templates/shell/model/i_list_element.as +8 -0
  45. data/app_generators/pureapp/templates/shell/model/list_proxy.as +53 -0
  46. data/app_generators/pureapp/templates/shell/model/module_descriptor.as +19 -0
  47. data/app_generators/pureapp/templates/shell/model/selection_proxy.as +30 -0
  48. data/app_generators/pureapp/templates/shell/shell_constants.as +11 -0
  49. data/app_generators/pureapp/templates/shell/view/components/modules_container.mxml +15 -0
  50. data/app_generators/pureapp/templates/shell/view/mediator.as +35 -0
  51. data/app_generators/pureapp/templates/shell/view/modules_container_mediator.as +124 -0
  52. data/bin/pureapp +17 -0
  53. data/lib/fabricator.rb +6 -0
  54. data/script/console +10 -0
  55. data/script/destroy +14 -0
  56. data/script/generate +14 -0
  57. data/test/test_fabricator.rb +11 -0
  58. data/test/test_generator_helper.rb +29 -0
  59. data/test/test_helper.rb +3 -0
  60. data/test/test_pureapp_generator.rb +43 -0
  61. metadata +145 -0
@@ -0,0 +1,29 @@
1
+ <html>
2
+ <head>
3
+ <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
4
+ <META HTTP-EQUIV="Expires" CONTENT="-1">
5
+ </head>
6
+ <body>
7
+ <script>
8
+ function processUrl()
9
+ {
10
+
11
+ var pos = url.indexOf("?");
12
+ url = pos != -1 ? url.substr(pos + 1) : "";
13
+ if (!parent._ie_firstload) {
14
+ parent.BrowserHistory.setBrowserURL(url);
15
+ try {
16
+ parent.BrowserHistory.browserURLChange(url);
17
+ } catch(e) { }
18
+ } else {
19
+ parent._ie_firstload = false;
20
+ }
21
+ }
22
+
23
+ var url = document.location.href;
24
+ processUrl();
25
+ document.write(url);
26
+ </script>
27
+ Hidden frame for Browser History support.
28
+ </body>
29
+ </html>
@@ -0,0 +1,121 @@
1
+ <!-- saved from url=(0014)about:internet -->
2
+ <html lang="en">
3
+
4
+ <!--
5
+ Smart developers always View Source.
6
+
7
+ This application was built using Adobe Flex, an open source framework
8
+ for building rich Internet applications that get delivered via the
9
+ Flash Player or to desktops via Adobe AIR.
10
+
11
+ Learn more about Flex at http://flex.org
12
+ // -->
13
+
14
+ <head>
15
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
16
+
17
+ <!-- BEGIN Browser History required section -->
18
+ <link rel="stylesheet" type="text/css" href="history/history.css" />
19
+ <!-- END Browser History required section -->
20
+
21
+ <title>${title}</title>
22
+ <script src="AC_OETags.js" language="javascript"></script>
23
+
24
+ <!-- BEGIN Browser History required section -->
25
+ <script src="history/history.js" language="javascript"></script>
26
+ <!-- END Browser History required section -->
27
+
28
+ <style>
29
+ body { margin: 0px; overflow:hidden }
30
+ </style>
31
+ <script language="JavaScript" type="text/javascript">
32
+ <!--
33
+ // -----------------------------------------------------------------------------
34
+ // Globals
35
+ // Major version of Flash required
36
+ var requiredMajorVersion = ${version_major};
37
+ // Minor version of Flash required
38
+ var requiredMinorVersion = ${version_minor};
39
+ // Minor version of Flash required
40
+ var requiredRevision = ${version_revision};
41
+ // -----------------------------------------------------------------------------
42
+ // -->
43
+ </script>
44
+ </head>
45
+
46
+ <body scroll="no">
47
+ <script language="JavaScript" type="text/javascript">
48
+ <!--
49
+ // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
50
+ var hasProductInstall = DetectFlashVer(6, 0, 65);
51
+
52
+ // Version check based upon the values defined in globals
53
+ var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
54
+
55
+ if ( hasProductInstall && !hasRequestedVersion ) {
56
+ // DO NOT MODIFY THE FOLLOWING FOUR LINES
57
+ // Location visited after installation is complete if installation is required
58
+ var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
59
+ var MMredirectURL = window.location;
60
+ document.title = document.title.slice(0, 47) + " - Flash Player Installation";
61
+ var MMdoctitle = document.title;
62
+
63
+ AC_FL_RunContent(
64
+ "src", "playerProductInstall",
65
+ "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
66
+ "width", "${width}",
67
+ "height", "${height}",
68
+ "align", "middle",
69
+ "id", "${application}",
70
+ "quality", "high",
71
+ "bgcolor", "${bgcolor}",
72
+ "name", "${application}",
73
+ "allowScriptAccess","sameDomain",
74
+ "type", "application/x-shockwave-flash",
75
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
76
+ );
77
+ } else if (hasRequestedVersion) {
78
+ // if we've detected an acceptable version
79
+ // embed the Flash Content SWF when all tests are passed
80
+ AC_FL_RunContent(
81
+ "src", "${swf}",
82
+ "width", "${width}",
83
+ "height", "${height}",
84
+ "align", "middle",
85
+ "id", "${application}",
86
+ "quality", "high",
87
+ "bgcolor", "${bgcolor}",
88
+ "name", "${application}",
89
+ "allowScriptAccess","sameDomain",
90
+ "type", "application/x-shockwave-flash",
91
+ "pluginspage", "http://www.adobe.com/go/getflashplayer"
92
+ );
93
+ } else { // flash is too old or we can't detect the plugin
94
+ var alternateContent = 'Alternate HTML content should be placed here. '
95
+ + 'This content requires the Adobe Flash Player. '
96
+ + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
97
+ document.write(alternateContent); // insert non-flash content
98
+ }
99
+ // -->
100
+ </script>
101
+ <noscript>
102
+ <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
103
+ id="${application}" width="${width}" height="${height}"
104
+ codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
105
+ <param name="movie" value="${swf}.swf" />
106
+ <param name="quality" value="high" />
107
+ <param name="bgcolor" value="${bgcolor}" />
108
+ <param name="allowScriptAccess" value="sameDomain" />
109
+ <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
110
+ width="${width}" height="${height}" name="${application}" align="middle"
111
+ play="true"
112
+ loop="false"
113
+ quality="high"
114
+ allowScriptAccess="sameDomain"
115
+ type="application/x-shockwave-flash"
116
+ pluginspage="http://www.adobe.com/go/getflashplayer">
117
+ </embed>
118
+ </object>
119
+ </noscript>
120
+ </body>
121
+ </html>
@@ -0,0 +1,7 @@
1
+ Copyright [2008] [Darshan Sawardekar] Licensed under the Apache License, Version 2.0 (the "License");
2
+ you may not use this file except in compliance with the License.
3
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4
+ Unless required by applicable law or agreed to in writing,
5
+ software distributed under the License is distributed on an
6
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,61 @@
1
+ PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
2
+ --------------------------------------------------------------------------
3
+ Reuse governed by Creative Commons Attribution 3.0 United States License
4
+ View this license and the associated Creative Commons deed online at:
5
+ http://creativecommons.org/licenses/by/3.0/us/
6
+ You must leave all copyright and license
7
+ statements intact in your final product.
8
+ --------------------------------------------------------------------------
9
+ License
10
+
11
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
12
+
13
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
14
+
15
+ 1. Definitions
16
+
17
+ 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with one or more other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
18
+ 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
19
+ 3. "Licensor" means the individual, individuals, entity or entities that offers the Work under the terms of this License.
20
+ 4. "Original Author" means the individual, individuals, entity or entities who created the Work.
21
+ 5. "Work" means the copyrightable work of authorship offered under the terms of this License.
22
+ 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
23
+
24
+ 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
25
+
26
+ 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
27
+
28
+ 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
29
+ 2. to create and reproduce Derivative Works provided that any such Derivative Work, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";;
30
+ 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
31
+ 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
32
+ 5. For the avoidance of doubt, where the Work is a musical composition:
33
+ 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or, in the event that Licensor is a member of a performance rights society (e.g. ASCAP, BMI, SESAC), via that society, royalties for the public performance or public digital performance (e.g. webcast) of the Work.
34
+ 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
35
+ 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
36
+
37
+ The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
38
+
39
+ 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
40
+
41
+ 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of a recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. When You distribute, publicly display, publicly perform, or publicly digitally perform the Work, You may not impose any technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by Section 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by Section 4(b), as requested.
42
+ 2. If You distribute, publicly display, publicly perform, or publicly digitally perform the Work (as defined in Section 1 above) or any Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above), You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, consistent with Section 3(b) in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(b) may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear, if a credit for all contributing authors of the Derivative Work or Collective Work appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
43
+
44
+ 5. Representations, Warranties and Disclaimer
45
+
46
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT OF ANY RIGHTS HELD IN THE LICENSED WORK BY THE LICENSOR. THE LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MARKETABILITY, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
47
+
48
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
49
+
50
+ 7. Termination
51
+
52
+ 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above) from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
53
+ 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
54
+
55
+ 8. Miscellaneous
56
+
57
+ 1. Each time You distribute or publicly digitally perform the Work (as defined in Section 1 above) or a Collective Work (as defined in Section 1 above), the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
58
+ 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
59
+ 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
60
+ 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
61
+ 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
@@ -0,0 +1,63 @@
1
+ PureMVC AS3/MultiCore Utility – Pipes
2
+ Copyright (c) 2008 Cliff Hall<cliff.hall@puremvc.org>
3
+ Your reuse is governed by the Creative Commons Attribution 3.0 License
4
+ --------------------------------------------------------------------------
5
+ Reuse governed by Creative Commons Attribution 3.0 United States License
6
+ View this license and the associated Creative Commons deed online at:
7
+ http://creativecommons.org/licenses/by/3.0/us/
8
+ You must leave all copyright and license
9
+ statements intact in your final product.
10
+ --------------------------------------------------------------------------
11
+ License
12
+
13
+ THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
14
+
15
+ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
16
+
17
+ 1. Definitions
18
+
19
+ 1. "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with one or more other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
20
+ 2. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
21
+ 3. "Licensor" means the individual, individuals, entity or entities that offers the Work under the terms of this License.
22
+ 4. "Original Author" means the individual, individuals, entity or entities who created the Work.
23
+ 5. "Work" means the copyrightable work of authorship offered under the terms of this License.
24
+ 6. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
25
+
26
+ 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
27
+
28
+ 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
29
+
30
+ 1. to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
31
+ 2. to create and reproduce Derivative Works provided that any such Derivative Work, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";;
32
+ 3. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
33
+ 4. to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
34
+ 5. For the avoidance of doubt, where the Work is a musical composition:
35
+ 1. Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or, in the event that Licensor is a member of a performance rights society (e.g. ASCAP, BMI, SESAC), via that society, royalties for the public performance or public digital performance (e.g. webcast) of the Work.
36
+ 2. Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
37
+ 6. Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
38
+
39
+ The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
40
+
41
+ 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
42
+
43
+ 1. You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of a recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. When You distribute, publicly display, publicly perform, or publicly digitally perform the Work, You may not impose any technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by Section 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by Section 4(b), as requested.
44
+ 2. If You distribute, publicly display, publicly perform, or publicly digitally perform the Work (as defined in Section 1 above) or any Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above), You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, consistent with Section 3(b) in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(b) may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear, if a credit for all contributing authors of the Derivative Work or Collective Work appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
45
+
46
+ 5. Representations, Warranties and Disclaimer
47
+
48
+ UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT OF ANY RIGHTS HELD IN THE LICENSED WORK BY THE LICENSOR. THE LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MARKETABILITY, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
49
+
50
+ 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
51
+
52
+ 7. Termination
53
+
54
+ 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works (as defined in Section 1 above) or Collective Works (as defined in Section 1 above) from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
55
+ 2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
56
+
57
+ 8. Miscellaneous
58
+
59
+ 1. Each time You distribute or publicly digitally perform the Work (as defined in Section 1 above) or a Collective Work (as defined in Section 1 above), the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
60
+ 2. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
61
+ 3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
62
+ 4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
63
+ 5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <fab:FlexApplication xmlns:mx="http://www.adobe.com/2006/mxml" pageTitle="<%= title%>"
3
+ xmlns:fab="org.puremvc.as3.multicore.utilities.fabrication.components.*" xmlns:sh="<%=base_package%>.shell.view.components.*"
4
+ backgroundGradientColors="[#3B6E8F, #FFFFFF]" backgroundGradientAlphas="[1.0, 1.0]" layout="absolute" themeColor="HaloBlue" frameRate="60">
5
+
6
+ <mx:Script>
7
+ <![CDATA[
8
+ import <%=base_package%>.shell.controller.<%= startup_command_name %>;
9
+
10
+ override public function getStartupCommand():Class {
11
+ return <%= startup_command_name %>;
12
+ }
13
+ ]]>
14
+ </mx:Script>
15
+
16
+ <mx:Zoom id="zoom" />
17
+ <mx:Fade id="fade" />
18
+ <mx:Dissolve id="dissolve" />
19
+
20
+ <!--mx:LinkBar dataProvider="{modulesContainer}" direction="vertical" borderStyle="solid" backgroundColor="#EEEEEE"/-->
21
+ <sh:ModulesContainer id="modulesContainer" />
22
+ </fab:FlexApplication>
@@ -0,0 +1,22 @@
1
+ package <%= base_package%>.modules.authentication.controller {
2
+ import org.puremvc.as3.multicore.interfaces.INotification;
3
+ import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
4
+
5
+ import <%= base_package%>.common.<%= name%>Constants;
6
+ import <%= base_package%>.modules.authentication.model.AuthenticationProxy;
7
+
8
+ import AuthenticationModule;
9
+ import <%= base_package%>.modules.authentication.view.AuthenticationModuleMediator;
10
+
11
+ public class AuthenticationModuleStartupCommand extends SimpleFabricationCommand {
12
+
13
+ override public function execute(note:INotification):void {
14
+ trace("starting authentication module")
15
+ registerProxy(new AuthenticationProxy());
16
+ /*registerCommand(FabricationRoutingDemoConstants.RECEIVE_MESSAGE, UpdateMessageCountsCommand);
17
+ */
18
+ registerMediator(new AuthenticationModuleMediator(note.getBody() as AuthenticationModule));
19
+ }
20
+
21
+ }
22
+ }
@@ -0,0 +1,20 @@
1
+ package <%= base_package%>.modules.authentication.model {
2
+ import org.puremvc.as3.multicore.utilities.fabrication.patterns.proxy.FabricationProxy;
3
+ import <%= base_package%>.common.<%= name%>Constants;
4
+
5
+ public class AuthenticationProxy extends FabricationProxy {
6
+
7
+ static public const NAME:String = "AuthenticationProxy";
8
+
9
+
10
+ public function AuthenticationProxy(name:String = NAME) {
11
+ super(name);
12
+ }
13
+
14
+
15
+ public function signIn(username:String, password:String):void {
16
+ trace("signing in with username "+username);
17
+ routeNotification(<%= name%>Constants.VALID_LOGIN, username, "securityToken","*");
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,31 @@
1
+ package <%= base_package%>.modules.authentication.view {
2
+ import org.puremvc.as3.multicore.utilities.fabrication.patterns.mediator.FlexMediator;
3
+
4
+ import <%= base_package%>.modules.authentication.view.components.SignInView;
5
+
6
+ public class AuthenticationModuleMediator extends FlexMediator {
7
+
8
+ static public const NAME:String = "AuthenticationModuleMediator";
9
+
10
+ static public function getDefinitionByName(path:String):Object {
11
+ return getDefinitionByName(path);
12
+ }
13
+
14
+ public function AuthenticationModuleMediator(viewComponent:AuthenticationModule) {
15
+ super(NAME, viewComponent);
16
+ }
17
+
18
+ public function get application():AuthenticationModule {
19
+ return viewComponent as AuthenticationModule;
20
+ }
21
+
22
+ public function get signInView():SignInView {
23
+ return application.signInView as SignInView;
24
+ }
25
+
26
+ override public function onRegister():void {
27
+ registerMediator(new SignInViewMediator(signInView));
28
+ }
29
+
30
+ }
31
+ }
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" horizontalCenter="0" verticalCenter="0" title="Sign in" horizontalAlign="center" width="420" height="210" show="onShow()" creationComplete="focusManager.setFocus(usernameTI);">
3
+ <mx:Script>
4
+ <![CDATA[
5
+ import mx.controls.Alert;
6
+
7
+ private function onShow():void {
8
+ usernameTI.text = "";
9
+ passwordTI.text = "";
10
+ focusManager.setFocus(usernameTI);
11
+ }
12
+
13
+ /**
14
+ * Enable or disable the login button depending on whether or not the user has entered something into both username and password fields
15
+ */
16
+ private function usernamePasswordChange():void {
17
+ signInButton.enabled = (usernameTI.text.length > 0 && passwordTI.length > 0);
18
+ }
19
+
20
+ /**
21
+ * Show an invalid login alert and clear the username and password fields
22
+ */
23
+ public function showInvalidSignInAlert():void {
24
+ // Popup an alert
25
+ Alert.show("Invalid username/password", "Sign in error", Alert.OK, this);
26
+
27
+ // Clear the input fields and notify the change handler (this will disable the connect button)
28
+ usernameTI.text = "";
29
+ passwordTI.text = "";
30
+ usernamePasswordChange();
31
+ }
32
+
33
+ ]]>
34
+ </mx:Script>
35
+
36
+ <mx:Form defaultButton="{signInButton}" horizontalCenter="0" verticalCenter="0">
37
+ <mx:FormItem required="true" label="Username">
38
+ <mx:TextInput id="usernameTI" width="105" change="usernamePasswordChange()" />
39
+ </mx:FormItem>
40
+ <mx:FormItem required="true" label="Password">
41
+ <mx:TextInput id="passwordTI" change="usernamePasswordChange()" displayAsPassword="true" width="105" />
42
+ </mx:FormItem>
43
+ <mx:FormItem horizontalAlign="left">
44
+ <mx:Button id="signInButton" label="Sign in" enabled="false" />
45
+
46
+ </mx:FormItem>
47
+ </mx:Form>
48
+ </mx:Panel>
@@ -0,0 +1,48 @@
1
+ package <%= base_package%>.modules.authentication.view
2
+ {
3
+ import org.puremvc.as3.multicore.utilities.fabrication.patterns.mediator.FlexMediator;
4
+ import <%= base_package%>.modules.authentication.view.components.SignInView;
5
+ import <%= base_package%>.modules.authentication.model.AuthenticationProxy;
6
+
7
+ import mx.controls.Button;
8
+ import flash.events.MouseEvent;
9
+
10
+ import flash.events.Event;
11
+
12
+ /*import org.puremvc.as3.multicore.interfaces.INotification;
13
+ import org.puremvc.as3.multicore.patterns.mediator.Mediator;*/
14
+
15
+ public class SignInViewMediator extends FlexMediator {
16
+
17
+ public static const NAME:String = "SignInViewMediator";
18
+
19
+ public function SignInViewMediator( viewComponent:SignInView )
20
+ {
21
+ super( NAME, viewComponent );
22
+ }
23
+
24
+ /**
25
+ * The viewComponent cast to type SignInView.
26
+ */
27
+ private function get signInView():SignInView
28
+ {
29
+ return viewComponent as SignInView;
30
+ }
31
+
32
+ public function get signInButton():Button {
33
+ return signInView.signInButton as Button;
34
+ }
35
+
36
+ public function reactToSignInButtonClick(e:MouseEvent):void {
37
+ signInView.enabled = false;
38
+ trace("sign in clicked");
39
+ var authenticationProxy:AuthenticationProxy = retrieveProxy(AuthenticationProxy.NAME) as AuthenticationProxy;
40
+ authenticationProxy.signIn(signInView.usernameTI.text, signInView.passwordTI.text);
41
+ signInView.usernameTI.text = "";
42
+ signInView.passwordTI.text = "";
43
+ signInButton.enabled = false
44
+ signInView.enabled = true;
45
+ }
46
+
47
+ }
48
+ }