Class ItemCopyContext
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.copy.ItemCopyContext
-
- Direct Known Subclasses:
GenericCatalogCopyContext
@Deprecated public class ItemCopyContext extends java.lang.Object
Deprecated.since agesItemCopyContext
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
UNIQUE_PREFIX
Deprecated.
-
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 void
addCopiedItem(PK source, PK copy)
Deprecated.Adds a source - to - target item mapping without processing pending references.protected void
addCreationAttribute(AttributeDescriptor attributeDescriptor)
Deprecated.protected java.util.Collection
allItems(AttributeCopyCreator acc, java.lang.Object value)
Deprecated.protected java.util.Collection
allItems(AttributeCopyCreator acc, java.lang.Object value, java.util.Collection valuesSoFar, boolean localized)
Deprecated.protected void
beforeCopying(ItemCopyCreator icc)
Deprecated.protected void
checkPendingReferences(PK key)
Deprecated.void
cleanup()
Deprecated.protected java.util.Set<Item>
collectPartOfItemsToCopy(AttributeCopyCreator acc)
Deprecated.protected Item
copy(ItemCopyCreator parent, Item original)
Deprecated.protected Item
copy(ItemCopyCreator parent, Item original, Item copyToUpdate)
Deprecated.Item
copy(Item original)
Deprecated.Item
copy(Item original, Item existingCopy)
Deprecated.protected void
copyMediaData(Media src, Media tgt)
Deprecated.protected java.util.Map<Item,Item>
copyPartOfValues(AttributeCopyCreator acc)
Deprecated.protected AttributeCopyCreator
createAttributeCopyCreator(ItemCopyCreator icc, AttributeCopyDescriptor acd, boolean ispreset, java.lang.Object sourceValue)
Deprecated.protected TypeCopyDescriptor
createCopyDescriptor(ComposedType composedType)
Deprecated.Creates a new type copy descriptor instance.void
debug(java.lang.String message)
Deprecated.void
error(java.lang.String message)
Deprecated.protected Item
findExistingCopyToUpdate(ItemCopyCreator parentCreator, Item original, boolean asPartOf)
Deprecated.This method is called every time a newItemCopyCreator
is instantiated.protected void
finishedCopying(ItemCopyCreator icc)
Deprecated.boolean
forceCopy(AttributeDescriptor attributeDescriptor)
Deprecated.protected Item
getCopy(java.lang.Object source)
Deprecated.Retrieves Items, PKs and Strings from cache and translated them into items again.protected java.util.Set
getCopyCreatorBlacklist(Item original, Item toUpdate)
Deprecated.protected java.util.Map
getCopyCreatorPresetValues(Item original, Item copyToUpdate)
Deprecated.protected java.util.Set
getCopyCreatorWhitelist(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.CATALOGVERSION
CatalogConstants.Attributes.Category.CATALOGVERSION
GeneratedCatalogConstants.Attributes.Media.CATALOGVERSION
GeneratedKeyword.CATALOGVERSION
GeneratedCatalogConstants.Attributes.Product.VARIANTTYPE
GeneratedVariantProduct.BASEPRODUCT
GeneratedProduct.UNIT
Override or calladdCreationAttribute(AttributeDescriptor)
to add own creation attributes.SessionContext
getCtx()
Deprecated.protected int
getMediaTypeCode()
Deprecated.TypeCopyDescriptor
getTypeCopyDescriptor(ComposedType type)
Deprecated.Returns a (cached) type copy descriptor for a given composed type.protected boolean
hasCopy(java.lang.Object source)
Deprecated.protected boolean
ignoreAttribute(AttributeDescriptor attributeDescriptor, java.lang.String qualifier)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)
to determine whether an attribute may be ignored or not.void
info(java.lang.String message)
Deprecated.boolean
isAlreadyCopied(Item src)
Deprecated.protected boolean
isAtomic(AttributeDescriptor attributeDescriptor)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)
to determine whether an attribute holds just atomic values.protected boolean
isAtomic(Type attributeType, boolean localized)
Deprecated.Traverses collection and map types to find any non-atomic type within.protected boolean
isCurrentlyCopying(PK original)
Deprecated.protected boolean
isCurrentlyCopying(Item original)
Deprecated.since agesboolean
isDebugEnabled()
Deprecated.boolean
isErrorEnabled()
Deprecated.boolean
isInfoEnabled()
Deprecated.protected boolean
isPartOf(AttributeDescriptor attributeDescriptor)
Deprecated.Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)
to determine whether an attribute holds partOf values.protected boolean
isRequiredForCreation(AttributeDescriptor attributeDescriptor)
Deprecated.Determines whether or not a attribute is required for the creation of a item copy.boolean
isSavePrevousValues()
Deprecated.protected boolean
isUntranslatable(AttributeCopyCreator acc, Item original)
Deprecated.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.boolean
isWarnEnabled()
Deprecated.protected void
log(java.lang.String message, org.apache.log4j.Level level)
Deprecated.Default log implementation using a Log4J appender.protected boolean
mustBeTranslated(AttributeCopyCreator acc, Item original)
Deprecated.Tells whether a original item should be translated into its copied counterpart.protected void
popCurrentlyCopying(ItemCopyCreator icc)
Deprecated.void
processPendingReferences()
Deprecated.protected void
pushCurrentlyCopying(ItemCopyCreator icc)
Deprecated.protected void
registerCopy(PK source, PK copy)
Deprecated.protected void
registerPendingReference(AttributeCopyCreator acc, Item waitingFor)
Deprecated.protected java.lang.String
safeToString(java.lang.Object attributeValue)
Deprecated.protected void
setSavePrevousValues(boolean setSaveOn)
Deprecated.protected java.util.Set<AttributeCopyDescriptor>[]
splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType)
Deprecated.Called during the creation of aTypeCopyDescriptor
.boolean
started()
Deprecated.protected Item
toItem(long lpk)
Deprecated.protected Item
toItem(PK pk)
Deprecated.protected java.lang.String
toString(AttributeDescriptor attributeDescriptor)
Deprecated.protected PK
transformCacheKey(java.lang.Object object)
Deprecated.protected java.util.Set<PK>
transformCacheKeys(java.util.Set objects)
Deprecated.protected java.lang.Object
translate(AttributeCopyCreator acc)
Deprecated.protected java.lang.String
translateAD(AttributeDescriptor attributeDescriptor)
Deprecated.protected Item
translateValue(AttributeCopyCreator acc, Item original, java.util.Map<Item,Item> partOfMappings)
Deprecated.protected java.lang.Object
translateValue(AttributeCopyCreator acc, java.lang.Object original, java.util.Map<Item,Item> partOfMappings, boolean localized)
Deprecated.protected java.lang.String
valuesToString(java.util.Map attributeValues)
Deprecated.void
warn(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.CATALOGVERSION
CatalogConstants.Attributes.Category.CATALOGVERSION
GeneratedCatalogConstants.Attributes.Media.CATALOGVERSION
GeneratedKeyword.CATALOGVERSION
GeneratedCatalogConstants.Attributes.Product.VARIANTTYPE
GeneratedVariantProduct.BASEPRODUCT
GeneratedProduct.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 newItemCopyCreator
is 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.TYPE
only. 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.
-
-