Class ItemCopyContext

  • Direct Known Subclasses:
    GenericCatalogCopyContext

    @Deprecated
    public class ItemCopyContext
    extends java.lang.Object
    Deprecated.
    since ages
    ItemCopyContext
    • 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.
      • 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​(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.
      • 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.
      • collectPartOfItemsToCopy

        protected java.util.Set<Item> collectPartOfItemsToCopy​(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.
      • 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.
      • 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.
        Parameters:
        source - the source Item, item PKor PK String
      • 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 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.
      • 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 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.
      • ignoreAttribute

        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. 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)
      • forceCopy

        public boolean forceCopy​(AttributeDescriptor attributeDescriptor)
        Deprecated.
      • 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 java.util.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 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.