public abstract class BMECatImportStep extends GeneratedBMECatImportStep
BMECatObjectProcessor instance processes the xml file and calls
initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob) before any data object
is read and
importBMECatObject(de.hybris.platform.bmecat.parser.Catalog, AbstractValueObject, BMECatImportCronJob) for
each BMECat value object provided by the actual parser.| Modifier and Type | Class and Description |
|---|---|
protected class |
BMECatImportStep.DefaultBMECatObjectProcessor
Default implementation of the BMECat object processor.
|
GenericItem.GenericItemImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static String |
XML_MIME_TYPE |
static String |
ZIP_MIME_TYPE |
DEFAULT_INITIAL_ATTRIBUTESBATCHJOB, CODE, CRONJOBPENDINGSTEPSRELATION_MARKMODIFIED, CRONJOBPENDINGSTEPSRELATION_SRC_ORDERED, CRONJOBPENDINGSTEPSRELATION_TGT_ORDERED, CRONJOBPROCESSEDSTEPSRELATION_MARKMODIFIED, CRONJOBPROCESSEDSTEPSRELATION_SRC_ORDERED, CRONJOBPROCESSEDSTEPSRELATION_TGT_ORDERED, ERRORMODE, PENDINGCRONJOBS, PROCESSEDCRONJOBS, SEQUENCENUMBER, SYNCHRONOUSLANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
BMECatImportStep() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canPerform(CronJob cronJob)
Tells wether this step is able to perform for the given cronJob or not.
|
Keyword |
createKeyword(BMECatImportCronJob cronJob,
String keyword,
Language lang)
Creates an new
Keyword for the given CatalogVersion and keyword value. |
protected BMECatObjectProcessor |
createProcessor(BMECatImportCronJob cronJob)
Creates the
BMECatObjectProcessor instance which should call
initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob) before any data
object is read and
importBMECatObject(de.hybris.platform.bmecat.parser.Catalog, AbstractValueObject, BMECatImportCronJob)
for each BMECat value object provided by the actual parser. |
protected void |
customizeImport(BMECatParser parser)
Overwrite this method to add own
TagListener to HEADER, ARTICLE or
CATALOG_STRUCTURE. |
protected void |
finalizeStep(CronJob cronJob)
Methods gives step the possibility to act before the step is finished.
|
protected BMECatManager |
getBMECatManager() |
protected CatalogManager |
getCatalogManager() |
int |
getCompletedCount(BMECatImportCronJob cronJob) |
int |
getCompletionStatus(BMECatImportCronJob cronJob)
Overwrite to provide a completion status for this currently processed step.
|
protected InputStream |
getData(JobMedia jobMedia)
Gets the BMECat xml file which will be parsed
|
protected Collection |
getOrCreateKeywords(BMECatImportCronJob cronJob,
Collection keywordValues)
Gets or creates
Keywords for every keyword value that is passed as parameter |
protected Product |
getProduct(CatalogVersion catalogVersion,
String articleID)
Returns a product for a specified catalag version and id
|
int |
getTotalToComplete(BMECatImportCronJob cronJob) |
protected abstract void |
importBMECatObject(Catalog catalog,
AbstractValueObject object,
BMECatImportCronJob cronJob)
Called once for each parsed BMECat value object except the
Catalog
itself, which is passed to
initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob)instead. |
protected abstract void |
initializeBMECatImport(Catalog catalog,
BMECatImportCronJob cronJob)
Called once per step to pass information about the importing catalog before all object will be processed
|
boolean |
isAbortable()
Identifies bmecat import steps as abortable by default
|
protected void |
performStep(CronJob cronJob)
Performs
BMECatImportCronJob by creating a BMECat 1.2 Sax parser around the
media data attached to the cronJob. |
void |
remove(SessionContext ctx)
Removes this item.
|
protected void |
undoStep(CronJob cronJob)
Removes all keywords created by this step for the specified cronJob.
|
protected void |
writeToFile(File file,
InputStream inputStream)
Writes an input stream to a file
|
getDefaultAttributeModesaddChange, canUndo, createItem, debug, error, fatal, getChanges, getChanges, getChanges, getChanges, getFailErrorMode, getIgnoreErrorMode, getMostRecentChange, getNonInitialAttributes, getPauseErrorMode, hasChanges, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isWarnEnabled, log, setNonInitialAttributes, toString, warngetBatchJob, getBatchJob, getCode, getCode, getErrorMode, getErrorMode, getSequenceNumber, getSequenceNumber, getSequenceNumberAsPrimitive, getSequenceNumberAsPrimitive, isSynchronous, isSynchronous, isSynchronousAsPrimitive, isSynchronousAsPrimitive, setBatchJob, setBatchJob, setCode, setCode, setErrorMode, setErrorMode, setSequenceNumber, setSequenceNumber, setSequenceNumber, setSequenceNumber, setSynchronous, setSynchronous, setSynchronous, setSynchronousgetInitialPropertiesgetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, readResolve, refreshRemote, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacegetImplementation, setTenantpublic static final String XML_MIME_TYPE
public static final String ZIP_MIME_TYPE
public void remove(SessionContext ctx) throws ConsistencyCheckException
Item
This method is using the following attributes of the given SessionContext:
| CacheUsage | Language | StagingMethod | ||
|---|---|---|---|---|
| n/a (this is a setter method) | no, language doesn't matter for removal | yes if called on a StageableItem, no otherwise |
remove in class Itemctx - A SessionContext objectConsistencyCheckException - if this item could not be removed for some reasonprotected InputStream getData(JobMedia jobMedia)
jobMedia - BMECat xml fileprotected void writeToFile(File file, InputStream inputStream)
file - file that the content is written toinputStream - content that will is writtenprotected void performStep(CronJob cronJob) throws AbortCronJobException
BMECatImportCronJob by creating a BMECat 1.2 Sax parser around the
media data attached to the cronJob.
First initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob)is called to
pass all informations about the BMECat catalog of the imported document. Afterwards
importBMECatObject(de.hybris.platform.bmecat.parser.Catalog, AbstractValueObject, BMECatImportCronJob) is
called for any other BMECat data object.
performStep in class StepcronJob - the CronJob which is used for executionAbortCronJobException - if the execution is aborted due to an errorStep.canPerform(CronJob)protected void finalizeStep(CronJob cronJob)
protected BMECatObjectProcessor createProcessor(BMECatImportCronJob cronJob)
BMECatObjectProcessor instance which should call
initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob) before any data
object is read and
importBMECatObject(de.hybris.platform.bmecat.parser.Catalog, AbstractValueObject, BMECatImportCronJob)
for each BMECat value object provided by the actual parser.cronJob - the cronJob which is currently executedBMECatProcessor instancepublic int getCompletionStatus(BMECatImportCronJob cronJob)
getCompletedCount(BMECatImportCronJob) and
getTotalToComplete(BMECatImportCronJob) are implemented, -1 otherwisepublic int getCompletedCount(BMECatImportCronJob cronJob)
public int getTotalToComplete(BMECatImportCronJob cronJob)
protected abstract void initializeBMECatImport(Catalog catalog, BMECatImportCronJob cronJob) throws ParseAbortException
catalog - object which holds information about the BMECat catalog tagcronJob - context under which this step isParseAbortExceptionprotected abstract void importBMECatObject(Catalog catalog, AbstractValueObject object, BMECatImportCronJob cronJob) throws ParseAbortException
Catalog
itself, which is passed to
initializeBMECatImport(de.hybris.platform.bmecat.parser.Catalog, BMECatImportCronJob)instead.catalog - the parsed catalog dataobject - the parsed value objectcronJob - the cronJob which executes the current importParseAbortExceptionpublic boolean canPerform(CronJob cronJob)
As default this method returns true.
canPerform in class StepcronJob - protected BMECatManager getBMECatManager()
protected CatalogManager getCatalogManager()
protected Product getProduct(CatalogVersion catalogVersion, String articleID)
catalogVersion - articleID - protected Collection getOrCreateKeywords(BMECatImportCronJob cronJob, Collection keywordValues)
Keywords for every keyword value that is passed as parametercronJob - context of search/creation which provides catalogversion and keyword typekeywordValues - collection of keyword names (Strings)Keywordspublic Keyword createKeyword(BMECatImportCronJob cronJob, String keyword, Language lang)
Keyword for the given CatalogVersion and keyword value.cronJob - The BMECatImportCronJob in which this step is executedkeyword - The keyword value.Keyword for the given CatalogVersion and keyword value.protected void undoStep(CronJob cronJob)
undoStep in class StepcronJob - context of step executionStep.canUndo(CronJob)protected void customizeImport(BMECatParser parser)
TagListener to HEADER, ARTICLE or
CATALOG_STRUCTURE.parser - bmecat parser which process the tagspublic boolean isAbortable()
isAbortable in class Steptrue, if this Step is abortableStep.isAbortable()Copyright © 2017 SAP SE. All Rights Reserved.