emergent-core 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.bnsignore +16 -0
- data/History.txt +4 -0
- data/Manifest.txt +348 -0
- data/README.rdoc +47 -0
- data/Rakefile +39 -0
- data/app_generators/emergent_core/USAGE +5 -0
- data/app_generators/emergent_core/emergent_core_generator.rb +73 -0
- data/app_generators/emergent_core/templates/core/actionscript.properties +16 -0
- data/app_generators/emergent_core/templates/core/actionscriptair.properties +16 -0
- data/app_generators/emergent_core/templates/core/app.yaml.erb +12 -0
- data/app_generators/emergent_core/templates/core/default_tasks.rake +51 -0
- data/app_generators/emergent_core/templates/core/empty.txt +0 -0
- data/app_generators/emergent_core/templates/core/expressInstall.swf +0 -0
- data/app_generators/emergent_core/templates/core/flex.properties +2 -0
- data/app_generators/emergent_core/templates/core/generate.rb +17 -0
- data/app_generators/emergent_core/templates/core/html-template/AC_OETags.js +276 -0
- data/app_generators/emergent_core/templates/core/html-template/history/history.css +6 -0
- data/app_generators/emergent_core/templates/core/html-template/history/history.js +645 -0
- data/app_generators/emergent_core/templates/core/html-template/history/historyFrame.html +29 -0
- data/app_generators/emergent_core/templates/core/html-template/index.template.html +121 -0
- data/app_generators/emergent_core/templates/core/html-template/playerProductInstall.swf +0 -0
- data/app_generators/emergent_core/templates/core/index.html.erb +18 -0
- data/app_generators/emergent_core/templates/core/index.yaml +11 -0
- data/app_generators/emergent_core/templates/core/mainair-app.xml +134 -0
- data/app_generators/emergent_core/templates/core/mainapp-config.xml +21 -0
- data/app_generators/emergent_core/templates/core/mainapp.mxml +106 -0
- data/app_generators/emergent_core/templates/core/project-textmate.erb +52 -0
- data/app_generators/emergent_core/templates/core/project.properties +18 -0
- data/app_generators/emergent_core/templates/core/projectair.properties +24 -0
- data/app_generators/emergent_core/templates/core/swfobject.js +5 -0
- data/bin/emergent +17 -0
- data/lib/emergent_core.rb +49 -0
- data/lib/restfulx/active_foo.rb +194 -0
- data/lib/restfulx/active_record_tasks.rb +81 -0
- data/lib/restfulx/configuration.rb +76 -0
- data/lib/restfulx/datamapper_foo.rb +31 -0
- data/lib/restfulx/rails/recipes.rb +60 -0
- data/lib/restfulx/rails/swf_helper.rb +60 -0
- data/lib/restfulx/tasks.rb +85 -0
- data/lib/restfulx.rb +117 -0
- data/rails_generators/emergent_cms/USAGE +5 -0
- data/rails_generators/emergent_cms/emergent_cms_generator.rb +21 -0
- data/rails_generators/emergent_cms/templates/PagesEditModel.as +114 -0
- data/rails_generators/emergent_cms/templates/PagesEditView.mxml +102 -0
- data/rails_generators/emergent_config/USAGE +5 -0
- data/rails_generators/emergent_config/emergent_config_generator.rb +330 -0
- data/rails_generators/emergent_config/templates/app/controllers/accounts_controller.rb +104 -0
- data/rails_generators/emergent_config/templates/app/controllers/addresses_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/controllers/application.rb +26 -0
- data/rails_generators/emergent_config/templates/app/controllers/assets_controller.rb +1 -0
- data/rails_generators/emergent_config/templates/app/controllers/content_assignments_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/controllers/contents_controller.rb +114 -0
- data/rails_generators/emergent_config/templates/app/controllers/sessions_controller.rb +72 -0
- data/rails_generators/emergent_config/templates/app/controllers/sites_controller.rb +1 -0
- data/rails_generators/emergent_config/templates/app/controllers/users_controller.rb +97 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/ICommand.as +16 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/Undoable.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/UpdateDocumentCommand.as +73 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/DocumentEvent.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/NavigationEvent.as +31 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/ResourceEvent.as +27 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/UndoEvent.as +36 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AboutUsManager.as +15 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AccountManager.as +31 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/AuthenticationManager.as +76 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ContentManager.as +92 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentManager.as +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/DocumentsManager.as +156 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/HomeManager.as +18 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/MainManager.as +23 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/PagesManager.as +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/ResourceManager.as +195 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/SiteManager.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/manager/UndoManager.as +143 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentMap.mxml +123 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/DocumentsMap.mxml +134 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ManagerPresentationModelMap.mxml +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/ObjectMap.mxml +75 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresentationModelViewMap.mxml +81 -0
- data/rails_generators/emergent_config/templates/app/flex/application/controllers/map/PresenterViewMap.mxml +67 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/DocumentType.as +52 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/Resource.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceAction.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/constant/ResourceResult.as +8 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Account.as +32 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Address.as +26 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Asset.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/AssetAssignment.as +25 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Content.as +46 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/ContentAssignment.as +33 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Document.as +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/PlainDocument.as +19 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/RichDocument.as +19 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Session.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/Snapshot.as +21 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/domain/User.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentFactory.as +61 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/DocumentViewFactory.as +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/factory/ResourceFactory.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AboutUsModel.as +22 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AccountModel.as +68 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/AuthenticationModel.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContactUsModel.as +45 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ContentModel.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentModel.as +235 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/DocumentsModel.as +169 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/HomeModel.as +23 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/MainModel.as +35 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/PagesModel.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ProfileModel.as +99 -0
- data/rails_generators/emergent_config/templates/app/flex/application/models/presentation/ResourceModel.as +100 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/about_us/about_us.mxml +105 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/account/account.mxml +97 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/contact_us/contact_us.mxml +65 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/document.mxml +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/documents.mxml +201 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/plain_document.mxml +9 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/document/rich_document.mxml +12 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/gallery/gallery.mxml +37 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home.mxml +58 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_presenter.as +81 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/home/home_troparchy.mxml +71 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/login/login.mxml +50 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main.mxml +131 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_presenter.as +166 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/main/main_troparchy.mxml +74 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_bottom_view.mxml +48 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_left_view.mxml +43 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_right_view.mxml +47 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_model.as +13 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_presenter.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bar_top_view.mxml +49 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_presenter.as +63 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_troparchy.mxml +63 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/navigation/navigation_bars_view.mxml +59 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages.mxml +44 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_presenter.as +83 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/pages/pages_troparchy.mxml +62 -0
- data/rails_generators/emergent_config/templates/app/flex/application/views/profile/profile.mxml +73 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Bold.otf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/fonts/MyriadPro-Regular.otf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/html/lorem.html +3 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture10.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture11.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture12.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture13.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture14.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture3.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture4.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture5.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture6.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture7.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture8.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/alexgrey/Picture9.png +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_0.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_180.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_270.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_90.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_bottom.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/images/hot_nebula_top.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/itunes7Bg.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukebox.css +764 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/jukeboxGfx.swf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidian.css +734 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianBg.jpg +0 -0
- data/rails_generators/emergent_config/templates/app/flex/assets/styles/obsidianGfx.swf +0 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/LayoutAction.as +377 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/actions/SimpleLayoutAction.as +210 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/FourDTweenCollection.mxml +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/IAnimator.as +39 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/animators/TweenMaxAnimator.as +269 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/cameras/AstroCamera.as +177 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDDataGrid.mxml +105 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/components/FourDItemRenderer.mxml +54 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/CenterPerspectiveProjection.as +72 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ComplexCondition.as +44 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/ConditionsUtil.as +82 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/FourDComponent.as +309 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstanceMethodInvoker.as +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/InstancePropertyInjector.as +43 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/MethodCaller.as +51 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pathway.as +10 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PathwayEvent.as +28 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron.as +34 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Pheron2.as +41 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/PheronReceptor.as +125 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Properties.as +57 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Router.as +50 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/RouterUtil.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleCondition.as +42 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSortVO.as +1 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/SimpleZSorter.as +1 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton.as +70 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/Tecton2.as +234 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonCache.as +111 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonEvent.as +39 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap.as +515 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMap2.as +289 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonMapSample.mxml +73 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonReceptor.as +43 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScope.as +38 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonScopeProperties.as +18 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/core/TectonUtils.as +51 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/events/LayoutActionEvent.as +75 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CarouselLayout.as +85 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CircleLayout.as +102 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/CoverFlowLayout.as +136 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/layouts/FourDLayout.as +272 -0
- data/rails_generators/emergent_config/templates/app/flex/com/fourD/utils/TweenUtil.as +110 -0
- data/rails_generators/emergent_config/templates/app/helpers/accounts_helper.rb +93 -0
- data/rails_generators/emergent_config/templates/app/helpers/application_helper.rb +3 -0
- data/rails_generators/emergent_config/templates/app/models/account.rb +84 -0
- data/rails_generators/emergent_config/templates/app/models/account_mailer.rb +24 -0
- data/rails_generators/emergent_config/templates/app/models/account_observer.rb +17 -0
- data/rails_generators/emergent_config/templates/app/models/address.rb +2 -0
- data/rails_generators/emergent_config/templates/app/models/asset.rb +6 -0
- data/rails_generators/emergent_config/templates/app/models/asset_assignment.rb +4 -0
- data/rails_generators/emergent_config/templates/app/models/category.rb +35 -0
- data/rails_generators/emergent_config/templates/app/models/comment.rb +98 -0
- data/rails_generators/emergent_config/templates/app/models/content.rb +89 -0
- data/rails_generators/emergent_config/templates/app/models/content_assignment.rb +21 -0
- data/rails_generators/emergent_config/templates/app/models/image.rb +3 -0
- data/rails_generators/emergent_config/templates/app/models/post.rb +76 -0
- data/rails_generators/emergent_config/templates/app/models/section.rb +97 -0
- data/rails_generators/emergent_config/templates/app/models/site.rb +1 -0
- data/rails_generators/emergent_config/templates/app/models/tag.rb +1 -0
- data/rails_generators/emergent_config/templates/app/models/user.rb +4 -0
- data/rails_generators/emergent_config/templates/app/views/account_mailer/activation.erb +3 -0
- data/rails_generators/emergent_config/templates/app/views/account_mailer/signup_notification.erb +8 -0
- data/rails_generators/emergent_config/templates/config/Capfile +4 -0
- data/rails_generators/emergent_config/templates/config/README.txt +18 -0
- data/rails_generators/emergent_config/templates/config/deploy.rb +36 -0
- data/rails_generators/emergent_config/templates/config/routes.rb +72 -0
- data/rails_generators/emergent_config/templates/core/actionscript.properties +16 -0
- data/rails_generators/emergent_config/templates/core/actionscriptair.properties +16 -0
- data/rails_generators/emergent_config/templates/core/app.yaml.erb +12 -0
- data/rails_generators/emergent_config/templates/core/default_tasks.rake +51 -0
- data/rails_generators/emergent_config/templates/core/emergent_tasks.rake +42 -0
- data/rails_generators/emergent_config/templates/core/empty.txt +0 -0
- data/rails_generators/emergent_config/templates/core/expressInstall.swf +0 -0
- data/rails_generators/emergent_config/templates/core/flex.properties +2 -0
- data/rails_generators/emergent_config/templates/core/generate.rb +17 -0
- data/rails_generators/emergent_config/templates/core/html-template/AC_OETags.js +276 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/history.css +6 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/history.js +645 -0
- data/rails_generators/emergent_config/templates/core/html-template/history/historyFrame.html +29 -0
- data/rails_generators/emergent_config/templates/core/html-template/index.template.html +121 -0
- data/rails_generators/emergent_config/templates/core/html-template/playerProductInstall.swf +0 -0
- data/rails_generators/emergent_config/templates/core/index.html.erb +18 -0
- data/rails_generators/emergent_config/templates/core/index.yaml +11 -0
- data/rails_generators/emergent_config/templates/core/mainair-app.xml +134 -0
- data/rails_generators/emergent_config/templates/core/mainapp-config.xml +21 -0
- data/rails_generators/emergent_config/templates/core/mainapp.mxml +101 -0
- data/rails_generators/emergent_config/templates/core/project-textmate.erb +52 -0
- data/rails_generators/emergent_config/templates/core/project.properties +18 -0
- data/rails_generators/emergent_config/templates/core/projectair.properties +24 -0
- data/rails_generators/emergent_config/templates/core/restfulx.yml +14 -0
- data/rails_generators/emergent_config/templates/core/restfulx_tasks.rake +6 -0
- data/rails_generators/emergent_config/templates/core/swfobject.js +5 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_accounts.rb +40 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_addresses.rb +18 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_asset_assignments.rb +19 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_assets.rb +20 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_content_assignments.rb +26 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_contents.rb +21 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_sessions.rb +16 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_sites.rb +27 -0
- data/rails_generators/emergent_config/templates/db/migrate/create_users.rb +15 -0
- data/rails_generators/emergent_config/templates/lib/analytics.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/app_controller.rb.erb +26 -0
- data/rails_generators/emergent_config/templates/lib/as3corelib-0.92.1.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3crypto-1.3patched.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3crypto.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3ds-1.04.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/as3httpclientlib-1.0.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/authenticated_system.rb +189 -0
- data/rails_generators/emergent_config/templates/lib/authenticated_test_helper.rb +11 -0
- data/rails_generators/emergent_config/templates/lib/containerEx.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flare.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flash_session_hack.rb +27 -0
- data/rails_generators/emergent_config/templates/lib/flex2BrowserManager.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/flexlib.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/fluint.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/mate_0_8_6_enhanced.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/openflux.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/pv3d.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/restfulx.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/site_keys.rb +38 -0
- data/rails_generators/emergent_config/templates/lib/tweenMax.swc +0 -0
- data/rails_generators/emergent_config/templates/lib/urlkitFlex3.swc +0 -0
- data/rails_generators/emergent_config/templates/shell_script +31 -0
- data/rails_generators/emergent_controller/USAGE +5 -0
- data/rails_generators/emergent_controller/emergent_controller_generator.rb +25 -0
- data/rails_generators/emergent_controller/templates/controller.as.erb +37 -0
- data/rails_generators/emergent_core/USAGE +5 -0
- data/rails_generators/emergent_core/emergent_core_generator.rb +157 -0
- data/rails_generators/emergent_iphone/USAGE +5 -0
- data/rails_generators/emergent_iphone/emergent_iphone_generator.rb +27 -0
- data/rails_generators/emergent_scaffold/USAGE +5 -0
- data/rails_generators/emergent_scaffold/emergent_scaffold_generator.rb +157 -0
- data/rails_generators/emergent_scaffold/templates/component.mxml.erb +101 -0
- data/rails_generators/emergent_scaffold/templates/controller.rb.erb +101 -0
- data/rails_generators/emergent_scaffold/templates/edit_index_view.mxml.erb +114 -0
- data/rails_generators/emergent_scaffold/templates/edit_show_view.mxml.erb +84 -0
- data/rails_generators/emergent_scaffold/templates/filter_view.mxml.erb +1 -0
- data/rails_generators/emergent_scaffold/templates/fixtures.yml.erb +128 -0
- data/rails_generators/emergent_scaffold/templates/index_view.mxml.erb +58 -0
- data/rails_generators/emergent_scaffold/templates/item_renderer.mxml.erb +53 -0
- data/rails_generators/emergent_scaffold/templates/manager.as.erb +31 -0
- data/rails_generators/emergent_scaffold/templates/migration.rb.erb +22 -0
- data/rails_generators/emergent_scaffold/templates/model.as.erb +42 -0
- data/rails_generators/emergent_scaffold/templates/model.rb.erb +11 -0
- data/rails_generators/emergent_scaffold/templates/presentation_model.as.erb +33 -0
- data/rails_generators/emergent_scaffold/templates/presenter.as.erb +98 -0
- data/rails_generators/emergent_scaffold/templates/show_view.mxml.erb +50 -0
- data/rails_generators/emergent_scaffold/templates/view_map.mxml.erb +40 -0
- data/rails_generators/emergent_scaffold/templates/views_panel.mxml.erb +64 -0
- data/rails_generators/emergent_styler/USAGE +5 -0
- data/rails_generators/emergent_styler/emergent_styler_generator.rb +21 -0
- data/rails_generators/rx_yaml_scaffold/USAGE +51 -0
- data/rails_generators/rx_yaml_scaffold/rx_yaml_scaffold_generator.rb +49 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/emergent_core_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- data/tasks/ann.rake +80 -0
- data/tasks/bones.rake +20 -0
- data/tasks/gem.rake +201 -0
- data/tasks/git.rake +40 -0
- data/tasks/manifest.rake +48 -0
- data/tasks/notes.rake +27 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +50 -0
- data/tasks/rubyforge.rake +55 -0
- data/tasks/setup.rb +279 -0
- data/tasks/spec.rake +54 -0
- data/tasks/svn.rake +47 -0
- data/tasks/test.rake +40 -0
- data/test/test_emergent_core.rb +0 -0
- data/test/test_emergent_iphone_generator.rb +46 -0
- data/test/test_generator_helper.rb +29 -0
- metadata +437 -0
@@ -0,0 +1,125 @@
|
|
1
|
+
/*
|
2
|
+
Copyright 2008 Nahuel Foronda/AsFusion
|
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. Y
|
6
|
+
ou 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, s
|
11
|
+
oftware 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 limitations under the License
|
14
|
+
|
15
|
+
Author: Nahuel Foronda, Principal Architect
|
16
|
+
nahuel at asfusion dot com
|
17
|
+
|
18
|
+
@ignore
|
19
|
+
*/
|
20
|
+
package com.fourD.core
|
21
|
+
{
|
22
|
+
import com.asfusion.mate.core.mate;
|
23
|
+
import com.asfusion.mate.events.UnhandledMessageFaultEvent;
|
24
|
+
import com.asfusion.mate.utils.debug.DebuggerUtil;
|
25
|
+
|
26
|
+
import mx.messaging.*;
|
27
|
+
import mx.messaging.events.MessageEvent;
|
28
|
+
import mx.messaging.events.MessageFaultEvent;
|
29
|
+
|
30
|
+
use namespace mate;
|
31
|
+
/**
|
32
|
+
* The <code>MessageHandlers</code> tag allows you to register a set of handlers as a consumer of a Flex Messaging Service.
|
33
|
+
* All the tags inside the <code>MessageHandlers</code> tag will be executed in order when a <code>Message</code> matching the
|
34
|
+
* criteria is received. This tag accepts the same attributes as the <code>Consumer</code> tag.
|
35
|
+
*/
|
36
|
+
public class PheronReceptors
|
37
|
+
|
38
|
+
public var pheron:Pheron2;
|
39
|
+
|
40
|
+
protected var initializeHandlersChanged:Boolean;
|
41
|
+
protected var startHandlersChanged:Boolean;
|
42
|
+
protected var completeHandlersChanged:Boolean;
|
43
|
+
|
44
|
+
private var _initializeHandlers:Array;
|
45
|
+
public function get initializeHandlers():Array { return _initializeHandlers; }
|
46
|
+
[ArrayElementType("com.asfusion.mate.actions.IAction")]
|
47
|
+
public function set initializeHandlers(value:Array):void {
|
48
|
+
_initializeHandlers = value;
|
49
|
+
initializeHandlersChanged = true;
|
50
|
+
validateNow();
|
51
|
+
}
|
52
|
+
|
53
|
+
private var _startHandlers:Array;
|
54
|
+
public function get startHandlers():Array { return _startHandlers; }
|
55
|
+
[ArrayElementType("com.asfusion.mate.actions.IAction")]
|
56
|
+
public function set startHandlers(value:Array):void {
|
57
|
+
_startHandlers = value;
|
58
|
+
startHandlersChanged = true;
|
59
|
+
validateNow();
|
60
|
+
}
|
61
|
+
|
62
|
+
private var _completeHandlers:Array;
|
63
|
+
public function get completeHandlers():Array { return _completeHandlers; }
|
64
|
+
[ArrayElementType("com.asfusion.mate.actions.IAction")]
|
65
|
+
public function set completeHandlers(value:Array):void {
|
66
|
+
_completeHandlers = value;
|
67
|
+
completeHandlersChanged = true;
|
68
|
+
validateNow();
|
69
|
+
}
|
70
|
+
|
71
|
+
public function PheronReceptor()
|
72
|
+
{
|
73
|
+
super();
|
74
|
+
}
|
75
|
+
|
76
|
+
override public function errorString():String
|
77
|
+
{
|
78
|
+
var str:String = "Destination:"+ destination + ". Error was found in a MessageHandlers list in file "
|
79
|
+
+ DebuggerUtil.getClassName(document);
|
80
|
+
return str;
|
81
|
+
}
|
82
|
+
|
83
|
+
protected function tectonStart(pheron:Pheron2):void
|
84
|
+
{
|
85
|
+
var currentScope:TectonScope = new TectonScope(event,debug, map, inheritedScope);
|
86
|
+
currentScope.owner = this;
|
87
|
+
currentScope.tecton = pheron.tecton;
|
88
|
+
currentScope.tropon = pheron.tropon;
|
89
|
+
currentScope.kanon = pheron.kanon;
|
90
|
+
currentScope.action = pheron.action;
|
91
|
+
runSequence(currentScope, startHandlers);
|
92
|
+
}
|
93
|
+
|
94
|
+
protected function tectonComplete(pheron:Pheron2):void
|
95
|
+
{
|
96
|
+
var currentScope:TectonScope = new TectonScope(event,debug, map, inheritedScope);
|
97
|
+
currentScope.owner = this;
|
98
|
+
currentScope.tecton = pheron.tecton;
|
99
|
+
currentScope.tropon = pheron.tropon;
|
100
|
+
currentScope.kanon = pheron.kanon;
|
101
|
+
currentScope.action = pheron.action;
|
102
|
+
runSequence(currentScope, completeHandlers);
|
103
|
+
}
|
104
|
+
/*-----------------------------------------------------------------------------------------------------------
|
105
|
+
* Override Protected methods
|
106
|
+
-------------------------------------------------------------------------------------------------------------*/
|
107
|
+
|
108
|
+
/*-.........................................commitProperties..........................................*/
|
109
|
+
/**
|
110
|
+
* Processes the properties set on the component.
|
111
|
+
*/
|
112
|
+
override protected function commitProperties():void
|
113
|
+
{
|
114
|
+
if (initializeHandlersChanged) {
|
115
|
+
initializeHandlersChanged = false;
|
116
|
+
}
|
117
|
+
if (startHandlersChanged) {
|
118
|
+
startHandlersChanged = false;
|
119
|
+
}
|
120
|
+
if (completeHandlersChanged) {
|
121
|
+
completeHandlersChanged = false;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
package com.fourD.core {
|
2
|
+
|
3
|
+
public dynamic class Properties {
|
4
|
+
/*-----------------------------------------------------------------------------------------------------------
|
5
|
+
* Public Fields
|
6
|
+
-------------------------------------------------------------------------------------------------------------*/
|
7
|
+
/**
|
8
|
+
* If you need to specify a property that is called "id", you need
|
9
|
+
* to use <code>_id</code> instead because Flex will normally use the <code>id</code>
|
10
|
+
* property as the identifier for this tag.
|
11
|
+
*/
|
12
|
+
public var _id:*;
|
13
|
+
|
14
|
+
/*-----------------------------------------------------------------------------------------------------------
|
15
|
+
* Public static methods
|
16
|
+
-------------------------------------------------------------------------------------------------------------*/
|
17
|
+
/**
|
18
|
+
* This method will parse all the SmartObjects and set the real values in the
|
19
|
+
* <code>target</code> Object
|
20
|
+
*/
|
21
|
+
public static function copyValuesToTarget(source:Object, target:Object):Object
|
22
|
+
{
|
23
|
+
|
24
|
+
for (var propertyName:String in source)
|
25
|
+
{
|
26
|
+
var realValue:* = source[propertyName];
|
27
|
+
try
|
28
|
+
{
|
29
|
+
target[propertyName] = realValue;
|
30
|
+
}
|
31
|
+
catch(error:ReferenceError)
|
32
|
+
{
|
33
|
+
}
|
34
|
+
catch(error:TypeError)
|
35
|
+
{
|
36
|
+
}
|
37
|
+
|
38
|
+
}
|
39
|
+
if(source._id) target['id'] = source._id;
|
40
|
+
return target;
|
41
|
+
}
|
42
|
+
|
43
|
+
/*-----------------------------------------------------------------------------------------------------------
|
44
|
+
* Public Methods
|
45
|
+
-------------------------------------------------------------------------------------------------------------*/
|
46
|
+
/**
|
47
|
+
* Similar to <code>smartCopy</code> this method will copy the properties
|
48
|
+
* to the target object.
|
49
|
+
* The difference is that it will copy its own properties to the target.
|
50
|
+
*/
|
51
|
+
public function injectProperties(target:Object):Object
|
52
|
+
{
|
53
|
+
return copyValuesToTarget(this, target);
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
package com.fourD.core
|
2
|
+
{
|
3
|
+
import flash.utils.Dictionary;
|
4
|
+
import flash.utils.getQualifiedClassName;
|
5
|
+
|
6
|
+
public class Router
|
7
|
+
{
|
8
|
+
private var views:Dictionary;
|
9
|
+
// injected from the application...
|
10
|
+
public var viewInstances:Dictionary;
|
11
|
+
|
12
|
+
public function Router()
|
13
|
+
{
|
14
|
+
views = new Dictionary();
|
15
|
+
viewInstances = new Dictionary();
|
16
|
+
}
|
17
|
+
|
18
|
+
public static function mapClasses(classes:Array, cache:Boolean = true):void {
|
19
|
+
for each (var view:Class in views) {
|
20
|
+
var fqn:String = getQualifiedClassName(view);
|
21
|
+
|
22
|
+
var viewName:String = fqn.split("::")[1] as String;
|
23
|
+
views[view] = fqn;
|
24
|
+
views[fqn] = view;
|
25
|
+
}
|
26
|
+
// once we have set up the core data structures we need another pass to compute
|
27
|
+
// the hierarchy of the components/views
|
28
|
+
classes.forEach(function(elm:Class, index:int, array:Array):void {
|
29
|
+
Router.extractMetadata(elm);
|
30
|
+
});
|
31
|
+
}
|
32
|
+
|
33
|
+
public static function extractMetadata(viewClass:Class):void {
|
34
|
+
var fqn:String = views[viewClass];
|
35
|
+
var view:UIComponent = viewInstances[viewClass];
|
36
|
+
var meta:XML = describeType(view);
|
37
|
+
|
38
|
+
for each (var node:XML in meta..accessor) {
|
39
|
+
var declaredBy:String = node.@declaredBy;
|
40
|
+
var name:String = node.@name;
|
41
|
+
var child:UIComponent;
|
42
|
+
// if the accessor was declared in one of your classes and it's a UIComponent...
|
43
|
+
if (viewClasses[declaredBy] && view[name] is UIComponent) {
|
44
|
+
child = view[name] as UIComponent;
|
45
|
+
mapChildToParent(troponMap, view, child);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
package com.fourD.core
|
2
|
+
{
|
3
|
+
import flash.utils.getQualifiedClassName;
|
4
|
+
|
5
|
+
public class RouterUtil
|
6
|
+
{
|
7
|
+
public function RouterUtil()
|
8
|
+
{
|
9
|
+
}
|
10
|
+
|
11
|
+
public static function getTectonName(path:String, action:String):String {
|
12
|
+
return path + "." + action;
|
13
|
+
}
|
14
|
+
|
15
|
+
public static function getGenericTectonName(app:*, kanon:String, tropon:String, action:String):String {
|
16
|
+
return getQualifiedClassName(app) + "::" + kanon + "::" + tropon + "::" + RouterUtil.upperCaseFirst(action);
|
17
|
+
}
|
18
|
+
|
19
|
+
public static function getClassTroponName(path:String):String {
|
20
|
+
// path = Project.mainView.tropon63
|
21
|
+
var pattern:RegExp = /\d+$/i; // numbers at the end
|
22
|
+
var index:int = path.indexOf(pattern);
|
23
|
+
var genericTropon:String = path.slice(0, index); // Project.mainView.tropon
|
24
|
+
pattern = /\w+$/i; // last word
|
25
|
+
index = path.indexOf(pattern);
|
26
|
+
genericTropon = path.slice(index, path.length);
|
27
|
+
return RouterUtil.upperCaseFirst(genericTropon);
|
28
|
+
}
|
29
|
+
|
30
|
+
public static function getInstanceTroponName(path:String):String {
|
31
|
+
// path = Project.mainView.tropon63
|
32
|
+
var pattern:RegExp = /\w+$/i; // numbers and word at the end
|
33
|
+
var index:int = path.indexOf(pattern);
|
34
|
+
return = path.slice(index, path.length); // Project.mainView.tropon
|
35
|
+
}
|
36
|
+
|
37
|
+
public static function getClassKanonName(path:String):String {
|
38
|
+
// path = Project.kanon12.tropon63
|
39
|
+
var pattern:RegExp = /\d+\.\w+$/i; // last word, period, and numbers before period
|
40
|
+
var index:int = path.indexOf(pattern);
|
41
|
+
var genericKanon:String = path.slice(0, index); // Project.kanon
|
42
|
+
pattern = /\w+$/i; // last word
|
43
|
+
index = path.indexOf(pattern);
|
44
|
+
genericKanon = path.slice(index, path.length);
|
45
|
+
return RouterUtil.upperCaseFirst(genericKanon);
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
public static function getInstanceKanonName(path:String):String {
|
50
|
+
// path = Project.kanon12.tropon63
|
51
|
+
var pattern:RegExp = /\.\w+$/i; // numbers at the end and period
|
52
|
+
var index:int = path.indexOf(pattern);\w+\.\w+$
|
53
|
+
var kanon:String = path.slice(0, index); // Project.kanon12
|
54
|
+
pattern = /\w+$/i; // last word
|
55
|
+
index = path.indexOf(pattern);
|
56
|
+
return path.slice(index, path.length);
|
57
|
+
}
|
58
|
+
|
59
|
+
public static function lowerCaseFirst(string:String):String {
|
60
|
+
return string.charAt(0).toLowerCase() + string.slice(1);
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Upper cases first letter in a string leaving the rest of it alone
|
65
|
+
*/
|
66
|
+
public static function upperCaseFirst(string:String):String {
|
67
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2008-2009 (c) Lance Pollard
|
3
|
+
* www.systemsofseven.com/blog
|
4
|
+
* www.4ddesignlab.com
|
5
|
+
* LanceJPollard@gmail.com
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person
|
8
|
+
* obtaining a copy of this software and associated documentation
|
9
|
+
* files (the "Software"), to deal in the Software without
|
10
|
+
* restriction, including without limitation the rights to use,
|
11
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
* copies of the Software, and to permit persons to whom the
|
13
|
+
* Software is furnished to do so, subject to the following
|
14
|
+
* conditions:
|
15
|
+
*
|
16
|
+
* The above copyright notice and this permission notice shall be
|
17
|
+
* included in all copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
21
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
22
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
23
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
24
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
25
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
26
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*/
|
28
|
+
|
29
|
+
package com.fourD.core {
|
30
|
+
|
31
|
+
[Bindable]
|
32
|
+
public class SimpleCondition {
|
33
|
+
|
34
|
+
public var property:*;
|
35
|
+
|
36
|
+
public var value:*;
|
37
|
+
|
38
|
+
// object with the property you're using in your condition
|
39
|
+
public var source:*;
|
40
|
+
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
package com.fourD.core {
|
@@ -0,0 +1 @@
|
|
1
|
+
package com.fourD.core {
|
@@ -0,0 +1,70 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2008-2009 (c) Lance Pollard
|
3
|
+
* www.systemsofseven.com/blog
|
4
|
+
* www.4ddesignlab.com
|
5
|
+
* LanceJPollard@gmail.com
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person
|
8
|
+
* obtaining a copy of this software and associated documentation
|
9
|
+
* files (the "Software"), to deal in the Software without
|
10
|
+
* restriction, including without limitation the rights to use,
|
11
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
* copies of the Software, and to permit persons to whom the
|
13
|
+
* Software is furnished to do so, subject to the following
|
14
|
+
* conditions:
|
15
|
+
*
|
16
|
+
* The above copyright notice and this permission notice shall be
|
17
|
+
* included in all copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
21
|
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
22
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
23
|
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
24
|
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
25
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
26
|
+
* OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*/
|
28
|
+
|
29
|
+
package com.fourD.core {
|
30
|
+
|
31
|
+
import flash.events.EventDispatcher;
|
32
|
+
|
33
|
+
[Bindable]
|
34
|
+
public class Tecton extends EventDispatcher {
|
35
|
+
|
36
|
+
public var actions:Array;
|
37
|
+
|
38
|
+
public var actionParams:*;
|
39
|
+
|
40
|
+
public var tropon:*;
|
41
|
+
|
42
|
+
// "parent", but more appropriately the rules defining it's behavior in a system.
|
43
|
+
public var kanon:*;
|
44
|
+
|
45
|
+
public var tropons:Array;
|
46
|
+
|
47
|
+
public var name:String;
|
48
|
+
|
49
|
+
public var actionName:String;
|
50
|
+
|
51
|
+
public var conditions:Array;
|
52
|
+
|
53
|
+
public var receptors:Array
|
54
|
+
|
55
|
+
public var initialize:Array;
|
56
|
+
|
57
|
+
public var start:Array;
|
58
|
+
|
59
|
+
public var complete:Array;
|
60
|
+
|
61
|
+
public var isInitialized:Boolean;
|
62
|
+
|
63
|
+
public var isRunning:Boolean;
|
64
|
+
|
65
|
+
public var isComplete:Boolean;
|
66
|
+
|
67
|
+
public var isActive:Boolean;
|
68
|
+
|
69
|
+
}
|
70
|
+
}
|
@@ -0,0 +1,234 @@
|
|
1
|
+
/*
|
2
|
+
Copyright 2008 Nahuel Foronda/AsFusion
|
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. Y
|
6
|
+
ou 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, s
|
11
|
+
oftware 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 limitations under the License
|
14
|
+
|
15
|
+
Author: Nahuel Foronda, Principal Architect
|
16
|
+
nahuel at asfusion dot com
|
17
|
+
|
18
|
+
@ignore
|
19
|
+
*/
|
20
|
+
package com.fourD.core
|
21
|
+
{
|
22
|
+
import com.asfusion.mate.core.mate;
|
23
|
+
import com.asfusion.mate.utils.debug.DebuggerUtil;
|
24
|
+
|
25
|
+
import flash.utils.Dictionary;
|
26
|
+
|
27
|
+
import mx.messaging.*;
|
28
|
+
|
29
|
+
use namespace mate;
|
30
|
+
/**
|
31
|
+
* The <code>MessageHandlers</code> tag allows you to register a set of handlers as a consumer of a Flex Messaging Service.
|
32
|
+
* All the tags inside the <code>MessageHandlers</code> tag will be executed in order when a <code>Message</code> matching the
|
33
|
+
* criteria is received. This tag accepts the same attributes as the <code>Consumer</code> tag.
|
34
|
+
*/
|
35
|
+
[Event(name="initialize", type="com.fourD.core.Pheron2")]
|
36
|
+
|
37
|
+
[Event(name="start", type="com.fourD.core.Pheron2")]
|
38
|
+
|
39
|
+
[Event(name="complete", type="com.fourD.core.Pheron2")]
|
40
|
+
|
41
|
+
public class Tecton2
|
42
|
+
|
43
|
+
private var isActiveChanged:Boolean;
|
44
|
+
private var isInitializedChanged:Boolean;
|
45
|
+
private var isRunningChanged:Boolean;
|
46
|
+
private var isCompleteChanged:Boolean;
|
47
|
+
|
48
|
+
private var activateBeforeChanged:Boolean;
|
49
|
+
private var activateDuringChanged:Boolean;
|
50
|
+
private var activateAfterChanged:Boolean;
|
51
|
+
private var inactivateBeforeChanged:Boolean;
|
52
|
+
|
53
|
+
private var requiredPherons:Dictionary;
|
54
|
+
private var inactivatePherons:Dictionary;
|
55
|
+
private var numRequiredPherons:int;
|
56
|
+
|
57
|
+
// "parent", but more appropriately the rules defining it's behavior in a system.
|
58
|
+
public var kanon:*;
|
59
|
+
|
60
|
+
public var tropons:Array;
|
61
|
+
|
62
|
+
public var name:String;
|
63
|
+
|
64
|
+
public var actionName:String;
|
65
|
+
|
66
|
+
public var conditions:Array;
|
67
|
+
|
68
|
+
private var _isActive:Boolean; [Bindable]
|
69
|
+
public function get isActive():Boolean { return _isActive; }
|
70
|
+
public function set isActive(value:Boolean):void {
|
71
|
+
_isActive = value;
|
72
|
+
isActiveChanged = true;
|
73
|
+
invalidateProperties();
|
74
|
+
}
|
75
|
+
|
76
|
+
private var _isInitialized:Boolean; [Bindable]
|
77
|
+
public function get isInitialized():Boolean { return _isInitialized; }
|
78
|
+
public function set isInitialized(value:Boolean):void {
|
79
|
+
_isInitialized = value;
|
80
|
+
isInitializedChanged = true;
|
81
|
+
invalidateProperties();
|
82
|
+
}
|
83
|
+
|
84
|
+
private var _isRunning:Boolean; [Bindable]
|
85
|
+
public function get isRunning():Boolean { return _isRunning; }
|
86
|
+
public function set isRunning(value:Boolean):void {
|
87
|
+
_isRunning = value;
|
88
|
+
isRunningChanged = true;
|
89
|
+
invalidateProperties();
|
90
|
+
}
|
91
|
+
|
92
|
+
private var _isComplete:Boolean; [Bindable]
|
93
|
+
public function get isComplete():Boolean { return _isComplete; }
|
94
|
+
public function set isComplete(value:Boolean):void {
|
95
|
+
_isComplete = value;
|
96
|
+
isCompletehanged = true;
|
97
|
+
invalidateProperties();
|
98
|
+
}
|
99
|
+
|
100
|
+
protected var initializeHandlersChanged:Boolean;
|
101
|
+
protected var startHandlersChanged:Boolean;
|
102
|
+
protected var completeHandlersChanged:Boolean;
|
103
|
+
|
104
|
+
private var _activateBefore:Array; [Bindable] // therefore it listens for INITIALIZE events
|
105
|
+
public function get activateBefore():Array { return _activateBefore; }
|
106
|
+
[ArrayElementType("com.fourD.core.Pheron2")]
|
107
|
+
public function set activateBefore(value:Array):void {
|
108
|
+
_activateBefore = value;
|
109
|
+
activateBeforeChanged = true;
|
110
|
+
invalidateProperties();
|
111
|
+
}
|
112
|
+
|
113
|
+
private var _inactivateBefore:Array; [Bindable] // therefore it listens for INITIALIZE events
|
114
|
+
public function get inactivateBefore():Array { return _inactivateBefore; }
|
115
|
+
[ArrayElementType("com.fourD.core.Pheron2")]
|
116
|
+
public function set inactivateBefore(value:Array):void {
|
117
|
+
_inactivateBefore = value;
|
118
|
+
inactivateBeforeChanged = true;
|
119
|
+
invalidateProperties();
|
120
|
+
}
|
121
|
+
|
122
|
+
private var _activateDuring:Array; [Bindable] // therefore it's listening for READY events
|
123
|
+
[ArrayElementType("com.fourD.core.Pheron2")]
|
124
|
+
public function get activateDuring():Array { return _activateDuring; }
|
125
|
+
public function set activateDuring(value:Array):void {
|
126
|
+
_activateDuring = value;
|
127
|
+
activateDuringChanged = true;
|
128
|
+
invalidateProperties();
|
129
|
+
}
|
130
|
+
|
131
|
+
private var _activateAfter:Array; [Bindable] // don't need to do, but it would dispatch COMPLETE to these
|
132
|
+
public function get activateAfter():Array { return _activateAfter; }
|
133
|
+
[ArrayElementType("com.fourD.core.Tecton2")]
|
134
|
+
public function set activateAfter(value:Array):void {
|
135
|
+
_activateAfter = value;
|
136
|
+
activateAfterChanged = true;
|
137
|
+
invalidateProperties();
|
138
|
+
}
|
139
|
+
|
140
|
+
public function Tecton2()
|
141
|
+
{
|
142
|
+
super();
|
143
|
+
}
|
144
|
+
|
145
|
+
override public function errorString():String
|
146
|
+
{
|
147
|
+
var str:String = "Destination:"+ destination + ". Error was found in a MessageHandlers list in file "
|
148
|
+
+ DebuggerUtil.getClassName(document);
|
149
|
+
return str;
|
150
|
+
}
|
151
|
+
|
152
|
+
protected function prepare(pheron:Pheron2):void {
|
153
|
+
var pheronType:String = pheron.name;
|
154
|
+
if (isComplete) {
|
155
|
+
if (requiredPherons[pheronType] && pheron.phase == Pheron2.INITIALIZE) {
|
156
|
+
isComplete = false;
|
157
|
+
isActive = false;
|
158
|
+
return;
|
159
|
+
}
|
160
|
+
}
|
161
|
+
if (isActive && isComplete) { return; }
|
162
|
+
|
163
|
+
delete requiredPherons[pheronType]; // do I even need to do this?
|
164
|
+
numRequirePherons --;
|
165
|
+
if (numRequiredPherons == 0) {
|
166
|
+
run(pheron.tecton);
|
167
|
+
dispatchPheron(Pheron2.COMPLETE);
|
168
|
+
isComplete = true;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
public function run(tecton:Tecton):void
|
173
|
+
{
|
174
|
+
var currentScope:TectonScope = new TectonScope(event,debug, map, inheritedScope);
|
175
|
+
currentScope.owner = this;
|
176
|
+
currentScope.tecton = pheron.tecton;
|
177
|
+
currentScope.tropon = pheron.tecton.tropon;
|
178
|
+
currentScope.kanon = pheron.tecton.kanon;
|
179
|
+
currentScope.action = pheron.tecton.action;
|
180
|
+
|
181
|
+
var presenter:* = pheron.tecton.kanon.presenter;
|
182
|
+
currentScope.presenter = (presenter) ? presenter : null;
|
183
|
+
|
184
|
+
isRunning = true;
|
185
|
+
|
186
|
+
runSequence(currentScope, actions);
|
187
|
+
}
|
188
|
+
|
189
|
+
override protected function commitProperties():void
|
190
|
+
{
|
191
|
+
var i:int=0; var
|
192
|
+
if (isActive && !isInitialized) {
|
193
|
+
isInitialized = true;
|
194
|
+
numRequiredPherons = 0;
|
195
|
+
dispatchPheron(Pheron2.INITIALIZE);
|
196
|
+
}
|
197
|
+
if (isActive && isInitialized && !isRunning) {
|
198
|
+
attachHandlers(before, Pheron2.COMPLETE);
|
199
|
+
attachHandlers(during, Pheron2.READY);
|
200
|
+
}
|
201
|
+
if (isComplete) {
|
202
|
+
attachInactivateHandlers(inactivateBefore, Pheron2.INITIALIZE);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
private function dispatchPheron(phase:String):void {
|
207
|
+
var pheron:Pheron2 = new Pheron2(phase);
|
208
|
+
pheron.tecton = this;
|
209
|
+
dispatcher.dispatchEvent(pheron);
|
210
|
+
}
|
211
|
+
|
212
|
+
private function attachHandlers(tectons:Array, phase:String):void {
|
213
|
+
var i:int=0, n:int=tectons.length;
|
214
|
+
for (i; i < n; i++) {
|
215
|
+
var tecton:Tecton = tectons[i].tecton;
|
216
|
+
var pheronType:String = tecton.toString() + phase;
|
217
|
+
dispatcher.addEventListener(pheronType, prepare);
|
218
|
+
numRequiredPherons ++;
|
219
|
+
requiredPherons[pheronType] = numRequiredPherons;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
private function attachInactivateHandlers(tectons:Array, phase:String):void {
|
224
|
+
var i:int=0, n:int=tectons.length;
|
225
|
+
for (i; i < n; i++) {
|
226
|
+
var tecton:Tecton = tectons[i].tecton;
|
227
|
+
var pheronType:String = tecton.toString() + phase;
|
228
|
+
dispatcher.addEventListener(pheronType, prepare);
|
229
|
+
numRequiredPherons ++;
|
230
|
+
inactivatePherons[pheronType] = numRequiredPherons;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|