Class ItemCopyContext

java.lang.Object
de.hybris.platform.catalog.jalo.copy.ItemCopyContext
Direct Known Subclasses:
GenericCatalogCopyContext

@Deprecated(since="ages", forRemoval=false) public class ItemCopyContext extends Object
Deprecated.
since ages
ItemCopyContext
  • Field Details

  • Constructor Details

    • ItemCopyContext

      public ItemCopyContext(SessionContext ctx, org.apache.log4j.Level logLevel, boolean forceUpdate)
      Deprecated.
  • Method Details

    • toItem

      protected final Item toItem(long lpk)
      Deprecated.
    • toItem

      protected final Item toItem(PK pk)
      Deprecated.
    • getMediaTypeCode

      protected final int getMediaTypeCode()
      Deprecated.
    • setSavePrevousValues

      protected void setSavePrevousValues(boolean setSaveOn)
      Deprecated.
    • isSavePrevousValues

      public boolean isSavePrevousValues()
      Deprecated.
    • log

      protected void log(String message, org.apache.log4j.Level level)
      Deprecated.
      Default log implementation using a Log4J appender.
    • debug

      public void debug(String message)
      Deprecated.
    • info

      public void info(String message)
      Deprecated.
    • warn

      public void warn(String message)
      Deprecated.
    • error

      public void error(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 Set<AttributeDescriptor> getCreationAttributes()
      Deprecated.
    • translateAD

      protected final 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(Object object)
      Deprecated.
    • transformCacheKeys

      protected final Set<PK> transformCacheKeys(Set objects)
      Deprecated.
    • createAttributeCopyCreator

      protected AttributeCopyCreator createAttributeCopyCreator(ItemCopyCreator icc, AttributeCopyDescriptor acd, boolean ispreset, Object sourceValue)
      Deprecated.
    • translate

      protected Object translate(AttributeCopyCreator acc)
      Deprecated.
    • collectPartOfItemsToCopy

      protected Set<Item> collectPartOfItemsToCopy(AttributeCopyCreator acc)
      Deprecated.
    • copyPartOfValues

      protected Map<Item,Item> copyPartOfValues(AttributeCopyCreator acc)
      Deprecated.
    • allItems

      protected final Collection allItems(AttributeCopyCreator acc, Object value)
      Deprecated.
    • allItems

      protected final Collection allItems(AttributeCopyCreator acc, Object value, 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 Object translateValue(AttributeCopyCreator acc, Object original, Map<Item,Item> partOfMappings, boolean localized)
      Deprecated.
    • translateValue

      protected Item translateValue(AttributeCopyCreator acc, Item original, Map<Item,Item> partOfMappings)
      Deprecated.
    • registerPendingReference

      protected final void registerPendingReference(AttributeCopyCreator acc, Item waitingFor)
      Deprecated.
    • isCurrentlyCopying

      @Deprecated(since="ages", forRemoval=false) 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(Object source)
      Deprecated.
      Retrieves Items, PKs and Strings from cache and translated them into items again.
      Parameters:
      source - the source Item, item PKor PK String
    • hasCopy

      protected final boolean hasCopy(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 String
      copy - the target item as either Item, PK or PK String
    • registerCopy

      protected final void registerCopy(PK source, PK copy)
      Deprecated.
    • checkPendingReferences

      protected final void checkPendingReferences(PK key)
      Deprecated.
    • beforeCopying

      protected void beforeCopying(ItemCopyCreator icc)
      Deprecated.
    • finishedCopying

      protected void finishedCopying(ItemCopyCreator icc)
      Deprecated.
    • copyMediaData

      protected void copyMediaData(Media src, Media tgt)
      Deprecated.
    • copy

      public Item copy(Item original)
      Deprecated.
    • copy

      public Item copy(Item original, Item existingCopy)
      Deprecated.
    • copy

      protected Item copy(ItemCopyCreator parent, Item original)
      Deprecated.
    • copy

      protected Item copy(ItemCopyCreator parent, Item original, Item copyToUpdate)
      Deprecated.
    • getCopyCreatorPresetValues

      protected Map getCopyCreatorPresetValues(Item original, Item copyToUpdate)
      Deprecated.
    • getCopyCreatorBlacklist

      protected Set getCopyCreatorBlacklist(Item original, Item toUpdate)
      Deprecated.
    • getCopyCreatorWhitelist

      protected 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 new 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.
      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 a TypeCopyDescriptor. Called by getTypeCopyDescriptor(ComposedType).
      Parameters:
      composedType -
    • ignoreAttribute

      protected boolean ignoreAttribute(AttributeDescriptor attributeDescriptor, String qualifier)
      Deprecated.
      Used by 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.
      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 by 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.
    • forceCopy

      public boolean forceCopy(AttributeDescriptor attributeDescriptor)
      Deprecated.
    • isAtomic

      protected boolean isAtomic(AttributeDescriptor attributeDescriptor)
      Deprecated.
      Used by splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just atomic values. This will call isAtomic(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 check
      localized - 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 Set<AttributeCopyDescriptor>[] splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType)
      Deprecated.
      Called during the creation of a TypeCopyDescriptor. 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 descriptor
      composedType - the actual composed type
      Returns:
      an array of 4 sets holding AttributeCopyDescriptors.
    • toString

      protected String toString(AttributeDescriptor attributeDescriptor)
      Deprecated.
    • valuesToString

      protected String valuesToString(Map attributeValues)
      Deprecated.
    • safeToString

      protected String safeToString(Object attributeValue)
      Deprecated.
    • cleanup

      public void cleanup()
      Deprecated.