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

FusionCharts Exporter is an ASP.NET C# script that handles FusionCharts (since v3.1) Server Side Export feature. This in conjuncture with other resource classses would process FusionCharts Export Data POSTED to it from FusionCharts and convert the data to an image or a PDF. Subsequently, it would save to the server or respond back as an HTTP response to client side as download. This script might be called as the FusionCharts Exporter - main module
Inheritance: IHttpHandler
ファイルを表示 Open project: debop/NFramework

Protected Properties

Property Type Description
DOMId string
ErrorMessages string>.IDictionary
FileSuffixFormat string
IntelligentFileNaming bool
IsDownload bool
OverwriteFile bool
rnd System.Random

Public Methods

Method Description
ProcessRequest ( HttpContext context ) : void

Protected Methods

Method Description
ExportChart ( ) : void

Chart를 Exporting하는 메인 함수입니다.

ParseExportRequestStream ( ) : Hashtable

Fusion Chart가 전송한 POST 방식의 요청 정보를 해석해서, Hashtable로 반환한다. 반환되는 Hashtable은 이미지 정보를 담은 'stream', 크기, 색상 등의 정보를 가진 'meta', 부가적인 ExportFormat, exportFileName, exportAction 정보를 담은 'parameters' 라는 키를 가집니다.

Private Methods

Method Description
BuildResponse ( IEnumerable 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

Exporting 상태 정보를 Chart나 Exporting 파일에 씁니다. 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

Exporting 상태 정보를 Chart나 Exporting 파일에 씁니다. 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
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

지정된 경로가 쓰기 가능한 Directory인지 알아본다.

OutputExportObject ( MemoryStream exportStream, Hashtable exportParams ) : bool

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.

ParseExportedStatus ( object filename, Hashtable meta, string msg ) : IList

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

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

ToHashtable ( string str ) : Hashtable

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

ToHashtable ( string str, char delimiters ) : Hashtable

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

WriteLogMessage ( string msg ) : void

예외정보를 발생 시킨다.

WriteLogMessage ( string msg, bool halt ) : void

예외정보를 발생 시킨다.

Method Details

ExportChart() protected method

Chart를 Exporting하는 메인 함수입니다.
protected ExportChart ( ) : void
return void

ParseExportRequestStream() protected method

Fusion Chart가 전송한 POST 방식의 요청 정보를 해석해서, Hashtable로 반환한다. 반환되는 Hashtable은 이미지 정보를 담은 'stream', 크기, 색상 등의 정보를 가진 'meta', 부가적인 ExportFormat, exportFileName, exportAction 정보를 담은 'parameters' 라는 키를 가집니다.
protected ParseExportRequestStream ( ) : Hashtable
return System.Collections.Hashtable

ProcessRequest() public method

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

Property Details

DOMId protected_oe property

DOMId of the chart
protected string DOMId
return string

ErrorMessages protected_oe static_oe property

protected static IDictionary ErrorMessages
return string>.IDictionary

FileSuffixFormat protected_oe property

value can be either 'TIMESTAMP' or 'RANDOM'
protected string FileSuffixFormat
return string

IntelligentFileNaming protected_oe property

protected bool IntelligentFileNaming
return bool

IsDownload protected_oe property

Whether the export action is download. default value. Would change as per setting retrieved from chart.
protected bool IsDownload
return bool

OverwriteFile protected_oe property

protected bool OverwriteFile
return bool

rnd protected_oe static_oe property

protected static Random,System rnd
return System.Random