Package de.hybris.platform.impex.jalo
Class ImpExManager
java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.extension.Extension
de.hybris.platform.impex.jalo.GeneratedImpExManager
de.hybris.platform.impex.jalo.ImpExManager
- All Implemented Interfaces:
ItemLifecycleListener,Serializable
This is the extension manager of the ImpEx extension. Here you can create default import or export cronjobs as well
as performing an import or export using pre-defined methods.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProviderNested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator -
Field Summary
Fields inherited from class de.hybris.platform.impex.jalo.GeneratedImpExManager
DEFAULT_INITIAL_ATTRIBUTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia (all Items of the System).createDefaultExportCronJob(ImpExExportJob impexExportJob, HeaderLibrary headerlibrary, Collection<Item> items) Creates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia with the given list (null for all Items of the System).Creates an export cronjob with given export configuration.createDefaultExportCronJob(HeaderLibrary headerlibrary, Collection<Item> items) Creates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia with the given list (null for all Items of the System).Creates a cronjob instance.createDefaultImpExImportCronJob(ImpExImportJob impexImportJob) Creates a cronjob instance.voidcreateEssentialData(Map params, JspContext jspc) createImpExExportMedia(String code) Creates anImpExExportMediawith given code.createImpExMedia(String code) Creates anImpExMediawith given code.createImpExMedia(String code, EnumerationValue encoding) Creates anImpExMediawith given code and default encoding.createImpExMedia(String code, String encoding) Creates anImpExMediawith given code and default encoding as well as CSV as mime type.createImpExMedia(String code, String encoding, InputStream content) Creates anImpExMediawith given code, default encoding and content as well as CSV as mime type.createImpExMedia(String code, String encoding, String content) Creates anImpExMediawith given code, default encoding and content as well as CSV as mime type.createImpExMediaForCodeAndExtractionId(String code, String extractionId) createItem(String type, String attributes, String values) Creates any item using ImpEx specific syntax.exportData(ImpExExportCronJob cronJob, boolean synchronous) Exports data using givenImpExExportCronJobinstance.exportData(ExportConfiguration config, boolean synchronous) Exports data using a newImpExExportCronJobinstance.exportData(ExportConfiguration config, HeaderLibrary library, Collection<Item> items, boolean synchronous) Exports data using a newImpExExportCronJobinstance.exportDataLight(ExportConfiguration config) Exports data without using a cronjob.
ATTENTION: No logs are available except of these fired to the log4j system.exportDataLight(ExportConfiguration config, HeaderLibrary library, Collection<Item> items) Exports data without using a cronjob.
ATTENTION: No logs are available except of these fired to the log4j system.static EnumerationValueGathers the enumeration value for the export only validation mode.static EnumerationValueGathers the enumeration value for the relaxed export validation mode.static EnumerationValueGathers the enumeration value for the strict export validation mode.Gets the impex specificMediaFolderused for storing data of ImpExMedia.static EnumerationValueGathers the enumeration value for the relaxed import validation mode.static EnumerationValueGathers the enumeration value for the strict import validation mode.static ImpExManagerGets the singleton instance of this manager.Gets (or creates) the centralImpExExportJobinstance.Gets the central import job instance or creates it if not existent already.static EnumerationValuegetValidationMode(String code) Gathers the enumeration value for given validation mode.importData(ImpExImportCronJob cronJob, boolean synchronous, boolean removeOnSuccess) Imports data using givenImpExImportCronJobinstance.importData(ImpExMedia media, ImpExMedia zipMedia, Collection<ImpExMedia> externalData, boolean codeexecution, boolean synchronous, boolean removeOnSuccess) Imports data using a newImpExImportCronJobinstance.importData(ImpExMedia media, Collection<ImpExMedia> externalData, boolean codeexecution, boolean synchronous, boolean removeOnSuccess) Imports data using a newImpExImportCronJobinstance.importData(InputStream dataIs, InputStream mediaIs, String encoding, char fieldSeparator, char quoteCharacter, boolean codeexecution) Imports data using a newImpExImportCronJobinstance.importData(InputStream input, String encoding, boolean codeexecution) Imports data using a newImpExImportCronJobinstance.importData(InputStream input, String encoding, char fieldSeparator, char quoteCharacter, boolean codeexecution) Imports data using a newImpExImportCronJobinstance.importDataLight(CSVReader reader, boolean codeexecution) Imports data without using a cronjob.
Amount of maximal performed passes will be set to infinit (-1).
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of those fired to the log4j system.importDataLight(CSVReader reader, boolean codeexecution, int passes) Imports data without using a cronjob.
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of these fired to the log4j system.importDataLight(InputStream input, String encoding, boolean codeexecution) Imports data without using a cronjob.
Amount of maximal performed passes will be set to infinit (-1).
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of these fired to the log4j system.isSystemType(SessionContext ctx, ComposedType item) This overridden version adds support for inheritance of the "system type" flag, i.e.Methods inherited from class de.hybris.platform.impex.jalo.GeneratedImpExManager
createDistributedImportProcess, createDistributedImportProcess, createDistributedImportSplitErrorDump, createDistributedImportSplitErrorDump, createExport, createExport, createExternalImportKey, createExternalImportKey, createHeaderLibrary, createHeaderLibrary, createImpexDocumentId, createImpexDocumentId, createImpExExportCronJob, createImpExExportCronJob, createImpExExportJob, createImpExExportJob, createImpExExportMedia, createImpExExportMedia, createImpExImportCronJob, createImpExImportCronJob, createImpExImportJob, createImpExImportJob, createImpExMedia, createImpExMedia, createImportBatch, createImportBatch, createImportBatchContent, createImportBatchContent, createReport, createReport, getDefaultAttributeModes, getName, isSystemType, isSystemTypeAsPrimitive, isSystemTypeAsPrimitive, setSystemType, setSystemType, setSystemType, setSystemTypeMethods inherited from class de.hybris.platform.jalo.extension.Extension
checkBeforeInitialization, checkBeforeItemRemoval, createProjectData, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, isCreatorDisabled, notifyInitializationEnd, notifyInitializationStart, notifyItemRemoval, onFirstSessionCreation, writeReplaceMethods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
Constructor Details
-
ImpExManager
public ImpExManager()
-
-
Method Details
-
getInstance
Gets the singleton instance of this manager.- Returns:
- instance of this manager
-
createDefaultExportCronJob
Creates an export cronjob with given export configuration.- Parameters:
config- export configuration- Returns:
- ImpExExportCronJob created instance
-
createDefaultExportCronJob
Creates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia (all Items of the System).- Returns:
- ImpExExportCronJob created instance
-
createDefaultExportCronJob
public ImpExExportCronJob createDefaultExportCronJob(HeaderLibrary headerlibrary, Collection<Item> items) throws ImpExException Creates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia with the given list (null for all Items of the System).- Parameters:
items- list of items to export (PK-Strings and/or Items) or null for all.- Returns:
- ImpExExportCronJob created instance
- Throws:
ImpExException
-
createDefaultExportCronJob
public ImpExExportCronJob createDefaultExportCronJob(ImpExExportJob impexExportJob, HeaderLibrary headerlibrary, Collection<Item> items) throws ImpExException Creates an export cronjob with default values including theDEST_MEDIAmedia andItemPKsMediamedia with the given list (null for all Items of the System).- Parameters:
impexExportJob- job instance set to cronjobitems- list of items to export (PK-Strings and/or Items) or null for all.- Returns:
- ImpExExportCronJob created instance
- Throws:
ImpExException
-
getOrCreateImpExExportJob
Gets (or creates) the centralImpExExportJobinstance.- Returns:
- the export job instance
-
createDefaultImpExImportCronJob
Creates a cronjob instance. As job instance the default job will be used.
Flagsingleexecutableis set to true andchangrecordingenabledis set to false.
FlagerrorModeis set toFAIL.- Returns:
- created cronjob instance
-
createDefaultImpExImportCronJob
Creates a cronjob instance. As job instance the given one is used or ifnullis given the default job will be used.
Flagsingleexecutableis set to true andchangrecordingenabledis set to false.
FlagerrorModeis set toFAIL.- Parameters:
impexImportJob- job instance the cronjob will be initialized with or null if default job will be used- Returns:
- created cronjob instance
-
getOrCreateImpExImportJob
Gets the central import job instance or creates it if not existent already.- Returns:
- import job instance
-
createImpExExportMedia
Creates anImpExExportMediawith given code.- Parameters:
code- code to use for media- Returns:
- created media
-
createImpExMedia
Creates anImpExMediawith given code. (null not allowed here)- Parameters:
code- code to use for media- Returns:
- created media
-
createImpExMediaForCodeAndExtractionId
-
createImpExMedia
Creates anImpExMediawith given code and default encoding.- Parameters:
code- code to use for mediaencoding- encoding set toencodingattribute of media- Returns:
- created media
-
createImpExMedia
public ImpExMedia createImpExMedia(String code, String encoding, InputStream content) throws UnsupportedEncodingException Creates anImpExMediawith given code, default encoding and content as well as CSV as mime type.- Parameters:
code- code to use for mediaencoding- encoding set toencodingattribute of mediacontent- content to be set to the media- Returns:
- created media
- Throws:
UnsupportedEncodingException
-
createImpExMedia
public ImpExMedia createImpExMedia(String code, String encoding, String content) throws UnsupportedEncodingException Creates anImpExMediawith given code, default encoding and content as well as CSV as mime type.- Parameters:
code- code to use for mediaencoding- encoding set toencodingattribute of mediacontent- content to be set to the media- Returns:
- created media
- Throws:
UnsupportedEncodingException
-
createImpExMedia
public ImpExMedia createImpExMedia(String code, String encoding) throws UnsupportedEncodingException Creates anImpExMediawith given code and default encoding as well as CSV as mime type.- Parameters:
code- code to use for mediaencoding- encoding set toencodingattribute of media- Returns:
- created media
- Throws:
UnsupportedEncodingException- given encoding can not be resolved to a valid encoding instance
-
createItem
Creates any item using ImpEx specific syntax. It is a simplification of an import with exactly one value line. It will be always performed an import withINSERTmode. For usage you have to give the type of the desired type, all attributes in ImpEx style you want to use (like in a header description) as well as the values for specified attributes.
The field separator to use is alwaysCSVConstants.HYBRIS_FIELD_SEPARATOR.
The quote character to use is alwaysCSVConstants.HYBRIS_QUOTE_CHARACTER.
Sample usage:Language lang = (Language) ImpExUtils.createItem("Language", "isocode; active", "testLang; false");The example call will result in an import with following script:
INSERT Language ; isocode ; active ; testLang ; false- Parameters:
type- the code of the type of the desired itemattributes- separated text with specification of all attributes used invaluesin same order (for accepted separator seeCSVConstants.DEFAULT_FIELD_SEPARATORvalues- separated text with values for all attributes as specified inattributesin same order (for accepted separator seeCSVConstants.DEFAULT_FIELD_SEPARATOR- Returns:
- created item
- Throws:
ImpExException- error while import of item
-
exportData
Exports data using givenImpExExportCronJobinstance.
The used cronjob instance will be returned for further information gathering, so check result of cronjob in error case.- Parameters:
cronJob- cronjob used for importsynchronous- start cronjob synchronous or asynchronous?- Returns:
- cronjob instance used for export
-
exportData
Exports data using a newImpExExportCronJobinstance.
The used cronjob instance will be created using given configuration. As result the resultingExportinstance is returned if successful.- Parameters:
config- export configuration to usesynchronous- start cronjob synchronous or asynchronous?- Returns:
- export instance resulting by used cronjob or null if export has failed
-
exportData
public Export exportData(ExportConfiguration config, HeaderLibrary library, Collection<Item> items, boolean synchronous) throws ImpExException Exports data using a newImpExExportCronJobinstance.
The used cronjob instance will be created using given configuration and export script created out of given library and items (seeExportUtils.createExportScript(HeaderLibrary, Collection). As result the resultingExportinstance is returned if successful.- Parameters:
config- export configuration to uselibrary- header library used for creating of the export scriptitems- list of items used for creating of the export scriptsynchronous- start cronjob synchronous or asynchronous?- Returns:
- export instance resulting by used cronjob or null if export has failed
- Throws:
ImpExException- Error while creating export script of given library and items
-
exportDataLight
public Export exportDataLight(ExportConfiguration config, HeaderLibrary library, Collection<Item> items) throws ImpExException Exports data without using a cronjob.
ATTENTION: No logs are available except of these fired to the log4j system.- Parameters:
config- export configuration to uselibrary- header library used for creating of the export scriptitems- list of items used for creating of the export script- Returns:
- export instance resulting by used cronjob or null if export has failed
- Throws:
ImpExException- Error while creating export script of given library and items
-
exportDataLight
Exports data without using a cronjob.
ATTENTION: No logs are available except of these fired to the log4j system.- Parameters:
config- export configuration to use- Returns:
- export instance resulting by used cronjob or null if export has failed
- Throws:
ImpExException- if no export script is set at config
-
importData
public ImpExImportCronJob importData(ImpExImportCronJob cronJob, boolean synchronous, boolean removeOnSuccess) Imports data using givenImpExImportCronJobinstance.
If you want to use ImpEx syntax in external files, you have to enable external syntax parsing via bean shell statements in source data.
The used cronjob instance will be returned for further information gathering ( except in removal case), so check result of cronjob in error case.- Parameters:
cronJob- cronjob used for importsynchronous- start cronjob synchronous or asynchronous?removeOnSuccess- removes the used cronjob instance on success- Returns:
- cronjob instance used for import or null if removed on success
-
importData
public ImpExImportCronJob importData(ImpExMedia media, Collection<ImpExMedia> externalData, boolean codeexecution, boolean synchronous, boolean removeOnSuccess) Imports data using a newImpExImportCronJobinstance.
If you want to use ImpEx syntax in external files, you have to enable external syntax parsing via bean shell statements in source data.
The used cronjob instance will be returned for further information gathering ( except in removal case), so check result of cronjob in error case.- Parameters:
media- input mediaexternalData- medias containing external datacodeexecution- enable code execution while importsynchronous- start cronjob synchronous or asynchronous?removeOnSuccess- removes the used cronjob instance on success- Returns:
- cronjob instance used for import or null if removed on success
-
importData
public ImpExImportCronJob importData(ImpExMedia media, ImpExMedia zipMedia, Collection<ImpExMedia> externalData, boolean codeexecution, boolean synchronous, boolean removeOnSuccess) Imports data using a newImpExImportCronJobinstance.
If you want to use ImpEx syntax in external files, you have to enable external syntax parsing via bean shell statements in source data.
The used cronjob instance will be returned for further information gathering ( except in removal case), so check result of cronjob in error case.- Parameters:
media- input mediazipMedia- input zip mediaexternalData- medias containing external datacodeexecution- enable code execution while importsynchronous- start cronjob synchronous or asynchronous?removeOnSuccess- removes the used cronjob instance on success- Returns:
- cronjob instance used for import or null if removed on success
-
importData
public ImpExImportCronJob importData(InputStream input, String encoding, char fieldSeparator, char quoteCharacter, boolean codeexecution) Imports data using a newImpExImportCronJobinstance.- Parameters:
input- input stream to source dataencoding- encoding used by source datafieldSeparator- separator used for separating CSV-fields within given streamquoteCharacter- separator used for separating CSV-fields within given streamcodeexecution- enable code execution while import- Returns:
- cronjob instance used for import or null if removed on success
-
importData
Imports data using a newImpExImportCronJobinstance.
The used cronjob will be executed synchronous and removed on success.
If you want to use ImpEx syntax in external files, you have to enable external syntax parsing via bean shell statements in source data.
The used cronjob instance will be returned for further information gathering ( except in removal case), so check result of cronjob in error case.
For further options please useimportData(ImpExMedia, Collection, boolean, boolean, boolean)orimportData(ImpExImportCronJob, boolean, boolean)directly.- Parameters:
input- input stream to source dataencoding- encoding used by source datacodeexecution- enable code execution while import- Returns:
- cronjob instance used for import or null if removed on success
-
importData
public ImpExImportCronJob importData(InputStream dataIs, InputStream mediaIs, String encoding, char fieldSeparator, char quoteCharacter, boolean codeexecution) Imports data using a newImpExImportCronJobinstance.- Parameters:
dataIs- input stream to source datamediaIs- input stream to source mediaencoding- encoding used by source datafieldSeparator- separator used for separating CSV-fields within given streamquoteCharacter- separator used for separating CSV-fields within given streamcodeexecution- enable code execution while import- Returns:
- cronjob instance used for import or null if removed on success
-
importDataLight
public Importer importDataLight(InputStream input, String encoding, boolean codeexecution) throws ImpExException Imports data without using a cronjob.
Amount of maximal performed passes will be set to infinit (-1).
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of these fired to the log4j system.- Parameters:
input- input stream to source dataencoding- encoding used by source datacodeexecution- enable code execution while import- Returns:
- for import used
Importerinstance - Throws:
ImpExException- unsupported encoding
-
importDataLight
Imports data without using a cronjob.
Amount of maximal performed passes will be set to infinit (-1).
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of those fired to the log4j system.- Parameters:
reader- reader providing source datacodeexecution- enable code execution while import- Returns:
- for import used
Importerinstance - Throws:
ImpExException- error while import
-
importDataLight
public Importer importDataLight(CSVReader reader, boolean codeexecution, int passes) throws ImpExException Imports data without using a cronjob.
For getting further informations about passed import process, the usedImporterinstance is returned.
ATTENTION: No logs are available except of these fired to the log4j system.- Parameters:
reader- providing source datacodeexecution- enable code execution while importpasses- maximal amount of import passes for resolving lines- Returns:
- for import used
Importerinstance - Throws:
ImpExException- unsupported encoding
-
isSystemType
This overridden version adds support for inheritance of the "system type" flag, i.e. sub types of a "system type" will also be system types unless they're explicitly set not to.- Overrides:
isSystemTypein classGeneratedImpExManager- Returns:
- the systemType
-
createEssentialData
- Overrides:
createEssentialDatain classExtension- Throws:
ConsistencyCheckException
-
getImpExMediaFolder
Gets the impex specificMediaFolderused for storing data of ImpExMedia.- Returns:
- folder for impex specific medias
- Since:
- 3.1-u4
-
getImportStrictMode
Gathers the enumeration value for the strict import validation mode.- Returns:
- enumeration value for strict import
-
getImportRelaxedMode
Gathers the enumeration value for the relaxed import validation mode.- Returns:
- enumeration value for relaxed import
-
getExportOnlyMode
Gathers the enumeration value for the export only validation mode.- Returns:
- enumeration value for export only mode
-
getExportReimportRelaxedMode
Gathers the enumeration value for the relaxed export validation mode.- Returns:
- enumeration value for relaxed export
-
getExportReimportStrictMode
Gathers the enumeration value for the strict export validation mode.- Returns:
- enumeration value for strict export
-
getValidationMode
Gathers the enumeration value for given validation mode.- Returns:
- enumeration value for given validation mode
-