Class DefaultSpreadsheetWorkbookDataValidatorDelegate
java.lang.Object
com.ptc.windchill.ixb.importer.custom.validator.delegate.DefaultSpreadsheetWorkbookDataValidatorDelegate
- All Implemented Interfaces:
SpreadsheetWorkbookDataValidatorDelegate
public class DefaultSpreadsheetWorkbookDataValidatorDelegate
extends Object
implements SpreadsheetWorkbookDataValidatorDelegate
The class provides the default implementation the custom validation hook for validating at Workbook level for adding validations across sheets.
The implementation must extend this class for adding custom validations at workbook level.
Custom warnings or exceptions thrown from custom validation logic should adhere to pattern mentioned below.
They should add warnings or exceptions to single list with all details, which will be returned by API getErrorsOrWarnings().
Supported API: true
Extendable: true
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(String exceptionMsg, boolean isWarning) This method provides adds Exceptions to single collection which can be thrown during custom validations.voidaddException(String sheetName, String rowNumber, String exceptionMsg, boolean isWarning) This method provides adds Exceptions or Warnings to single collection which can be thrown during custom validations.voidaddException(String sheetName, String rowNumber, WTException customExceptionOrWarning) This method provides adds Exceptions or Warnings to single collection which can be thrown during custom validations.voidaddException(WTException customExceptionOrWarning) This method provides adds Exceptions to single collection which can be thrown during custom validations.This method returns list of custom warnings or exceptions thrown by custom logic during validations.voidvalidateFieldsForAllSheetsInWorkbook(Map<String, Map<String, Map<String, Map>>> trackableToElementsMap, Locale locale) This method provides the custom validation for the entire workbook.
-
Method Details
-
validateFieldsForAllSheetsInWorkbook
public void validateFieldsForAllSheetsInWorkbook(Map<String, Map<String, throws WTExceptionMap<String, Map>>> trackableToElementsMap, Locale locale) This method provides the custom validation for the entire workbook. The specifics of validation is left to customer's implementation where customer will have access to entire workbook data and group of sheets along with all rows present in given sheet.
Supported API: true- Specified by:
validateFieldsForAllSheetsInWorkbookin interfaceSpreadsheetWorkbookDataValidatorDelegate- Parameters:
trackableToElementsMap- This will give all import data in form of Map of ImportType as key, and value is Map of SheetNames against RowInformation. This is again a Map with RowNumber as key and RowData as value. Import type can be PART,BOM etc.locale-allWorkbookSheetDataAlongWithAllRows- This will give all import data in form of Mapinvalid input: '<'ImportType, ArrayListinvalid input: '<'Mapinvalid input: '<'SheetName, Mapinvalid input: '<'RowNumber,RowData>>>>, Where import type can be PART,BOM etc.- Throws:
WTException
-
addException
public void addException(String sheetName, String rowNumber, String exceptionMsg, boolean isWarning) throws WTException This method provides adds Exceptions or Warnings to single collection which can be thrown during custom validations.
Supported API: true- Parameters:
sheetName- Name of current sheet being importedrowNumber- row Number of given row being validatedexceptionMsg- Localized exception message to be givenisWarning- If true, then Warning would be reported, else will be treated as Error- Throws:
WTException
-
addException
public void addException(String sheetName, String rowNumber, WTException customExceptionOrWarning) throws WTException This method provides adds Exceptions or Warnings to single collection which can be thrown during custom validations.
Supported API: true- Parameters:
sheetName- Name of current sheet being importedrowNumber- row Number of given row being validatedcustomExceptionOrWarning- Exception to be thrown to Import Framework- Throws:
WTException
-
addException
This method provides adds Exceptions to single collection which can be thrown during custom validations.
Supported API: true- Parameters:
exceptionMsg- Localized exception message to be givenisWarning- If true, then Warning would be reported, else will be treated as Error- Throws:
WTException
-
addException
This method provides adds Exceptions to single collection which can be thrown during custom validations.
Supported API: true- Parameters:
customExceptionOrWarning- Exception to be thrown to Import Framework- Throws:
WTException
-
getErrorsOrWarnings
This method returns list of custom warnings or exceptions thrown by custom logic during validations. Custom implementation should override this API to return warnings or exceptions to be shown on Import from Spreadsheet UI.
Supported API: true- Specified by:
getErrorsOrWarningsin interfaceSpreadsheetWorkbookDataValidatorDelegate- Returns:
- List
List of exceptions/warnings thrown from custom logic, to be returned to ImportService - Throws:
WTException
-