public abstract class AbstractItemCopyContext
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected SessionContext |
ctx |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractItemCopyContext(SessionContext ctx,
Level logLevel) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<Item> |
allItems(AttributeCopyCreator acc,
java.lang.Object value)
Returns (recursively) all items which were found in the given value.
|
void |
cleanup() |
protected TypeCopyDescriptor |
createCopyDescriptor(ComposedType composedType)
Creates a new type copy descriptor instance.
|
protected JaloSession |
createSession() |
void |
debug(java.lang.String message) |
void |
error(java.lang.String message) |
protected CatalogManager |
getCatalogManager() |
SessionContext |
getCtx() |
protected FlexibleSearch |
getFlexibleSearch() |
protected JaloSession |
getSession() |
TypeCopyDescriptor |
getTypeCopyDescriptor(ComposedType type)
Returns a (cached) type copy descriptor for a given composed type.
|
protected boolean |
ignoreAttribute(AttributeDescriptor attributeDescriptor,
java.lang.String qualifier)
Used by
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be
ignored or not. |
void |
info(java.lang.String message) |
protected boolean |
isAtomic(AttributeDescriptor attributeDescriptor)
Used by
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds just
atomic values. |
protected boolean |
isAtomic(Type attributeType,
boolean localized)
Traverses collection and map types to find any non-atomic type within.
|
protected boolean |
isCopyOnDemand(AttributeDescriptor attributeDescriptor) |
boolean |
isDebugEnabled() |
boolean |
isErrorEnabled() |
boolean |
isInfoEnabled() |
protected boolean |
isPartOf(AttributeDescriptor attributeDescriptor)
Used by
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute holds partOf
values. |
protected boolean |
isRequiredForCreation(AttributeDescriptor attributeDescriptor)
Determines whether or not a attribute is required for the creation of a item copy.
|
boolean |
isWarnEnabled() |
protected void |
log(java.lang.String message,
Level level)
Default log implementation using a Log4J appender.
|
protected java.lang.String |
safeToString(java.lang.Object attributeValue) |
protected java.util.Set<AttributeCopyDescriptor>[] |
splitDescriptors(TypeCopyDescriptor tcd,
ComposedType composedType)
Called during the creation of a
TypeCopyDescriptor. |
protected Item |
toItem(PK pk)
|
protected java.util.Collection<? extends Item> |
toItems(java.util.Collection<PK> pks) |
protected java.lang.String |
toString(AttributeDescriptor attributeDescriptor) |
protected java.lang.String |
valuesToString(java.util.Map attributeValues) |
void |
warn(java.lang.String message) |
protected SessionContext ctx
protected AbstractItemCopyContext(SessionContext ctx, Level logLevel)
protected JaloSession createSession()
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 final JaloSession getSession()
protected java.util.Collection<Item> allItems(AttributeCopyCreator acc, java.lang.Object value)
public TypeCopyDescriptor getTypeCopyDescriptor(ComposedType type)
protected TypeCopyDescriptor createCopyDescriptor(ComposedType composedType)
TypeCopyDescriptor. Called by
getTypeCopyDescriptor(ComposedType).composedType - protected 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 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 boolean isAtomic(Type attributeType, boolean localized)
attributeType - the argument type to checklocalized - whether or not the attribute is localizedprotected 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.protected boolean isCopyOnDemand(AttributeDescriptor attributeDescriptor)
protected 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 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 java.lang.String toString(AttributeDescriptor attributeDescriptor)
protected java.lang.String safeToString(java.lang.Object attributeValue)
protected java.lang.String valuesToString(java.util.Map attributeValues)
public void cleanup()
protected CatalogManager getCatalogManager()
protected FlexibleSearch getFlexibleSearch()
Copyright © 2018 SAP SE. All Rights Reserved.