Changeset 3120
- Timestamp:
- 07/08/13 14:27:42 (12 years ago)
- Location:
- ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/Browse.mxml
r2985 r3120 17 17 import clarin.cmdi.componentregistry.common.components.BrowseContextMenu; 18 18 import clarin.cmdi.componentregistry.common.components.RegistryViewStack; 19 import clarin.cmdi.componentregistry.services.BrowserService;20 19 import clarin.cmdi.componentregistry.services.ComponentInfoService; 21 20 import clarin.cmdi.componentregistry.services.ComponentListService; … … 25 24 import clarin.cmdi.componentregistry.services.ProfileListService; 26 25 26 //debug 27 import clarin.cmdi.componentregistry.common.Profile; 28 27 29 public static const START_ITEM_LOADED:String = "startItemLoaded"; 28 30 … … 91 93 startupItemId = Config.instance.startupItem; 92 94 startupPanel = Config.instance.browserPanel; 93 if (startupItemId) { //only load this once on startup 94 componentsSrv.addEventListener(BrowserService.ITEMS_LOADED, componentsLoaded); 95 profilesSrv.addEventListener(BrowserService.ITEMS_LOADED, profilesLoaded); 96 } 97 98 refresh(); 95 if (startupItemId) { //only load this once on startup 96 profilesSrv.addEventListener(ProfileListService.PROFILES_LOADED, profilesLoaded); 97 componentsSrv.addEventListener(ComponentListService.COMPONENTS_LOADED, componentsLoaded); 98 profilesSrv.load(); 99 } 100 else{ 101 refresh(); 102 } 99 103 } 100 104 101 105 public function refresh():void { 102 106 componentsSrv.load(); 103 profilesSrv.load(); 104 107 profilesSrv.load(); 105 108 selectedComponentSrv = new ComponentInfoService(); 106 109 selectedProfileSrv = new ProfileInfoService(); 107 110 } 108 111 109 private function profilesLoaded(event:Event):void { 112 113 114 private function profilesLoaded(event:Event):void { 115 profilesSrv.removeEventListener(ProfileListService.PROFILES_LOADED, profilesLoaded); 116 componentsSrv.load(); 117 } 118 119 private function componentsLoaded(event:Event):void { 120 componentsSrv.removeEventListener(ComponentListService.COMPONENTS_LOADED, componentsLoaded); 121 110 122 var item:ItemDescription = ProfileListService.findDescription(startupItemId); 111 loadStartupItem(item); 112 profileInfoPage.infoPanel.setPanel(Config.instance.browserPanel); 113 profilesSrv.removeEventListener(BrowserService.ITEMS_LOADED, profilesLoaded); 114 } 115 116 private function componentsLoaded(event:Event):void { 117 var item:ItemDescription = ComponentListService.findDescription(startupItemId); 118 if(item != null){ 123 if(item != null){ 124 selectedProfileSrv = new ProfileInfoService(); 119 125 loadStartupItem(item); 120 componentInfoPage.infoPanel.setPanel(Config.instance.browserPanel); 121 componentsSrv.removeEventListener(BrowserService.ITEMS_LOADED, componentsLoaded); 126 profileInfoPage.infoPanel.setPanel(Config.instance.browserPanel); 127 } 128 129 item = ComponentListService.findDescription(startupItemId); 130 if(item != null){ 131 selectedComponentSrv = new ComponentInfoService(); 132 loadStartupItem(item); 133 componentInfoPage.infoPanel.setPanel(Config.instance.browserPanel); 122 134 } 123 135 } … … 204 216 return false; 205 217 } 218 } 219 220 private function debugProfile():Profile{ 221 trace("in mxml: "+selectedProfileSrv.profile.components.length + "components for the given profile"); 222 return selectedProfileSrv.profile; 206 223 } 207 224 -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/BrowserService.as
r2515 r3120 9 9 10 10 11 [Event(name="itemsLoaded", type="flash.events.Event")]11 // [Event(name="itemsLoaded", type="flash.events.Event")] 12 12 public class BrowserService extends ComponentRegistryService { 13 public static const ITEMS_LOADED:String = "itemsLoaded";13 // public static const ITEMS_LOADED:String = "itemsLoaded"; 14 14 15 15 /** … … 39 39 */ 40 40 override protected function result(resultEvent:ResultEvent):void { 41 dispatchEvent(new Event(ITEMS_LOADED));41 //dispatchEvent(new Event(ITEMS_LOADED)); 42 42 } 43 43 -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/ComponentListService.as
r867 r3120 5 5 import mx.collections.ArrayCollection; 6 6 import mx.rpc.events.ResultEvent; 7 import flash.events.Event; 7 8 9 [Event(name="componentsLoaded", type="flash.events.Event")] 8 10 public class ComponentListService extends BrowserService { 9 11 12 public static const COMPONENTS_LOADED:String = "componentsLoaded"; 13 10 14 private static var _instance:ComponentListService = new ComponentListService(); 11 15 private static var _userSpaceInstance:ComponentListService = new ComponentListService(true); … … 28 32 tempArray.refresh(); 29 33 setItemDescriptions(new ArrayCollection(tempArray.toArray())); 30 super.result(resultEvent); 34 trace(itemDescriptions.length + " components are loaded"); 35 dispatchEvent(new Event(COMPONENTS_LOADED)); 36 // super.result(resultEvent); 31 37 } 32 38 -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/ProfileListService.as
r867 r3120 4 4 5 5 import mx.collections.ArrayCollection; 6 import mx.rpc.events.ResultEvent; 7 6 import mx.rpc.events.ResultEvent; 7 import flash.events.Event; 8 9 10 [Event(name="profilesLoaded", type="flash.events.Event")] 8 11 public class ProfileListService extends BrowserService { 9 12 … … 11 14 private static var _userSpaceInstance:ProfileListService = new ProfileListService(true); 12 15 16 public static const PROFILES_LOADED:String = "profilesLoaded"; 17 13 18 public function ProfileListService(userSpace:Boolean=false) { 14 19 super(Config.instance.profileListUrl, userSpace); … … 26 31 tempArray.sort = BrowserColumns.getInitialSortForProfiles(); 27 32 tempArray.refresh(); 28 setItemDescriptions(new ArrayCollection(tempArray.toArray())); 29 super.result(resultEvent); 33 setItemDescriptions(new ArrayCollection(tempArray.toArray())); 34 trace(itemDescriptions.length + " profiles are loaded"); 35 dispatchEvent(new Event(PROFILES_LOADED)); 36 //super.result(resultEvent); 30 37 } 31 38
Note: See TracChangeset
for help on using the changeset viewer.