C# Class NSoft.NFramework.FusionCharts.Web.FusionChartExporterHandler

Inheritance: IHttpHandler
ファイルを表示 Open project: debop/NFramework

Public Methods

Method Description
ExportChart ( ) : void

The main function that handles all Input - Process - Output of this Export Architecture

ProcessRequest ( HttpContext context ) : void

Private Methods

Method Description
bang ( string str ) : Hashtable
bang ( string str, char delimiterList ) : Hashtable

Helper function that splits a string containing delimiter separated key value pairs into hashtable

buildResponse ( ArrayList arrMsg ) : string

Builds response from an array of status information. Joins the array to a string. Each array element should be a string which is a key=value pair. This array are either joined by a & to build a querystring (to pass to chart) or joined by a HTML
to show neat and clean status informaton in Browser window if download fails at the processing stage.

exportProcessor ( string strFormat, string stream, Hashtable meta ) : MemoryStream

Get Export data from and build the export binary/objct.

flushStatus ( object filename, Hashtable meta ) : void

Flushes exported status message/or any status message to the chart or the output stream. It parses the exported status through parser function parseExportedStatus, builds proper response string using buildResponse function and flushes the response string to the output stream and terminates the program.

flushStatus ( object filename, Hashtable meta, string msg ) : void

Flushes exported status message/or any status message to the chart or the output stream. It parses the exported status through parser function parseExportedStatus, builds proper response string using buildResponse function and flushes the response string to the output stream and terminates the program.

generateIntelligentFileId ( ) : string

generates a file suffix for a existing file name to apply smart file naming

getExtension ( string exportType ) : string

gets file extension checking the export type.

getMime ( string exportType ) : string

gets mime type for an export type

isDirectoryWritable ( string path ) : bool

Finds if a directory is writable

outputExportObject ( MemoryStream exportObj, Hashtable exportParams ) : object

Checks whether the export action is download or save. If action is 'download', send export parameters to 'setupDownload' function. If action is not-'download', send export parameters to 'setupServer' function. In either case it gets exportSettings and passes the settings along with processed export binary (image/PDF) to the output handler function if the export settings return a 'ready' flag set to 'true' or 'download'. The export process would stop here if the action is 'download'. In the other case, it gets back success status from output handler function and returns it.

parseExportRequestStream ( ) : Hashtable

Parses POST stream from chart and builds a Hashtable containing export data and parameters in a format readable by other functions. The Hashtable contains keys 'stream' (contains encoded image data) ; 'meta' ( Hashtable with 'width', 'height' and 'bgColor' keys) ; and 'parameters' ( Hashtable of all export parameters from chart as keys, like - exportFormat, exportFileName, exportAction etc.)

parseExportedStatus ( object filename, IDictionary meta, string msg ) : ArrayList

Parses the exported status and builds an array of export status information. As per status it builds a status array which contains statusCode (0/1), statusMesage, fileName, width, height and notice in some cases.

parseParams ( string strParams ) : Hashtable

Parse export 'parameters' string into a Hashtable Also synchronise default values from defaultparameterValues Hashtable

raise_error ( string msg ) : void
raise_error ( string msg, bool halt ) : void

Error reporter function that has a list of error messages. It can terminate the execution and send successStatus=0 along with a error message. It can also append notice to a global variable and continue execution of the program.

setupDownload ( Hashtable exportParams ) : Hashtable

setup download headers and return ready flag in exportSettings

setupServer ( Hashtable exportParams ) : Hashtable

check server permissions and settings and return ready flag to exportSettings

Method Details

ExportChart() public method

The main function that handles all Input - Process - Output of this Export Architecture
public ExportChart ( ) : void
return void

ProcessRequest() public method

public ProcessRequest ( HttpContext context ) : void
context System.Web.HttpContext
return void