Class ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
- Enclosing class:
ImportExcelInJobRequest
-
Method Summary
Modifier and TypeMethodDescriptionbatchSize
(int batchSize) Sets the size of the batch.build()
deleteFile
(boolean deleteFile) Sets whether the Excel file should be deleted after the import job is finished, regardless of the result.Sets the Excel file to upload.Sets theid
of uploaded Excel file.Sets the name of the Excel file to upload.headerRow
(boolean headerRow) Sets whether the first row of the imported Excel sheet is the header.sendNotification
(boolean sendNotification) Sets whether job status notification should be sent.sheetIndex
(Integer sheetIndex) Sets the index of the Excel sheet.Sets the name of the Excel sheet.simulation
(boolean simulation) Sets whether the import should be triggered as a simulation.Sets the template that should be used for parsing and importing the contents of the Excel file.
-
Method Details
-
sheetName
Sets the name of the Excel sheet.If the name is
null
andImportExcelInJobRequest.sheetIndex
isnull
, the first sheet of the workbook will be used for the import.If the name is
null
andImportExcelInJobRequest.sheetIndex
is notnull
, the sheet with the index specified by value ofImportExcelInJobRequest.sheetIndex
will be used for the import.- Parameters:
sheetName
- the name of the sheet
-
sheetIndex
Sets the index of the Excel sheet.If the index is
null
andImportExcelInJobRequest.sheetName
isnull
, the first sheet of the workbook will be used for the import.If the index is
null
andImportExcelInJobRequest.sheetName
is notnull
, the sheet with the name specified by value ofImportExcelInJobRequest.sheetName
will be used for the import.- Parameters:
sheetIndex
- the index of the sheet
-
headerRow
Sets whether the first row of the imported Excel sheet is the header. The default value isfalse
.- Parameters:
headerRow
- whether the first row of the imported Excel sheet is the header
-
template
Sets the template that should be used for parsing and importing the contents of the Excel file.There is one placeholder currently supported:
- ${x} - refers to the x-th column in the Excel file (with numbering starting from 0, e.g. ${0}, ${1}, ...)
Example of a correct JSON template:
[ { "identifier": { "name": "${0}", "domain": { "name": "${1}", "community": { "name": "Some Community" } } }, "attributes" : { "00000000-0000-0000-0000-000000003115" : [ { "value" : "${2}" } ], "00000000-0000-0000-0000-000000000222" : [ { "value" : "${3}" } ] }, "resourceType": "Asset" } ]
- Parameters:
template
- the template that should be used for parsing and importing the contents of the Excel file
-
fileId
Sets theid
of uploaded Excel file.NOTE: if this field is used,
FileImportRequest.file
should not be set.- Parameters:
fileId
- theid
of uploaded Excel file
-
file
Sets the Excel file to upload. If set, then alsoFileImportRequest.fileName
should be provided.NOTE: if this field is used,
FileImportRequest.fileId
should not be set.- Parameters:
file
- the Excel file to upload
-
fileName
Sets the name of the Excel file to upload. If set, then alsoFileImportRequest.file
should be provided.NOTE: if this field is used,
FileImportRequest.fileId
should not be set.- Parameters:
fileName
- the name of the Excel file to upload
-
deleteFile
Sets whether the Excel file should be deleted after the import job is finished, regardless of the result. The default value isfalse
.NOTE: if the Excel file corresponds to an attachment, the attachment will be deleted. When import operation fails then file will not be deleted.
- Parameters:
deleteFile
- whether the Excel file should be deleted after the import job is finished
-
sendNotification
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder sendNotification(boolean sendNotification) Sets whether job status notification should be sent. The default value isfalse
.- Parameters:
sendNotification
- whether job status notification should be sent
-
batchSize
Sets the size of the batch. The default value is1000
.- Parameters:
batchSize
- the size of the batch
-
simulation
Sets whether the import should be triggered as a simulation. The default value isfalse
.If
true
, the result of the import simulation will be available at the end of the job but no change will be applied to the DGC.- Parameters:
simulation
- whether the import should be triggered as a simulation
-
build
-