source: ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/LoginLabelButton.as @ 3368

Last change on this file since 3368 was 3368, checked in by g.georgovassilis@mpi.nl, 11 years ago

#269 BaseRemoteService? abstracts HTTP communication away for XML services, added facility for mocking services in unit tests, moved tests into src/test

File size: 1.0 KB
Line 
1package clarin.cmdi.componentregistry.common.components {
2        import clarin.cmdi.componentregistry.services.Config;
3
4        import com.adobe.net.URI;
5
6        import flash.events.MouseEvent;
7        import flash.net.URLRequest;
8        import flash.net.navigateToURL;
9
10
11        public class LoginLabelButton extends LabelButton {
12
13                [Bindable]
14                public var viewType:String;
15                [Bindable]
16                public var spaceType:String;
17                [Bindable]
18                public var itemId:String;
19
20                public function LoginLabelButton() {
21                        super(handleLogin, "login");
22                        toolTip = "Click to login";
23                }
24
25                private function handleLogin(event:MouseEvent):void {
26                        var req:URLRequest = new URLRequest();
27
28                        var uri:URI  = new URI(Config.instance.serviceRootUrl);
29                        uri.setQueryValue("shhaaDo", "lI");
30                        if (viewType) {
31                                uri.setQueryValue(Config.REGISTRY_PARAM_VIEW, viewType);
32                        }
33                        if (spaceType) {
34                                uri.setQueryValue(Config.REGISTRY_PARAM_SPACE, spaceType);
35                        }
36                        if (itemId) {
37                                uri.setQueryValue(Config.REGISTRY_PARAM_ITEM, itemId);
38                        }
39                        req.url = uri.toString();
40                        navigateToURL(req, "_top");
41                }
42
43        }
44}
Note: See TracBrowser for help on using the repository browser.