source: ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/ComponentRegistryService.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: 751 bytes
Line 
1package clarin.cmdi.componentregistry.services //trunk
2{
3        import com.adobe.net.URI;
4       
5        public class ComponentRegistryService extends BaseRemoteService {
6               
7                protected var serviceUrl:URI;
8                protected var userSpace:Boolean;
9               
10                public function ComponentRegistryService(successEvent:String, serviceUrl:URI) {
11                        super(successEvent);
12                        this.serviceUrl = serviceUrl;
13                }
14               
15                override protected function dispatchRequest(url:URI):void {
16                        url.setQueryValue("unique", new Date().getTime().toString());
17                        if (userSpace) {
18                                url.setQueryValue(Config.PARAM_USERSPACE, "true");
19                        } else
20                                url.setQueryValue(Config.PARAM_USERSPACE, null);
21                        super.dispatchRequest(url);
22                }
23               
24                public function load():void {
25                        dispatchRequest(serviceUrl);
26                }
27               
28        }
29}
Note: See TracBrowser for help on using the repository browser.