Display condition and resource status

247 views
Skip to first unread message

Frederick Yocum

unread,
Jul 17, 2017, 11:51:42 AM7/17/17
to ResourceSpace
I have created a new metadata field which, ideally, would only be visible when the resource was NOT in the Active state. The field is for notes that have to do with the process of approving or removing the resource.

There is an advanced setting called Display Condition that should fit the bill.

Display condition
This means that a field will only appear if a certain condition is met. This field can still be set to 'required' and will just be exempted from the check if the display condition is not met. As an example: 'shortname=value1|value2' or 'shortnamea=validoptiona;shortnameb=validoptionb1|validoptionb2'. A real world example would be for a 'region' field, which would only be displayed if a field with the shortname 'product' was set to 'DVD' or 'Blu-Ray'. i.e. 'product=DVD|Blu-Ray'. 

In resourcespace archive states are -2 (pending submission), -1 (Pending review), 0 (Active), 1 (Awaiting archive), 2 (archived) and 3 (deleted)


Theoretically, I should be able to add this to the Display Condition field:

archive="-1|1|2|3";

Adding this just lands us with a never ending beachball. I have never had much success in trying to filter with archive states. So, what would be the correct format. Or would there be another way to achieve the same thing?

TIA
Frederick 

Dan Huby

unread,
Jul 17, 2017, 6:51:18 PM7/17/17
to ResourceSpace
Hi Frederick,

I've had a look through the code and I can't see that "archive" is supported for search filters. It's for regular metadata fields only. Where did you read about that?

Thanks,

Dan

Allison Stec

unread,
Jul 18, 2017, 8:23:35 AM7/18/17
to resour...@googlegroups.com, Frederick Yocum
You could try using the value filter for this purpose. It does require php knowledge, but since you only want the value to display under certain archive states you could blank the value out when the condition isn’t satisfied and it won’t show. This will not alter the value in the db or hide the field on the advanced search or edit pages.

Allison Stec


--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.com
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frederick Yocum

unread,
Jul 18, 2017, 1:41:46 PM7/18/17
to ResourceSpace
Dan

I am pretty sure I didn’t read it in the documentation. The archive field is exposed in search strings:

will get you the resources with the status (archive state) of  pending:review for a user with the id of 14.

Archive is a field in the metadata of a resource, correct? It was a logical step to try and reference it. I am not sure I know what the difference is between a search filter or a regular metadata field. 

Frederick Yocum

unread,
Jul 18, 2017, 1:51:27 PM7/18/17
to ResourceSpace, fred...@frederickyocum.com
Allison

This seems slightly hacky. The field would show up in the Resource Panel, it would just be blank? The field is not enabled in advanced or simple search which is what we would want since it is meant to contain action point that is specific to that resource and only relevant when the user edits the metadata. 

Value Filter
Allows the transformation of $value with a php code snippet, which will modify the display of a field value in search display fields, Resource View, and contact sheet text. Useful for transforming number options into words, rearranging or reducing comma-separated lists, or modifying date format and such.

Allison Stec

unread,
Jul 18, 2017, 2:15:15 PM7/18/17
to resour...@googlegroups.com, Frederick Yocum
The field would not show up in the resource panel if it’s a blank value.

Since you’ve elaborated and included the pages that you want the field to display (edit and advanced search) this won’t work for you.

Allison Stec


Frederick Yocum

unread,
Jul 18, 2017, 3:44:35 PM7/18/17
to ResourceSpace, fred...@frederickyocum.com
Sorry Allison, that was a badly constructed sentence. I have unchecked advanced and simple search in the field configuration since we don’t want it to influence search. Will explore value filter. 

Frederick

Frederick Yocum

unread,
Jul 20, 2017, 12:58:22 PM7/20/17
to ResourceSpace, fred...@frederickyocum.com
@Allison

The only time the field should be hidden is when the resource is being displayed in the resource panel with the status of active. Looking at the documentation for the value filter, I can alter the value of the field because it is exposed using $value. But I would need to know is whether the resource has the status of active. Slightly more complex. Is there a global variable out there in ResourceSpaceLand or would I need to somehow make a call to the resource table to find out whether the status was set to active?

if ($archive!='0'){$value="";} 

TIA ...
Frederick

> You could try using a value filter

On Tuesday, July 18, 2017 at 8:23:35 AM UTC-4, Allison Stec wrote:
Reply all
Reply to author
Forward
0 new messages