Class ItemCopyContext
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.copy.ItemCopyContext
-
- Direct Known Subclasses:
GenericCatalogCopyContext
@Deprecated public class ItemCopyContext extends java.lang.ObjectDeprecated.since agesItemCopyContext
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringUNIQUE_PREFIXDeprecated.
-
Constructor Summary
Constructors Constructor Description ItemCopyContext(SessionContext ctx, org.apache.log4j.Level logLevel, boolean forceUpdate)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCopiedItem(PK source, PK copy)Deprecated.Adds a source - to - target item mapping without processing pending references.protected voidaddCreationAttribute(AttributeDescriptor attributeDescriptor)Deprecated.protected java.util.CollectionallItems(AttributeCopyCreator acc, java.lang.Object value)Deprecated.protected java.util.CollectionallItems(AttributeCopyCreator acc, java.lang.Object value, java.util.Collection valuesSoFar, boolean localized)Deprecated.protected voidbeforeCopying(ItemCopyCreator icc)Deprecated.protected voidcheckPendingReferences(PK key)Deprecated.voidcleanup()Deprecated.protected java.util.Set<Item>collectPartOfItemsToCopy(AttributeCopyCreator acc)Deprecated.protected Itemcopy(ItemCopyCreator parent, Item original)Deprecated.protected Itemcopy(ItemCopyCreator parent, Item original, Item copyToUpdate)Deprecated.Itemcopy(Item original)Deprecated.Itemcopy(Item original, Item existingCopy)Deprecated.protected voidcopyMediaData(Media src, Media tgt)Deprecated.protected java.util.Map<Item,Item>copyPartOfValues(AttributeCopyCreator acc)Deprecated.protected AttributeCopyCreatorcreateAttributeCopyCreator(ItemCopyCreator icc, AttributeCopyDescriptor acd, boolean ispreset, java.lang.Object sourceValue)Deprecated.protected TypeCopyDescriptorcreateCopyDescriptor(ComposedType composedType)Deprecated.Creates a new type copy descriptor instance.voiddebug(java.lang.String message)Deprecated.voiderror(java.lang.String message)Deprecated.protected ItemfindExistingCopyToUpdate(ItemCopyCreator parentCreator, Item original, boolean asPartOf)Deprecated.This method is called every time a newItemCopyCreatoris instantiated.protected voidfinishedCopying(ItemCopyCreator icc)Deprecated.booleanforceCopy(AttributeDescriptor attributeDescriptor)Deprecated.protected ItemgetCopy(java.lang.Object source)Deprecated.Retrieves Items, PKs and Strings from cache and translated them into items again.protected java.util.SetgetCopyCreatorBlacklist(Item original, Item toUpdate)Deprecated.protected java.util.MapgetCopyCreatorPresetValues(Item original, Item copyToUpdate)Deprecated.protected java.util.SetgetCopyCreatorWhitelist(Item original, Item toUpdate)Deprecated.protected java.util.Set<AttributeDescriptor>getCreationAttributes()Deprecated.Makes sure the following attribute are set during item creation although they are item references (normally item references are translated and set after creating the copy):GeneratedCatalogConstants.Attributes.Product.CATALOGVERSIONCatalogConstants.Attributes.Category.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Media.CATALOGVERSIONGeneratedKeyword.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Product.VARIANTTYPEGeneratedVariantProduct.BASEPRODUCTGeneratedProduct.UNITOverride or calladdCreationAttribute(AttributeDescriptor)to add own creation attributes.SessionContextgetCtx()Deprecated.protected intgetMediaTypeCode()Deprecated.TypeCopyDescriptorgetTypeCopyDescriptor(ComposedType type)Deprecated.Returns a (cached) type copy descriptor for a given composed type.protected booleanhasCopy(java.lang.Object source)Deprecated.protected booleanignoreAttribute(AttributeDescriptor attributeDescriptor, java.lang.String qualifier)Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be ignored or not.voidinfo(java.lang.String message)Deprecated.booleanisAlreadyCopied(Item src)Deprecated.protected booleanisAtomic(AttributeDescriptor attributeDescriptor)Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just atomic values.protected booleanisAtomic(Type attributeType, boolean localized)Deprecated.Traverses collection and map types to find any non-atomic type within.protected booleanisCurrentlyCopying(PK original)Deprecated.protected booleanisCurrentlyCopying(Item original)Deprecated.since agesbooleanisDebugEnabled()Deprecated.booleanisErrorEnabled()Deprecated.booleanisInfoEnabled()Deprecated.protected booleanisPartOf(AttributeDescriptor attributeDescriptor)Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf values.protected booleanisRequiredForCreation(AttributeDescriptor attributeDescriptor)Deprecated.Determines whether or not a attribute is required for the creation of a item copy.booleanisSavePrevousValues()Deprecated.protected booleanisUntranslatable(AttributeCopyCreator acc, Item original)Deprecated.protected booleanisUpToDate(ItemCopyCreator parentCC, Item original, Item copy)Deprecated.Tells whether a item pair is up to date and must not be updated right now.booleanisWarnEnabled()Deprecated.protected voidlog(java.lang.String message, org.apache.log4j.Level level)Deprecated.Default log implementation using a Log4J appender.protected booleanmustBeTranslated(AttributeCopyCreator acc, Item original)Deprecated.Tells whether a original item should be translated into its copied counterpart.protected voidpopCurrentlyCopying(ItemCopyCreator icc)Deprecated.voidprocessPendingReferences()Deprecated.protected voidpushCurrentlyCopying(ItemCopyCreator icc)Deprecated.protected voidregisterCopy(PK source, PK copy)Deprecated.protected voidregisterPendingReference(AttributeCopyCreator acc, Item waitingFor)Deprecated.protected java.lang.StringsafeToString(java.lang.Object attributeValue)Deprecated.protected voidsetSavePrevousValues(boolean setSaveOn)Deprecated.protected java.util.Set<AttributeCopyDescriptor>[]splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType)Deprecated.Called during the creation of aTypeCopyDescriptor.booleanstarted()Deprecated.protected ItemtoItem(long lpk)Deprecated.protected ItemtoItem(PK pk)Deprecated.protected java.lang.StringtoString(AttributeDescriptor attributeDescriptor)Deprecated.protected PKtransformCacheKey(java.lang.Object object)Deprecated.protected java.util.Set<PK>transformCacheKeys(java.util.Set objects)Deprecated.protected java.lang.Objecttranslate(AttributeCopyCreator acc)Deprecated.protected java.lang.StringtranslateAD(AttributeDescriptor attributeDescriptor)Deprecated.protected ItemtranslateValue(AttributeCopyCreator acc, Item original, java.util.Map<Item,Item> partOfMappings)Deprecated.protected java.lang.ObjecttranslateValue(AttributeCopyCreator acc, java.lang.Object original, java.util.Map<Item,Item> partOfMappings, boolean localized)Deprecated.protected java.lang.StringvaluesToString(java.util.Map attributeValues)Deprecated.voidwarn(java.lang.String message)Deprecated.
-
-
-
Field Detail
-
UNIQUE_PREFIX
protected static final java.lang.String UNIQUE_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ItemCopyContext
public ItemCopyContext(SessionContext ctx, org.apache.log4j.Level logLevel, boolean forceUpdate)
Deprecated.
-
-
Method Detail
-
toItem
protected final Item toItem(long lpk)
Deprecated.
-
getMediaTypeCode
protected final int getMediaTypeCode()
Deprecated.
-
setSavePrevousValues
protected void setSavePrevousValues(boolean setSaveOn)
Deprecated.
-
isSavePrevousValues
public boolean isSavePrevousValues()
Deprecated.
-
log
protected void log(java.lang.String message, org.apache.log4j.Level level)Deprecated.Default log implementation using a Log4J appender.
-
debug
public void debug(java.lang.String message)
Deprecated.
-
info
public void info(java.lang.String message)
Deprecated.
-
warn
public void warn(java.lang.String message)
Deprecated.
-
error
public void error(java.lang.String message)
Deprecated.
-
isDebugEnabled
public boolean isDebugEnabled()
Deprecated.
-
isInfoEnabled
public boolean isInfoEnabled()
Deprecated.
-
isWarnEnabled
public boolean isWarnEnabled()
Deprecated.
-
isErrorEnabled
public boolean isErrorEnabled()
Deprecated.
-
getCtx
public final SessionContext getCtx()
Deprecated.
-
getCreationAttributes
protected java.util.Set<AttributeDescriptor> getCreationAttributes()
Deprecated.Makes sure the following attribute are set during item creation although they are item references (normally item references are translated and set after creating the copy):GeneratedCatalogConstants.Attributes.Product.CATALOGVERSIONCatalogConstants.Attributes.Category.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Media.CATALOGVERSIONGeneratedKeyword.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Product.VARIANTTYPEGeneratedVariantProduct.BASEPRODUCTGeneratedProduct.UNIT
addCreationAttribute(AttributeDescriptor)to add own creation attributes.
-
translateAD
protected final java.lang.String translateAD(AttributeDescriptor attributeDescriptor)
Deprecated.
-
addCreationAttribute
protected final void addCreationAttribute(AttributeDescriptor attributeDescriptor)
Deprecated.
-
started
public final boolean started()
Deprecated.- Returns:
- true if at least one item was copied or is currently being copied.
-
processPendingReferences
public void processPendingReferences()
Deprecated.
-
transformCacheKey
protected final PK transformCacheKey(java.lang.Object object)
Deprecated.
-
transformCacheKeys
protected final java.util.Set<PK> transformCacheKeys(java.util.Set objects)
Deprecated.
-
createAttributeCopyCreator
protected AttributeCopyCreator createAttributeCopyCreator(ItemCopyCreator icc, AttributeCopyDescriptor acd, boolean ispreset, java.lang.Object sourceValue)
Deprecated.
-
translate
protected java.lang.Object translate(AttributeCopyCreator acc)
Deprecated.
-
collectPartOfItemsToCopy
protected java.util.Set<Item> collectPartOfItemsToCopy(AttributeCopyCreator acc)
Deprecated.
-
copyPartOfValues
protected java.util.Map<Item,Item> copyPartOfValues(AttributeCopyCreator acc)
Deprecated.
-
allItems
protected final java.util.Collection allItems(AttributeCopyCreator acc, java.lang.Object value)
Deprecated.
-
allItems
protected final java.util.Collection allItems(AttributeCopyCreator acc, java.lang.Object value, java.util.Collection valuesSoFar, boolean localized)
Deprecated.
-
isUntranslatable
protected boolean isUntranslatable(AttributeCopyCreator acc, Item original)
Deprecated.
-
isUpToDate
protected boolean isUpToDate(ItemCopyCreator parentCC, Item original, Item copy)
Deprecated.Tells whether a item pair is up to date and must not be updated right now.- Parameters:
original-copy-- Returns:
- true if item is up to date
-
mustBeTranslated
protected boolean mustBeTranslated(AttributeCopyCreator acc, Item original)
Deprecated.Tells whether a original item should be translated into its copied counterpart. By default this applies to all items which are currently being copied ( means all parent items of a partOf item ) and all previously copied items.- Parameters:
acc-original-- Returns:
- a boolean
-
translateValue
protected final java.lang.Object translateValue(AttributeCopyCreator acc, java.lang.Object original, java.util.Map<Item,Item> partOfMappings, boolean localized)
Deprecated.
-
translateValue
protected Item translateValue(AttributeCopyCreator acc, Item original, java.util.Map<Item,Item> partOfMappings)
Deprecated.
-
registerPendingReference
protected final void registerPendingReference(AttributeCopyCreator acc, Item waitingFor)
Deprecated.
-
isCurrentlyCopying
@Deprecated protected final boolean isCurrentlyCopying(Item original)
Deprecated.since ages
-
isCurrentlyCopying
protected final boolean isCurrentlyCopying(PK original)
Deprecated.
-
pushCurrentlyCopying
protected final void pushCurrentlyCopying(ItemCopyCreator icc)
Deprecated.
-
popCurrentlyCopying
protected final void popCurrentlyCopying(ItemCopyCreator icc)
Deprecated.
-
getCopy
protected Item getCopy(java.lang.Object source)
Deprecated.Retrieves Items, PKs and Strings from cache and translated them into items again.
-
hasCopy
protected final boolean hasCopy(java.lang.Object source)
Deprecated.
-
isAlreadyCopied
public final boolean isAlreadyCopied(Item src)
Deprecated.
-
addCopiedItem
protected final void addCopiedItem(PK source, PK copy)
Deprecated.Adds a source - to - target item mapping without processing pending references. These items are considered as being copied before.Use this method to pre-fill a copy context with already copied items.
- Parameters:
source- the source item as either Item, PK or PK Stringcopy- the target item as either Item, PK or PK String
-
checkPendingReferences
protected final void checkPendingReferences(PK key)
Deprecated.
-
beforeCopying
protected void beforeCopying(ItemCopyCreator icc)
Deprecated.
-
finishedCopying
protected void finishedCopying(ItemCopyCreator icc)
Deprecated.
-
copy
protected Item copy(ItemCopyCreator parent, Item original)
Deprecated.
-
copy
protected Item copy(ItemCopyCreator parent, Item original, Item copyToUpdate)
Deprecated.
-
getCopyCreatorPresetValues
protected java.util.Map getCopyCreatorPresetValues(Item original, Item copyToUpdate)
Deprecated.
-
getCopyCreatorBlacklist
protected java.util.Set getCopyCreatorBlacklist(Item original, Item toUpdate)
Deprecated.
-
getCopyCreatorWhitelist
protected java.util.Set getCopyCreatorWhitelist(Item original, Item toUpdate)
Deprecated.
-
findExistingCopyToUpdate
protected Item findExistingCopyToUpdate(ItemCopyCreator parentCreator, Item original, boolean asPartOf)
Deprecated.This method is called every time a newItemCopyCreatoris instantiated. It allows to find automatically an existing copy of a given original item. If such one exists the copy process will update it instead of creating a new one.- Parameters:
parentCreator-original-asPartOf-- Returns:
- the copyitem
-
getTypeCopyDescriptor
public final TypeCopyDescriptor getTypeCopyDescriptor(ComposedType type)
Deprecated.Returns a (cached) type copy descriptor for a given composed type.
-
createCopyDescriptor
protected TypeCopyDescriptor createCopyDescriptor(ComposedType composedType)
Deprecated.Creates a new type copy descriptor instance. By default this will create aTypeCopyDescriptor. Called bygetTypeCopyDescriptor(ComposedType).- Parameters:
composedType-
-
ignoreAttribute
protected boolean ignoreAttribute(AttributeDescriptor attributeDescriptor, java.lang.String qualifier)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be ignored or not. By default this will apply toItem.TYPEonly. Override to define own ignored attributes.- Parameters:
attributeDescriptor-qualifier-- Returns:
- true if the attribute should not be included in type copy informations (so it cannot be copied)
-
isPartOf
protected boolean isPartOf(AttributeDescriptor attributeDescriptor)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf values. These values are always copied (created or translated if already existing) when the original item is being copied.
-
forceCopy
public boolean forceCopy(AttributeDescriptor attributeDescriptor)
Deprecated.
-
isAtomic
protected boolean isAtomic(AttributeDescriptor attributeDescriptor)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just atomic values. This will callisAtomic(Type, boolean)for analyzing the real attribute type.
-
isAtomic
protected final boolean isAtomic(Type attributeType, boolean localized)
Deprecated.Traverses collection and map types to find any non-atomic type within. If localized is true and the attribute type is a map type it ignores the argument type - however nested map types are fully searched subsequently.- Parameters:
attributeType- the argument type to checklocalized- whether or not the attribute is localized- Returns:
- true if the argument type is a atomic type or a collection or map type containing atomic types only
-
isRequiredForCreation
protected boolean isRequiredForCreation(AttributeDescriptor attributeDescriptor)
Deprecated.Determines whether or not a attribute is required for the creation of a item copy. These attributes cannot be delayed, which requires that all values must be translatable or preset.If no item is actually created but an existing copy is updated these attributes are set alltogether before all partOf references and other attributes. Delaying is neither allowed here.
- Parameters:
attributeDescriptor- the attribute descriptor to determine creation status for- Returns:
- true if the attribute is required for item creation
-
splitDescriptors
protected final java.util.Set<AttributeCopyDescriptor>[] splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType)
Deprecated.Called during the creation of aTypeCopyDescriptor. It must split all attribute descriptors into 4 different sets:- initial writable only
- initial
- partOf attributes
- other (mostly reference) attributes
- Parameters:
tcd- the newly created type copy descriptorcomposedType- the actual composed type- Returns:
- an array of 4 sets holding
AttributeCopyDescriptors.
-
toString
protected java.lang.String toString(AttributeDescriptor attributeDescriptor)
Deprecated.
-
valuesToString
protected java.lang.String valuesToString(java.util.Map attributeValues)
Deprecated.
-
safeToString
protected java.lang.String safeToString(java.lang.Object attributeValue)
Deprecated.
-
cleanup
public void cleanup()
Deprecated.
-
-