@Deprecated
public class ItemCopyContext
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
UNIQUE_PREFIX
Deprecated.
|
| Constructor and Description |
|---|
ItemCopyContext(SessionContext ctx,
Level logLevel,
boolean forceUpdate)
Deprecated.
|
| Modifier and Type | Method and 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.
|
Item |
copy(Item original)
Deprecated.
|
protected Item |
copy(ItemCopyCreator parent,
Item original)
Deprecated.
|
protected Item |
copy(ItemCopyCreator parent,
Item original,
Item copyToUpdate)
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 new
ItemCopyCreatoris 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 call addCreationAttribute(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 by
splitDescriptors(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 by
splitDescriptors(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(Item original)
Deprecated.
since ages
|
protected boolean |
isCurrentlyCopying(PK original)
Deprecated.
|
boolean |
isDebugEnabled()
Deprecated.
|
boolean |
isErrorEnabled()
Deprecated.
|
boolean |
isInfoEnabled()
Deprecated.
|
protected boolean |
isPartOf(AttributeDescriptor attributeDescriptor)
Deprecated.
Used by
splitDescriptors(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,
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 a
TypeCopyDescriptor. |
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.
|
protected static final java.lang.String UNIQUE_PREFIX
public ItemCopyContext(SessionContext ctx, Level logLevel, boolean forceUpdate)
protected final Item toItem(long lpk)
protected final int getMediaTypeCode()
protected void setSavePrevousValues(boolean setSaveOn)
public boolean isSavePrevousValues()
protected void log(java.lang.String message,
Level level)
public void debug(java.lang.String message)
public void info(java.lang.String message)
public void warn(java.lang.String message)
public void error(java.lang.String message)
public boolean isDebugEnabled()
public boolean isInfoEnabled()
public boolean isWarnEnabled()
public boolean isErrorEnabled()
public final SessionContext getCtx()
protected java.util.Set<AttributeDescriptor> getCreationAttributes()
GeneratedCatalogConstants.Attributes.Product.CATALOGVERSIONCatalogConstants.Attributes.Category.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Media.CATALOGVERSIONGeneratedKeyword.CATALOGVERSIONGeneratedCatalogConstants.Attributes.Product.VARIANTTYPEGeneratedVariantProduct.BASEPRODUCTGeneratedProduct.UNITaddCreationAttribute(AttributeDescriptor) to add own creation attributes.protected final java.lang.String translateAD(AttributeDescriptor attributeDescriptor)
protected final void addCreationAttribute(AttributeDescriptor attributeDescriptor)
public final boolean started()
public void processPendingReferences()
protected final PK transformCacheKey(java.lang.Object object)
protected final java.util.Set<PK> transformCacheKeys(java.util.Set objects)
protected AttributeCopyCreator createAttributeCopyCreator(ItemCopyCreator icc, AttributeCopyDescriptor acd, boolean ispreset, java.lang.Object sourceValue)
protected java.lang.Object translate(AttributeCopyCreator acc)
protected java.util.Set<Item> collectPartOfItemsToCopy(AttributeCopyCreator acc)
protected java.util.Map<Item,Item> copyPartOfValues(AttributeCopyCreator acc)
protected final java.util.Collection allItems(AttributeCopyCreator acc, java.lang.Object value)
protected final java.util.Collection allItems(AttributeCopyCreator acc, java.lang.Object value, java.util.Collection valuesSoFar, boolean localized)
protected boolean isUntranslatable(AttributeCopyCreator acc, Item original)
protected boolean isUpToDate(ItemCopyCreator parentCC, Item original, Item copy)
original - copy - protected boolean mustBeTranslated(AttributeCopyCreator acc, Item original)
acc - original - protected final java.lang.Object translateValue(AttributeCopyCreator acc, java.lang.Object original, java.util.Map<Item,Item> partOfMappings, boolean localized)
protected Item translateValue(AttributeCopyCreator acc, Item original, java.util.Map<Item,Item> partOfMappings)
protected final void registerPendingReference(AttributeCopyCreator acc, Item waitingFor)
@Deprecated protected final boolean isCurrentlyCopying(Item original)
protected final boolean isCurrentlyCopying(PK original)
protected final void pushCurrentlyCopying(ItemCopyCreator icc)
protected final void popCurrentlyCopying(ItemCopyCreator icc)
protected Item getCopy(java.lang.Object source)
protected final boolean hasCopy(java.lang.Object source)
public final boolean isAlreadyCopied(Item src)
protected final void addCopiedItem(PK source, PK copy)
Use this method to pre-fill a copy context with already copied items.
source - the source item as either Item, PK or PK Stringcopy - the target item as either Item, PK or PK Stringprotected final void checkPendingReferences(PK key)
protected void beforeCopying(ItemCopyCreator icc)
protected void finishedCopying(ItemCopyCreator icc)
protected Item copy(ItemCopyCreator parent, Item original)
protected Item copy(ItemCopyCreator parent, Item original, Item copyToUpdate)
protected java.util.Map getCopyCreatorPresetValues(Item original, Item copyToUpdate)
protected java.util.Set getCopyCreatorBlacklist(Item original, Item toUpdate)
protected java.util.Set getCopyCreatorWhitelist(Item original, Item toUpdate)
protected Item findExistingCopyToUpdate(ItemCopyCreator parentCreator, Item original, boolean asPartOf)
ItemCopyCreatoris 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.parentCreator - original - asPartOf - public final TypeCopyDescriptor getTypeCopyDescriptor(ComposedType type)
protected TypeCopyDescriptor createCopyDescriptor(ComposedType composedType)
TypeCopyDescriptor. Called by
getTypeCopyDescriptor(ComposedType).composedType - protected boolean ignoreAttribute(AttributeDescriptor attributeDescriptor, java.lang.String qualifier)
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be
ignored or not. By default this will apply to Item.TYPEonly. Override to define own ignored attributes.attributeDescriptor - qualifier - protected boolean isPartOf(AttributeDescriptor attributeDescriptor)
splitDescriptors(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.public boolean forceCopy(AttributeDescriptor attributeDescriptor)
protected boolean isAtomic(AttributeDescriptor attributeDescriptor)
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just
atomic values. This will call isAtomic(Type, boolean)for analyzing the real attribute type.protected final boolean isAtomic(Type attributeType, boolean localized)
attributeType - the argument type to checklocalized - whether or not the attribute is localizedprotected boolean isRequiredForCreation(AttributeDescriptor attributeDescriptor)
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.
attributeDescriptor - the attribute descriptor to determine creation status forprotected final java.util.Set<AttributeCopyDescriptor>[] splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType)
TypeCopyDescriptor. It must split all attribute descriptors into 4
different sets:
tcd - the newly created type copy descriptorcomposedType - the actual composed typeAttributeCopyDescriptors.protected java.lang.String toString(AttributeDescriptor attributeDescriptor)
protected java.lang.String valuesToString(java.util.Map attributeValues)
protected java.lang.String safeToString(java.lang.Object attributeValue)
public void cleanup()
Copyright © 2018 SAP SE. All Rights Reserved.