public class LinkManager extends Manager
Link items.| Modifier and Type | Class and Description |
|---|---|
protected static class |
LinkManager.LinkManagerSerializableDTO |
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BEAN_NAME |
static java.lang.String |
DISABLE_LINK_REMOVAL_NOTIFICATION
Use this session context option upon item removal to disable marking all of its currently linked items as
modified.
|
| Constructor and Description |
|---|
LinkManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position,
boolean shift)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
boolean markModified) |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position,
boolean shift)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position,
boolean shift,
boolean markModified) |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position,
boolean shift,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
void |
addLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List items,
int position,
boolean shift,
boolean sortSrc2Tgt,
boolean sortTgt2Src,
boolean markModified) |
protected void |
checkBeforeItemRemoval(SessionContext ctx,
Item item)
Superclass method overridden to avoid call to EJB layer
|
Link |
createLink(java.lang.String qualifier,
Item source,
Item target,
int sequenceNumber)
Deprecated.
since ages
|
Link |
createLink(java.lang.String qualifier,
Item source,
Item target,
int sequenceNumber,
int reverseSequenceNumber)
Creates a new localized
Link |
Link |
createLink(java.lang.String qualifier,
Language language,
Item source,
Item target,
int sequenceNumber)
Deprecated.
since ages
|
Link |
createLink(java.lang.String qualifier,
Language language,
Item source,
Item target,
int sequenceNumber,
int reverseSequenceNumber)
Creates a new localized
Link |
Link |
createLink(java.lang.String qualifier,
Language language,
PK sourcePK,
PK targetPK,
int sequenceNumber,
int reverseSequenceNumber)
Creates a new link using item PKs instead of real items as source and target.
|
void |
createLinkNoWrap(java.lang.String qualifier,
Language language,
Item source,
Item target,
int sequenceNumber,
int reverseSequenceNumber)
Creates a new link just like
createLink(String, Language, Item, Item, int, int) but without loading and
wrapping the new link item. |
void |
createLinkNoWrap(java.lang.String qualifier,
Language language,
PK sourcePK,
PK targetPK,
int sequenceNumber,
int reverseSequenceNumber)
Creates a new link just like
createLink(String, Language, PK, PK, int, int) but without loading and
wrapping the new link item. |
protected boolean |
enableRelationRestrictions() |
java.util.Map |
getAllLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier)
Returns a
Map of all Items which are linked to the specified Item by
localized Links with matching qualifier. |
java.util.Map |
getAllLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
boolean enableRestrictions)
Returns a
Map of all Items which are linked to the specified Item by
localized Links with matching qualifier. |
java.util.Collection |
getAllLinkedItems(SessionContext ctx,
java.util.Collection items,
boolean itemsAreSource,
java.lang.String qualifier,
Language lang)
Returns all linked items belonging to any of the given source or target items.
|
static LinkManager |
getInstance() |
java.util.List |
getLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang)
Returns a
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. |
java.util.List |
getLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
int start,
int count)
Returns a
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language. |
<T> SearchResult<T> |
getLinkedItems(PK itemPk,
boolean itemIsSource,
java.lang.String qualifier,
PK langPk,
boolean enableRestrictions,
int start,
int count,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang)
Returns a
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
boolean enableRestrictions)
Returns a
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
boolean enableRestrictions,
int start,
int count)
Returns a
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language. |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
boolean enableRestrictions,
int start,
int count,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
int start,
int count)
Returns a
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language. |
java.util.List |
getLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
int start,
int count,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
java.util.List |
getLinkedItems(SessionContext ctx,
PK itemPk,
boolean itemIsSource,
PK langPk,
java.lang.String relationTypeCode,
java.lang.String relatedItemCode,
int start,
int count,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
<T> SearchResult<T> |
getLinkedItems(SessionContext ctx,
PK itemPk,
boolean itemIsSource,
java.lang.String qualifier,
PK langPk,
boolean enableRestrictions,
int start,
int count,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
long |
getLinkedItemsCount(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang)
Returns a
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. |
long |
getLinkedItemsCount(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang)
Returns a
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. |
long |
getLinkedItemsCount(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
boolean enableRestrictions)
Returns the number of
Items, which are linked to the specified Item by a
Link, which matches the specified qualifier, Language. |
long |
getLinkedItemsCount(SessionContext ctx,
PK itemPk,
boolean itemIsSource,
java.lang.String relationTypeCode,
java.lang.String relatedItemCode,
PK langPk) |
java.util.Collection<Link> |
getLinks(java.lang.String qualifier,
Item source,
Item target)
Returns a
Collection of all Links with matching qualifier, and source and target
Item . The usage of wildcards always searches on all link tables because no concrete Link type
can be parsed from qualifier. |
java.util.Collection<Link> |
getLinks(java.lang.String qualifier,
Language language,
Item source,
Item target)
Returns a
Collection of all Links with matching qualifier, Language, source
and target Item. The usage of wildcards always searches on all link tables because no concrete
Link type can be parsed from qualifier. |
java.lang.Class |
getRemoteManagerClass() |
void |
removeAllLinksFor(SessionContext ctx,
Item item) |
void |
removeLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
java.util.List itemsToUnlink) |
void |
removeLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<Item> items)
Removes all specified
Items, which are linked to the specified Item by links with
matching qualifier and Language. |
void |
removeLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<Item> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
void |
removeLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<Item> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src,
boolean markModified) |
void |
setAllLinkedItems(SessionContext ctx,
java.util.Collection<Item> itemColl,
boolean itemsAreSource,
java.lang.String qualifier,
Language language,
java.util.List<Item> items,
boolean ordered)
Mass-setter for linking a collection of items to a specified list of target items.
|
void |
setAllLinkedItems(SessionContext ctx,
java.util.Collection<Item> itemColl,
boolean itemsAreSource,
java.lang.String qualifier,
Language language,
java.util.List<Item> items,
boolean ordered,
boolean markModified)
Mass-setter for linking a collection of items to a specified list of target items.
|
void |
setAllLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
java.util.Map<Language,java.util.List<Item>> items)
Creates new localized
Links between the specified Item and the specified
Map of Language-Items mappings using the provided qualifier and deletes all
old Links, which match the specified qualifier, Item and Language. |
void |
setAllLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
java.util.Map<Language,java.util.List<Item>> items,
boolean markMpdified)
Markmodified variant.
|
void |
setAllLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
java.util.Map<Language,java.util.List<Item>> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
void |
setAllLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
java.util.Map<Language,java.util.List<Item>> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src,
boolean preserveHiddenLanguages,
boolean markModified) |
void |
setLinkedItems(Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language lang,
java.util.List itemsToLink) |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.Collection<? extends Item> items) |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.Collection<? extends Item> items,
boolean markModified) |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.Collection<? extends Item> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src,
boolean markModified) |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<? extends Item> items)
Creates new
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language and deletes all old
Links, which match the specified qualifier, Item and Language. |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<? extends Item> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src) |
void |
setLinkedItems(SessionContext ctx,
Item item,
boolean itemIsSource,
java.lang.String qualifier,
Language language,
java.util.List<? extends Item> items,
boolean sortSrc2Tgt,
boolean sortTgt2Src,
boolean markModified) |
protected boolean |
skipChangingExistingLinks(SessionContext ctx) |
java.lang.Object |
writeReplace() |
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, notifyItemRemoval, setAttribute, setTenant, setTransientObject, wrappublic static final java.lang.String BEAN_NAME
public static final java.lang.String DISABLE_LINK_REMOVAL_NOTIFICATION
Item toRemove = ...
SessionContext ctx = JaloSession.getCurrentSession().getSessionContext();
ctx.setAttribute( LinkManager.DISABLE_LINK_REMOVAL_NOTIFICATION, Boolean.TRUE );
toRemove.remove( ctx );
protected boolean skipChangingExistingLinks(SessionContext ctx)
public java.lang.Class getRemoteManagerClass()
getRemoteManagerClass in class Managerpublic static LinkManager getInstance()
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
checkBeforeItemRemoval in class Managerctx - the current session contextitem - the item which should be removedConsistencyCheckException - thrown to abort removal due to consistency errorsprotected boolean enableRelationRestrictions()
public java.util.List getLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language lang)
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. If search restrictions are
considered depends on the configuration of the property 'relation.restrictions.enabled' in the
project|local.properties of the hybris Platform core. The default value is true.item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, int start, int count)
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language. If
search restrictions are considered depends on the configuration of the property 'relation.restrictions.enabled' in
the project|local.properties of the hybris Platform core. The default value is true.item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the Linkstart - start index of the rangecount - number of Items in the rangeList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic long getLinkedItemsCount(Item item, boolean itemIsSource, java.lang.String qualifier, Language lang)
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. If search restrictions are
considered depends on the configuration of the property 'relation.restrictions.enabled' in the
project|local.properties of the hybris Platform core. The default value is true.item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang)
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. If search restrictions are
considered depends on the configuration of the property 'relation.restrictions.enabled' in the
project|local.properties of the hybris Platform core. The default value is true.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, int start, int count)
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language. If
search restrictions are considered depends on the configuration of the property 'relation.restrictions.enabled' in
the project|local.properties of the hybris Platform core. The default value is true.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the Linkstart - start index of the rangecount - number of Items in the rangeList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src)
public long getLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang)
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language. If search restrictions are
considered depends on the configuration of the property 'relation.restrictions.enabled' in the
project|local.properties of the hybris Platform core. The default value is true.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, boolean enableRestrictions)
List of all Items, which are linked to the specified Item with a
Link which matches the specified qualifier and Language.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkenableRestrictions - if true the all defined rescrictions will be consideredList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, boolean enableRestrictions, int start, int count)
List of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Language.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkenableRestrictions - if true all defined rescrictions will be consideredstart - start index of the rangecount - number of Items in the rangeList of all Items in the specified range, which are linked to the specified
Item with a Link which matches the specified qualifier and Languagepublic java.util.List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src)
public <T> SearchResult<T> getLinkedItems(PK itemPk, boolean itemIsSource, java.lang.String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src)
public <T> SearchResult<T> getLinkedItems(SessionContext ctx, PK itemPk, boolean itemIsSource, java.lang.String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src)
public java.util.List getLinkedItems(SessionContext ctx, PK itemPk, boolean itemIsSource, PK langPk, java.lang.String relationTypeCode, java.lang.String relatedItemCode, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src)
public java.util.Collection getAllLinkedItems(SessionContext ctx, java.util.Collection items, boolean itemsAreSource, java.lang.String qualifier, Language lang)
public long getLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, boolean enableRestrictions)
Items, which are linked to the specified Item by a
Link, which matches the specified qualifier, Language.ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklang - the Language of the LinkenableRestrictions - if true all defined rescrictions will be consideredItems, which are linked to the specified Item by a
Link, which matches the specified qualifier, Languagepublic long getLinkedItemsCount(SessionContext ctx, PK itemPk, boolean itemIsSource, java.lang.String relationTypeCode, java.lang.String relatedItemCode, PK langPk)
public java.util.Map getAllLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier)
Map of all Items which are linked to the specified Item by
localized Links with matching qualifier. The map contains { Language -> [ Item+ ] }
mappings.
If search restrictions are considered depends on the configuration of the property 'relation.restrictions.enabled'
in the project|local.properties of the hybris Platform core. The default value is true.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the LinkMap of all Items which are linked to the specified Item by
localized Links with matching qualifierpublic java.util.Map getAllLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, boolean enableRestrictions)
Map of all Items which are linked to the specified Item by
localized Links with matching qualifier. The map contains { Language -> [ Item+ ] }
mappings.
If search restrictions are considered depends on the configuration of the property 'relation.restrictions.enabled'
in the project|local.properties of the hybris Platform core. The default value is true.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the LinkenableRestrictions - if true all defined rescrictions will be consideredMap of all Items which are linked to the specified Item by
localized Links with matching qualifierpublic void setLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, java.util.List itemsToLink)
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.Collection<? extends Item> items)
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.Collection<? extends Item> items, boolean markModified)
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<? extends Item> items)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language and deletes all old
Links, which match the specified qualifier, Item and Language. Depending on
the value of itemIsSource the specified Item will be either the source or the target
Item of the new Links.
ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itempublic void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.Collection<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified)
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src)
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified)
public void setAllLinkedItems(SessionContext ctx, java.util.Collection<Item> itemColl, boolean itemsAreSource, java.lang.String qualifier, Language language, java.util.List<Item> items, boolean ordered)
public void setAllLinkedItems(SessionContext ctx, java.util.Collection<Item> itemColl, boolean itemsAreSource, java.lang.String qualifier, Language language, java.util.List<Item> items, boolean ordered, boolean markModified)
public void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, java.util.Map<Language,java.util.List<Item>> items)
Links between the specified Item and the specified
Map of Language-Items mappings using the provided qualifier and deletes all
old Links, which match the specified qualifier, Item and Language. The
Map must contains { Language -> [ Item+ ] } mappings.
Depending on the value of itemIsSource the specified Item will be either the source or
the target Item of the new Links.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linkitems - the Map of all Items, which should be linked to the specified
Itempublic void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, java.util.Map<Language,java.util.List<Item>> items, boolean markMpdified)
public void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, java.util.Map<Language,java.util.List<Item>> items, boolean sortSrc2Tgt, boolean sortTgt2Src)
public void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, java.util.Map<Language,java.util.List<Item>> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean preserveHiddenLanguages, boolean markModified)
public void addLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itempublic void addLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itemposition - the automatically increased sequence number of the new Links will start with this numberpublic void addLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position, boolean shift)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
item - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itemposition - the automatically increased sequence number of the new Links will start with this numbershift - if set to true, the sequence numbers all existing Links with higher sequence
number and matching qualifier, source/target Item and Language will be raised
by the number of Items in itemspublic void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itempublic void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, boolean markModified)
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itemposition - the automatically increased sequence number of the new Links will start with this numberpublic void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position, boolean shift)
Links between the specified Item and the specified List of
Items using the provided values for qualifier and Language. Depending on the value of
itemIsSource the specified Item will be either the source or the target
Item of the new Links.
ctx - the SessionContext, which will be useditem - Item on one end of the LinkitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linklanguage - if null, unlocalized links will be created, otherwise localized links for the specified
Language will be createditems - the List of all Items, which should be linked to the specified
Itemposition - the automatically increased sequence number of the new Links will start with this numbershift - if set to true, the sequence numbers all existing Links with higher sequence
number and matching qualifier, source/target Item and Language will be raised
by the number of Items in itemspublic void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position, boolean shift, boolean markModified)
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src)
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified)
public void removeLinkedItems(Item item, boolean itemIsSource, java.lang.String qualifier, Language lang, java.util.List itemsToUnlink)
public void removeAllLinksFor(SessionContext ctx, Item item)
public void removeLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<Item> items)
Items, which are linked to the specified Item by links with
matching qualifier and Language.ctx - the SessionContext, which will be useditem - Item on one end of the LinksitemIsSource - is the specified Item the source (true) or the target Item (
false) of the Linkqualifier - the qualifier of the Linkslanguage - the Language of the Links, null for unlocalized
Linksitems - List of all Items which should be removedpublic void removeLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src)
public void removeLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, java.lang.String qualifier, Language language, java.util.List<Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified)
public java.util.Collection<Link> getLinks(java.lang.String qualifier, Language language, Item source, Item target)
Collection of all Links with matching qualifier, Language, source
and target Item. The usage of wildcards always searches on all link tables because no concrete
Link type can be parsed from qualifier. So using wildcards is potential slower than giving the concrete qualifier
without usage of wildcards.qualifier - the qualifier, may contain SQL wildcards, e.g. "%"language - the Language, or Link.ANYLANGUAGEsource - the source Item, or Link.ANYITEMtarget - the target Item, or Link.ANYITEMCollection of all Links with matching qualifier, Language, source
and target Item@Deprecated public Link createLink(java.lang.String qualifier, Language language, Item source, Item target, int sequenceNumber) throws ConsistencyCheckException
ConsistencyCheckExceptionpublic Link createLink(java.lang.String qualifier, Language language, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException
Linkqualifier - the qualifier of the link (any String, for example a predefined constant like
Media.PICTURElanguage - the language that defines the link's localesource - the source Itemtarget - the target ItemsequenceNumber - the sequence number of the new LinkLinkConsistencyCheckExceptionpublic Link createLink(java.lang.String qualifier, Language language, PK sourcePK, PK targetPK, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException
qualifier - the link qualifierlanguage - optional: the language to qualify as localized linksourcePK - the pk of the source itemtargetPK - the pk of the target itemsequenceNumber - the link position in source-target directionreverseSequenceNumber - the link position in target-source directionConsistencyCheckExceptionpublic void createLinkNoWrap(java.lang.String qualifier,
Language language,
Item source,
Item target,
int sequenceNumber,
int reverseSequenceNumber)
throws ConsistencyCheckException
createLink(String, Language, Item, Item, int, int) but without loading and
wrapping the new link item.ConsistencyCheckExceptionpublic void createLinkNoWrap(java.lang.String qualifier,
Language language,
PK sourcePK,
PK targetPK,
int sequenceNumber,
int reverseSequenceNumber)
throws ConsistencyCheckException
createLink(String, Language, PK, PK, int, int) but without loading and
wrapping the new link item.ConsistencyCheckExceptionpublic java.util.Collection<Link> getLinks(java.lang.String qualifier, Item source, Item target)
Collection of all Links with matching qualifier, and source and target
Item . The usage of wildcards always searches on all link tables because no concrete Link type
can be parsed from qualifier. So using wildcards is potential slower than giving the concrete qualifier without
usage of wildcards.qualifier - the qualifier, may contain SQL wildcards, e.g. "%"source - the source Item, or Link.ANYITEMtarget - the target Item, or Link.ANYITEMCollection of all Links with matching qualifier, Language, source
and target Item@Deprecated public Link createLink(java.lang.String qualifier, Item source, Item target, int sequenceNumber) throws ConsistencyCheckException
ConsistencyCheckExceptionpublic Link createLink(java.lang.String qualifier, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException
Linkqualifier - the qualifier of the link (any String, for example a predefined constant like
Media.PICTUREsource - the source Itemtarget - the target ItemsequenceNumber - the sequence number of the new LinkLinkConsistencyCheckExceptionpublic java.lang.Object writeReplace()
throws java.io.ObjectStreamException
writeReplace in class Managerjava.io.ObjectStreamExceptionCopyright © 2018 SAP SE. All Rights Reserved.