Removing items from a Slot Thru API

Is there any API to remove items from a given slot. I do have the content id/ guid of the parent item and know the name of the slot from which I want to remove all the items.

I was looking for a method similar to adding content relations that takes some of the parameters as follows:

addContentRelations(parentItem, childItemList, slotName, templateName, val);

But I found a method as follows:

void deleteContentRelations(List<IPSGuid> ids)
Delete all content relations for the specified relationship ids.

The problem is that this method takes a list of relationship guid(s). I do know the item guid of the item which I intend to delete from the slot.
The problem is how do I construct a list of PSAaRelationship?



I’ve answered this one in an email to you last week.

You have to load the contents of the slot (using the loadContentRelations() method), loop through the resulting list and extract the GUID of each relationship (with the getId() method). You then call deleteContentRelations() with the list of GUIDs.


Thanks Dave…

I dont think I got any email from you last week.
What email address you sent it to?


Use the loadSlot method to get the current list of slot contents for a content id. Then you can use the deleteContentRelations method on the results.