Changeset 2423
- Timestamp:
- 12/13/12 16:37:21 (11 years ago)
- Location:
- ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorManager.as
r479 r2423 1 1 package clarin.cmdi.componentregistry.editor { 2 2 import clarin.cmdi.componentregistry.services.IsocatService; 3 import clarin.cmdi.componentregistry.services.OAuth2Service; 3 4 4 5 … … 16 17 isocatSearchPopUp.searchService = new IsocatService(); 17 18 isocatSearchPopUp.isocatSearchType = isocatSearchType; 19 isocatSearchPopUp.oAuthService = new OAuth2Service(); 18 20 return isocatSearchPopUp; 19 21 } -
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/IsocatSearchPopUp.mxml
r2126 r2423 3 3 xmlns:rictus="com.rictus.controls.*" 4 4 showCloseButton="true" 5 creationComplete=" PopUpManager.centerPopUp(this)"5 creationComplete="onCreationComplete();" 6 6 close="cleanUp();" 7 title="Search in Isocat.org" >8 7 title="Search in Isocat.org" xmlns:components="clarin.cmdi.componentregistry.common.components.*" xmlns:editor="clarin.cmdi.componentregistry.editor.*"> 8 9 9 <mx:Metadata> 10 10 [Event(name="OK", type="flash.events.Event")] 11 11 </mx:Metadata> 12 12 13 <mx:Script> 13 14 <![CDATA[ 14 15 import clarin.cmdi.componentregistry.services.IsocatService; 16 import clarin.cmdi.componentregistry.services.OAuth2Service; 15 17 16 18 import mx.controls.TextInput; 17 19 import mx.managers.PopUpManager; 18 20 19 21 public static const OK_EVENT:String = "OK"; 20 22 21 23 [Bindable] 22 24 public var searchService:IsocatService = null; 23 25 [Bindable] 26 public var oAuthService:OAuth2Service = null; 27 24 28 public var isocatSearchType:String = null; 25 29 26 30 //To store the result 27 31 public var editField:TextInput; 28 32 29 33 private function handleOkClick():void { 30 34 dispatchEvent(new Event(OK_EVENT)); 31 35 cleanUp(); 32 36 } 33 37 34 38 private function cleanUp():void { 35 39 searchService.close(); 36 40 PopUpManager.removePopUp(this); 37 41 } 38 42 39 43 private function initializeDataGrid():void { 40 44 editField = new TextInput(); 41 45 } 42 46 43 47 private function setItem():void { 44 48 var selectedItem:XML = dataGrid.selectedItem as XML; … … 48 52 } 49 53 } 50 54 51 55 private function handleSearch(event:Event):void { 52 56 if(event is MouseEvent || (event is KeyboardEvent && KeyboardEvent(event).keyCode == Keyboard.ENTER)){ … … 54 58 } 55 59 } 60 61 protected function connectLink_clickHandler(event:MouseEvent):void 62 { 63 oAuthService.acquire(); 64 } 65 66 private function onCreationComplete():void { 67 PopUpManager.centerPopUp(this); 68 oAuthService.check(); 69 } 56 70 ]]> 57 71 </mx:Script> 58 72 59 73 <mx:VBox> 60 <mx:HBox >74 <mx:HBox width="100%"> 61 75 <rictus:SearchBox id="searchBox" 62 76 label="type keyword and press 'enter' to search" … … 67 81 click="handleSearch(event);" /> 68 82 <mx:Label text="{dataGrid.dataProvider.length} results"/> 83 84 <mx:Spacer width="100%" /> 85 86 <mx:Label text="Checking ISOcat connection..." visible="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_UNKNOWN}" 87 includeInLayout="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_UNKNOWN}" 88 /> 89 <mx:Label text="Connected to ISOcat" visible="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_AUTHENTICATED}" 90 includeInLayout="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_AUTHENTICATED}" 91 /> 92 <editor:IsocatConnectLinkButton text="Connect to ISOcat" visible="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_UNAUTHENTICATED}" 93 includeInLayout="{oAuthService.authentationState == OAuth2Service.AUTH_STATE_UNAUTHENTICATED}" 94 /> 69 95 </mx:HBox> 70 96 <mx:DataGrid id="dataGrid" -
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/Config.as
r2278 r2423 41 41 private static const USER_SETTINGS_URL:String = "/admin/userSettings"; 42 42 private static const COMMENTS_URL_PATH:String = "/comments/"; 43 private static const ISOCAT_SERVLET:String = "/isocat"; 44 43 private static const OAUTH_SERVLET:String = "/oauth2/connect"; 44 private static const OAUTH_CONNECT_SERVLET:String = OAUTH_SERVLET; 45 private static const OAUTH_CHECK_SERVLET:String = OAUTH_SERVLET + "?acquire=false"; 46 private static const ISOCAT_SERVLET:String = "/oauth2/isocat"; 45 47 46 48 private static var _instance:Config = new Config(); … … 133 135 return _serviceRootUrl + ISOCAT_SERVLET; 134 136 } 135 137 138 public function get oAuth2CheckUrl():String { 139 return _serviceRootUrl + OAUTH_CHECK_SERVLET; 140 } 141 142 public function get oAuth2ConnectUrl():String { 143 return _serviceRootUrl + OAUTH_CONNECT_SERVLET; 144 } 145 136 146 public function get serviceRootUrl():String { 137 147 return _serviceRootUrl; -
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/IsocatService.as
r1591 r2423 13 13 14 14 public class IsocatService extends EventDispatcher { 15 public static const PROFILE_LOADED:String = "ProfileLoaded";16 15 public static const TYPE_SIMPLE:String = "simple"; 17 16 public static const TYPE_COMPLEX:String = "complex"; … … 19 18 20 19 namespace dcif = "http://www.isocat.org/ns/dcif"; 21 22 20 23 21 private var service:HTTPService; -
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentRegistry/src/main/webapp/css/flexui.css
r2422 r2423 27 27 z-index: 100; 28 28 29 padding: 5px; 30 background: #ccc; 29 padding: 1em; 30 padding-top: 2px; 31 background: #ddd; 31 32 } 32 33
Note: See TracChangeset
for help on using the changeset viewer.