Changeset 322


Ignore:
Timestamp:
04/08/10 14:58:57 (14 years ago)
Author:
patdui
Message:
  • removed AS3httpclientlib (socket based http request) because it does not pass along cookies and such (Needed for shibboleth authentication). Using other third party free class (which I modified a bit) to handle my multipart/form posts.
  • rewrote Delete/Isocat? and upload servies to do browser/flash based GET/POST request and handling all complicated stuff on server side.
Location:
ComponentRegistry/trunk/ComponentBrowserGui
Files:
7 added
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentBrowserGui/libs/maveninstalllib.txt

    r206 r322  
    1 mvn install:install-file -DgroupId=org.httpclient -DartifactId=as3httpclientlib -Dversion=1.0.6 -Dpackaging=swc -Dfile=as3httpclientlib-1_0_6.swc -DgeneratePom=true
    21mvn install:install-file -DgroupId=com.adobe -DartifactId=as3corelib -Dversion=0.92.1 -Dpackaging=swc -Dfile=as3corelib-0.92.1.swc -DgeneratePom=true
    3 mvn install:install-file -DgroupId=com.hurlant -DartifactId=as3crypto -Dversion=1.3 -Dpackaging=swc -Dfile=as3crypto-1.3.swc -DgeneratePom=true
  • ComponentRegistry/trunk/ComponentBrowserGui/pom.xml

    r224 r322  
    3636                </dependency>
    3737                <dependency>
    38                         <groupId>org.httpclient</groupId>
    39                         <artifactId>as3httpclientlib</artifactId>
    40                         <version>1.0.6</version>
    41                         <type>swc</type>
    42                 </dependency>
    43                 <dependency>
    4438                        <groupId>com.adobe</groupId>
    4539                        <artifactId>as3corelib</artifactId>
    4640                        <version>0.92.1</version>
    47                         <type>swc</type>
    48                 </dependency>
    49                 <dependency>
    50                         <groupId>com.hurlant</groupId>
    51                         <artifactId>as3crypto</artifactId>
    52                         <version>1.3</version>
    5341                        <type>swc</type>
    5442                </dependency>
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r281 r322  
    7777}
    7878
    79 //private var ref:FileReference = new FileReference();
    80 
    8179private function saveSpec():void {
    8280//      Alert.show(xmlEditor.cmdSpec.toXml());
    83 //ref.save(xmlEditor.cmdSpec.toXml(), "test.xml");
    84 
    8581        var item:ItemDescription = new ItemDescription();
    8682        item.description = xmlEditor.cmdSpec.headerDescription;
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/importer/Importer.mxml

    r206 r322  
    88        <mx:Script>
    99                <![CDATA[
     10                    import clarin.cmdi.componentregistry.common.Credentials;
     11                    import mx.core.Application;
    1012                        import clarin.cmdi.componentregistry.common.ItemDescription;
    1113
     
    2224                                item.description = description.text;
    2325                                item.name = nameInput.text;
     26                                item.groupName = groupName.text;
    2427                                item.isProfile = isProfile;
    2528                                if (isProfile) {
    2629                                        uploadSrv.submitProfile(item);
    2730                                } else {
    28                                         item.groupName = groupName.text;
    2931                                        uploadSrv.submitComponent(item);
    3032                                }
     
    7779                        </mx:FormItem>
    7880                        <mx:FormItem label="Creator Name">
    79                                 <mx:Text id="creatorName" text="loginName"/>
     81                                <mx:Text id="creatorName" text="{Credentials.instance.userName}"/>
    8082                        </mx:FormItem>
    8183                        <mx:FormItem label="Group Name"
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/Config.as

    r281 r322  
    99                private static const PROFILE_INFO_URL:String = "/rest/registry/profiles/";
    1010                private static const COMPONENT_INFO_URL:String = "/rest/registry/components/";
     11                private static const ISOCAT_SERVLET:String = "/isocat";
    1112
    1213                private static var _instance:Config = new Config();
     
    1617                //Like this: "FlashVars", "serviceRootUrl=http://localhost:8080/ComponentRegistry"
    1718
    18                 private var _isocatSearchUrl:String = "http://www.isocat.org/rest/user/guest/search";
    19                 //Default _isocatSearchUrl value can be useful for testing. Set the proper value in your (index.)html that embeds the flash object.
    20                 //Like this: "FlashVars", "isocatSearchUrl=http://www.isocat.org/rest/user/guest/search"
    21 
    22        // private var _sessionId:String = "";
    23 
    2419                public function Config() {
    2520                        if (_instance != null) {
    2621                                throw new Error("Config can only be accessed through Config.instance");
    2722                        }
    28                         var serviceRootUrl:String = Application.application.parameters.serviceRootUrl;
     23                }
     24               
     25                private function init(applicationParameters:Object):void {
     26                        var serviceRootUrl:String = applicationParameters.serviceRootUrl;
    2927                        if (serviceRootUrl != null) {
    3028                                _serviceRootUrl = serviceRootUrl;
    3129                        }
    32                         var isocatSearchUrl:String = Application.application.parameters.isocatSearchUrl;
    33                         if (isocatSearchUrl != null) {
    34                                 _isocatSearchUrl = isocatSearchUrl;
    35                         }
    36 //                      var sessionId:String = Application.application.parameters.jsessionid;
    37 //                      if (sessionId != null) {
    38 //                              _sessionId = sessionId;
    39 //                      }
     30                }
     31               
     32                public static function create(applicationParameters:Object):void {
     33                    _instance.init(applicationParameters);
    4034                }
    4135
     
    6559
    6660                public function get isocatSearchUrl():String {
    67                         return _isocatSearchUrl;
     61                        return _serviceRootUrl + ISOCAT_SERVLET;
    6862                }
    69                
    70 //              public function get sessionId():String {
    71 //                      return _sessionId;
    72 //              }
    7363
    7464                public function get serviceRootUrl():String {
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/DeleteService.as

    r291 r322  
    22        import clarin.cmdi.componentregistry.common.ItemDescription;
    33       
    4         import com.adobe.net.URI;
    5         import com.hurlant.util.Base64;
    6        
    7         import flash.events.ErrorEvent;
    84        import flash.events.Event;
    95        import flash.events.EventDispatcher;
     
    117        import mx.controls.Alert;
    128        import mx.managers.CursorManager;
     9        import mx.messaging.messages.HTTPRequestMessage;
     10        import mx.rpc.events.FaultEvent;
     11        import mx.rpc.events.ResultEvent;
     12        import mx.rpc.http.HTTPService;
    1313        import mx.utils.StringUtil;
    14        
    15         import org.httpclient.HttpClient;
    16         import org.httpclient.events.HttpResponseEvent;
    17         import org.httpclient.http.Delete;
    1814
    1915        [Event(name="itemDeleted", type="flash.events.Event")]
     
    2117        public class DeleteService extends EventDispatcher {
    2218                public static const ITEM_DELETED:String = "itemDeleted";
    23                 private var service:HttpClient;
    24 
    25         private static var _instance:DeleteService = new DeleteService();
     19        private var service:HTTPService;
     20        private static const DELETE_METHOD:Object = {"method": "delete"};
     21       
     22                private static var _instance:DeleteService = new DeleteService();
    2623
    2724                public function DeleteService() {
    28                         if (_instance != null) {
     25                        if (_instance != null) {
    2926                                throw new Error("DeleteService should only be accessed through DeleteService.instance");
    3027                        }
    31                         service = new HttpClient();
    32                         service.listener.onComplete = handleResult;
    33                         service.listener.onError = handleError;
    34                 }
    35 
    36                 private function getCredentials():String {
    37                         return Base64.encode("tomcat:tomcat");
     28                        service = new HTTPService();
     29                        service.addEventListener(FaultEvent.FAULT, handleError);
     30                        service.addEventListener(ResultEvent.RESULT, handleResult);
     31                        service.method = HTTPRequestMessage.POST_METHOD;
    3832                }
    3933
    4034                public function deleteItem(item:ItemDescription):void {
    4135                        CursorManager.setBusyCursor();
    42                         var uri:URI = new URI(item.dataUrl);//+";JSESSIONID="+Config.instance.sessionId
    43                         var httpDelete:Delete = new Delete();
    44                         httpDelete.addHeader("Authorization", "BASIC " + getCredentials());
    45                         service.request(uri, httpDelete);
     36                        service.url = item.dataUrl;
     37                        service.send(DELETE_METHOD);
    4638                }
    4739
    48                 private function handleResult(resultEvent:HttpResponseEvent):void {
     40                private function handleResult(resultEvent:ResultEvent):void {
    4941                        CursorManager.removeBusyCursor();
    50                         if (resultEvent.response.isSuccess) {
     42                        if (resultEvent.statusCode >= 200 && resultEvent.statusCode < 300) {
    5143                                dispatchEvent(new Event(ITEM_DELETED));
    52                         } else if (resultEvent.response.isClientError) {
    53                                 Alert.show("Unauthorized to delete item, you are not the creator.");
    54                         } else if (resultEvent.response.isServerError) {
    55                                 Alert.show("Unexpected error, server returned status: " + resultEvent.response.code);
     44                        } else {
     45                                Alert.show("Unexpected error, server returned status: " + resultEvent.statusCode + "\n Message = ");
    5646                        }
    5747                }
    5848
    59                 public function handleError(faultEvent:ErrorEvent):void {
     49                public function handleError(faultEvent:FaultEvent):void {
    6050                        CursorManager.removeBusyCursor();
    61                         var errorMessage:String = StringUtil.substitute("Error in {0}: {1}", this, faultEvent.text);
    62                     Alert.show(errorMessage);
     51                        if (faultEvent.statusCode == 401) {
     52                                Alert.show("Unauthorized to delete item, you are not the creator.");
     53                        } else {
     54                                var errorMessage:String = StringUtil.substitute("Error in {0} status {1}: {2}", this, faultEvent.statusCode, faultEvent.fault.faultString);
     55                                Alert.show(errorMessage);
     56                        }
    6357                }
    6458
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/IsocatService.as

    r238 r322  
    11package clarin.cmdi.componentregistry.services {
    22        import com.adobe.net.URI;
    3 
    4         import flash.events.ErrorEvent;
     3       
    54        import flash.events.EventDispatcher;
    6 
     5       
    76        import mx.controls.Alert;
    87        import mx.managers.CursorManager;
     8        import mx.messaging.messages.HTTPRequestMessage;
     9        import mx.rpc.events.FaultEvent;
     10        import mx.rpc.events.ResultEvent;
     11        import mx.rpc.http.HTTPService;
    912        import mx.utils.StringUtil;
    10 
    11         import org.httpclient.HttpClient;
    12         import org.httpclient.events.HttpDataEvent;
    13         import org.httpclient.events.HttpResponseEvent;
    14         import org.httpclient.http.Get;
    1513
    1614        public class IsocatService extends EventDispatcher {
     
    1917
    2018
    21                 private var service:HttpClient;
     19                private var service:HTTPService;
    2220
    2321                [Bindable]
     
    3331                                var uri:URI = new URI(Config.instance.isocatSearchUrl);
    3432                                uri.setQueryValue("keywords", keyword);
    35                                 uri.setQueryValue("dcif-mode", "list");
    36 
    37                                 var httpGet:Get = new Get();
    38                                 httpGet.addHeader("Accept", "application/dcif+xml");
    39                                 service.request(uri, httpGet);
     33                                service.url = uri.toString();
     34                                service.send();
    4035                        }
    4136                }
     
    4338                public function close():void {
    4439                        if (service) {
    45                                 service.close();
     40                                service.cancel();
    4641                        }
    4742                        CursorManager.removeBusyCursor();
     
    4944
    5045                private function createClient():void {
    51                         service = new HttpClient();
    52                         service.listener.onComplete = handleResult;
    53                         service.listener.onError = handleError;
    54                         service.listener.onData = handleData;
     46                        service = new HTTPService();
     47                        service.method = HTTPRequestMessage.GET_METHOD;
     48                        service.resultFormat = HTTPService.RESULT_FORMAT_E4X;
     49                        service.addEventListener(ResultEvent.RESULT, handleResult);
     50                        service.addEventListener(FaultEvent.FAULT, handleError);
    5551                }
    5652
    57                 private function handleData(event:HttpDataEvent):void {
    58                         var data:XML = new XML(event.bytes);
    59                         searchResults = data.dcif::dataCategory;
    60                 }
    6153
    62                 private function handleResult(resultEvent:HttpResponseEvent):void {
     54                private function handleResult(resultEvent:ResultEvent):void {
    6355                        CursorManager.removeBusyCursor();
    64                         if (resultEvent.response.isClientError) {
    65                                 Alert.show("Unauthorized search, server return status:" + resultEvent.response.code);
    66                         } else if (resultEvent.response.isServerError) {
    67                                 Alert.show("Unexpected error, server returned status: " + resultEvent.response.code);
     56                        if (resultEvent.statusCode >= 200 && resultEvent.statusCode < 300) {
     57                                var data:XML = new XML(resultEvent.result);
     58                                searchResults = data.dcif::dataCategory;
     59                        } else {
     60                                Alert.show("Unexpected error, server returned status: " + resultEvent.statusCode + "\n Message = ");
    6861                        }
    6962                }
    7063
    71                 private function handleError(faultEvent:ErrorEvent):void {
     64                private function handleError(faultEvent:FaultEvent):void {
    7265                        CursorManager.removeBusyCursor();
    73                         var errorMessage:String = StringUtil.substitute("Error in {0}: {1}", this, faultEvent.text);
     66                        var errorMessage:String = StringUtil.substitute("Error in {0} status {1}: {2}", this, faultEvent.statusCode, faultEvent.fault.faultString);
    7467                        Alert.show(errorMessage);
    7568                }
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/UploadService.as

    r268 r322  
    22        import clarin.cmdi.componentregistry.common.ItemDescription;
    33        import clarin.cmdi.componentregistry.importer.UploadCompleteEvent;
    4        
     4
    55        import com.adobe.net.URI;
    6         import com.hurlant.util.Base64;
    7        
    8         import flash.events.DataEvent;
    9         import flash.events.ErrorEvent;
     6
    107        import flash.events.Event;
     8        import flash.events.HTTPStatusEvent;
    119        import flash.events.IOErrorEvent;
    1210        import flash.events.ProgressEvent;
     
    1412        import flash.net.FileFilter;
    1513        import flash.net.FileReference;
    16        
     14        import flash.net.URLVariables;
     15        import flash.utils.ByteArray;
     16
    1717        import mx.controls.ProgressBar;
    1818        import mx.managers.CursorManager;
    19        
    20         import org.httpclient.HttpClient;
    21         import org.httpclient.events.HttpDataEvent;
    22         import org.httpclient.events.HttpResponseEvent;
    23         import org.httpclient.http.Post;
    24         import org.httpclient.http.multipart.Multipart;
    25         import org.httpclient.http.multipart.Part;
     19
     20        import ru.inspirit.net.MultipartURLLoader;
    2621
    2722        [Event(name="uploadComplete", type="clarin.cmdi.componentregistry.importer.UploadCompleteEvent")]
     
    3732
    3833                private var fileRef:FileReference;
    39                 private var httpClient:HttpClient;
    4034                private var pb:ProgressBar;
     35                private var ml:MultipartURLLoader;
    4136
    4237                public function init(progressBar:ProgressBar):void {
     
    4641                private function createAndInitRequest():void {
    4742                        CursorManager.setBusyCursor();
    48                         httpClient = new HttpClient();
    49                         httpClient.listener.onError = httpclientErrorHandler;
    50                         httpClient.listener.onData = httpclientDataHandler;
    51                         httpClient.listener.onComplete = httpclientCompleteHandler;
     43                        ml = new MultipartURLLoader();
     44                        ml.addEventListener(Event.COMPLETE, completeHandler);
     45                        ml.addEventListener(ProgressEvent.PROGRESS, progressHandler);
     46                        ml.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
     47                        ml.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
     48                        ml.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    5249                }
    5350
     
    5552                        fileRef = new FileReference();
    5653                        fileRef.addEventListener(Event.SELECT, selectHandler);
    57                         fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, responseHandler);
     54                        //no uploads are done through FileRef only loads so this UPLOAD_COMPLETE_DATA event will not be thrown
     55                        //fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, responseHandler);
    5856                        fileRef.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    5957                        fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
     
    6664                public function submitProfile(description:ItemDescription, data:String = null):void {
    6765                        createAndInitRequest();
    68                         submit(description, data, new URI(Config.instance.uploadProfileUrl));
     66                        submit(description, createByteArray(data), new URI(Config.instance.uploadProfileUrl));
    6967                }
    7068
     
    7472                public function submitComponent(description:ItemDescription, data:String = null):void {
    7573                        createAndInitRequest();
    76                         submit(description, data, new URI(Config.instance.uploadComponentUrl));
     74                        submit(description, createByteArray(data), new URI(Config.instance.uploadComponentUrl));
    7775                }
    7876
    79                 private function getCredentials():String {
    80                         return Base64.encode("tomcat:tomcat");
     77                private function createByteArray(data:String):ByteArray {
     78                        var result:ByteArray = null;
     79                        if (data != null) {
     80                                result = new ByteArray();
     81                                result.writeUTFBytes(data);
     82                                result.position = 0;
     83                        }
     84                        return result
    8185                }
    8286
    83                 private function submit(description:ItemDescription, data:String, uri:URI):void {
     87                private function submit(description:ItemDescription, data:ByteArray, uri:URI):void {
    8488                        message = "";
    8589                        try {
    8690                                if (data != null) {
    87                                         var parts:Array = new Array();
    88                                         parts.push(new Part("description", description.description));
    89                                         parts.push(new Part("name", description.name));
    90                                         parts.push(new Part("group", description.groupName));
    91                                         parts.push(new Part("data", data, "application/octet-stream", [{name: "filename", value: description.name + ".xml"}]));
    92 
    93                                         var multipart:Multipart = new Multipart(parts);
    94                                         startUploadHandler();
    95                                         var post:Post = new Post();
    96                                         post.addHeader("Authorization", "BASIC " + getCredentials());
    97                                         post.setMultipart(multipart);
    98                                         httpClient.request(uri, post);
     91                                        var params:URLVariables = new URLVariables();
     92                                        ml.addVariable("description", description.description);
     93                                        ml.addVariable("name", description.name);
     94                                        ml.addVariable("group", description.groupName);
     95                                        ml.addFile(data, description.name + ".xml", "data");
     96                                        ml.load(uri.toString());
    9997                                } else {
    100                                         // Cannot sent credentials with FileReference.upload so just load the data and then submit through HttpClient
     98                                        // Cannot sent data that is not a file with FileReference.upload so just load the data and then submit through HttpClient.
     99                                        // FileReference also does not handle authentication tokens.
    101100                                        startUploadHandler();
    102101                                        if (fileRef.data == null) {
    103102                                                //only load if not loaded before otherwise sent the already loaded file. You can only force a reload of the file by selecting it again (it is a flash thingy).
    104103                                                fileRef.addEventListener(Event.COMPLETE, function(event:Event):void {
    105                                                                 submit(description, new String(fileRef.data), uri);
     104                                                                submit(description, fileRef.data, uri);
    106105                                                        });
    107106                                                fileRef.load();
    108107                                        } else {
    109                                                 submit(description, new String(fileRef.data), uri);
     108                                                submit(description, fileRef.data, uri);
    110109                                        }
    111110                                }
     
    129128                }
    130129
    131                 private function httpclientCompleteHandler(event:HttpResponseEvent):void {
    132                         if (!event.response.isSuccess) {
    133                                 addToMessage("Server Failed to handle registration. Unexpected error, try again later. (httpstatus code was: " + event.response.code + ")\n");
    134                         }
    135             CursorManager.removeBusyCursor();
    136                         httpClient.close();
    137                 }
    138 
    139                 private function httpclientDataHandler(event:HttpDataEvent):void {
     130                private function completeHandler(event:Event):void {
    140131                        uploadComplete();
    141                         var response:XML = new XML(event.bytes);
     132                        var response:XML = new XML(ml.loader.data);
    142133                        handleResponse(response);
    143134                }
    144135
    145                 private function httpclientErrorHandler(event:ErrorEvent):void {
    146                         addToMessage("Server Failed to handle registration. Unexpected error, try again later. (error: " + event.text + ")\n");
     136                private function httpStatusHandler(event:HTTPStatusEvent):void {
     137                        if (event.status != 200) {
     138                                addToMessage("Server Failed to handle registration. Unexpected error, try again later. (httpstatus code was: " + event.status + ")\n");
     139                        }
     140                        CursorManager.removeBusyCursor();
    147141                }
    148142
    149143                private function securityErrorHandler(event:SecurityErrorEvent):void {
    150144                        addToMessage("Server Failed to handle registration. Unexpected error, try again later. (error: " + event.text + ")\n");
     145                        CursorManager.removeBusyCursor();
    151146                }
    152147
    153148                private function ioErrorHandler(event:IOErrorEvent):void {
    154149                        addToMessage("Unable to load file. (error: " + event.text + ")\n");
     150                        CursorManager.removeBusyCursor();
    155151                }
    156152
     
    158154                        trace("Uploading: " + event.bytesLoaded + "/" + event.bytesTotal);
    159155                        pb.setProgress(event.bytesLoaded, event.bytesTotal);
    160                 }
    161 
    162 
    163                 private function responseHandler(event:DataEvent):void {
    164                         uploadComplete();
    165                         var response:XML = new XML(event.data);
    166                         handleResponse(response);
    167156                }
    168157
     
    186175                                createErrorMessage(response);
    187176                        }
    188 
    189177                }
    190178
     
    192180                        pb.label = "Upload complete";
    193181                        pb.setProgress(100, 100);
     182                        CursorManager.removeBusyCursor();
    194183                }
    195184
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/main.mxml

    r281 r322  
    33                                xmlns:common="clarin.cmdi.componentregistry.common.components.*"
    44                                layout="absolute"
     5                                preinitialize="initializeInstances();"
    56                                applicationComplete="init();"
    67                                backgroundColor="#DDE3EF">
     
    910                <![CDATA[
    1011                        import clarin.cmdi.componentregistry.services.Config;
     12                        import clarin.cmdi.componentregistry.common.Credentials;
    1113                        import flash.net.navigateToURL;
    1214                        import mx.managers.PopUpManager;
    13                         import clarin.cmdi.componentregistry.services.UploadService;
    1415                        import org.hasseg.externalMouseWheel.ExternalMouseWheelSupport;
    1516
     17                        private function initializeInstances():void {
     18                                Config.create(Application.application.parameters);
     19                                Credentials.create(Application.application.parameters);
     20                        }
     21                       
    1622                        private function init():void {
    1723                                ExternalMouseWheelSupport.getInstance(stage);
    18                                 //var sessionId:String = Application.application.parameters.jsessionid;
    19                                 //trace("JSession=" + sessionId);
    20 //    var urltext:String = "/webapp/ChartXML.do;JSESSIONID="+JSESSIONID;
    21 //    trace ("Requested URL:",urltext);
    22 //    httpService.url= urltext;
    23 //    httpService.send();
    24 //    trace("httpService sent");
    2524                        }
    2625
    27                         private function handleLogin(event:MouseEvent):void {
    28                                 var req:URLRequest = new URLRequest();
    29                                 req.url = Config.instance.serviceRootUrl + "?shhaaDo=lI";
    30                                 navigateToURL(req, "_top");
    31                         }
    32 
    33                         [Bindable]
    34                         private var userName:String = "";
    35 
    36                         private function checkUser():void {
    37                                 userName = Application.application.parameters.userName;
    38                                 trace("user = " + userName);
    39                         }
     26//                      private function handleLogin(event:MouseEvent):void {
     27//                              var req:URLRequest = new URLRequest();
     28//                              req.url = Config.instance.serviceRootUrl + "?shhaaDo=lI";
     29//                              navigateToURL(req, "_top");
     30//                      }
    4031                ]]>
    4132        </mx:Script>
     
    5041                <mx:VBox height="100%"
    5142                                 width="100%">
    52                         <mx:HBox borderStyle="none">
     43                        <mx:HBox borderStyle="none"
     44                                         width="100%">
    5345                                <mx:ToggleButtonBar id="toggleBar"
    54                                                                         dataProvider="{viewStack}"
    55                                                                         initialize="checkUser();"/>
    56                                 <mx:Button id="login"
    57                                                    label="login {userName}"
    58                                                    click="handleLogin(event)"/>
     46                                                                        dataProvider="{viewStack}"/>
     47                                <mx:Spacer width="90%"/>
     48                                <mx:Label text="User: {Credentials.instance.userName}"/>
     49                                <!--                            <mx:Button id="login"
     50                                         label="login {userName}"
     51                                         click="handleLogin(event)"/>-->
    5952                        </mx:HBox>
    6053                        <common:RegistryViewStack id="viewStack"
Note: See TracChangeset for help on using the changeset viewer.