Salesforce

Utility panels

« Go Back
Information
Utility panels
000004110
Public
Product Selection
aiWare - aiWare
Article Details

One utility panel is available in the aiWARE SDK:

Local machine importer panel

Local machine importer uploads files from your local machine to aiWARE. With local machine importer, you can upload up to 1000 files at a time.

Panel format

The local machine importer has 2 objects. They use this format:

const microFrontend = {
    name: 'DATA_CENTER_IMPORTER',
    config: {
    fileLimit: 50
    },
};

const panelConfig = {
    type: 'APP_BAR_PANEL_TEMPLATE',
    marginTop: 55,
    marginStart: 80,
    size: 'large',
    zIndex: 1000,
    dimmed: 0,
};

Properties

The Local machine importer panel has these properties:

microFrontend

NameRequiredTypeDescription
nameTrueStringThe name of the component. Must be 'DATA_CENTER_IMPORTER'.
configTrueObject (config)The properties of the panel that handle or interact with data.

config

NameRequiredTypeDescription
fileLimitFalseNumberThe number of files a user can upload at once. Min is 1, max is 1000. Defaults to 100.
fileEditMetadataFalseBooleanCan the user modify the metadata once uploaded.  Default: true
panelTitleFalseStringThe title of the panel. Default: Local Machine Importer
titleFalseStringThe title below the panel title. Default: Local Machine
titleSubTextFalseStringThe text right below the title. Default: Choose files from your computer to import into your account.
locationFolderTitleFalseStringThe location folder title Default: Location Folder
locationFolderSubTextFalseStringThe location subtitle right below the location title. Default: Choose the Data Center folder location where this content will be stored.
locationFolderInputLabelFalseStringThe input label for Folder. Default: Folder

panelConfig

NameRequiredTypeDescription
typeTrueStringThe panel type. Must be 'APP_BAR_PANEL_TEMPLATE'.
marginTopFalseNumberThe top margin of the panel.
marginStartFalseNumberThe right margin of the panel.
sizeFalseStringThe width of the panel in pixels. Can be small, medium, large, xlarge, or xxlarge. Each value is defined in getWidth().
zIndexFalseNumberThe z-index of the panel.
dimmedFalseNumberThe number of panels that slide over this panel in the UI. The number affects how much this panel is dimmed.

Events

Local machine importer has these events:

fileUpload

fileUpload runs when a file is uploaded.

aiware.on("fileUpload", function(error, data) {
});

fileUpload returns either a data object or an error object.

Response

data: {
    expiresInSeconds: number,
    file: file,
    getUrl: string,
    id: string,
    key: string,
    unsignedUrl: string,
    url: string
}

The data object has these properties:

NameTypeDescription
expiresInSecondsnumberThe number of seconds until the file expires.
fileFileA File object.
getUrlstringA signed URL that can be used with HTTP GET to retrieve the new resource.
idstringThe unique ID of the file.
keystringThe storage object key.
unsignedUrlstringThe unsigned, base URL to the object, which can be safely persisted and re-signed later by a client with the necessary storage credentials.
urlstringThe signed URL, which you can upload to with HTTP PUT. HTTP POST won't work.

fileUploadProgress

fileUploadProgress runs while a file is uploading.

aiware.on("fileUploadProgress", function(error, file) {
});

fileUploadProgress returns either a data object or an error object.

Response

data: {
    fileId: number,
    progress: number
}

The data object has these properties.

NameTypeDescription
fileIdnumberThe ID of the file that's uploading.
progressnumberThe percentage of the file that has been uploaded.

tdoCreated

tdoCreated runs when the Import button is clicked.

aiware.on("tdoCreated", function(error, tdo) {
});

tdoCreated returns either a data object or an error object.

Response

data: {
    fileId: number, 
    tdoId: number
}

The data object has these properties:

NameTypeDescription
fileIdnumberThe ID of the file that's uploading.
tdoIdnumberThe ID of the TDO created for this file.
  • To learn how to work with panels, see Panels in the aiWARE SDK
  • For more information about the error object for the Local Machine Importer panel, see Error objects (External link).
  • For more information about the file object for the Local Machine Importer panel, see File object (External link).
  • For more information a about TDOs, see TDO.
Additional Technical Documentation Information
Properties
1/31/2025 7:25 PM
1/31/2025 7:26 PM
1/31/2025 7:26 PM
Documentation
Documentation
000004110
Translation Information
English

Powered by