Class GenericCatalogCopyContext

    • Field Detail

      • LEGACY_MODE_FLAG

        public static final java.lang.String LEGACY_MODE_FLAG
        See Also:
        Constant Field Values
      • PARTIAL_COLLECTION_TRANSLATION_ALLOWED

        public static final java.lang.String PARTIAL_COLLECTION_TRANSLATION_ALLOWED
        See Also:
        Constant Field Values
    • Method Detail

      • setTargetLanguages

        protected void setTargetLanguages​(java.util.Collection<Language> languages)
      • getIsCatalogTypeCache

        protected YLongToByteMap getIsCatalogTypeCache()
      • getDependentItemTypes

        public java.util.Set<ComposedType> getDependentItemTypes()
      • getDependentItemResolverCache

        protected YLongToObjectMap<java.util.Set<de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ParentResolver>> getDependentItemResolverCache()
      • mayBeCatalogItemDependent

        protected boolean mayBeCatalogItemDependent​(Item item)
      • mayBeCatalogItemDependent

        protected boolean mayBeCatalogItemDependent​(ComposedType composedType)
      • isCatalogItem

        protected boolean isCatalogItem​(Item item)
      • isCatalogItemType

        protected boolean isCatalogItemType​(ComposedType composedType)
      • setCategoryOptions

        public void setCategoryOptions​(boolean copyProducts,
                                       boolean copySubcategories)
        Sets special options for copying categories:
        • copyProducts - all products of a explicitly copied category are copied as well
        • copySubcategories - all sub categories of a explicitly copied category are copied as well
      • getSourceVersion

        public final CatalogVersion getSourceVersion()
        Returns:
        the source for the copy action
      • getTargetVersion

        public final CatalogVersion getTargetVersion()
        Returns:
        the target for the copy action
      • isExclusiveMode

        public boolean isExclusiveMode()
        If true the syncjob is added to the ItemSyncTimestamp
        Returns:
        the exclusiveMode
      • getCurrentTurn

        protected abstract int getCurrentTurn()
      • translate

        protected java.lang.Object translate​(AttributeCopyCreator acc)
        Filters localized attribute values by available catalog languages. Besides it adds {language->null} entries for each missing language within the map.
      • createCreator

        protected CatalogItemCopyCreator createCreator​(ItemCopyCreator parent,
                                                       Item source,
                                                       Item target,
                                                       ItemSyncTimestamp itemSyncTimestamp,
                                                       java.util.Collection<java.lang.String> blacklist,
                                                       java.util.Collection<java.lang.String> whiteList,
                                                       java.util.Map<java.lang.String,​java.lang.Object> presetValues)
      • queryExistingSyncTimestamp

        protected ItemSyncTimestamp queryExistingSyncTimestamp​(Item src,
                                                               PK tgtPK)
        Returns the ItemSyncTimestamp which has the given Item as source and the given PK as targetPK. An error is reported if more than one timestamp was found.
        Returns:
        null if nothing was found.
      • mustBeTranslated

        protected boolean mustBeTranslated​(java.lang.String attributeQualifier,
                                           Item original)
      • computeDependentItemResolvers

        protected YLongToObjectMap<java.util.Set<de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ParentResolver>> computeDependentItemResolvers()
      • computeParentResolvers

        protected java.util.Collection<de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ParentResolver> computeParentResolvers​(ComposedType parentType,
                                                                                                                                                        java.util.Set<ComposedType> ctControlSet,
                                                                                                                                                        java.util.Set<AttributeDescriptor> adControlSet)
      • isDependentFromSourceVersion

        public boolean isDependentFromSourceVersion​(Item dependentItem)
      • getCopyCreatorPresetValues

        protected java.util.Map getCopyCreatorPresetValues​(Item original,
                                                           Item copyToupdate)
        Sets fixedly the catalog version attribute for all Products,Categories, Mediasand Keywords.
      • getRootCatalogTypeCache

        protected YLongToObjectMap<java.lang.String> getRootCatalogTypeCache()
      • getCatalogVersionAttributeCache

        protected YLongToObjectMap<java.lang.String> getCatalogVersionAttributeCache()
      • getCatalogKeyAttributesCache

        protected YLongToObjectMap<java.util.Set<java.lang.String>> getCatalogKeyAttributesCache()
      • getNonCatalogKeyAttributesCache

        protected YLongToObjectMap<java.util.Set<java.lang.String>> getNonCatalogKeyAttributesCache()
      • getCopyOnDemandCache

        protected YLongToByteMap getCopyOnDemandCache()
      • getCatalogVersionAttribute

        protected java.lang.String getCatalogVersionAttribute​(ComposedType composedType)
      • getRootCatalogType

        protected java.lang.String getRootCatalogType​(ComposedType composedType)
      • getRootUniqueItemType

        protected java.lang.String getRootUniqueItemType​(ComposedType composedType,
                                                         java.util.Set<java.lang.String> uniqueAttributes)
      • getUniqueKeyAttributes

        protected java.util.Set<java.lang.String> getUniqueKeyAttributes​(ComposedType composedType)
      • getNonCatalogItemUniqueAttributes

        protected java.util.Set<java.lang.String> getNonCatalogItemUniqueAttributes​(ComposedType composedType)
      • isUntranslatablePartOfItem

        protected boolean isUntranslatablePartOfItem​(AttributeCopyCreator acc,
                                                     Item original)
        Superclass method overridden to avoid copying catalog items which do not originate from the source version.
      • isUntranslatableProductFeature

        protected boolean isUntranslatableProductFeature​(ProductFeature productFeature)
      • computeIsCopyOnDemand

        protected boolean computeIsCopyOnDemand​(AttributeDescriptor attributeDescriptor)
      • isCopyOnDemandCatalogItemType

        protected boolean isCopyOnDemandCatalogItemType​(ComposedType catalogItemType,
                                                        java.lang.Class jaloClass)
      • getCopiedItemCache

        protected final java.util.Map<PK,​de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry> getCopiedItemCache​(boolean create)
      • getCopy

        protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry getCopy​(Item source)
      • queryCopy

        protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry queryCopy​(Item source)
      • queryCatalogItemCopy

        protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry queryCatalogItemCopy​(Item sourceItem)
      • queryNonCatalogItemCopy

        protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry queryNonCatalogItemCopy​(Item source)
      • processQueryResult

        protected de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry processQueryResult​(Item sourceItem,
                                                                                                                                  java.util.List<Item> rows,
                                                                                                                                  java.util.List<java.lang.Object> keys)
      • getCounterpartItem

        protected Item getCounterpartItem​(Item original)
      • setSavePrevousValues

        protected void setSavePrevousValues​(boolean setSaveToOn)
      • isSavePrevousValues

        public boolean isSavePrevousValues()
      • translateAD

        protected final java.lang.String translateAD​(AttributeDescriptor attributeDescriptor)
      • addCreationAttribute

        protected final void addCreationAttribute​(AttributeDescriptor attributeDescriptor)
      • isStarted

        public final boolean isStarted()
        Returns:
        true if at least one item was copied or is currently being copied.
      • copyPartOfValues

        protected java.util.Map<Item,​Item> copyPartOfValues​(AttributeCopyCreator acc)
        Tries to copy all items from AttributeCopyCreator.getPartOfItemsToCopy(). The returned map contains each partOf item and (if successfully copied) the associated copy. Please note that some attribute value items may been untranslatable - they don't turn up in the result map!
        Parameters:
        acc - the attribute copy creator
      • translateValue

        protected final java.lang.Object translateValue​(AttributeCopyCreator acc,
                                                        java.lang.Object original,
                                                        java.util.Map<Item,​Item> partOfItemsToBeCopied,
                                                        boolean localized)
      • isCurrentlyCopying

        protected final boolean isCurrentlyCopying​(Item original)
      • registerCopy

        protected final void registerCopy​(de.hybris.platform.catalog.jalo.synchronization.GenericCatalogCopyContext.ItemCopyCacheEntry copyInfo)
      • copyMediaData

        protected void copyMediaData​(Media src,
                                     Media tgt)
      • copy

        public Item copy​(Item original)
      • getCopyCreatorBlacklist

        protected java.util.Set getCopyCreatorBlacklist​(Item original,
                                                        Item toUpdate)
      • getCopyCreatorWhitelist

        protected java.util.Set getCopyCreatorWhitelist​(Item original,
                                                        Item toUpdate)
      • isRequiredForCreation

        protected boolean isRequiredForCreation​(AttributeDescriptor attributeDescriptor)
        Description copied from class: AbstractItemCopyContext
        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.

        Overrides:
        isRequiredForCreation in class AbstractItemCopyContext
        Parameters:
        attributeDescriptor - the attribute descriptor to determine creation status for
        Returns:
        true if the attribute is required for item creation
      • isForceUpdate

        protected boolean isForceUpdate()
      • getCopyCacheSize

        public int getCopyCacheSize()
        Returns:
        the copyCacheSize
      • setCopyCacheSize

        public void setCopyCacheSize​(int copyCacheSize)
        Parameters:
        copyCacheSize - the copyCacheSize to set
      • getTargetLanguages

        protected java.util.Set<Language> getTargetLanguages()
        Returns:
        the targetLanguages
      • getCopyCacheHits

        public long getCopyCacheHits()
        Returns:
        the copyCacheHits
      • setCopyCacheHits

        public void setCopyCacheHits​(long copyCacheHits)
        Parameters:
        copyCacheHits - the copyCacheHits to set
      • getCopyCacheMisses

        public long getCopyCacheMisses()
        Returns:
        the copyCacheMisses
      • setCopyCacheMisses

        public void setCopyCacheMisses​(long copyCacheMisses)
        Parameters:
        copyCacheMisses - the copyCacheMisses to set
      • getTargetVersionForQueryCatalogItemCopy

        protected CatalogVersion getTargetVersionForQueryCatalogItemCopy​(Item sourceItem)
      • canBeTranslatedPartially

        protected boolean canBeTranslatedPartially​(AttributeCopyCreator attributeCopyCreator)
      • isPartialCollectionTranslationEnabledGlobally

        protected boolean isPartialCollectionTranslationEnabledGlobally()