Class ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
- Object
-
- ImportExcelInJobRequestBuilder
-
- Enclosing class:
- ImportExcelInJobRequest
public static final class ImportExcelInJobRequest.ImportExcelInJobRequestBuilder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
batchSize(int batchSize)
Sets the size of the batch.ImportExcelInJobRequest
build()
ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
deleteFile(boolean deleteFile)
Sets whether the Excel file should be deleted after the import job is finished, regardless of the result.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
file(File file)
Sets the Excel file to upload.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
fileId(UUID fileId)
Sets theid
of uploaded Excel file.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
fileName(String fileName)
Sets the name of the Excel file to upload.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
headerRow(boolean headerRow)
Sets whether the first row of the imported Excel sheet is the header.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
sendNotification(boolean sendNotification)
Sets whether job status notification should be sent.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
sheetIndex(Integer sheetIndex)
Sets the index of the Excel sheet.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
sheetName(String sheetName)
Sets the name of the Excel sheet.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
simulation(boolean simulation)
Sets whether the import should be triggered as a simulation.ImportExcelInJobRequest.ImportExcelInJobRequestBuilder
template(String template)
Sets the template that should be used for parsing and importing the contents of the Excel file.
-
-
-
Method Detail
-
sheetName
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder sheetName(String 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder sheetIndex(Integer 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder headerRow(boolean 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder template(String 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder fileId(UUID 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder file(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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder fileName(String 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder deleteFile(boolean 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
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder batchSize(int batchSize)
Sets the size of the batch. The default value is1000
.- Parameters:
batchSize
- the size of the batch
-
simulation
public ImportExcelInJobRequest.ImportExcelInJobRequestBuilder simulation(boolean 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
public ImportExcelInJobRequest build()
-
-