public class Link extends ExtensibleItem
Items. A Link can be either localized or
unlocalized.| Modifier and Type | Class and Description |
|---|---|
static interface |
Link.LinkImpl
Interface to persistence layer.
|
ExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static Item |
ANYITEM
Used in Link Manager finder methods to express "any source" or "any target".
|
static Language |
ANYLANGUAGE
Used in Link Manager finder methods to express "any language".
|
static java.lang.String |
LANGUAGE
Constant identifier for
language attribute of Link type. |
static java.lang.String |
QUALIFIER
Constant identifier for
qualifier attribute of Link type. |
static java.lang.String |
REVERSE_SEQUENCE_NUMBER
Constant identifier for
reverseSequenceNumber attribute of Link type. |
static java.lang.String |
SEQUENCE_NUMBER
Constant identifier for
sequenceNumber attribute of Link type. |
static java.lang.String |
SOURCE
Constant identifier for
source attribute of Link type. |
static java.lang.String |
TARGET
Constant identifier for
target attribute of Link type. |
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
Link() |
| Modifier and Type | Method and Description |
|---|---|
protected Item |
createItem(SessionContext ctx,
ComposedType type,
Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.
|
Link.LinkImpl |
getImplementation()
returns the implementation object of this jalo bridge abstraction
|
Language |
getLanguage()
Returns the
Language which is assigned to the Link. |
protected Item.ItemAttributeMap |
getNonInitialAttributes(SessionContext ctx,
Item.ItemAttributeMap allAttributes)
Defines all attributes which should be set after item creation.
|
java.lang.String |
getQualifier()
Returns the qualifier of the
Link. |
int |
getReverseSequenceNumber()
Returns the reverse sequence number of the
Link. |
int |
getSequenceNumber()
Returns the sequence number of the
Link. |
Item |
getSource()
Returns the source
Item of the Link. |
Item |
getTarget()
Returns the target
Item of the Link. |
protected void |
removeLinks()
Superclass method overridden to disable searching for links for links themselves.
|
void |
setAttribute(SessionContext ctx,
java.lang.String qualifier,
java.lang.Object value)
Overwritten to accept
pk instances as value for source and target attribute too
(perf). |
void |
setLanguage(Language language)
Sets the
Language which is assigned to the Link. |
void |
setQualifier(java.lang.String qualifier)
Sets the new qualifier of the
Link. |
void |
setReverseSequenceNumber(int number)
Sets the sequence number of the
Link. |
void |
setSequenceNumber(int number)
Sets the sequence number of the
Link. |
void |
setSource(Item source)
Sets the source
Item of the Link. |
void |
setSourcePK(PK sourcePK)
Changes source item PK directly.
|
void |
setTarget(Item target)
Sets the target
Item of the Link. |
void |
setTargetPK(PK targetPK)
Changes target item PK directly.
|
java.lang.String |
toString()
Returns the
String representation of the Link.Link[Qualifier: null|Link.QUALIFIER, Language: null|Link.LANGUAGE, Source: null|Link.SOURCE -> Target: null|Link.TARGET] |
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacesetTenantpublic static final Item ANYITEM
public static final Language ANYLANGUAGE
public static final java.lang.String QUALIFIER
qualifier attribute of Link type.public static final java.lang.String SOURCE
source attribute of Link type.public static final java.lang.String TARGET
target attribute of Link type.public static final java.lang.String LANGUAGE
language attribute of Link type.public static final java.lang.String SEQUENCE_NUMBER
sequenceNumber attribute of Link type.public static final java.lang.String REVERSE_SEQUENCE_NUMBER
reverseSequenceNumber attribute of Link type.public Link.LinkImpl getImplementation()
BridgeAbstractiongetImplementation in class ExtensibleItemprotected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
ItemComposedType.newInstance(Map).
In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap) too.
Sn example:
public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext
ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return
man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) );
// here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes(
SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret =
super.getNonInitialAttributes( ctx, allAttributes );
// remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
createItem in class Itemctx - the current session context which this item is created withintype - the actual item type ( since subtypes may not provide a own jalo class this may be different from the
type which this method was implemented for )JaloBusinessException - indicates an error during creation - any changes will be rollbackedprotected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes)
ItemItem.createItem(SessionContext, ComposedType, ItemAttributeMap).
use it like this:
protected ItemAttributeMap getNonInitialAttributes( SessionContext ctx, ItemAttributeMap allAttributes ) {
// let all superclasses remove their intial attributes too final ItemAttributeMap attributes =
super.getNonInitialAttributes( ctx, allAttributes ); // remove own initial attributes here attributes.remove(
MyItem.MY_INITIAL_ATTR ); return ret; }
it is vital to optain the map via super.getNonInitialAttributes and pass it on as such since this
ensures that attribute qualifiers are treated case insensitive!getNonInitialAttributes in class Itemctx - session context with language = NULLallAttributes - a ItemAttributeMap contaning attribute values.ItemAttributeMap containing all attribute values, which belong to non-initial attributes.public void setAttribute(SessionContext ctx, java.lang.String qualifier, java.lang.Object value) throws JaloInvalidParameterException, JaloSecurityException, JaloBusinessException
pk instances as value for source and target attribute too
(perf).setAttribute in class Itemctx - the session contextqualifier - the attribute qualifier of the attribute, of which the value will be set.value - the attribute value which will be setJaloInvalidParameterExceptionJaloSecurityExceptionJaloBusinessExceptionprotected void removeLinks()
removeLinks in class Itempublic Item getSource()
Item of the Link.Item of the Linkpublic void setSource(Item source)
Item of the Link.source - the new source Item of the Linkpublic void setSourcePK(PK sourcePK)
sourcePK - public Item getTarget()
Item of the Link.Item of the Linkpublic void setTarget(Item target)
Item of the Link.target - the new target Item of the Linkpublic void setTargetPK(PK targetPK)
targetPK - public Language getLanguage()
Language which is assigned to the Link. If the Link is
unlocalized, null is returned.Language which is assigned to the Linkpublic void setLanguage(Language language)
Language which is assigned to the Link.language - the new Languagepublic java.lang.String getQualifier()
Link.Linkpublic void setQualifier(java.lang.String qualifier)
Link.qualifier - the new qualifierpublic java.lang.String toString()
String representation of the Link.Link[Qualifier: null|Link.QUALIFIER, Language: null|Link.LANGUAGE, Source: null|Link.SOURCE -> Target: null|Link.TARGET]public int getSequenceNumber()
Link. The sequence number is used to define a order over all links
with the same source Item and qualifier. The sequence number is automatically set, if the
Link has been created with
Item.addLinkedItems(boolean, String, Language, java.util.List)Item.addLinkedItems(boolean, String, Language, java.util.List, int)Item.addLinkedItems(boolean, String, Language, java.util.List, int, boolean)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List, int)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List, int, boolean)LinksetSequenceNumber(int)public void setSequenceNumber(int number)
Link.number - the new sequence numbergetSequenceNumber()public int getReverseSequenceNumber()
Link. The number is used to define an order over all links
with the same target Item and qualifier. The sequence number is automatically set, if the
Link has been created with
Item.addLinkedItems(boolean, String, Language, java.util.List)Item.addLinkedItems(boolean, String, Language, java.util.List, int)Item.addLinkedItems(boolean, String, Language, java.util.List, int, boolean)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List, int)Item.addLinkedItems(SessionContext, boolean, String, Language, java.util.List, int, boolean)LinksetReverseSequenceNumber(int)public void setReverseSequenceNumber(int number)
Link.number - the new sequence numbergetReverseSequenceNumber()Copyright © 2018 SAP SE. All Rights Reserved.