Last change
on this file since 3366 was
3366,
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:
713 bytes
|
Line | |
---|
1 | package clarin.cmdi.componentregistry.services { |
---|
2 | |
---|
3 | import flash.net.URLRequest; |
---|
4 | import flash.net.navigateToURL; |
---|
5 | import clarin.cmdi.componentregistry.common.ItemDescription; |
---|
6 | import com.adobe.net.URI; |
---|
7 | |
---|
8 | public class SaveItemDialog { |
---|
9 | |
---|
10 | |
---|
11 | public function SaveItemDialog() { |
---|
12 | } |
---|
13 | |
---|
14 | public function saveAsXML(item:ItemDescription):void { |
---|
15 | save(item, "xml"); |
---|
16 | } |
---|
17 | |
---|
18 | public function saveAsXSD(item:ItemDescription):void { |
---|
19 | save(item, "xsd"); |
---|
20 | } |
---|
21 | |
---|
22 | private function save(item:ItemDescription, extension:String, urlVariable:String = null):void { |
---|
23 | var req:URLRequest = new URLRequest(); |
---|
24 | var url:URI = new URI(item.dataUrl + "/" + extension); |
---|
25 | req.url = url.toString(); |
---|
26 | navigateToURL(req, "_top"); |
---|
27 | } |
---|
28 | |
---|
29 | } |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.