BiTextLoader

This class is used to load a plain text document from the server or the file system (if the application is run locally).

This class extends BiAbstractLoader and therefore all methods and fields available for BiAbstractLoader are also available for BiTextLoader .

Constructor

new BiTextLoader ( )

Parameters

No parameters.

Properties

NameTypegetsetDescripton
abortedBooleancheckedWhether the loader has aborted
methodStringcheckedcheckedThe HTTP method to use for the request
passwordStringcheckedcheckedThe password to use when authentication is needed to load the file
textStringcheckedThe text inside the file
uriBiUricheckedcheckedThe URI (location) of the file to load. If this is set to a string a new URI is created from that string relative to the ADF path.
userStringcheckedcheckedThe user name to use when authentication is needed to load the file
xmlHttpBiXmlHttpcheckedThe underlying BiXmlHttp that handles the communication.

Methods

NameDescription
openPrepares the text loader so that data can be sent and recieved. After the loader has been opened you can use send to start the send/load. This is done automatically when using load and post.
postDoes an HTTP POST to recieve the file. A BiXmlDocument can be sent to the server containing the data. The data sent can also be a string and in this case the content type of the underlying BiXmlHttp should be set.
sendStarts the HTTP request and loads the result. If an argument is provided this is either a BiXmlDocument or a String. You can simulate a HTML form post by encoding the string as a application/x-www-form-urlencoded and by setting the Content-Type request header of the xmlHttp object.

Events

NameTypeBubblesDescripton
loadBiEventFires when the file has been loaded

Static Methods

NameDescription
loadLoads a file synchronously from the given URI and returns the text content the file

Static Fields

None.

Remarks

Using syncronous loading freezes the web browser while the loading takes place. This should be prevented as much as possible and therefore asynchronous loading is preferred.

Method Details

open

Prepares the text loader so that data can be sent and recieved. After the loader has been opened you can use send to start the send/load. This is done automatically when using load and post.

Syntax

object.open ( sMethod,oUri [ ,bAsync [ ,sUser [ ,sPassword ] ] ] )

Parameters

NameTypeOptionalDefaultDescripton
sMethodStringThe HTTP method used to send/load the data. For example GET and POST.
oUriBiUriThe location of the file. If this is a string a new URI is created from that string relative to the ADF path.
bAsyncBooleancheckedWhether to load the text file asynchronously or synchronously
sUserStringcheckedThe user name to use for authentication. If empty no authentacation is used.
sPasswordStringcheckedThe password to use for authentication. If empty no authentacation is used.

Return Type

void

post

Does an HTTP POST to recieve the file. A BiXmlDocument can be sent to the server containing the data. The data sent can also be a string and in this case the content type of the underlying BiXmlHttp should be set.

Syntax

object.post ( oUri [ ,oXmlDocument ] )

Parameters

NameTypeOptionalDefaultDescripton
oUriBiUriThe location of the file. If this is a string a new URI is created from that string relative to the ADF path.
oXmlDocumentBiXmlDocumentcheckedAn XML document containing the POST data

Return Type

void

send

Starts the HTTP request and loads the result. If an argument is provided this is either a BiXmlDocument or a String. You can simulate a HTML form post by encoding the string as a application/x-www-form-urlencoded and by setting the Content-Type request header of the xmlHttp object.

Syntax

object.send ( oObject )

Parameters

NameTypeOptionalDefaultDescripton
oObjectObjectAn XML document or a string containing the POST data

Return Type

void

Static Method Details

load

Loads a file synchronously from the given URI and returns the text content the file

Syntax

BiTextLoader . load ( oUri )

Parameters

NameTypeOptionalDefaultDescripton
oUriBiUriThe location of the file. If this is a string a new URI is created from that string relative to the ADF path.

Return Type

String