Keyword replacement for Link "updated" user/datetime

(John gill) #1

Version: any

Is it possible to surface the data about who last updated a link, or when it was updated, with a keyword replacement (or JS API, or at all)?

I realised that data about when a link was updated must be stored because Purge Trash is able to purge only those assets over a certain link age. Checking the DB in the test image confirmed that the data is stored (columns “updated” and “updated_userid”)

matrix=> \d sq_ast_lnk
                          Table "public.sq_ast_lnk"
     Column     |            Type             |           Modifiers
 linkid         | integer                     | not null
 majorid        | character varying(15)       | not null
 minorid        | character varying(15)       | not null
 link_type      | integer                     | not null
 value          | character varying(255)      | default ''::character varying
 sort_order     | integer                     | not null default 0
 is_dependant   | character(1)                | not null default '0'::bpchar
 is_exclusive   | character(1)                | not null default '0'::bpchar
 updated        | timestamp without time zone | not null
 updated_userid | character varying(255)      | not null
 locked         | character(1)                | not null default '0'::bpchar

I’ve scoured the Common and Global keywords documentation. The best candidate looked like %asset_linking_info%, but it only seems to provide linkID, link_type, link_value, lineage. Ditto JS api, no calls (getParents, getLineage, getAssetTree, getLinkId etc) seem to return these fields.

Is there any way to expose this data?

(Bart Banda) #2

Not through keywords at the moment, I guess the only way would be through a DB Data Source asset where you make a custom call to the Matrix DB to extract the data you need.

What’s the use case?

(John gill) #3

The thing that made me go looking was an attempt to make a “Show me a list of assets in Trash that I have sufficient permissions to un-trash, along with when they were trashed and by who” facility for editors.

The first part of that is easy, the second part seems not possible. Trashing doesn’t change %asset_updated% or %asset_updated_by_name%.

(Bart Banda) #4

Correct, it does not.

You could maybe use a Trigger to fire on the Before Asset Deleted event to set a metadata date field when an asset is moved to the trash?