public abstract class AbstractItemCopyContext extends 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 Collection<Item> |
allItems(AttributeCopyCreator acc,
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(String message) |
void |
error(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,
String qualifier)
Used by
splitDescriptors(TypeCopyDescriptor, ComposedType)to determine whether an attribute may be
ignored or not. |
void |
info(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(String message,
Level level)
Default log implementation using a Log4J appender.
|
protected String |
safeToString(Object attributeValue) |
protected Set<AttributeCopyDescriptor>[] |
splitDescriptors(TypeCopyDescriptor tcd,
ComposedType composedType)
Called during the creation of a
TypeCopyDescriptor. |
protected Item |
toItem(PK pk)
|
protected Collection<? extends Item> |
toItems(Collection<PK> pks) |
protected String |
toString(AttributeDescriptor attributeDescriptor) |
protected String |
valuesToString(Map attributeValues) |
void |
warn(String message) |
protected SessionContext ctx
protected AbstractItemCopyContext(SessionContext ctx, Level logLevel)
protected JaloSession createSession()
protected void log(String message, Level level)
public void debug(String message)
public void info(String message)
public void warn(String message)
public void error(String message)
public boolean isDebugEnabled()
public boolean isInfoEnabled()
public boolean isWarnEnabled()
public boolean isErrorEnabled()
public final SessionContext getCtx()
protected final JaloSession getSession()
protected Collection<Item> allItems(AttributeCopyCreator acc, Object value)
public TypeCopyDescriptor getTypeCopyDescriptor(ComposedType type)
protected TypeCopyDescriptor createCopyDescriptor(ComposedType composedType)
TypeCopyDescriptor. Called by
getTypeCopyDescriptor(ComposedType).composedType - protected 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, 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 String toString(AttributeDescriptor attributeDescriptor)
public void cleanup()
protected CatalogManager getCatalogManager()
protected FlexibleSearch getFlexibleSearch()
protected Collection<? extends Item> toItems(Collection<PK> pks)
Copyright © 2017 SAP SE. All Rights Reserved.