Interface ExportJobInterface

The ExportJobInterface interface is used to ask for a 3D / 2D export of a set of data.

Such export request is performed by the 3djuump Infinite backend and the ExportJobInterface is used to monitor the progress of the 3D export procedure and retrieve the result.

The ExportJobInterface interfaces are created through the DataSessionInterface.export3D, DataSessionInterface.export2D or DataSessionInterface.exportSVG methods. The output format of the 3D export procedure is defined by an Export3DOutputFormatInterface interface that sets the 3D format to use for the export procedure and some properties to tailor the final output file(s). Indeed, the export procedure consists in a number of different files, the number of files is available when the ExportJobInterfaceSignal.ExportFileCountReady signal is fired (getFileCount).

Only WorkingSetInterface may be exported with some modifiers, individual geometric instance ids cannot be exported per se, they must be included in a WorkingSetInterface. The list of WorkingSetInterface to export is defined by an array of WorkingSet3DExportInterface or WorkingSet2DExportInterface.

The list of signals the ExportJobInterface may trigger is available in the ExportJobInterfaceSignal enumeration.

The export mechanism is triggered through the DataSessionInterface.export3D, DataSessionInterface.export2D or DataSessionInterface.exportSVG method. The export is not available right away, but the event ExportJobInterfaceSignal.ExportJobFinished is triggered when the result of the ExportJobInterface is available.

The result may then be downloaded after calling the computeDownloadURL function and when the event ExportJobInterfaceSignal.ExportJobURLReady is triggered. The getDownloadURL will then retrieve the URL to fetch with an http GET request.

Warning : there may be cases when the computeDownloadURL and getDownloadURL are not available such as when the export procedure is running, i.e. when isRunning returns true, or when the ExportJobInterface has been cancelled, i.e. when isCancelled returns true.

The download URL has a short life span, so make sure to download the actual data shortly after calling computeDownloadURL, or recall computeDownloadURL if getDownloadURL returns undefined.

An export procedure may be interrupted (cancelled) when the ExportJobInterface is fetching data and cancel is called. In such cases, the ExportJobInterfaceSignal.ExportJobCancelled signal is fired, and shortly after, ExportJobInterfaceSignal.ExportJobFinished signal is fired.

/** 
* Sample to illustrate the use of a 3d export procedure.
*/
import { DataSessionInterface, WorkingSetInterface, ExportJobInterface, ExportJobInterfaceSignal, InfiniteError, InfiniteEvent, Export3DOutputFormat } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as 3d data
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;
// the file to download
// In this test, we will only download one file
let lFileOffset : number = -1;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = () : boolean =>
{
// will will try to export as fbx
lExportJob = lDataSession.export3D(
[{ workingSet: lWorkingSetToExport }],
{
type: 'export3DOutputFormat',
dataFormat: Export3DOutputFormat.EOF_FBX,
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobFinished, (pEvent : InfiniteEvent) : void =>
{
// only get the URL if no error
const lError : InfiniteError | undefined = lExportJob.getLastError();
if(lError === undefined && (lFileOffset === -1))
{
lFileOffset = pEvent.attachments;
if(lExportJob.isExportSuccess(lFileOffset))
{
// trigger the URL computing
if(!lExportJob.computeDownloadURL(lFileOffset))
{
console.log('Export job failed');
}
}
}
});
// URL will be ready
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobURLReady, () : void =>
{
const lUrl : string | undefined = lExportJob.getDownloadURL(lFileOffset);
// sanity check
if(lUrl === undefined)
{
console.log('Export job failed');
return;
}
// trigger the download from the browser
onDownloadReady(lUrl);
});
return true;
};

startExportProcedure();

/** 
* Sample to illustrate the use of a "complete" screenshot export procedure.
*/
import {
DataSessionInterface, WorkingSetInterface, ExportJobInterface, ExportJobInterfaceSignal, InfiniteError, InfiniteEvent, InfiniteEngineInterface,
Export2DOutputFormat, Vector2, Vector4
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as a raster screenshot
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;
// the infinite engine in use, created previously
let lInfiniteEngine: InfiniteEngineInterface;

// the file to download
// In this test, we will only download one file
let lFileOffset : number = -1;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = () : boolean =>
{
// we will try to export as png
lExportJob = lDataSession.export2D(
[{ workingSet: lWorkingSetToExport }],
{
type: 'export2DOutputFormat',
outputs: [
{
// the name inside the screenshot procedure, as multiple viewpoint may
// be set, in this case this is useless
itemName: 'screenshot',
// the resolution of the image
resolution: new Vector2(1024, 768),
// camera parameters
viewpoint: lInfiniteEngine.getCameraManager().toJSON(),
// the background color
backgroundColor: new Vector4(1, 1, 1, 1),
// PNG to get a lossless compression
dataFormat: Export2DOutputFormat.EOF_PNG
}
],
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobFinished, (pEvent : InfiniteEvent) : void =>
{
// only get the URL if no error
const lError : InfiniteError | undefined = lExportJob.getLastError();
if(lError === undefined && (lFileOffset === -1))
{
lFileOffset = pEvent.attachments;
if(lExportJob.isExportSuccess(lFileOffset))
{
// trigger the URL computing
if(!lExportJob.computeDownloadURL(lFileOffset))
{
console.log('Export job failed');
}
}
}
});
// URL will be ready
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobURLReady, () : void =>
{
const lUrl : string | undefined = lExportJob.getDownloadURL(lFileOffset);
// sanity check
if(lUrl === undefined)
{
console.log('Export job failed');
return;
}
// trigger the download from the browser
onDownloadReady(lUrl);
});
return true;
};

startExportProcedure();

/** 
* Sample to illustrate the use of a SVG export procedure.
*/
import {
DataSessionInterface, WorkingSetInterface, ExportJobInterface, ExportJobInterfaceSignal, InfiniteError, InfiniteEvent,
InfiniteEngineInterface, Vector2, ExportSVGOutputFormat
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as a svg image
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;
// the infinite engine in use, created previously
let lInfiniteEngine: InfiniteEngineInterface;

// the file to download
// In this test, we will only download one file
let lFileOffset : number = -1;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = () : boolean =>
{
// will will try to export as svg
lExportJob = lDataSession.exportSVG(
[{ workingSet: lWorkingSetToExport }],
{
type: 'exportSVGOutputFormat',
outputs: [
{
// the name inside the screenshot procedure, as multiple viewpoint may
// be set, in this case this is useless
itemName: 'svg_screenshot',
// the page size in mm (A4 here)
pageSize: new Vector2(210, 287),
// camera parameters
viewpoint: lInfiniteEngine.getCameraManager().toJSON(),
// SVG file format
dataFormat: ExportSVGOutputFormat.EOF_SVG
}
],
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobFinished, (pEvent : InfiniteEvent) : void =>
{
// only get the URL if no error
const lError : InfiniteError | undefined = lExportJob.getLastError();
if(lError === undefined && (lFileOffset === -1))
{
lFileOffset = pEvent.attachments;
if(lExportJob.isExportSuccess(lFileOffset))
{
// trigger the URL computing
if(!lExportJob.computeDownloadURL(lFileOffset))
{
console.log('Export job failed');
}
}
}
});
// URL will be ready
lExportJob.addEventListener(ExportJobInterfaceSignal.ExportJobURLReady, () : void =>
{
const lUrl : string | undefined = lExportJob.getDownloadURL(lFileOffset);
// sanity check
if(lUrl === undefined)
{
console.log('Export job failed');
return;
}
// trigger the download from the browser
onDownloadReady(lUrl);
});
return true;
};

startExportProcedure();

or asynchronously :
/** 
* Sample to illustrate the asynchronous use of a 3d export procedure.
*/
import { DataSessionInterface, WorkingSetInterface, ExportJobInterface, AsyncResultReason, Export3DOutputFormat } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as 3d data
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = async () : Promise<boolean> =>
{
// will will try to export as fbx
lExportJob = lDataSession.export3D(
[{ workingSet: lWorkingSetToExport }],
{
type: 'export3DOutputFormat',
dataFormat: Export3DOutputFormat.EOF_FBX,
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
// wait for file count to be known
const lWaitForFileCount : AsyncResultReason = await lExportJob.asyncWaitForFileCount();
if(lWaitForFileCount !== AsyncResultReason.ARR_Success)
{
return false;
}
const lNbFiles: number = lExportJob.getFileCount();
console.log('The export procedure consists in ' + lNbFiles + ' files');
if(lNbFiles < 1)
{
// not enough files ?
// => should not happen
return false;
}
// wait for everything to be computed
// we could have waited for a specific file with an asyncWaitForFinished(item)
const lExportResult : AsyncResultReason = await lExportJob.asyncWaitForFinished();
if(lExportResult !== AsyncResultReason.ARR_Success)
{
return false;
}
// file is ready
// claim for a download url for file 0
console.log('retrieving file ' + lExportJob.getFilename(0));
await lExportJob.asyncGetDownloadURL(0);
const lUrl : string | undefined = lExportJob.getDownloadURL(0);
if(lUrl === undefined)
{
return false;
}
// trigger a download of the file
onDownloadReady(lUrl);
return true;
};

startExportProcedure();

/** 
* Sample to illustrate the asynchronous use of a "complete" screenshot export procedure.
*/
import { DataSessionInterface, WorkingSetInterface, ExportJobInterface, AsyncResultReason, Export2DOutputFormat, Vector2, Vector4, InfiniteEngineInterface } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as a raster screenshot
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;
// the infinite engine in use, created previously
let lInfiniteEngine: InfiniteEngineInterface;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = async () : Promise<boolean> =>
{
// we will try to export as png
lExportJob = lDataSession.export2D(
[{ workingSet: lWorkingSetToExport }],
{
type: 'export2DOutputFormat',
outputs: [
{
// the name inside the screenshot procedure, as multiple viewpoint may
// be set, in this case this is useless
itemName: 'screenshot',
// the resolution of the image
resolution: new Vector2(1024, 768),
// camera parameters
viewpoint: lInfiniteEngine.getCameraManager().toJSON(),
// the background color
backgroundColor: new Vector4(1, 1, 1, 1),
// PNG to get a lossless compression
dataFormat: Export2DOutputFormat.EOF_PNG
}
],
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
// wait for file count to be known
const lWaitForFileCount : AsyncResultReason = await lExportJob.asyncWaitForFileCount();
if(lWaitForFileCount !== AsyncResultReason.ARR_Success)
{
return false;
}
const lNbFiles: number = lExportJob.getFileCount();
console.log('The export procedure consists in ' + lNbFiles + ' files');
if(lNbFiles < 1)
{
// not enough files ?
// => should not happen
return false;
}
// wait for everything to be computed
// we could have waited for a specific file with an asyncWaitForFinished(item)
const lExportResult : AsyncResultReason = await lExportJob.asyncWaitForFinished();
if(lExportResult !== AsyncResultReason.ARR_Success)
{
return false;
}
// file is ready
// claim for a download url for file 0
console.log('retrieving file ' + lExportJob.getFilename(0));
await lExportJob.asyncGetDownloadURL(0);
const lUrl : string | undefined = lExportJob.getDownloadURL(0);
if(lUrl === undefined)
{
return false;
}
// trigger a download of the file
onDownloadReady(lUrl);
return true;
};

startExportProcedure();

/** 
* Sample to illustrate the asynchronous use of a SVG export procedure.
*/
import {
DataSessionInterface, WorkingSetInterface, ExportJobInterface, AsyncResultReason,
Vector2, InfiniteEngineInterface, ExportSVGOutputFormat
} from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession: DataSessionInterface;
// the working set to export as a svg image
let lWorkingSetToExport : WorkingSetInterface;
// the export job to monitor
let lExportJob : ExportJobInterface | undefined = undefined;
// the infinite engine in use, created previously
let lInfiniteEngine: InfiniteEngineInterface;

// triggers a save file from the browser
const onDownloadReady = (pUrl : string) : void => {
const downloadLink = document.createElement('a');
downloadLink.target = '_blank';
// set object URL as the anchors href
downloadLink.href = pUrl;
// append the anchor to document body
document.body.appendChild(downloadLink);
// fire a click event on the anchor
downloadLink.click();
// cleanup: remove element and revoke object URL
downloadLink.remove();
};

const startExportProcedure = async () : Promise<boolean> =>
{
// will will try to export as svg
lExportJob = lDataSession.exportSVG(
[{ workingSet: lWorkingSetToExport }],
{
type: 'exportSVGOutputFormat',
outputs: [
{
// the name inside the screenshot procedure, as multiple viewpoint may
// be set, in this case this is useless
itemName: 'svg_screenshot',
// the page size in mm (A4 here)
pageSize: new Vector2(210, 287),
// camera parameters
viewpoint: lInfiniteEngine.getCameraManager().toJSON(),
// SVG file format
dataFormat: ExportSVGOutputFormat.EOF_SVG
}
],
// filename without extension
filename: 'test'
}
);
// sanity check
if(lExportJob === undefined)
{
return false;
}
// wait for file count to be known
const lWaitForFileCount : AsyncResultReason = await lExportJob.asyncWaitForFileCount();
if(lWaitForFileCount !== AsyncResultReason.ARR_Success)
{
return false;
}
const lNbFiles: number = lExportJob.getFileCount();
console.log('The export procedure consists in ' + lNbFiles + ' files');
if(lNbFiles < 1)
{
// not enough files ?
// => should not happen
return false;
}
// wait for everything to be computed
// we could have waited for a specific file with an asyncWaitForFinished(item)
const lExportResult : AsyncResultReason = await lExportJob.asyncWaitForFinished();
if(lExportResult !== AsyncResultReason.ARR_Success)
{
return false;
}
// file is ready
// claim for a download url for file 0
console.log('retrieving file ' + lExportJob.getFilename(0));
await lExportJob.asyncGetDownloadURL(0);
const lUrl : string | undefined = lExportJob.getDownloadURL(0);
if(lUrl === undefined)
{
return false;
}
// trigger a download of the file
onDownloadReady(lUrl);
return true;
};

startExportProcedure();

Please make sure the destination browser supports promises before using async calls.

Please note that the DataSessionInterface MUST NOT be closed before retrieving the final result, since closing the given DataSessionInterface will cancel the export procedure and get rid of the exported data.


AsyncJobs

interface ExportJobInterface {
    addEventListener(pType, pListener, pObject): string;
    addEventListener(pType, pListener): string;
    areSignalsBlocked(): boolean;
    asyncGetDownloadURL(pFileOffset): Promise<AsyncExportURLResult>;
    asyncWaitForFileCount(): Promise<AsyncResultReason>;
    asyncWaitForFinished(pFileOffset?): Promise<AsyncResultReason>;
    blockSignals(pBlock): void;
    cancel(pFileOffset?): boolean;
    computeDownloadURL(pFileOffset): boolean;
    dispose(): void;
    getCompressionScheme(pFileOffset): string;
    getCreationDate(): number;
    getDownloadSize(pFileOffset): number;
    getDownloadURL(pFileOffset): string;
    getExportId(): string;
    getFileCount(): number;
    getFileExtension(pFileOffset): string;
    getFileId(pFileOffset): string;
    getFileProgress(pFileOffset): number;
    getFileState(pFileOffset): ExportState;
    getFileType(pFileOffset): string;
    getFilename(pFileOffset): string;
    getFinalFileSize(pFileOffset): number;
    getInfiniteObjectType(): InfiniteObjectType;
    getLastError(pFileOffset?): InfiniteError;
    getOutputFormat(): Export3DOutputFormatInterface | Export2DOutputFormatInterface | ExportSVGOutputFormatInterface;
    hasEventListener(pType, pListener): boolean;
    hasEventListenerById(pId): boolean;
    isCancelled(pFileOffset?): boolean;
    isDisposed(): boolean;
    isExportSuccess(pFileOffset): boolean;
    isRunning(pFileOffset?): boolean;
    removeAllEventListeners(): boolean;
    removeEventListener(pType, pListener, pObject): boolean;
    removeEventListener(pType, pListener): boolean;
    removeEventListenerById(pId): boolean;
    setExportId(pExportId): void;
}

Hierarchy (view full)

Methods

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal. It is possible to add an object that will be included in the callback to avoid creating too many closures. Calling twice addEventListener with the same parameters results in the second call to be ignored, only unique pairs callback / object are allowed, in order to avoid calling multiple times the same thing.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.
    • pObject: Object
      in
      The optional object the callback will be called with when the given event fires.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Adds a listener to an event type.

    When an event of the type pType fires, the callback pListener will be called. This function returns a unique string id that may be used in removeEventListenerById to allow simple listener removal.

    Parameters

    • pType: string
      in
      The type of the event pListener will be called upon.
    • pListener: tListenerCallback
      in
      The listener function that fires when the given event type occurs.

    Returns string

    The id of the inserted callback (actually an UUID).

  • Tells if signals sent by the object are blocked or not.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Returns boolean

    true if signals are blocked.

  • Asynchronously gets the download URL of the given file.

    Such a call must be made when isRunning is false and the export procedure for the given file was successful.

    Returns a promise.

    The promise contains a valid URL when :

    • the export procedure for the given file is finished and successful.
    • the URL has been successfully retrieved from the backend.

    If this returns a valid URL, then a simple http GET request to this URL will return the content of the export procedure.

    Parameters

    • pFileOffset: number
      in
      The file offset to compute the download url to.

    Returns Promise<AsyncExportURLResult>

    A promise that contains the download URL to use to get the result of the file of the export procedure.

  • Asynchronous - Waits for the export procedure to compute the number of required files to fulfill the request.

    After waiting for the promise, then getFileCount will get the number of files of the export procedure.

    Returns Promise<AsyncResultReason>

    A promise.

  • Asynchronous - Waits for the export procedure to complete (be it successful, erroneous or cancelled).

    If pResultOffset is undefined, the promise is signalled when all files are ready. If pResultOffset is positive and inferior to the file count, the promise is signalled when the given file is ready, but you may call asyncWaitForFileCount before.

    When the export procedure is completed, the promise is resolved with the result of the export file procedure.

    Parameters

    • Optional pFileOffset: number
      in
      The file offset to wait for, or all files if undefined.

    Returns Promise<AsyncResultReason>

    A promise.

  • Blocks / Unblocks all signals sent by the object.

    If signals are blocked, no signal will be emitted nor buffered, such signal will be lost.

    Parameters

    • pBlock: boolean
      in
      If set to true, all further signals will be silently discarded.

    Returns void

  • Cancels the computation of the given file of the export process (if running).

    If pFileOffset is undefined, then all the files of the export procedure are cancelled. If pFileOffset is set and in the range [0, getFileCount() - 1], then the given file export will be cancelled.

    A ExportJobInterfaceSignal.ExportJobCancelled signal is emitted if the ExportJobInterface is running.

    Parameters

    • Optional pFileOffset: number
      in
      The file offset of the file to cancel, or undefined to cancel all files.

    Returns boolean

    true if the ExportJobInterface was running and cancelled by the call, else false.

  • If the export is finished and successful, triggers the calculation of the download URL of the given file.

    If the export is not finished or not successful, returns false. If computeDownloadURL has already been called, returns false. The URL is ready when the ExportJobInterfaceSignal.ExportJobURLReady event is fired and then getDownloadURL can be called. The URL has a very short life span, so the download procedure from the browser should be started right after ExportJobInterfaceSignal.ExportJobURLReady event is fired (and if successful).

    Parameters

    • pFileOffset: number
      in
      The file offset to compute the download url to.

    Returns boolean

    true if the download URL computing is launched.

  • Gets the compression scheme of the export procedure of the given file.

    Returns a string telling the compression scheme of the file inside the export procedure. An empty string means that the compression scheme is unknown.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns string

    The compression scheme of the export procedure.

  • Gets the timestamp of the creation of the export job.

    Returns the number of milliseconds elapsed since the epoch.

    Returns number

    The the number of milliseconds elapsed since the epoch.

  • Gets the final size of the export procedure of the given file.

    Returns a number telling the final download size of the file inside the export procedure. A '-1' value means that the size is unknown.

    The download size is the number of bytes that will be downloaded from the server, but since this stream is compressed, getDownloadSize may be significantly lower than getFinalFileSize.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns number

    The download size of the export procedure.

  • Gets the download URL once ExportJobInterfaceSignal.ExportJobURLReady event is fired.

    Returns a valid URL when :

    If this returns a valid URL, then a simple http GET request to this URL will return the content of the export procedure.

    Parameters

    • pFileOffset: number
      in
      The file offset to retrieve the download url to.

    Returns string

    The download URL to use to get the result of the export procedure.

  • Gets the final extension of the export procedure of the given file.

    Returns a string telling the extension of the file inside the export procedure. An empty string means that the extension is unknown.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns string

    The file extension of the export procedure.

  • Gets the unique file id that has been set by the export procedure for the given file.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns string

    The unique file id for the given file of the export procedure.

  • Gets the progress of the export procedure of the given file.

    Returns a number in the [0,1] range telling the progress of the file inside the export procedure.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns number

    The progress of the export procedure.

  • Gets the file type that has been set by the export procedure for the given file.

    The file type is not an extension, but a more generic info such as 'export2d', 'export3d', 'exportsvg.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns string

    The filename for the given file of the export procedure.

  • Gets the filename that has been set by the export procedure for the given file.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns string

    The filename for the given file of the export procedure.

  • Gets the final file size of the export procedure of the given file.

    This will be the size that will be reported by the operating system for the given file.

    Returns a number telling the final file size of the file inside the export procedure. A '-1' value means that the size is unknown.

    getFinalFileSize may be significantly greater that getDownloadSize depending on the file content.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns number

    The file size of the export procedure.

  • Gets the last error of the export procedure.

    If pFileOffset is undefined, this gets the first error in the files request. If pFileOffset is set and in the range [0, getFileCount() - 1], the error of the given file export procedure is returned.

    Parameters

    • Optional pFileOffset: number
      in
      The file offset of the file to query, or undefined to query the first error.

    Returns InfiniteError

    The last error (if any, or undefined if no error occurred).

  • Tells if the EventDispatcher has such a callback registered for the given event type.

    Parameters

    • pType: string
      in
      The type of the event to test.
    • pListener: tListenerCallback
      in
      The listener function that gets tested.

    Returns boolean

    true if such a listener is installed for the given type of event.

  • Tells if the EventDispatcher has such a callback registered for the given callback id.

    Parameters

    • pId: string
      in
      The id of the callback to test.

    Returns boolean

    true if such a listener is installed for the given callback id.

  • Tells if the ExportJobInterface has been cancelled for the given file.

    This is generally the case after calling cancel when the ExportJobInterface is running.

    If pFileOffset is set, this returns true if the given file is cancelled. If pFileOffset is undefined, this returns if at least one file is cancelled.

    Parameters

    • Optional pFileOffset: number
      in
      The file offset of the file to query, or undefined to tell if at least one file is cancelled.

    Returns boolean

    true if the ExportJobInterface is cancelled.

  • Tells if the the given file of the export procedure can be downloaded.

    Returns true if the export procedure has successfully processed the given file.

    Parameters

    • pFileOffset: number
      in
      The file offset of the file to query.

    Returns boolean

    true if the export procedure has successfully processed the given file.

  • Tells if the export procedure for the given file is running.

    This is the case before ExportJobInterfaceSignal.ExportJobURLReady event is fired.

    If pFileOffset is set, this tells of the export procedure is running for the given file. If pFileOffset is undefined, this tells if any file export procedure is running.

    Parameters

    • Optional pFileOffset: number

      The file offset of the file to query, or undefined to tell if at least one file export procedure is running.

    Returns boolean

    true if the export procedure is running.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    • pObject: Object

      The listener object that was used when addEventListener was called.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener from an event type.

    If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.

    Parameters

    • pType: string
      in
      The type of the listener that gets removed.
    • pListener: tListenerCallback

      The listener function that gets removed.

    Returns boolean

    true if the callback was removed else false.

  • Removes a listener by its id.

    If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.

    Parameters

    • pId: string
      in
      The id returned by the call to addEventListener that you want to remove.

    Returns boolean

    true if the callback was removed else false.

  • Sets the identifier of the ExportJobInterface.

    Make sure the id is unique. A unique ExportJobInterface identifier is automatically created if the identifier is not overridden.

    Parameters

    • pExportId: string
      in
      The new identifier of the ExportJobInterface.

    Returns void