I’m trying to figure out how to retrieve an item’s translation parent from within the bindings of a database publishing template. I have the latest PSO toolkit installed.
Failed Attempt 1: Used com.percussion.pso.jexl.PSORelationshipTools.findAllParentIds
I tried using this expression in my binding:
$user.psoRelationships.findAllParentIds($sys.item.getProperty("rx:sys_contentid").String,"")
I think the problem with this is that it needs a slot ID as the second parameter, and there is no slot ID for a translation parent, so I put in an empty string.
This error appears during assembly:
Problems during binding evaluation
$transparent=The slot specified by was not found
Failed Attempt 2: Used $user.psoNavTools.getAncestors
This code
$user.psoNavTools.getAncestors($sys.item)
returned the object itself, rather than its translation parent.
Successful, but potential flawed Attempt 3: Used SQL query to retrieve translation parent content ID from PSX_OBJECTRELATIONSHIP table
I used these bindings, and was able to get the translation parent content ID, but it seems like there should be a way to use the API, rather than retrieving directly from the PSX_OBJECTRELATIONSHIP table. I’m concerned that I’m missing something in my understanding of the backend tables.
$sqlquery = "SELECT owner_id from psx_objectrelationship where dependent_id=" + $sys.item.getProperty("rx:sys_contentid").String + " and config_id=6"
$transparentfromquery = $rx.db.get("RhythmyxData",$sqlquery)
$transparentcontentid = $transparentfromquery.get(0).get("owner_id")
Has anyone tried to do this? Does anyone have any suggestions for me?
Thanks,
Kathleen