Class AbstractItemCopyContext
java.lang.Object
de.hybris.platform.catalog.jalo.synchronization.AbstractItemCopyContext
- Direct Known Subclasses:
GenericCatalogCopyContext
- Since:
- 3.1-u6
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractItemCopyContext(SessionContext ctx, org.apache.log4j.Level logLevel) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Item>allItems(AttributeCopyCreator acc, Object value) Returns (recursively) all items which were found in the given value.voidcleanup()protected TypeCopyDescriptorcreateCopyDescriptor(ComposedType composedType) Creates a new type copy descriptor instance.protected JaloSessionvoidvoidvoidvoidprotected CatalogManagerfinal SessionContextgetCtx()protected FlexibleSearchprotected final JaloSessionReturns a (cached) type copy descriptor for a given composed type.protected booleanignoreAttribute(AttributeDescriptor attributeDescriptor, String qualifier) Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be ignored or not.voidvoidprotected booleanisAtomic(AttributeDescriptor attributeDescriptor) Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just atomic values.protected booleanTraverses collection and map types to find any non-atomic type within.protected booleanisCopyOnDemand(AttributeDescriptor attributeDescriptor) booleanbooleanbooleanprotected booleanisPartOf(AttributeDescriptor attributeDescriptor) Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf values.protected booleanisRequiredForCreation(AttributeDescriptor attributeDescriptor) Determines whether or not a attribute is required for the creation of a item copy.booleanprotected voidDefault log implementation using a Log4J appender.protected voidprotected StringsafeToString(Object attributeValue) protected Set<AttributeCopyDescriptor>[]splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType) Called during the creation of aTypeCopyDescriptor.protected Itemprotected Collection<? extends Item>toItems(Collection<PK> pks) protected StringtoString(AttributeDescriptor attributeDescriptor) protected StringvaluesToString(Map attributeValues) voidvoid
-
Field Details
-
ctx
-
-
Constructor Details
-
AbstractItemCopyContext
-
-
Method Details
-
createSession
- Returns:
- current JaloSession
-
log
-
log
Default log implementation using a Log4J appender. -
debug
-
info
-
warn
-
error
-
debug
-
info
-
warn
-
error
-
isDebugEnabled
public boolean isDebugEnabled() -
isInfoEnabled
public boolean isInfoEnabled() -
isWarnEnabled
public boolean isWarnEnabled() -
isErrorEnabled
public boolean isErrorEnabled() -
getCtx
-
getSession
- Returns:
- JaloSession which is bound to this CopyContext
-
allItems
Returns (recursively) all items which were found in the given value. If the value is- an Item: this item is returned
- a Collection: the containing Items are returned
- a Map for a localized attribute: the map values (which are items) are returned
- a Map for a non-localized attribute: the map keys and values (which are items) are returned
- Returns:
- an empty set if nothing (no item) was found at all.
-
getTypeCopyDescriptor
Returns a (cached) type copy descriptor for a given composed type. -
createCopyDescriptor
Creates a new type copy descriptor instance. By default this will create aTypeCopyDescriptor. Called bygetTypeCopyDescriptor(ComposedType).- Parameters:
composedType-
-
splitDescriptors
protected Set<AttributeCopyDescriptor>[] splitDescriptors(TypeCopyDescriptor tcd, ComposedType composedType) 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.
-
isAtomic
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
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
-
isPartOf
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. -
isCopyOnDemand
-
isRequiredForCreation
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
-
ignoreAttribute
Used bysplitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be ignored or not. By default this will apply toItem.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)
-
toString
-
safeToString
-
valuesToString
-
cleanup
public void cleanup() -
getCatalogManager
-
getFlexibleSearch
-
toItem
- Returns:
- null if not found or not valid anymore.
-
toItems
-