Package de.hybris.platform.jalo.link
Class LinkManager
java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.link.LinkManager
- All Implemented Interfaces:
ItemLifecycleListener,Serializable
The manager of the link package which offers methods to create and search
Link items.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items, int position) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, boolean markModified) voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage.voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean markModified) voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src) voidaddLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) protected voidcheckBeforeItemRemoval(SessionContext ctx, Item item) Superclass method overridden to avoid call to EJB layercreateLink(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.createLink(String qualifier, Language language, Item source, Item target, int sequenceNumber) Deprecated.since agescreateLink(String qualifier, Language language, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) Creates a new localizedLinkcreateLink(String qualifier, Item source, Item target, int sequenceNumber) Deprecated.since agescreateLink(String qualifier, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) Creates a new localizedLinkvoidcreateLinkNoWrap(String qualifier, Language language, PK sourcePK, PK targetPK, int sequenceNumber, int reverseSequenceNumber) Creates a new link just likecreateLink(String, Language, PK, PK, int, int)but without loading and wrapping the new link item.voidcreateLinkNoWrap(String qualifier, Language language, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) Creates a new link just likecreateLink(String, Language, Item, Item, int, int)but without loading and wrapping the new link item.protected booleangetAllLinkedItems(Item item, boolean itemIsSource, String qualifier) Returns aMapof allItemswhich are linked to the specifiedItemby localizedLinkswith matching qualifier.getAllLinkedItems(Item item, boolean itemIsSource, String qualifier, boolean enableRestrictions) Returns aMapof allItemswhich are linked to the specifiedItemby localizedLinkswith matching qualifier.getAllLinkedItems(SessionContext ctx, Collection items, boolean itemsAreSource, String qualifier, Language lang) Returns all linked items belonging to any of the given source or target items.static LinkManager<T> SearchResult<T>getLinkedItems(PK itemPk, boolean itemIsSource, String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) getLinkedItems(Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(SessionContext ctx, PK itemPk, boolean itemIsSource, PK langPk, String relationTypeCode, String relatedItemCode, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) <T> SearchResult<T>getLinkedItems(SessionContext ctx, PK itemPk, boolean itemIsSource, String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) longgetLinkedItemsCount(Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.longgetLinkedItemsCount(SessionContext ctx, PK itemPk, boolean itemIsSource, String relationTypeCode, String relatedItemCode, PK langPk) longgetLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.longgetLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions) Returns the number ofItems, which are linked to the specifiedItemby aLink, which matches the specified qualifier,Language.Returns aCollectionof allLinkswith matching qualifier,Language, source and targetItem. The usage of wildcards always searches on all link tables because no concrete Link type can be parsed from qualifier.Returns aCollectionof allLinkswith matching qualifier, and source and targetItem. The usage of wildcards always searches on all link tables because no concrete Link type can be parsed from qualifier.protected booleanhasDisabledRelations(Item item) protected booleanisRelationDisabled(Item item, RelationType rel) voidremoveAllLinksFor(SessionContext ctx, Item item) voidremoveLinkedItems(Item item, boolean itemIsSource, String qualifier, Language lang, List itemsToUnlink) voidremoveLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<Item> items) Removes all specifiedItems, which are linked to the specifiedItemby links with matching qualifier andLanguage.voidremoveLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src) voidremoveLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) voidsetAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items) Creates new localizedLinksbetween the specifiedItemand the specifiedMapofLanguage-Itemsmappings using the provided qualifier and deletes all oldLinks, which match the specified qualifier,ItemandLanguage.voidsetAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items, boolean markMpdified) Markmodified variant.voidsetAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items, boolean sortSrc2Tgt, boolean sortTgt2Src) voidsetAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean preserveHiddenLanguages, boolean markModified) voidsetAllLinkedItems(SessionContext ctx, Collection<Item> itemColl, boolean itemsAreSource, String qualifier, Language language, List<Item> items, boolean ordered) Mass-setter for linking a collection of items to a specified list of target items.voidsetAllLinkedItems(SessionContext ctx, Collection<Item> itemColl, boolean itemsAreSource, String qualifier, Language language, List<Item> items, boolean ordered, boolean markModified) Mass-setter for linking a collection of items to a specified list of target items.voidsetLinkedItems(Item item, boolean itemIsSource, String qualifier, Language lang, List itemsToLink) voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items) voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items, boolean markModified) voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<? extends Item> items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguageand deletes all oldLinks, which match the specified qualifier,ItemandLanguage.voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src) voidsetLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) protected booleanMethods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, notifyItemRemoval, setAttribute, setTenant, setTransientObject, wrap
-
Field Details
-
BEAN_NAME
- See Also:
-
DISABLE_LINK_REMOVAL_NOTIFICATION
Use this session context option upon item removal to disable marking all of its currently linked items as modified.Item toRemove = ... SessionContext ctx = JaloSession.getCurrentSession().getSessionContext(); ctx.setAttribute( LinkManager.DISABLE_LINK_REMOVAL_NOTIFICATION, Boolean.TRUE ); toRemove.remove( ctx );- See Also:
-
-
Constructor Details
-
LinkManager
public LinkManager()
-
-
Method Details
-
skipChangingExistingLinks
-
getRemoteManagerClass
- Overrides:
getRemoteManagerClassin classManager
-
getInstance
- Returns:
- instance of this manager
-
checkBeforeItemRemoval
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException Superclass method overridden to avoid call to EJB layer- Overrides:
checkBeforeItemRemovalin classManager- Parameters:
ctx- the current session contextitem- the item which should be removed- Throws:
ConsistencyCheckException- thrown to abort removal due to consistency errors- Since:
- 2.10
-
enableRelationRestrictions
protected boolean enableRelationRestrictions() -
getLinkedItems
Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLink- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLinkstart- start index of the rangecount- number ofItemsin the range- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItemsCount
Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLink- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLink- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLinkstart- start index of the rangecount- number ofItemsin the range- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) -
getLinkedItemsCount
public long getLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage. 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 istrue.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLink- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions) Returns aListof allItems, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLinkenableRestrictions- iftruethe all defined rescrictions will be considered- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions, int start, int count) Returns aListof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLinkenableRestrictions- iftrueall defined rescrictions will be consideredstart- start index of the rangecount- number ofItemsin the range- Returns:
- a
Listof allItemsin the specified range, which are linked to the specifiedItemwith aLinkwhich matches the specified qualifier andLanguage
-
getLinkedItems
public List getLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) -
getLinkedItems
public <T> SearchResult<T> getLinkedItems(PK itemPk, boolean itemIsSource, String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) -
getLinkedItems
public <T> SearchResult<T> getLinkedItems(SessionContext ctx, PK itemPk, boolean itemIsSource, String qualifier, PK langPk, boolean enableRestrictions, int start, int count, boolean sortSrc2Tgt, boolean sortTgt2Src) -
getLinkedItems
-
getAllLinkedItems
public Collection getAllLinkedItems(SessionContext ctx, Collection items, boolean itemsAreSource, String qualifier, Language lang) Returns all linked items belonging to any of the given source or target items. Please note that the result set is not ordered but duplicates are eliminated.- Since:
- 2.20
-
getLinkedItemsCount
public long getLinkedItemsCount(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language lang, boolean enableRestrictions) Returns the number ofItems, which are linked to the specifiedItemby aLink, which matches the specified qualifier,Language.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklang- theLanguageof theLinkenableRestrictions- iftrueall defined rescrictions will be considered- Returns:
- the number of
Items, which are linked to the specifiedItemby aLink, which matches the specified qualifier,Language
-
getLinkedItemsCount
public long getLinkedItemsCount(SessionContext ctx, PK itemPk, boolean itemIsSource, String relationTypeCode, String relatedItemCode, PK langPk) -
getAllLinkedItems
Returns aMapof allItemswhich are linked to the specifiedItemby localizedLinkswith 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.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLink- Returns:
- a
Mapof allItemswhich are linked to the specifiedItemby localizedLinkswith matching qualifier
-
getAllLinkedItems
public Map getAllLinkedItems(Item item, boolean itemIsSource, String qualifier, boolean enableRestrictions) Returns aMapof allItemswhich are linked to the specifiedItemby localizedLinkswith 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.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinkenableRestrictions- iftrueall defined rescrictions will be considered- Returns:
- a
Mapof allItemswhich are linked to the specifiedItemby localizedLinkswith matching qualifier
-
setLinkedItems
-
setLinkedItems
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items) -
setLinkedItems
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items, boolean markModified) -
setLinkedItems
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<? extends Item> items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguageand deletes all oldLinks, which match the specified qualifier,ItemandLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItem
-
setLinkedItems
public void setLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, Collection<? extends Item> items, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) -
setLinkedItems
-
setLinkedItems
-
setAllLinkedItems
public void setAllLinkedItems(SessionContext ctx, Collection<Item> itemColl, boolean itemsAreSource, String qualifier, Language language, List<Item> items, boolean ordered) Mass-setter for linking a collection of items to a specified list of target items. Please note that for localized relations this will affect links for the specified language only!- Since:
- 2.20
-
setAllLinkedItems
public void setAllLinkedItems(SessionContext ctx, Collection<Item> itemColl, boolean itemsAreSource, String qualifier, Language language, List<Item> items, boolean ordered, boolean markModified) Mass-setter for linking a collection of items to a specified list of target items. Please note that for localized relations this will affect links for the specified language only!- Since:
- 5.00
-
setAllLinkedItems
public void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items) Creates new localizedLinksbetween the specifiedItemand the specifiedMapofLanguage-Itemsmappings using the provided qualifier and deletes all oldLinks, which match the specified qualifier,ItemandLanguage. TheMapmust contains{ Language -> [ Item+ ] }mappings.Depending on the value of
itemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinkitems- theMapof allItems, which should be linked to the specifiedItem
-
setAllLinkedItems
public void setAllLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Map<Language, List<Item>> items, boolean markMpdified) Markmodified variant. -
setAllLinkedItems
-
setAllLinkedItems
-
addLinkedItems
public void addLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItem
-
addLinkedItems
public void addLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items, int position) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItemposition- the automatically increased sequence number of the newLinkswill start with this number
-
addLinkedItems
public void addLinkedItems(Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
item-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItemposition- the automatically increased sequence number of the newLinkswill start with this numbershift- if set totrue, the sequence numbers all existingLinkswith higher sequence number and matching qualifier, source/targetItemandLanguagewill be raised by the number ofItemsin items
-
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItem
-
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, boolean markModified) -
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItemposition- the automatically increased sequence number of the newLinkswill start with this number
-
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift) Creates newLinksbetween the specifiedItemand the specifiedListofItemsusing the provided values for qualifier andLanguage. Depending on the value ofitemIsSourcethe specifiedItemwill be either the source or the targetItemof the newLinks.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinkitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinklanguage- ifnull, unlocalized links will be created, otherwise localized links for the specifiedLanguagewill be createditems- theListof allItems, which should be linked to the specifiedItemposition- the automatically increased sequence number of the newLinkswill start with this numbershift- if set totrue, the sequence numbers all existingLinkswith higher sequence number and matching qualifier, source/targetItemandLanguagewill be raised by the number ofItemsin items
-
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean markModified) -
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src) -
addLinkedItems
public void addLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List items, int position, boolean shift, boolean sortSrc2Tgt, boolean sortTgt2Src, boolean markModified) -
removeLinkedItems
-
removeAllLinksFor
-
hasDisabledRelations
-
isRelationDisabled
-
removeLinkedItems
public void removeLinkedItems(SessionContext ctx, Item item, boolean itemIsSource, String qualifier, Language language, List<Item> items) Removes all specifiedItems, which are linked to the specifiedItemby links with matching qualifier andLanguage.- Parameters:
ctx- theSessionContext, which will be useditem-Itemon one end of theLinksitemIsSource- is the specifiedItemthe source (true) or the targetItem(false) of theLinkqualifier- the qualifier of theLinkslanguage- theLanguageof theLinks,nullfor unlocalizedLinksitems-Listof allItemswhich should be removed
-
removeLinkedItems
-
removeLinkedItems
-
getLinks
Returns aCollectionof allLinkswith matching qualifier,Language, source and targetItem. 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.- Parameters:
qualifier- the qualifier, may contain SQL wildcards, e.g. "%"language- theLanguage, orLink.ANYLANGUAGEsource- the sourceItem, orLink.ANYITEMtarget- the targetItem, orLink.ANYITEM- Returns:
- a
Collectionof allLinkswith matching qualifier,Language, source and targetItem
-
createLink
@Deprecated(since="ages", forRemoval=false) public Link createLink(String qualifier, Language language, Item source, Item target, int sequenceNumber) throws ConsistencyCheckException Deprecated.since ages- Throws:
ConsistencyCheckException
-
createLink
public Link createLink(String qualifier, Language language, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException Creates a new localizedLink- Parameters:
qualifier- the qualifier of the link (any String, for example a predefined constant likeMedia.PICTURElanguage- the language that defines the link's localesource- the sourceItemtarget- the targetItemsequenceNumber- the sequence number of the newLink- Returns:
- a new
Link - Throws:
ConsistencyCheckException
-
createLink
public Link createLink(String qualifier, Language language, PK sourcePK, PK targetPK, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException Creates a new link using item PKs instead of real items as source and target. Please be aware that type safety cannot be guaranteed here so make sure the PKs really belong to the intended item type!- Parameters:
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 direction- Returns:
- the new link
- Throws:
ConsistencyCheckException- Since:
- 3.1-u8
-
createLinkNoWrap
public void createLinkNoWrap(String qualifier, Language language, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException Creates a new link just likecreateLink(String, Language, Item, Item, int, int)but without loading and wrapping the new link item.- Throws:
ConsistencyCheckException- Since:
- 3.1-u7
-
createLinkNoWrap
public void createLinkNoWrap(String qualifier, Language language, PK sourcePK, PK targetPK, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException Creates a new link just likecreateLink(String, Language, PK, PK, int, int)but without loading and wrapping the new link item.- Throws:
ConsistencyCheckException- Since:
- 3.1-u8
-
getLinks
Returns aCollectionof allLinkswith matching qualifier, and source and targetItem. 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.- Parameters:
qualifier- the qualifier, may contain SQL wildcards, e.g. "%"source- the sourceItem, orLink.ANYITEMtarget- the targetItem, orLink.ANYITEM- Returns:
- a
Collectionof allLinkswith matching qualifier,Language, source and targetItem
-
createLink
@Deprecated(since="ages", forRemoval=false) public Link createLink(String qualifier, Item source, Item target, int sequenceNumber) throws ConsistencyCheckException Deprecated.since ages- Throws:
ConsistencyCheckException
-
createLink
public Link createLink(String qualifier, Item source, Item target, int sequenceNumber, int reverseSequenceNumber) throws ConsistencyCheckException Creates a new localizedLink- Parameters:
qualifier- the qualifier of the link (any String, for example a predefined constant likeMedia.PICTUREsource- the sourceItemtarget- the targetItemsequenceNumber- the sequence number of the newLink- Returns:
- a new
Link - Throws:
ConsistencyCheckException
-
writeReplace
- Specified by:
writeReplacein classManager- Throws:
ObjectStreamException
-