Reference Source
public class | source

Server

Default server client which loads content for a BIMViewer via HTTP from the file system.

A BIMViewer is instantiated with an instance of this class.

To load content from an alternative source, instantiate BIMViewer with your own custom implementation of this class.

Constructor Summary

Public Constructor
public

constructor(cfg: *)

Constructs a Server.

Method Summary

Public Methods
public

getGeometry(projectId: String, modelId: String, done: Function, error: Function)

Gets geometry for a model within a project.

public

getIssues(projectId: String, modelId: String, done: Function, error: Function)

Gets existing issues for a model within a project.

public

getMetadata(projectId: String, modelId: String, done: Function, error: Function)

Gets metadata for a model within a project.

public

getObjectInfo(projectId: String, modelId: String, objectId: String, done: Function, error: Function)

Gets metadata for an object within a model within a project.

public

getProject(projectId: String, done: Function, error: Function)

Gets information for a project.

public

getProjects(done: Function, error: Function)

Gets information on all available projects.

public

getSplitModelGeometry(projectId: String, modelId: String, geometryFileName: String, done: Function, error: Function)

Gets one of the XKT geometry files within a split model within a project.

public

getSplitModelManifest(projectId: String, modelId: String, manifestName: String, done: Function, error: Function)

Gets a JSON manifest file for a model that's split into multiple XKT files (and maybe also JSON metadata files).

The manifest can have an arbitrary name, and will list all the XKT (and maybe separate JSON metada files) that comprise the model.

public

getSplitModelMetadata(projectId: String, modelId: String, metadataFileName: String, done: Function, error: Function)

Gets one of the metadata files within a split model within a project.

Public Constructors

public constructor(cfg: *) source

Constructs a Server.

Params:

NameTypeAttributeDescription
cfg *
  • optional

Server configuration.

cfg.dataDir String
  • optional

Base directory for content.

Public Methods

public getGeometry(projectId: String, modelId: String, done: Function, error: Function) source

Gets geometry for a model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getIssues(projectId: String, modelId: String, done: Function, error: Function) source

Gets existing issues for a model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getMetadata(projectId: String, modelId: String, done: Function, error: Function) source

Gets metadata for a model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getObjectInfo(projectId: String, modelId: String, objectId: String, done: Function, error: Function) source

Gets metadata for an object within a model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

objectId String

ID of the object.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getProject(projectId: String, done: Function, error: Function) source

Gets information for a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getProjects(done: Function, error: Function) source

Gets information on all available projects.

Params:

NameTypeAttributeDescription
done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getSplitModelGeometry(projectId: String, modelId: String, geometryFileName: String, done: Function, error: Function) source

Gets one of the XKT geometry files within a split model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

geometryFileName String

Filename of the XKT geometry file.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getSplitModelManifest(projectId: String, modelId: String, manifestName: String, done: Function, error: Function) source

Gets a JSON manifest file for a model that's split into multiple XKT files (and maybe also JSON metadata files).

The manifest can have an arbitrary name, and will list all the XKT (and maybe separate JSON metada files) that comprise the model.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

manifestName String

Filename of the manifest.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.

public getSplitModelMetadata(projectId: String, modelId: String, metadataFileName: String, done: Function, error: Function) source

Gets one of the metadata files within a split model within a project.

Params:

NameTypeAttributeDescription
projectId String

ID of the project.

modelId String

ID of the model.

metadataFileName String

Filename of the metadata file.

done Function

Callback through which the JSON result is returned.

error Function

Callback through which an error message is returned on error.