Changeset 2426


Ignore:
Timestamp:
12/14/12 13:03:27 (11 years ago)
Author:
twagoo
Message:

Check/connect OAuth2 token interaction with javascript

Location:
ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/IsocatConnectLinkButton.as

    r2423 r2426  
    1010        import flash.net.navigateToURL;
    1111       
     12        import mx.controls.Alert;
     13       
    1214        public class IsocatConnectLinkButton extends LabelButton
    1315        {
    1416                public function IsocatConnectLinkButton()
    1517                {
    16                         super(connectToIsocat);
     18                        super(connectToIsocat); 
    1719                }
    1820               
  • ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/Config.as

    r2423 r2426  
    4141                private static const USER_SETTINGS_URL:String = "/admin/userSettings";
    4242                private static const COMMENTS_URL_PATH:String = "/comments/";
    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";
     43                private static const OAUTH_CONNECT_SERVLET:String = "/oauth2/connect";
     44                private static const OAUTH_CHECK_SERVLET:String = "/oauth2/check";
    4645                private static const ISOCAT_SERVLET:String = "/oauth2/isocat";
    4746
  • ComponentRegistry/branches/ComponentRegistry-oauth-1.13.0/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/OAuth2Service.as

    r2423 r2426  
    33       
    44        import flash.events.EventDispatcher;
     5        import flash.external.ExternalInterface;
    56       
    67        import mx.controls.Alert;
     
    2425
    2526                public function OAuth2Service() {
     27                        ExternalInterface.addCallback("handleOAuthConnect", handleOAuthConnect);
    2628                }
    2729               
     
    6870                        }
    6971                }
    70                
    71 //              private function handleAcquireResult(resultEvent:ResultEvent):void {
    72 //                      if (resultEvent.statusCode >= 200 && resultEvent.statusCode < 300) {
    73 //                              var data:XML = new XML(resultEvent.result);
    74 //                              searchResults = data.dcif::dataCategory;
    75 //                      } else {
    76 //                              Alert.show("Unexpected error, server returned status: " + resultEvent.statusCode + "\n Message = ");
    77 //                      }
    78 //              }
    7972
    8073                private function handleError(faultEvent:FaultEvent):void {
     
    8477                }
    8578
    86 
     79                /***
     80                 * To be called from JavaScript in embedding page
     81                 */
     82                private function handleOAuthConnect(result:String):void{
     83                        // OAuth connect finished, either failed or succeeded. Update status.
     84                        check();
     85                        ExternalInterface.call("hideOAuthFrame");
     86                }
    8787        }
    8888}
Note: See TracChangeset for help on using the changeset viewer.