emergent-core 0.1.0
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.
- 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,114 @@
|
|
|
1
|
+
class ContentsController < ApplicationController
|
|
2
|
+
# GET /users
|
|
3
|
+
# GET /users.xml
|
|
4
|
+
# GET /users.fxml
|
|
5
|
+
def index
|
|
6
|
+
@contents = Content.find(:first).descendants
|
|
7
|
+
|
|
8
|
+
respond_to do |format|
|
|
9
|
+
format.html # index.html.erb
|
|
10
|
+
format.fxml do
|
|
11
|
+
render :fxml => @contents
|
|
12
|
+
end
|
|
13
|
+
format.xml do
|
|
14
|
+
render :xml => @contents
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# GET /users/1
|
|
20
|
+
# GET /users/1.xml
|
|
21
|
+
# GET /users/1.fxml
|
|
22
|
+
def show
|
|
23
|
+
@content = Content.find(params[:id])
|
|
24
|
+
@content_assignments = []
|
|
25
|
+
@procs
|
|
26
|
+
ContentAssignment.find(:first, :conditions => {:content_id => @content.id}).descendants.each do |child|
|
|
27
|
+
proc = Proc.new do |opts|
|
|
28
|
+
opts[:builder].tag!('parent_id', child.parent.content.id)
|
|
29
|
+
end
|
|
30
|
+
@content_assignments.push(child)
|
|
31
|
+
@procs.push(proc)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
respond_to do |format|
|
|
35
|
+
format.html # index.html.erb
|
|
36
|
+
format.fxml do
|
|
37
|
+
render :fxml => @content.to_fxml(:child_proc => @procs)
|
|
38
|
+
end
|
|
39
|
+
format.xml do
|
|
40
|
+
render :xml => @content.to_fxml(:child_proc => @procs)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# GET /users/new
|
|
46
|
+
# GET /users/new.xml
|
|
47
|
+
def new
|
|
48
|
+
@content = Content.new
|
|
49
|
+
|
|
50
|
+
respond_to do |format|
|
|
51
|
+
format.html # new.html.erb
|
|
52
|
+
format.xml { render :xml => @content }
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# GET /users/1/edit
|
|
57
|
+
def edit
|
|
58
|
+
@content = Content.find(params[:id])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# POST /users
|
|
62
|
+
# POST /users.xml
|
|
63
|
+
# POST /users.fxml
|
|
64
|
+
def create
|
|
65
|
+
@content = Content.new(params[:content])
|
|
66
|
+
respond_to do |format|
|
|
67
|
+
if @content.save
|
|
68
|
+
flash[:notice] = 'Content was successfully created.'
|
|
69
|
+
format.html { redirect_to(@content) }
|
|
70
|
+
format.xml { render :xml => @content, :status => :created, :location => @content }
|
|
71
|
+
format.fxml { render :fxml => @content }
|
|
72
|
+
else
|
|
73
|
+
format.html { render :action => "new" }
|
|
74
|
+
format.xml { render :xml => @content.errors, :status => :unprocessable_entity }
|
|
75
|
+
format.fxml { render :fxml => @content.errors }
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# PUT /users/1
|
|
81
|
+
# PUT /users/1.xml
|
|
82
|
+
# PUT /users/1.fxml
|
|
83
|
+
def update
|
|
84
|
+
@content = Content.find(params[:id])
|
|
85
|
+
|
|
86
|
+
respond_to do |format|
|
|
87
|
+
if @content.update_attributes(params[:content])
|
|
88
|
+
flash[:notice] = 'Content was successfully updated.'
|
|
89
|
+
format.html { redirect_to(@content) }
|
|
90
|
+
format.xml { head :ok }
|
|
91
|
+
format.fxml { render :fxml => @content.to_fxml }
|
|
92
|
+
else
|
|
93
|
+
format.html { render :action => "edit" }
|
|
94
|
+
format.xml { render :xml => @content.errors, :status => :unprocessable_entity }
|
|
95
|
+
format.fxml { render :fxml => @content.errors }
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# DELETE /users/1
|
|
101
|
+
# DELETE /users/1.xml
|
|
102
|
+
# DELETE /users/1.fxml
|
|
103
|
+
def destroy
|
|
104
|
+
@content = Content.find(params[:id])
|
|
105
|
+
@content.destroy
|
|
106
|
+
|
|
107
|
+
respond_to do |format|
|
|
108
|
+
format.html { redirect_to(contents_url) }
|
|
109
|
+
format.xml { head :ok }
|
|
110
|
+
format.fxml { render :fxml => @content }
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# This controller handles the login/logout function of the site.
|
|
2
|
+
class SessionsController < ApplicationController
|
|
3
|
+
|
|
4
|
+
skip_before_filter :login_required
|
|
5
|
+
|
|
6
|
+
# render new.rhtml
|
|
7
|
+
def new
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def create
|
|
11
|
+
logout_keeping_session!
|
|
12
|
+
account = Account.authenticate(params[:login], params[:password])
|
|
13
|
+
if account
|
|
14
|
+
# Protects against session fixation attacks, causes request forgery
|
|
15
|
+
# protection if user resubmits an earlier form using back
|
|
16
|
+
# button. Uncomment if you understand the tradeoffs.
|
|
17
|
+
# reset_session
|
|
18
|
+
new_cookie_flag = (params[:remember_me] == "1")
|
|
19
|
+
handle_remember_cookie! new_cookie_flag
|
|
20
|
+
|
|
21
|
+
Account.session_token = session.session_id
|
|
22
|
+
|
|
23
|
+
self.current_account = account
|
|
24
|
+
respond_to do |format|
|
|
25
|
+
format.html do
|
|
26
|
+
redirect_back_or_default('/')
|
|
27
|
+
flash[:notice] = "Logged in successfully"
|
|
28
|
+
end
|
|
29
|
+
format.fxml do
|
|
30
|
+
render :fxml => account.user.to_fxml(:methods => :photo,
|
|
31
|
+
:include => {:address => {}, :account => {:only => [:id, :login, :email, :name],
|
|
32
|
+
:methods => [:session_token, :photo_url]}})
|
|
33
|
+
end
|
|
34
|
+
format.xml do
|
|
35
|
+
render :xml => account.user.to_fxml(:methods => :photo,
|
|
36
|
+
:include => {:address => {}, :account => {:only => [:id, :login, :email, :name],
|
|
37
|
+
:methods => [:session_token, :photo_url]}})
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
else
|
|
41
|
+
note_failed_signin
|
|
42
|
+
respond_to do |format|
|
|
43
|
+
format.html do
|
|
44
|
+
@login = params[:login]
|
|
45
|
+
@remember_me = params[:remember_me]
|
|
46
|
+
render :action => 'new'
|
|
47
|
+
end
|
|
48
|
+
format.fxml { render :text => "login_failed" }
|
|
49
|
+
format.xml { render :text => "login_failed" }
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def destroy
|
|
55
|
+
logout_killing_session!
|
|
56
|
+
respond_to do |format|
|
|
57
|
+
format.html do
|
|
58
|
+
flash[:notice] = "You have been logged out."
|
|
59
|
+
redirect_back_or_default('/')
|
|
60
|
+
end
|
|
61
|
+
format.fxml { render :text => "loggedout" }
|
|
62
|
+
format.xml { render :text => "loggedout" }
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
protected
|
|
67
|
+
# Track failed login attempts
|
|
68
|
+
def note_failed_signin
|
|
69
|
+
flash[:error] = "Couldn't log you in as '#{params[:login]}'"
|
|
70
|
+
logger.warn "Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}"
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ContentAssignment
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
class UsersController < ApplicationController
|
|
2
|
+
# GET /users
|
|
3
|
+
# GET /users.xml
|
|
4
|
+
# GET /users.fxml
|
|
5
|
+
def index
|
|
6
|
+
@users = User.find(:all)
|
|
7
|
+
|
|
8
|
+
respond_to do |format|
|
|
9
|
+
format.html # index.html.erb
|
|
10
|
+
format.xml { render :xml => @users }
|
|
11
|
+
format.fxml { render :fxml => @users }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# GET /users/1
|
|
16
|
+
# GET /users/1.xml
|
|
17
|
+
# GET /users/1.fxml
|
|
18
|
+
def show
|
|
19
|
+
@user = User.find(params[:id])
|
|
20
|
+
|
|
21
|
+
respond_to do |format|
|
|
22
|
+
format.html # show.html.erb
|
|
23
|
+
format.xml { render :xml => @user }
|
|
24
|
+
format.fxml { render :fxml => @user }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# GET /users/new
|
|
29
|
+
# GET /users/new.xml
|
|
30
|
+
def new
|
|
31
|
+
@user = User.new
|
|
32
|
+
|
|
33
|
+
respond_to do |format|
|
|
34
|
+
format.html # new.html.erb
|
|
35
|
+
format.xml { render :xml => @user }
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# GET /users/1/edit
|
|
40
|
+
def edit
|
|
41
|
+
@user = User.find(params[:id])
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# POST /users
|
|
45
|
+
# POST /users.xml
|
|
46
|
+
# POST /users.fxml
|
|
47
|
+
def create
|
|
48
|
+
@user = User.new(params[:user])
|
|
49
|
+
|
|
50
|
+
respond_to do |format|
|
|
51
|
+
if @user.save
|
|
52
|
+
flash[:notice] = 'User was successfully created.'
|
|
53
|
+
format.html { redirect_to(@user) }
|
|
54
|
+
format.xml { render :xml => @user, :status => :created, :location => @user }
|
|
55
|
+
format.fxml { render :fxml => @user }
|
|
56
|
+
else
|
|
57
|
+
format.html { render :action => "new" }
|
|
58
|
+
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
|
|
59
|
+
format.fxml { render :fxml => @user.errors }
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# PUT /users/1
|
|
65
|
+
# PUT /users/1.xml
|
|
66
|
+
# PUT /users/1.fxml
|
|
67
|
+
def update
|
|
68
|
+
@user = User.find(params[:id])
|
|
69
|
+
|
|
70
|
+
respond_to do |format|
|
|
71
|
+
if @user.update_attributes(params[:user])
|
|
72
|
+
flash[:notice] = 'User was successfully updated.'
|
|
73
|
+
format.html { redirect_to(@user) }
|
|
74
|
+
format.xml { head :ok }
|
|
75
|
+
format.fxml { render :fxml => @user.to_fxml(:methods => :photo) }
|
|
76
|
+
else
|
|
77
|
+
format.html { render :action => "edit" }
|
|
78
|
+
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
|
|
79
|
+
format.fxml { render :fxml => @user.errors }
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# DELETE /users/1
|
|
85
|
+
# DELETE /users/1.xml
|
|
86
|
+
# DELETE /users/1.fxml
|
|
87
|
+
def destroy
|
|
88
|
+
@user = User.find(params[:id])
|
|
89
|
+
@user.destroy
|
|
90
|
+
|
|
91
|
+
respond_to do |format|
|
|
92
|
+
format.html { redirect_to(users_url) }
|
|
93
|
+
format.xml { head :ok }
|
|
94
|
+
format.fxml { render :fxml => @user }
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/ICommand.as
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* Copyright 2008 Theo Hultberg/Iconara */
|
|
2
|
+
|
|
3
|
+
package <%= base_package %>.controllers.command
|
|
4
|
+
{
|
|
5
|
+
/**
|
|
6
|
+
* A very basic command interface that just provides an execute method.
|
|
7
|
+
* Any data that the command needs in order to do its work should be injected
|
|
8
|
+
* through the constructor or through properties.
|
|
9
|
+
*/
|
|
10
|
+
public interface ICommand {
|
|
11
|
+
|
|
12
|
+
function execute( ) : void ;
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
data/rails_generators/emergent_config/templates/app/flex/application/controllers/command/Undoable.as
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Copyright 2008 Theo Hultberg/Iconara */
|
|
2
|
+
|
|
3
|
+
package <%= base_package %>.controllers.command
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Commands that implement this interface should provide a way for undoing the
|
|
8
|
+
* actions taken in their execute method.
|
|
9
|
+
*
|
|
10
|
+
* Undoables have a redo method in addition to execute, even though those two
|
|
11
|
+
* most often will do the same work. The default implementation may be to have
|
|
12
|
+
* redo call execute, but more complex situations may arise where some extra
|
|
13
|
+
* steps are necessary when redoing, compared to executing the command initially.
|
|
14
|
+
*
|
|
15
|
+
* It is up to the implementation how the undoing is done. It can be done by
|
|
16
|
+
* saving a snapshot of the state of the object being modified, or just by
|
|
17
|
+
* applying the same set of actions in reverse, whichever works for the situation.
|
|
18
|
+
*/
|
|
19
|
+
public interface Undoable extends ICommand {
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The timestamp is for enabling grouping of undoables so that many undoables
|
|
23
|
+
* that were executed at almost the same time (say milliseconds apart) could
|
|
24
|
+
* be undone as one. Sometimes the user's perspecive of what consitutes one
|
|
25
|
+
* action is not the same as the application's perspective.
|
|
26
|
+
*
|
|
27
|
+
* The timestamp should be recorded in the execute method. It should not be
|
|
28
|
+
* overwritten if the execute method runs again (for example during a redo).
|
|
29
|
+
*/
|
|
30
|
+
function get timestamp( ) : Date ;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The description property is for situations where the application wants to
|
|
34
|
+
* display an undo history. It can simply return the name of the command or a
|
|
35
|
+
* proper description of the changes the command made.
|
|
36
|
+
*/
|
|
37
|
+
function get description( ) : String ;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
function undo( ) : void ;
|
|
41
|
+
|
|
42
|
+
function redo( ) : void ;
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* Copyright 2008 Theo Hultberg/Iconara */
|
|
2
|
+
|
|
3
|
+
package <%= base_package %>.controllers.command
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
import <%= base_package %>.models.domain.Document;
|
|
7
|
+
import <%= base_package %>.models.domain.Snapshot;
|
|
8
|
+
|
|
9
|
+
public class UpdateDocumentCommand implements Undoable {
|
|
10
|
+
|
|
11
|
+
private var _timestamp:Date;
|
|
12
|
+
|
|
13
|
+
private var undoSnapshot:Snapshot;
|
|
14
|
+
|
|
15
|
+
private var document:Document;
|
|
16
|
+
|
|
17
|
+
public var title:String;
|
|
18
|
+
public var body:String;
|
|
19
|
+
public var abstract:String;
|
|
20
|
+
public var menuTitle:String;
|
|
21
|
+
public var subTitle:String;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
public function get timestamp():Date {
|
|
25
|
+
return _timestamp;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public function get description():String {
|
|
29
|
+
return "Update document";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
public function UpdateDocumentCommand() {
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public function prepare(document:Document, vars:*):void {
|
|
37
|
+
this.document = document;
|
|
38
|
+
document.mapProperties(this, vars, document.desiredProperties);
|
|
39
|
+
/*this.title = vars.title;
|
|
40
|
+
this.body = vars.body;
|
|
41
|
+
this.abstract = vars.abstract;
|
|
42
|
+
this.menuTitle = vars.menuTitle;
|
|
43
|
+
this.subTitle = vars.subTitle;*/
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public function execute():void {
|
|
47
|
+
undoSnapshot = document.createSnapshot();
|
|
48
|
+
|
|
49
|
+
document.mapProperties(document.content, this, document.desiredProperties);
|
|
50
|
+
/*document.title = title;
|
|
51
|
+
document.body = body;
|
|
52
|
+
document.abstract = abstract;
|
|
53
|
+
document.menuTitle = menuTitle;
|
|
54
|
+
document.subTitle = subTitle;*/
|
|
55
|
+
|
|
56
|
+
if ( _timestamp == null ) {
|
|
57
|
+
// don't overwrite the timestamp on redo
|
|
58
|
+
|
|
59
|
+
_timestamp = new Date();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public function undo():void {
|
|
64
|
+
document.loadSnapshot(undoSnapshot);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public function redo():void {
|
|
68
|
+
execute();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Copyright 2008 Theo Hultberg/Iconara */
|
|
2
|
+
|
|
3
|
+
package <%= base_package %>.controllers.event {
|
|
4
|
+
|
|
5
|
+
import flash.events.Event;
|
|
6
|
+
|
|
7
|
+
import <%= base_package %>.models.domain.Document;
|
|
8
|
+
import <%= base_package %>.models.constant.DocumentType;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Events of this type are used to request document-related actions such as opening, closing,
|
|
13
|
+
* deleting, creating and updating.
|
|
14
|
+
*
|
|
15
|
+
* All instances of this event bubble.
|
|
16
|
+
*/
|
|
17
|
+
public class DocumentEvent extends Event {
|
|
18
|
+
|
|
19
|
+
public static const UPDATE : String = "update";
|
|
20
|
+
public static const CREATE_NEW : String = "createNew";
|
|
21
|
+
public static const OPEN : String = "open";
|
|
22
|
+
public static const CLOSE : String = "close";
|
|
23
|
+
public static const DELETE : String = "delete";
|
|
24
|
+
public static const SAVE : String = "save";
|
|
25
|
+
public static const SAVED : String = "saved";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Events that refer to a specific document (UPDATE, OPEN, CLOSE, DELETE, SAVE and SAVED)
|
|
29
|
+
* use this property to pass that document.
|
|
30
|
+
*/
|
|
31
|
+
public var reference : Document;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Events that create new documents (CREATE_NEW) use this property to specify
|
|
35
|
+
* which kind of document to create. Must be one of the constants on the DocumentType class.
|
|
36
|
+
*/
|
|
37
|
+
public var documentType : DocumentType;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
public function DocumentEvent( type : String, bubbles : Boolean = false, cancelable : Boolean = false ) {
|
|
41
|
+
super(type, true, cancelable);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package <%= base_package %>.controllers.event
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
import flash.events.*;
|
|
5
|
+
|
|
6
|
+
public class NavigationEvent extends Event
|
|
7
|
+
{
|
|
8
|
+
/**
|
|
9
|
+
* A NavigationEvent tells the View how to respond when some new data is loaded
|
|
10
|
+
* It also allows you to finely control the View state logic
|
|
11
|
+
* Edit this as you see fit.
|
|
12
|
+
*/
|
|
13
|
+
public var url:Array;
|
|
14
|
+
|
|
15
|
+
// Attach any RxModel to this.
|
|
16
|
+
public var resource:*;
|
|
17
|
+
|
|
18
|
+
// whether or not you want to show or hide it
|
|
19
|
+
public var action:String;
|
|
20
|
+
|
|
21
|
+
public function NavigationEvent(type:String, bubbles:Boolean = false)
|
|
22
|
+
{
|
|
23
|
+
super(type, bubbles);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
override public function clone():Event
|
|
27
|
+
{
|
|
28
|
+
return new NavigationEvent(type, bubbles);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package <%= base_package %>.controllers.event
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
import flash.events.*;
|
|
5
|
+
|
|
6
|
+
public class ResourceEvent extends Event {
|
|
7
|
+
|
|
8
|
+
// can be null, success, or failure.
|
|
9
|
+
public var result:String;
|
|
10
|
+
|
|
11
|
+
// can be list, open, create, upload, destroy... etc or null
|
|
12
|
+
public var action:String;
|
|
13
|
+
|
|
14
|
+
public var data:*; // RxModel
|
|
15
|
+
|
|
16
|
+
public function ResourceEvent(type:String, bubbles:Boolean = false)
|
|
17
|
+
{
|
|
18
|
+
action = type;
|
|
19
|
+
super(type, bubbles);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
override public function clone():Event
|
|
23
|
+
{
|
|
24
|
+
return new ResourceEvent(type, bubbles);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
data/rails_generators/emergent_config/templates/app/flex/application/controllers/event/UndoEvent.as
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* Copyright 2008 Theo Hultberg/Iconara */
|
|
2
|
+
|
|
3
|
+
package <%= base_package %>.controllers.event
|
|
4
|
+
{
|
|
5
|
+
import flash.events.Event;
|
|
6
|
+
|
|
7
|
+
import <%= base_package %>.controllers.command.Undoable;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Events of this type are used to request undo-related actions.
|
|
12
|
+
*/
|
|
13
|
+
public class UndoEvent extends Event {
|
|
14
|
+
|
|
15
|
+
public static const UNDO : String = "undo";
|
|
16
|
+
public static const REDO : String = "redo";
|
|
17
|
+
public static const RESTORE : String = "restore";
|
|
18
|
+
public static const ADD_UNDOABLE : String = "addUndoable";
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Events that refer to a specific undoable (RESTORE, ADD_UNDOABLE) use
|
|
23
|
+
* this property to pass that object.
|
|
24
|
+
*/
|
|
25
|
+
public var undoable : Undoable;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
public function UndoEvent( type : String, undoable : Undoable = null ) {
|
|
29
|
+
super(type, true);
|
|
30
|
+
|
|
31
|
+
this.undoable = undoable;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package <%= base_package %>.controllers.manager {
|
|
2
|
+
|
|
3
|
+
import <%= base_package %>.models.domain.Content;
|
|
4
|
+
import <%= base_package %>.models.domain.ContentAssignment;
|
|
5
|
+
|
|
6
|
+
import org.restfulx.Rx;
|
|
7
|
+
import org.restfulx.collections.ModelsCollection;
|
|
8
|
+
|
|
9
|
+
public class AboutUsManager extends ContentManager {
|
|
10
|
+
|
|
11
|
+
public function AboutUsManager() {
|
|
12
|
+
setModel(target);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package <%= base_package %>.controllers.manager {
|
|
2
|
+
|
|
3
|
+
import flash.events.Event;
|
|
4
|
+
import flash.events.EventDispatcher;
|
|
5
|
+
import flash.utils.getDefinitionByName;
|
|
6
|
+
import flash.utils.getQualifiedClassName;
|
|
7
|
+
|
|
8
|
+
import org.restfulx.Rx;
|
|
9
|
+
import org.restfulx.collections.ModelsCollection;
|
|
10
|
+
import org.restfulx.models.RxModel;
|
|
11
|
+
import org.restfulx.utils.RxUtils;
|
|
12
|
+
|
|
13
|
+
import <%= base_package %>.models.domain.Account;
|
|
14
|
+
import <%= base_package %>.controllers.event.ResourceEvent;
|
|
15
|
+
|
|
16
|
+
public class AccountManager extends ResourceManager {
|
|
17
|
+
|
|
18
|
+
/** Injector targets */
|
|
19
|
+
[Bindable] public var accountEvent:ResourceEvent;
|
|
20
|
+
|
|
21
|
+
private var _account:Account; [Bindable]
|
|
22
|
+
public function get account():Account { return _account; }
|
|
23
|
+
public function set account(value:Account):void {
|
|
24
|
+
_account = value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public function AccountManager() {
|
|
28
|
+
setModel(account, accountEvent);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
package <%= base_package %>.controllers.manager {
|
|
2
|
+
|
|
3
|
+
import flash.events.Event;
|
|
4
|
+
import flash.events.EventDispatcher;
|
|
5
|
+
import flash.utils.getDefinitionByName;
|
|
6
|
+
import flash.utils.getQualifiedClassName;
|
|
7
|
+
|
|
8
|
+
import org.restfulx.Rx;
|
|
9
|
+
import org.restfulx.collections.ModelsCollection;
|
|
10
|
+
import org.restfulx.models.RxModel;
|
|
11
|
+
import org.restfulx.utils.RxUtils;
|
|
12
|
+
|
|
13
|
+
import <%= base_package %>.models.domain.Session;
|
|
14
|
+
import <%= base_package %>.models.domain.User;
|
|
15
|
+
|
|
16
|
+
import <%= base_package %>.models.constant.ResourceResult;
|
|
17
|
+
import <%= base_package %>.models.constant.ResourceAction;
|
|
18
|
+
import <%= base_package %>.controllers.event.ResourceEvent;
|
|
19
|
+
|
|
20
|
+
public class AuthenticationManager extends ResourceManager {
|
|
21
|
+
|
|
22
|
+
/** Injector targets */
|
|
23
|
+
[Bindable] public var loginEvent:ResourceEvent;
|
|
24
|
+
[Bindable] public var logoutEvent:ResourceEvent;
|
|
25
|
+
|
|
26
|
+
private var _currentUser:User; [Bindable]
|
|
27
|
+
public function get currentUser():User { return _currentUser; }
|
|
28
|
+
public function set currentUser(value:User):void {
|
|
29
|
+
_currentUser = value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private var _sessionToken:*; [Bindable]
|
|
33
|
+
public function get sessionToken():* { return _sessionToken; }
|
|
34
|
+
public function set sessionToken(value:*):void {
|
|
35
|
+
_sessionToken = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public function AuthenticationManager() {
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override protected function create(resource:*):void {
|
|
43
|
+
var r:* = discover(resource);
|
|
44
|
+
login(r as Session);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
override protected function destroy(resource:*):void {
|
|
48
|
+
var r:* = discover(resource);
|
|
49
|
+
logout(resource as Session);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public function login(session:Session):void {
|
|
53
|
+
Rx.http(onLoginSuccess, onLoginFailure).invoke("session.fxml",
|
|
54
|
+
{ login: session.login, password: session.password }, "POST", true);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public function logout(session:Session):void {
|
|
58
|
+
Rx.http(onLogout).invoke({URL: "session.fxml", method: "DELETE"});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private function onLoginSuccess(result:User):void {
|
|
62
|
+
currentUser = result;
|
|
63
|
+
Rx.sessionToken = result.account.sessionToken;
|
|
64
|
+
sessionToken = Rx.sessionToken;
|
|
65
|
+
success(result, loginEvent);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private function onLoginFailure(result:Object):void {
|
|
69
|
+
failure(result, loginEvent);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private function onLogout(result:Object):void {
|
|
73
|
+
inject(result, logoutEvent);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|