asset.namespace.query :where name = ? (or something like it)

19 views
Skip to first unread message

Scott Wood

unread,
Mar 6, 2014, 1:44:16 AM3/6/14
to medi...@googlegroups.com
Hi Folks,

Some of our users who have permissions to rename namspaces, but not destroy them, have renamed them to mark them for deletion.  For example "/originalname" might now be called "/originalname_todelete".  Is there any way to query namespaces with pattern matching?

Alternatively, being able to run the equivalent of "tree -d" on the namespace hierarchy would do, as I could just parse that list.

Thanks for any tips you all may have.

Regards,
Scott

John Twyman

unread,
Mar 20, 2014, 9:45:02 PM3/20/14
to medi...@googlegroups.com
Hi Scott,

As regards "tree -d" style functionality you might want to use

asset.namespace.describe :namespace /path/to/namespace :levels n

where n is an integer value. It produces a LOT of output so be wary of the computational cost of running this command with a high :levels value.

I suspect a better approach is to make use of the :text argument to asset.query. Something like this perhaps:

asset.query :action get-path :where ... :text "_todelete"

When I run that I get the assets that come back but it would be pretty straightforward to derive the relevant namespace(s) from that query.

Another thing to review is the documentation on Asset Query Language. There might be something in there you can use to your advantage.

Cheers,
John

Scott Wood

unread,
May 28, 2014, 9:17:56 PM5/28/14
to medi...@googlegroups.com
Hey John,

My apologies for not having replied.  I rarely check the email that my google groups account is connected to and didn't realize you'd responded until just now.  Thanks for the tips.  As it was almost three months ago, I don't remember how I got through it, but I solved it with an ugly cascade of aterm, pipes, greps, etc..  I came here today for another asset.query and your link provided with the answer to that, too.  Thanks!

Scott
Reply all
Reply to author
Forward
0 new messages