| Package | com.yworks.remote |
| Class | public class DownloadHandler |
| Inheritance | DownloadHandler AbstractFileWriteHandler flash.events.EventDispatcher |
For a serverless write handler, see class SaveHandler
See also
| Property | Defined By | ||
|---|---|---|---|
| additionalParameters : Object
Get or set an object containing additional parameters that will be
transfered to the service URL. | DownloadHandler | ||
| compress : Boolean
Whether to use compression for the graphml data
that is sent to the server. | DownloadHandler | ||
![]() | fileName : String [read-only]
The name of the last successfully downloaded file. | AbstractFileWriteHandler | |
![]() | outputIOHandler : GraphMLIOHandler
Get or set the GraphMLIOHandler instance that will be used for graph serialization. | AbstractFileWriteHandler | |
| uriEncode : Boolean
Whether to encode the graphML string sent to
the server using the global encodeURIComponent function. | DownloadHandler | ||
| Method | Defined By | ||
|---|---|---|---|
DownloadHandler(downloadURL:String, roundtripHandler:RoundtripHandler = null)
Create a new instance for the given service URL. | DownloadHandler | ||
Calls the download URL that was passed upon initialization. | DownloadHandler | ||
| Method | Defined By | ||
|---|---|---|---|
![]() | createFileReference():FileReference
Creates a new FileReference and sets the fileReference
property. | AbstractFileWriteHandler | |
![]() | createGraphML(graph:IGraph):XML
Create the GraphML representation of the given graph. | AbstractFileWriteHandler | |
![]() |
Create the GraphMLIOHandler instance that will be used for graph serialization. | AbstractFileWriteHandler | |
createURLRequest(downloadURL:String):URLRequest
Create the URLRequest instance that will be used for the download request. | DownloadHandler | ||
createURLVariables(graph:IGraph):URLVariables
Create the parameters object that is transferred to the server. | DownloadHandler | ||
![]() | onCancel(evt:Event):void
Called when the user cancels the download using the file chooser's cancel button. | AbstractFileWriteHandler | |
![]() | onComplete(evt:Event):void
Called when the download operation has finished successfully. | AbstractFileWriteHandler | |
![]() | onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status. | AbstractFileWriteHandler | |
![]() | onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the file download. | AbstractFileWriteHandler | |
![]() | onProgress(evt:ProgressEvent):void
Dispatched periodically during the file upload or download operation. | AbstractFileWriteHandler | |
![]() | onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the file download. | AbstractFileWriteHandler | |
![]() | onSelect(evt:Event):void
Called when the user has selected a location for the file download. | AbstractFileWriteHandler | |
| additionalParameters | property |
additionalParameters:ObjectGet or set an object containing additional parameters that will be transfered to the service URL.
public function get additionalParameters():Object public function set additionalParameters(value:Object):void| compress | property |
compress:BooleanWhether to use compression for the graphml data that is sent to the server.
If true, the value of the "graph"
parameter will be compressed using zlib compression
and encoded using base64 encoding.
The default value is true.
public function get compress():Boolean public function set compress(value:Boolean):void| uriEncode | property |
uriEncode:Boolean
Whether to encode the graphML string sent to
the server using the global encodeURIComponent function.
The default value is false.
public function get uriEncode():Boolean public function set uriEncode(value:Boolean):voidSee also
| DownloadHandler | () | Constructor |
public function DownloadHandler(downloadURL:String, roundtripHandler:RoundtripHandler = null)Create a new instance for the given service URL.
ParametersdownloadURL:String — An URL that corresponds to a service which sends a file to the client.
| |
roundtripHandler:RoundtripHandler (default = null) — The roundtrip handler to receive the outputIOHandler from.
|
| createURLRequest | () | method |
protected function createURLRequest(downloadURL:String):URLRequestCreate the URLRequest instance that will be used for the download request.
Parameters
downloadURL:String — The service URL that was passed upon initialization.
|
URLRequest — An URLRequest instance that will be used in the download method.
|
| createURLVariables | () | method |
protected function createURLVariables(graph:IGraph):URLVariablesCreate the parameters object that is transferred to the server.
This implementation will include a serialization of the current graph instance contained in the graphCanvas,
if send is true. The GraphML string will be sent as a request parameter named "graph".
If compress is true, the GraphML serialization of the graph will
be compressed and base64-encoded. This is indicated to the server by prepending "base64/zlib" to
the "graphEncoding" request parameter.
If uriEncode is true, the GraphML string will be encoded using the global encodeURIComponent
function. This is indicated to the server by setting thge "graphEncoding" request parameter to "encodeURIComponent".
Parameters
graph:IGraph — The graph to be serialized
|
URLVariables — The parameters object to be transferred to the server.
|
See also
| download | () | method |
public function download(graph:IGraph, defaultFileName:String):voidCalls the download URL that was passed upon initialization.
Event handling can be customized by overriding the various protected event handler functions.
Parameters
graph:IGraph — The graph instance that is to be serialized.
| |
defaultFileName:String — The default file name to be shown in the browser's download dialog.
|