Listing based on date metadata


(gja) #1

Hi,

 

I'm wanting to create a listing that displays assets which have a metadata date field which is in the past.

 

The post http://forums.squizsuite.net/index.php?showtopic=8524from 31 August 2011 describes what I'm wanting to achieve

 create a page that will list all assets that have expired (ie DC.Date.valid < today's date).

 

The suggestions all go down a path that I want to avoid, and are a few years old.

 

Given the matrix changes in past few years I thought I would ask the question again.

 

Is there a neat and tidy way to  "create a page that will list all assets that have expired (ie DC.Date.valid < today's date)."

 

Thanks Georgina.


(Bart Banda) #2

The easiest way would probably be to set up a trigger that changes a different metadata field on that asset once the metadata expires, or even links it into a new folder. That way you can either do a stored search page for the pages with the newly set metadata, or just do an asset listing of all assets that are in the newly linked folder, this would be a lot quicker to list as well. 

 

Another way would be to try and do a stored search that by default searches the from date from something like 1970, and the to date to todays date, that then targets the date metadata field. But I've never set a search page to do that exact stored search before so not sure if it works. 

 

A 3rd option is to use a REST asset as the proxy asset for the search page and pass the right default query parameters to it via global date keywords, I know that option works as I've implemented that in the past. 

 

So either option 1 or 3 is the way to go I think. 


(gja) #3

Hi Bart,

 

Thanks for your reply.

Option (1) isn't going to work for us as a trigger that updates a metadata field or links into a new folder will have the side effect of updating the asset.  We don't want the asset itself to be updated.  The reason for this is that I am wanting to create a list of assets requiring review and if the last updated date is as a result of a trigger then that might cause confusion.

 

I'm interested in the other two options.

Option (3) using "REST asset as the proxy asset for the search page"  this sounds interesting.  Can you supply more details on how to get started with this?

 

Thanks Georgina.


(Tim Davison) #4

My 2cents, avoid using 'asset updated' dates for review dates as they change too often (and often when you do not expect them to).  Even the most minor changes can result in this intrinsic date value changing.  For example, a metadata regeneration will result in 'asset updated' being changed, I learnt that one the the hard way.  I'd have to test, but I think applying a role, permission, or workflow would similarly change it's updated date value.  

 

In our instances we have review cycles of 6 months.  We used to use asset updated - big mistake.  Now we use asset published.

 

I agree, option 3 also sounds interesting.  I've never tried to use dates in a search page.  Would love to see an example, may be useful in a number of places.


(Bart Banda) #5

So with option 3, you basically set up a REST asset that requests the search page you are using. Within the URL field of the REST asset, after you enter the URL of the search page, you manually add the GET variables for the start date and end date search fields. The start date could just be fixed to 1970-1-1 if you wanted to, and then the end date you could use global date keywords for, for example &end_date=%globals_date% (not the correct format but you get the idea). 

 

As search page results are basically printed by a GET request to it with a bunch of GET variables, it would return the Search Results within the REST asset response, and then you'd just print the response with the REST asset JS area. 

 

Hope that makes sense and gets you on the right track.