Package org.cyclos.impl.system
Class GeneralReferenceImportHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.system.BaseImportHandlerImpl<GeneralReferenceImportedFileDTO,GeneralReferenceImportedFileData,GeneralReferenceImportedFile,GeneralReference>
-
- org.cyclos.impl.system.GeneralReferenceImportHandlerImpl
-
- All Implemented Interfaces:
ImportHandler<GeneralReferenceImportedFileDTO,GeneralReferenceImportedFileData,GeneralReferenceImportedFile,GeneralReference>
@Component public class GeneralReferenceImportHandlerImpl extends BaseImportHandlerImpl<GeneralReferenceImportedFileDTO,GeneralReferenceImportedFileData,GeneralReferenceImportedFile,GeneralReference>
Implementation forGeneralReferenceImportHandlerImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>REQUIRED_HEADERS-
Fields inherited from class org.cyclos.impl.system.BaseImportHandlerImpl
currencyService, rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description GeneralReferenceImportHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Predicate<String>getAllowedImportFieldsPredicate(GeneralReferenceImportedFile importedFile)Returns a predicate that evaluates true for a field allowed to be importedGeneralReferenceImportedFileDatagetData(GeneralReferenceImportedFile importedFile)Returns the data associated to an importClass<GeneralReference>getEntityClass()Returns the class of the imported entityClass<GeneralReferenceImportedFile>getImportedFileClass()Returns the imported file classImportTypegetImportType()Returns the type of imports handled by this classList<String>getKeywordFields()Returns a list of field names that can be used to search for imported linesSet<String>getMissingRequiredFields(GeneralReferenceImportedFile importedFile, List<String> headers)Return the fields that are required and are not present in the given headers.List<ImportField>getSearchImportedLineFields()Returns the list of fields that will be used to show the information of import lines.ObjectinstantiateContext()Returns an import context that will be used in the validation and processing of each import line.GeneralReferenceImportedFilenewImportedFile(GeneralReferenceImportedFileDTO dto)Instantiates anImportedFilea new entity based on a dtoGeneralReferenceprocessImportedLine(ImportedLine importedLine, Object processContext)Imports an entity with the information in the imported line and returns the imported entity.ValidatorresolveValidator(GeneralReferenceImportedFileDTO dto)Returns a new validator for the import.voidvalidateImportedLine(ImportedLine importedLine, Object context)Validates the imported line-
Methods inherited from class org.cyclos.impl.system.BaseImportHandlerImpl
fieldName, find, finishImport, getImportField, locateUser, locateUser, parseAmount, parseBoolean, parseDate, parseDateTime
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
getAllowedImportFieldsPredicate
public Predicate<String> getAllowedImportFieldsPredicate(GeneralReferenceImportedFile importedFile)
Description copied from interface:ImportHandlerReturns a predicate that evaluates true for a field allowed to be imported
-
getData
public GeneralReferenceImportedFileData getData(GeneralReferenceImportedFile importedFile)
Description copied from interface:ImportHandlerReturns the data associated to an import
-
getEntityClass
public Class<GeneralReference> getEntityClass()
Description copied from interface:ImportHandlerReturns the class of the imported entity
-
getImportedFileClass
public Class<GeneralReferenceImportedFile> getImportedFileClass()
Description copied from interface:ImportHandlerReturns the imported file class
-
getImportType
public ImportType getImportType()
Description copied from interface:ImportHandlerReturns the type of imports handled by this class
-
getKeywordFields
public List<String> getKeywordFields()
Description copied from interface:ImportHandlerReturns a list of field names that can be used to search for imported lines
-
getMissingRequiredFields
public Set<String> getMissingRequiredFields(GeneralReferenceImportedFile importedFile, List<String> headers)
Description copied from interface:ImportHandlerReturn the fields that are required and are not present in the given headers.
-
getSearchImportedLineFields
public List<ImportField> getSearchImportedLineFields()
Description copied from interface:ImportHandlerReturns the list of fields that will be used to show the information of import lines.
-
instantiateContext
public Object instantiateContext()
Description copied from interface:ImportHandlerReturns an import context that will be used in the validation and processing of each import line.
-
newImportedFile
public GeneralReferenceImportedFile newImportedFile(GeneralReferenceImportedFileDTO dto)
Description copied from interface:ImportHandlerInstantiates anImportedFilea new entity based on a dto
-
processImportedLine
public GeneralReference processImportedLine(ImportedLine importedLine, Object processContext)
Description copied from interface:ImportHandlerImports an entity with the information in the imported line and returns the imported entity.
-
resolveValidator
public Validator resolveValidator(GeneralReferenceImportedFileDTO dto)
Description copied from interface:ImportHandlerReturns a new validator for the import.
-
validateImportedLine
public void validateImportedLine(ImportedLine importedLine, Object context) throws ValidationException
Description copied from interface:ImportHandlerValidates the imported line- Throws:
ValidationException
-
-