I am sorry for this very basic question I am asking as I could not fully understand the javadoc for this method.

The signature for this method is a list of Guids that need to be arranged. If I supply a list of guids of content items that are already in the same slot, would this method sort them as the method javadoc implies.

If so, is the sort going to be alphabetically and if so which field is used for this sorting. Is the sort field the sys_title field or something else?


The list of IPSGuid (parameter of reorderContentRelationss) is not a list of item GUIDs, but it is a list of PSAaRelationship GUIDs.
IPSContentWs.reorderContentRelationshs is similar with IPSContentWs.reArrangeContentRelations. Both sort the relationship by the “sortRank” property of the relationship object.

Is there anyway to override the default sort criteria to be changed from sortRank to the value in field sys_title?

Both IPSContentWs.reorderContentRelationshs and IPSContentWs.reArrangeContentRelations will reset the sort-rank according to the order of the relationships you specified to the API.

That means you need to “sort” the relationships the way you wanted first, then pass to the API, which will rearrange the relationships according to your sorted result.

For example, if you retrieve all the relationships of a slot, rearrange the relationships according to the sys_title (or any other property of the dependent items), pass them to one of the API, then the items should be displayed in the slot according to your sorted order.

Thanks yubingchen…
Yes…I was able to retrieve the list of Relations. After I look into an individual relation, I am not able to find any property by which I can load the content item that was added to the slot. I did a getAllProperties and got the following result.

{rs_islocaldependency=yes, sys_folderid=null, rs_inlinerelationship=null, rs_usedependentrevision=no, sys_siteid=null, rs_allowcloning=yes, sys_variantid=587, rs_skippromotion=no, sys_slotid=555, rs_useownerrevision=yes, rs_useserverid=yes, sys_sortrank=0}

Also I looked into a few other methods, but could not make out which method would yield me the sys_title or the Guid of the content item?


To read the contents of the dependent item, you have to load the content node with the content manager.

The PSRelationship object is a legacy object (designed before there were GUIDs and Services).

PSRelationship.getDependent() will return a PSLocator. You can use the IPSGuidManager.makeGuid() method to create a GUID from the locator. The next step is to load the node with IPSContentMgr.findItemsByGUID() which requires a list of GUIDs. The “config” parameter can be left as null.

I hope this helps


Thanks Dave and yubingchen.

I think I have resolved the sort issue, and am able to sort the content items. Essentially, what I did was first I invoked the loadSlotRelations method. Then I manually sorted all the relations. After that I simply invoked the PSOSlotRelations.saveSlotRelations() method, and passed in the sorted list of Relations.


That approach obviously works, but as Ben pointed out earlier, you could also have used the “reArrangeContentRelations” method instead the “saveContentRelations” method. Using “reOrderContentRelations” requires you to build a list of Relationship GUIDs, rather than a list of Relationships.

Whatever works for you.